1 | <?php |
||
32 | class EspressoEvents extends EspressoShortcode |
||
33 | { |
||
34 | |||
35 | |||
36 | |||
37 | /** |
||
38 | * the actual shortcode tag that gets registered with WordPress |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | public function getTag() |
||
46 | |||
47 | |||
48 | |||
49 | /** |
||
50 | * the time in seconds to cache the results of the processShortcode() method |
||
51 | * 0 means the processShortcode() results will NOT be cached at all |
||
52 | * |
||
53 | * @return int |
||
54 | */ |
||
55 | public function cacheExpiration() |
||
59 | |||
60 | |||
61 | |||
62 | /** |
||
63 | * a place for adding any initialization code that needs to run prior to wp_header(). |
||
64 | * this may be required for shortcodes that utilize a corresponding module, |
||
65 | * and need to enqueue assets for that module |
||
66 | * |
||
67 | * @return void |
||
68 | */ |
||
69 | public function initializeShortcode() |
||
73 | |||
74 | |||
75 | |||
76 | /** |
||
77 | * callback that runs when the shortcode is encountered in post content. |
||
78 | * IMPORTANT !!! |
||
79 | * remember that shortcode content should be RETURNED and NOT echoed out |
||
80 | * |
||
81 | * @param array $attributes |
||
82 | * @return string |
||
83 | */ |
||
84 | public function processShortcode($attributes = array()) |
||
110 | |||
111 | |||
112 | |||
113 | /** |
||
114 | * merge incoming attributes with filtered defaults |
||
115 | * |
||
116 | * @param array $attributes |
||
117 | * @return array |
||
118 | */ |
||
119 | private function getAttributes(array $attributes) |
||
139 | |||
140 | |||
141 | |||
142 | /** |
||
143 | * array for defining custom attribute sanitization callbacks, |
||
144 | * where keys match keys in your attributes array, |
||
145 | * and values represent the sanitization function you wish to be applied to that attribute. |
||
146 | * So for example, if you had an integer attribute named "event_id" |
||
147 | * that you wanted to be sanitized using absint(), |
||
148 | * then you would pass the following for your $custom_sanitization array: |
||
149 | * array('event_id' => 'absint') |
||
150 | * |
||
151 | * @return array |
||
152 | */ |
||
153 | protected function customAttributeSanitizationMap() |
||
164 | |||
165 | |||
166 | |||
167 | } |
||
168 | // End of file EspressoEvents.php |
||
169 | // Location: EventEspresso\core\domain\entities\shortcodes/EspressoEvents.php |