1 | <?php |
||
29 | class EspressoEventAttendees extends EspressoShortcode |
||
30 | { |
||
31 | |||
32 | private $query_params = array( |
||
33 | 0 => array() |
||
34 | ); |
||
35 | |||
36 | private $template_args = array( |
||
37 | 'contacts' => array(), |
||
38 | 'event' => null, |
||
39 | 'datetime' => null, |
||
40 | 'ticket' => null, |
||
41 | ); |
||
42 | |||
43 | /** |
||
44 | * the actual shortcode tag that gets registered with WordPress |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | public function getTag() |
||
52 | |||
53 | |||
54 | |||
55 | /** |
||
56 | * the time in seconds to cache the results of the processShortcode() method |
||
57 | * 0 means the processShortcode() results will NOT be cached at all |
||
58 | * |
||
59 | * @return int |
||
60 | */ |
||
61 | public function cacheExpiration() |
||
65 | |||
66 | |||
67 | |||
68 | /** |
||
69 | * a place for adding any initialization code that needs to run prior to wp_header(). |
||
70 | * this may be required for shortcodes that utilize a corresponding module, |
||
71 | * and need to enqueue assets for that module |
||
72 | * |
||
73 | * @return void |
||
74 | */ |
||
75 | public function initializeShortcode() |
||
79 | |||
80 | |||
81 | |||
82 | /** |
||
83 | * process_shortcode - ESPRESSO_EVENT_ATTENDEES - Returns a list of attendees to an event. |
||
84 | * [ESPRESSO_EVENT_ATTENDEES] |
||
85 | * - defaults to attendees for earliest active event, or earliest upcoming event. |
||
86 | * |
||
87 | * [ESPRESSO_EVENT_ATTENDEES event_id=123] |
||
88 | * - attendees for specific event. |
||
89 | * |
||
90 | * [ESPRESSO_EVENT_ATTENDEES datetime_id=245] |
||
91 | * - attendees for a specific datetime. |
||
92 | * |
||
93 | * [ESPRESSO_EVENT_ATTENDEES ticket_id=123] |
||
94 | * - attendees for a specific ticket. |
||
95 | * |
||
96 | * [ESPRESSO_EVENT_ATTENDEES status=all] |
||
97 | * - specific registration status (use status id) or all for all attendees regardless of status. |
||
98 | * Note default is to only return approved attendees |
||
99 | * |
||
100 | * [ESPRESSO_EVENT_ATTENDEES show_gravatar=true] |
||
101 | * - default is to not return gravatar. Otherwise if this is set then return gravatar for email address given. |
||
102 | * |
||
103 | * [ESPRESSO_EVENT_ATTENDEES display_on_archives=true] |
||
104 | * - default is to not display attendees list on archive pages. |
||
105 | * |
||
106 | * Note: because of the relationship between event_id, ticket_id, and datetime_id: |
||
107 | * If more than one of those params is included, then preference is given to the following: |
||
108 | * - event_id is used whenever its present and any others are ignored. |
||
109 | * - if no event_id then datetime is used whenever its present and any others are ignored. |
||
110 | * - otherwise ticket_id is used if present. |
||
111 | * |
||
112 | * @param array $attributes |
||
113 | * @return string |
||
114 | * @throws EE_Error |
||
115 | */ |
||
116 | public function processShortcode($attributes = array()) |
||
161 | |||
162 | |||
163 | |||
164 | /** |
||
165 | * merge incoming attributes with filtered defaults |
||
166 | * |
||
167 | * @param array $attributes |
||
168 | * @return array |
||
169 | */ |
||
170 | private function getAttributes(array $attributes) |
||
184 | |||
185 | |||
186 | |||
187 | /** |
||
188 | * @param array $attributes |
||
189 | * @return EE_Event|null |
||
190 | * @throws EE_Error |
||
191 | */ |
||
192 | private function getEventAndQueryParams(array $attributes){ |
||
227 | |||
228 | |||
229 | |||
230 | /** |
||
231 | * @param array $attributes |
||
232 | * @return EE_Datetime|null |
||
233 | */ |
||
234 | private function getDatetimeAndQueryParams(array $attributes) |
||
249 | |||
250 | |||
251 | |||
252 | /** |
||
253 | * @param array $attributes |
||
254 | * @return \EE_Base_Class|null |
||
255 | * @throws EE_Error |
||
256 | */ |
||
257 | private function getTicketAndQueryParams(array $attributes) |
||
273 | |||
274 | |||
275 | |||
276 | /** |
||
277 | * @param array $attributes |
||
278 | * @throws EE_Error |
||
279 | */ |
||
280 | private function setAdditionalQueryParams(array $attributes) |
||
292 | |||
293 | |||
294 | |||
295 | } |
||
296 | // End of file EspressoEventAttendees.php |
||
298 |