1 | <?php |
||
28 | class EspressoEventAttendees extends EspressoShortcode |
||
29 | { |
||
30 | |||
31 | private $query_params = array( |
||
32 | 0 => array() |
||
33 | ); |
||
34 | |||
35 | private $template_args = array( |
||
36 | 'contacts' => array(), |
||
37 | 'event' => null, |
||
38 | 'datetime' => null, |
||
39 | 'ticket' => null, |
||
40 | ); |
||
41 | |||
42 | /** |
||
43 | * the actual shortcode tag that gets registered with WordPress |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getTag() |
||
51 | |||
52 | |||
53 | |||
54 | /** |
||
55 | * the time in seconds to cache the results of the processShortcode() method |
||
56 | * 0 means the processShortcode() results will NOT be cached at all |
||
57 | * |
||
58 | * @return int |
||
59 | */ |
||
60 | public function cacheExpiration() |
||
64 | |||
65 | |||
66 | |||
67 | /** |
||
68 | * a place for adding any initialization code that needs to run prior to wp_header(). |
||
69 | * this may be required for shortcodes that utilize a corresponding module, |
||
70 | * and need to enqueue assets for that module |
||
71 | * |
||
72 | * @return void |
||
73 | */ |
||
74 | public function initializeShortcode() |
||
78 | |||
79 | |||
80 | |||
81 | /** |
||
82 | * process_shortcode - ESPRESSO_EVENT_ATTENDEES - Returns a list of attendees to an event. |
||
83 | * [ESPRESSO_EVENT_ATTENDEES] - defaults to attendees for earliest active event, or earliest upcoming event. |
||
84 | * [ESPRESSO_EVENT_ATTENDEES event_id=123] - attendees for specific event. |
||
85 | * [ESPRESSO_EVENT_ATTENDEES datetime_id=245] - attendees for a specific datetime. |
||
86 | * [ESPRESSO_EVENT_ATTENDEES ticket_id=123] - attendees for a specific ticket. |
||
87 | * [ESPRESSO_EVENT_ATTENDEES status=all] - specific registration status (use status id) or all for all attendees |
||
88 | * regardless of status. Note default is to only return approved attendees |
||
89 | * [ESPRESSO_EVENT_ATTENDEES show_gravatar=true] - default is to not return gravatar. Otherwise if this is set |
||
90 | * then return gravatar for email address given. |
||
91 | * Note: because of the relationship between event_id, ticket_id, and datetime_id. |
||
92 | * If more than one of those params is included then preference is given to the following: |
||
93 | * - event_id is used whenever its present and any others are ignored. |
||
94 | * - if no event_id then datetime is used whenever its present and any others are ignored. |
||
95 | * - otherwise ticket_id is used if present. |
||
96 | * |
||
97 | * @param array $attributes |
||
98 | * @return string |
||
99 | * @throws \EE_Error |
||
100 | */ |
||
101 | public function processShortcode($attributes = array()) |
||
137 | |||
138 | |||
139 | |||
140 | /** |
||
141 | * merge incoming attributes with filtered defaults |
||
142 | * |
||
143 | * @param array $attributes |
||
144 | * @return array |
||
145 | */ |
||
146 | private function getAttributes(array $attributes) |
||
162 | |||
163 | |||
164 | |||
165 | /** |
||
166 | * @param array $attributes |
||
167 | * @return EE_Event|null |
||
168 | * @throws \EE_Error |
||
169 | */ |
||
170 | private function getEventAndQueryParams(array $attributes){ |
||
206 | |||
207 | |||
208 | |||
209 | /** |
||
210 | * @param array $attributes |
||
211 | * @return EE_Datetime|null |
||
212 | */ |
||
213 | private function getDatetimeAndQueryParams(array $attributes) |
||
228 | |||
229 | |||
230 | |||
231 | /** |
||
232 | * @param array $attributes |
||
233 | * @return \EE_Base_Class|null |
||
234 | * @throws \EE_Error |
||
235 | */ |
||
236 | private function getTicketAndQueryParams(array $attributes) |
||
252 | |||
253 | |||
254 | |||
255 | /** |
||
256 | * @param array $attributes |
||
257 | */ |
||
258 | private function setAdditionalQueryParams(array $attributes) |
||
270 | |||
271 | |||
272 | |||
273 | } |
||
274 | // End of file EspressoEventAttendees.php |
||
275 | // Location: EventEspresso\core\domain\entities\shortcodes/EspressoEventAttendees.php |