@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * @var integer $limit |
29 | 29 | */ |
30 | - private $limit = 10; |
|
30 | + private $limit = 10; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @var string $css_class |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function __construct($args = array()) |
70 | 70 | { |
71 | - $args = $this->parseArgs((array)$args); |
|
71 | + $args = $this->parseArgs((array) $args); |
|
72 | 72 | $this->setupEventQueryHelper(); |
73 | 73 | $this->setupFilters(); |
74 | 74 | $args = $this->getQueryArgs($args); |
@@ -19,206 +19,206 @@ |
||
19 | 19 | class EventListQuery extends WP_Query |
20 | 20 | { |
21 | 21 | |
22 | - /** |
|
23 | - * @var string $title |
|
24 | - */ |
|
25 | - private $title; |
|
26 | - |
|
27 | - /** |
|
28 | - * @var integer $limit |
|
29 | - */ |
|
30 | - private $limit = 10; |
|
31 | - |
|
32 | - /** |
|
33 | - * @var string $css_class |
|
34 | - */ |
|
35 | - private $css_class; |
|
36 | - |
|
37 | - /** |
|
38 | - * @var boolean $show_expired |
|
39 | - */ |
|
40 | - private $show_expired = false; |
|
41 | - |
|
42 | - /** |
|
43 | - * @var string $month |
|
44 | - */ |
|
45 | - private $month; |
|
46 | - |
|
47 | - /** |
|
48 | - * @var string $category_slug |
|
49 | - */ |
|
50 | - private $category_slug; |
|
51 | - |
|
52 | - /** |
|
53 | - * @var string $order_by |
|
54 | - */ |
|
55 | - private $order_by; |
|
56 | - |
|
57 | - /** |
|
58 | - * @var string $sort |
|
59 | - */ |
|
60 | - private $sort; |
|
61 | - |
|
62 | - /** |
|
63 | - * @var boolean $show_title |
|
64 | - */ |
|
65 | - private $show_title = true; |
|
66 | - |
|
67 | - |
|
68 | - |
|
69 | - /** |
|
70 | - * EE_Event_List_Query Constructor * |
|
71 | - * |
|
72 | - * @param array $args |
|
73 | - */ |
|
74 | - public function __construct($args = array()) |
|
75 | - { |
|
76 | - $args = $this->parseArgs((array)$args); |
|
77 | - $this->setupEventQueryHelper(); |
|
78 | - $this->setupFilters(); |
|
79 | - $args = $this->getQueryArgs($args); |
|
80 | - // run the query |
|
81 | - parent::__construct($args); |
|
82 | - } |
|
83 | - |
|
84 | - |
|
85 | - |
|
86 | - /** |
|
87 | - * @param array $args |
|
88 | - * @return array |
|
89 | - */ |
|
90 | - private function parseArgs(array $args) |
|
91 | - { |
|
92 | - // incoming args could be a mix of WP query args + EE shortcode args |
|
93 | - foreach ($args as $property => $value) { |
|
94 | - // if the arg is a property of this class, then it's an EE shortcode arg |
|
95 | - if (property_exists($this, $property)) { |
|
96 | - // set the property value |
|
97 | - $this->{$property} = $value; |
|
98 | - // then remove it from the array of args that will later be passed to WP_Query() |
|
99 | - unset($args[$property]); |
|
100 | - } |
|
101 | - } |
|
102 | - return $args; |
|
103 | - } |
|
104 | - |
|
105 | - |
|
106 | - |
|
107 | - private function setupEventQueryHelper() |
|
108 | - { |
|
109 | - //add query filters |
|
110 | - EEH_Event_Query::add_query_filters(); |
|
111 | - // set params that will get used by the filters |
|
112 | - EEH_Event_Query::set_query_params( |
|
113 | - $this->month, |
|
114 | - $this->category_slug, |
|
115 | - $this->show_expired, |
|
116 | - $this->order_by, |
|
117 | - $this->sort |
|
118 | - ); |
|
119 | - } |
|
120 | - |
|
121 | - |
|
122 | - |
|
123 | - private function setupFilters() |
|
124 | - { |
|
125 | - // first off, let's remove any filters from previous queries |
|
126 | - remove_filter( |
|
127 | - 'FHEE__archive_espresso_events_template__show_header', |
|
128 | - array($this, 'show_event_list_title') |
|
129 | - ); |
|
130 | - remove_filter( |
|
131 | - 'FHEE__archive_espresso_events_template__upcoming_events_h1', |
|
132 | - array($this, 'event_list_title') |
|
133 | - ); |
|
134 | - remove_all_filters('FHEE__content_espresso_events__event_class'); |
|
135 | - // Event List Title ? |
|
136 | - add_filter( |
|
137 | - 'FHEE__archive_espresso_events_template__show_header', |
|
138 | - array($this, 'show_event_list_title') |
|
139 | - ); |
|
140 | - add_filter( |
|
141 | - 'FHEE__archive_espresso_events_template__upcoming_events_h1', |
|
142 | - array($this, 'event_list_title'), |
|
143 | - 10, |
|
144 | - 1 |
|
145 | - ); |
|
146 | - // add the css class |
|
147 | - add_filter( |
|
148 | - 'FHEE__content_espresso_events__event_class', |
|
149 | - array($this, 'event_list_css'), |
|
150 | - 10, |
|
151 | - 1 |
|
152 | - ); |
|
153 | - } |
|
154 | - |
|
155 | - |
|
156 | - |
|
157 | - private function getQueryArgs(array $args) |
|
158 | - { |
|
159 | - // the current "page" we are viewing |
|
160 | - $paged = max(1, get_query_var('paged')); |
|
161 | - // Force these args |
|
162 | - return array_merge( |
|
163 | - $args, |
|
164 | - array( |
|
165 | - 'post_type' => 'espresso_events', |
|
166 | - 'posts_per_page' => $this->limit, |
|
167 | - 'update_post_term_cache' => false, |
|
168 | - 'update_post_meta_cache' => false, |
|
169 | - 'paged' => $paged, |
|
170 | - 'offset' => ($paged - 1) * $this->limit, |
|
171 | - ) |
|
172 | - ); |
|
173 | - } |
|
174 | - |
|
175 | - |
|
176 | - |
|
177 | - /** |
|
178 | - * show_event_list_title |
|
179 | - * |
|
180 | - * @return boolean |
|
181 | - */ |
|
182 | - public function show_event_list_title() |
|
183 | - { |
|
184 | - return filter_var( |
|
185 | - $this->show_title, |
|
186 | - FILTER_VALIDATE_BOOLEAN |
|
187 | - ); |
|
188 | - } |
|
189 | - |
|
190 | - |
|
191 | - |
|
192 | - /** |
|
193 | - * callback for FHEE__archive_espresso_events_template__upcoming_events_h1 filter |
|
194 | - * |
|
195 | - * @param string $event_list_title |
|
196 | - * @return string |
|
197 | - */ |
|
198 | - public function event_list_title($event_list_title = '') |
|
199 | - { |
|
200 | - if ( ! empty($this->title)) { |
|
201 | - return $this->title; |
|
202 | - } |
|
203 | - return $event_list_title; |
|
204 | - } |
|
205 | - |
|
206 | - |
|
207 | - |
|
208 | - /** |
|
209 | - * callback for FHEE__content_espresso_events__event_class filter |
|
210 | - * |
|
211 | - * @param string $event_list_css |
|
212 | - * @return string |
|
213 | - */ |
|
214 | - public function event_list_css($event_list_css = '') |
|
215 | - { |
|
216 | - $event_list_css .= ! empty($event_list_css) ? ' ' : ''; |
|
217 | - $event_list_css .= ! empty($this->css_class) ? $this->css_class : ''; |
|
218 | - $event_list_css .= ! empty($event_list_css) ? ' ' : ''; |
|
219 | - $event_list_css .= ! empty($this->category_slug) ? $this->category_slug : ''; |
|
220 | - return $event_list_css; |
|
221 | - } |
|
22 | + /** |
|
23 | + * @var string $title |
|
24 | + */ |
|
25 | + private $title; |
|
26 | + |
|
27 | + /** |
|
28 | + * @var integer $limit |
|
29 | + */ |
|
30 | + private $limit = 10; |
|
31 | + |
|
32 | + /** |
|
33 | + * @var string $css_class |
|
34 | + */ |
|
35 | + private $css_class; |
|
36 | + |
|
37 | + /** |
|
38 | + * @var boolean $show_expired |
|
39 | + */ |
|
40 | + private $show_expired = false; |
|
41 | + |
|
42 | + /** |
|
43 | + * @var string $month |
|
44 | + */ |
|
45 | + private $month; |
|
46 | + |
|
47 | + /** |
|
48 | + * @var string $category_slug |
|
49 | + */ |
|
50 | + private $category_slug; |
|
51 | + |
|
52 | + /** |
|
53 | + * @var string $order_by |
|
54 | + */ |
|
55 | + private $order_by; |
|
56 | + |
|
57 | + /** |
|
58 | + * @var string $sort |
|
59 | + */ |
|
60 | + private $sort; |
|
61 | + |
|
62 | + /** |
|
63 | + * @var boolean $show_title |
|
64 | + */ |
|
65 | + private $show_title = true; |
|
66 | + |
|
67 | + |
|
68 | + |
|
69 | + /** |
|
70 | + * EE_Event_List_Query Constructor * |
|
71 | + * |
|
72 | + * @param array $args |
|
73 | + */ |
|
74 | + public function __construct($args = array()) |
|
75 | + { |
|
76 | + $args = $this->parseArgs((array)$args); |
|
77 | + $this->setupEventQueryHelper(); |
|
78 | + $this->setupFilters(); |
|
79 | + $args = $this->getQueryArgs($args); |
|
80 | + // run the query |
|
81 | + parent::__construct($args); |
|
82 | + } |
|
83 | + |
|
84 | + |
|
85 | + |
|
86 | + /** |
|
87 | + * @param array $args |
|
88 | + * @return array |
|
89 | + */ |
|
90 | + private function parseArgs(array $args) |
|
91 | + { |
|
92 | + // incoming args could be a mix of WP query args + EE shortcode args |
|
93 | + foreach ($args as $property => $value) { |
|
94 | + // if the arg is a property of this class, then it's an EE shortcode arg |
|
95 | + if (property_exists($this, $property)) { |
|
96 | + // set the property value |
|
97 | + $this->{$property} = $value; |
|
98 | + // then remove it from the array of args that will later be passed to WP_Query() |
|
99 | + unset($args[$property]); |
|
100 | + } |
|
101 | + } |
|
102 | + return $args; |
|
103 | + } |
|
104 | + |
|
105 | + |
|
106 | + |
|
107 | + private function setupEventQueryHelper() |
|
108 | + { |
|
109 | + //add query filters |
|
110 | + EEH_Event_Query::add_query_filters(); |
|
111 | + // set params that will get used by the filters |
|
112 | + EEH_Event_Query::set_query_params( |
|
113 | + $this->month, |
|
114 | + $this->category_slug, |
|
115 | + $this->show_expired, |
|
116 | + $this->order_by, |
|
117 | + $this->sort |
|
118 | + ); |
|
119 | + } |
|
120 | + |
|
121 | + |
|
122 | + |
|
123 | + private function setupFilters() |
|
124 | + { |
|
125 | + // first off, let's remove any filters from previous queries |
|
126 | + remove_filter( |
|
127 | + 'FHEE__archive_espresso_events_template__show_header', |
|
128 | + array($this, 'show_event_list_title') |
|
129 | + ); |
|
130 | + remove_filter( |
|
131 | + 'FHEE__archive_espresso_events_template__upcoming_events_h1', |
|
132 | + array($this, 'event_list_title') |
|
133 | + ); |
|
134 | + remove_all_filters('FHEE__content_espresso_events__event_class'); |
|
135 | + // Event List Title ? |
|
136 | + add_filter( |
|
137 | + 'FHEE__archive_espresso_events_template__show_header', |
|
138 | + array($this, 'show_event_list_title') |
|
139 | + ); |
|
140 | + add_filter( |
|
141 | + 'FHEE__archive_espresso_events_template__upcoming_events_h1', |
|
142 | + array($this, 'event_list_title'), |
|
143 | + 10, |
|
144 | + 1 |
|
145 | + ); |
|
146 | + // add the css class |
|
147 | + add_filter( |
|
148 | + 'FHEE__content_espresso_events__event_class', |
|
149 | + array($this, 'event_list_css'), |
|
150 | + 10, |
|
151 | + 1 |
|
152 | + ); |
|
153 | + } |
|
154 | + |
|
155 | + |
|
156 | + |
|
157 | + private function getQueryArgs(array $args) |
|
158 | + { |
|
159 | + // the current "page" we are viewing |
|
160 | + $paged = max(1, get_query_var('paged')); |
|
161 | + // Force these args |
|
162 | + return array_merge( |
|
163 | + $args, |
|
164 | + array( |
|
165 | + 'post_type' => 'espresso_events', |
|
166 | + 'posts_per_page' => $this->limit, |
|
167 | + 'update_post_term_cache' => false, |
|
168 | + 'update_post_meta_cache' => false, |
|
169 | + 'paged' => $paged, |
|
170 | + 'offset' => ($paged - 1) * $this->limit, |
|
171 | + ) |
|
172 | + ); |
|
173 | + } |
|
174 | + |
|
175 | + |
|
176 | + |
|
177 | + /** |
|
178 | + * show_event_list_title |
|
179 | + * |
|
180 | + * @return boolean |
|
181 | + */ |
|
182 | + public function show_event_list_title() |
|
183 | + { |
|
184 | + return filter_var( |
|
185 | + $this->show_title, |
|
186 | + FILTER_VALIDATE_BOOLEAN |
|
187 | + ); |
|
188 | + } |
|
189 | + |
|
190 | + |
|
191 | + |
|
192 | + /** |
|
193 | + * callback for FHEE__archive_espresso_events_template__upcoming_events_h1 filter |
|
194 | + * |
|
195 | + * @param string $event_list_title |
|
196 | + * @return string |
|
197 | + */ |
|
198 | + public function event_list_title($event_list_title = '') |
|
199 | + { |
|
200 | + if ( ! empty($this->title)) { |
|
201 | + return $this->title; |
|
202 | + } |
|
203 | + return $event_list_title; |
|
204 | + } |
|
205 | + |
|
206 | + |
|
207 | + |
|
208 | + /** |
|
209 | + * callback for FHEE__content_espresso_events__event_class filter |
|
210 | + * |
|
211 | + * @param string $event_list_css |
|
212 | + * @return string |
|
213 | + */ |
|
214 | + public function event_list_css($event_list_css = '') |
|
215 | + { |
|
216 | + $event_list_css .= ! empty($event_list_css) ? ' ' : ''; |
|
217 | + $event_list_css .= ! empty($this->css_class) ? $this->css_class : ''; |
|
218 | + $event_list_css .= ! empty($event_list_css) ? ' ' : ''; |
|
219 | + $event_list_css .= ! empty($this->category_slug) ? $this->category_slug : ''; |
|
220 | + return $event_list_css; |
|
221 | + } |
|
222 | 222 | |
223 | 223 | } |
224 | 224 | // End of file EventListQuery.php |
@@ -8,45 +8,45 @@ |
||
8 | 8 | interface EnqueueAssetsInterface |
9 | 9 | { |
10 | 10 | |
11 | - /** |
|
12 | - * a place to register scripts and stylesheets with WordPress core |
|
13 | - * IMPORTANT !!! |
|
14 | - * ALL JavaScript files need to be registered for loading in the footer |
|
15 | - * by setting the 5th parameter of wp_register_script() to ` true ` |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function registerScriptsAndStylesheets(); |
|
20 | - |
|
21 | - /** |
|
22 | - * a place to enqueue previously registered stylesheets |
|
23 | - * this will be called during the wp_enqueue_scripts hook for frontend requests |
|
24 | - * |
|
25 | - * @return void |
|
26 | - */ |
|
27 | - public function enqueueStylesheets(); |
|
28 | - |
|
29 | - /** |
|
30 | - * a place to enqueue previously registered stylesheets |
|
31 | - * this will be called during the admin_enqueue_scripts hook for admin requests |
|
32 | - * |
|
33 | - * @return void |
|
34 | - */ |
|
35 | - public function enqueueAdminStylesheets(); |
|
36 | - |
|
37 | - /** |
|
38 | - * a place to enqueue previously registered scripts for frontend requests |
|
39 | - * |
|
40 | - * @return void |
|
41 | - */ |
|
42 | - public function enqueueScripts(); |
|
43 | - |
|
44 | - /** |
|
45 | - * a place to enqueue previously registered scripts for admin requests |
|
46 | - * |
|
47 | - * @return void |
|
48 | - */ |
|
49 | - public function enqueueAdminScripts(); |
|
11 | + /** |
|
12 | + * a place to register scripts and stylesheets with WordPress core |
|
13 | + * IMPORTANT !!! |
|
14 | + * ALL JavaScript files need to be registered for loading in the footer |
|
15 | + * by setting the 5th parameter of wp_register_script() to ` true ` |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function registerScriptsAndStylesheets(); |
|
20 | + |
|
21 | + /** |
|
22 | + * a place to enqueue previously registered stylesheets |
|
23 | + * this will be called during the wp_enqueue_scripts hook for frontend requests |
|
24 | + * |
|
25 | + * @return void |
|
26 | + */ |
|
27 | + public function enqueueStylesheets(); |
|
28 | + |
|
29 | + /** |
|
30 | + * a place to enqueue previously registered stylesheets |
|
31 | + * this will be called during the admin_enqueue_scripts hook for admin requests |
|
32 | + * |
|
33 | + * @return void |
|
34 | + */ |
|
35 | + public function enqueueAdminStylesheets(); |
|
36 | + |
|
37 | + /** |
|
38 | + * a place to enqueue previously registered scripts for frontend requests |
|
39 | + * |
|
40 | + * @return void |
|
41 | + */ |
|
42 | + public function enqueueScripts(); |
|
43 | + |
|
44 | + /** |
|
45 | + * a place to enqueue previously registered scripts for admin requests |
|
46 | + * |
|
47 | + * @return void |
|
48 | + */ |
|
49 | + public function enqueueAdminScripts(); |
|
50 | 50 | |
51 | 51 | } |
52 | 52 | // End of file EnqueueAssetsInterface.php |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function processShortcode($attributes = array()) |
89 | 89 | { |
90 | 90 | // grab attributes and merge with defaults |
91 | - $attributes = $this->getAttributes((array)$attributes); |
|
91 | + $attributes = $this->getAttributes((array) $attributes); |
|
92 | 92 | // add attributes to template args |
93 | 93 | $this->template_args['show_gravatar'] = $attributes['show_gravatar']; |
94 | 94 | // add required objects: event, datetime, and ticket |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @return EE_Event|null |
155 | 155 | * @throws \EE_Error |
156 | 156 | */ |
157 | - private function getEventAndQueryParams(array $attributes){ |
|
157 | + private function getEventAndQueryParams(array $attributes) { |
|
158 | 158 | if ( ! empty($attributes['event_id'])) { |
159 | 159 | $event = EEM_Event::instance()->get_one_by_ID($attributes['event_id']); |
160 | 160 | if ($event instanceof EE_Event) { |
@@ -28,245 +28,245 @@ |
||
28 | 28 | class EspressoEventAttendees extends EspressoShortcode |
29 | 29 | { |
30 | 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() |
|
48 | - { |
|
49 | - return 'ESPRESSO_EVENT_ATTENDEES'; |
|
50 | - } |
|
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() |
|
61 | - { |
|
62 | - return 0; |
|
63 | - } |
|
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() |
|
75 | - { |
|
76 | - $this->shortcodeHasBeenInitialized(); |
|
77 | - } |
|
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()) |
|
102 | - { |
|
103 | - // grab attributes and merge with defaults |
|
104 | - $attributes = $this->getAttributes((array)$attributes); |
|
105 | - // add attributes to template args |
|
106 | - $this->template_args['show_gravatar'] = $attributes['show_gravatar']; |
|
107 | - // add required objects: event, datetime, and ticket |
|
108 | - $this->template_args['event'] = $this->getEventAndQueryParams($attributes); |
|
109 | - $this->template_args['datetime'] = $this->getDatetimeAndQueryParams($attributes); |
|
110 | - $this->template_args['ticket'] = $this->getTicketAndQueryParams($attributes); |
|
111 | - |
|
112 | - // if any of the above objects is invalid or missing, |
|
113 | - // then there was an invalid parameter or the shortcode was used incorrectly |
|
114 | - // so when WP_DEBUG is set and true, we'll show a message, |
|
115 | - // otherwise we'll just return an empty string. |
|
116 | - if ( |
|
117 | - ! $this->template_args['event'] instanceof EE_Event |
|
118 | - || empty($this->query_params[0]) |
|
119 | - || ($attributes['datetime_id'] && ! $this->template_args['datetime'] instanceof EE_Datetime) |
|
120 | - || ($attributes['ticket_id'] && ! $this->template_args['ticket'] instanceof EE_Ticket) |
|
121 | - ) { |
|
122 | - if (WP_DEBUG) { |
|
123 | - return '<div class="important-notice ee-attention">' |
|
124 | - . esc_html__('The [ESPRESSO_EVENT_ATTENDEES] shortcode has been used incorrectly. Please double check the arguments you used for any typos. In the case of ID type arguments, its possible the given ID does not correspond to existing data in the database.', |
|
125 | - 'event_espresso') |
|
126 | - . '</div>'; |
|
127 | - } else { |
|
128 | - return ''; |
|
129 | - } |
|
130 | - } |
|
131 | - $this->setAdditionalQueryParams($attributes); |
|
132 | - //get contacts! |
|
133 | - $this->template_args['contacts'] = EEM_Attendee::instance()->get_all($this->query_params); |
|
134 | - //all set let's load up the template and return. |
|
135 | - return EEH_Template::locate_template('loop-espresso_event_attendees.php', $this->template_args, true, true); |
|
136 | - } |
|
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) |
|
147 | - { |
|
148 | - return array_merge( |
|
149 | - (array) apply_filters( |
|
150 | - 'EES_Espresso_Event_Attendees__process_shortcode__default_shortcode_atts', |
|
151 | - array( |
|
152 | - 'event_id' => null, |
|
153 | - 'datetime_id' => null, |
|
154 | - 'ticket_id' => null, |
|
155 | - 'status' => EEM_Registration::status_id_approved, |
|
156 | - 'show_gravatar' => false |
|
157 | - ) |
|
158 | - ), |
|
159 | - $attributes |
|
160 | - ); |
|
161 | - } |
|
162 | - |
|
163 | - |
|
164 | - |
|
165 | - /** |
|
166 | - * @param array $attributes |
|
167 | - * @return EE_Event|null |
|
168 | - * @throws \EE_Error |
|
169 | - */ |
|
170 | - private function getEventAndQueryParams(array $attributes){ |
|
171 | - if ( ! empty($attributes['event_id'])) { |
|
172 | - $event = EEM_Event::instance()->get_one_by_ID($attributes['event_id']); |
|
173 | - if ($event instanceof EE_Event) { |
|
174 | - $this->query_params[0]['Registration.EVT_ID'] = $attributes['event_id']; |
|
175 | - return $event; |
|
176 | - } |
|
177 | - } |
|
178 | - //seems like is_espresso_event_single() isn't working as expected. So using alternate method. |
|
179 | - if (is_single() && is_espresso_event()) { |
|
180 | - $event = EEH_Event_View::get_event(); |
|
181 | - if ($event instanceof EE_Event) { |
|
182 | - $this->query_params[0]['Registration.EVT_ID'] = $event->ID(); |
|
183 | - return $event; |
|
184 | - } |
|
185 | - } |
|
186 | - // one last shot... |
|
187 | - // try getting the earliest active event |
|
188 | - $events = EEM_Event::instance()->get_active_events(array( |
|
189 | - 'limit' => 1, |
|
190 | - 'order_by' => array('Datetime.DTT_EVT_start' => 'ASC') |
|
191 | - )); |
|
192 | - // if none then get the next upcoming |
|
193 | - $events = empty($events) |
|
194 | - ? EEM_Event::instance()->get_upcoming_events(array( |
|
195 | - 'limit' => 1, |
|
196 | - 'order_by' => array('Datetime.DTT_EVT_start' => 'ASC') |
|
197 | - )) |
|
198 | - : $events; |
|
199 | - $event = reset($events); |
|
200 | - if ($event instanceof EE_Event) { |
|
201 | - $this->query_params[0]['Registration.EVT_ID'] = $event->ID(); |
|
202 | - return $event; |
|
203 | - } |
|
204 | - return null; |
|
205 | - } |
|
206 | - |
|
207 | - |
|
208 | - |
|
209 | - /** |
|
210 | - * @param array $attributes |
|
211 | - * @return EE_Datetime|null |
|
212 | - */ |
|
213 | - private function getDatetimeAndQueryParams(array $attributes) |
|
214 | - { |
|
215 | - if ( ! empty($attributes['datetime_id'])) { |
|
216 | - $datetime = EEM_Datetime::instance()->get_one_by_ID($attributes['datetime_id']); |
|
217 | - if ($datetime instanceof EE_Datetime) { |
|
218 | - $this->query_params[0]['Registration.Ticket.Datetime.DTT_ID'] = $attributes['datetime_id']; |
|
219 | - $this->query_params['default_where_conditions'] = 'this_model_only'; |
|
220 | - if ( ! $this->template_args['event'] instanceof EE_Event) { |
|
221 | - $this->template_args['event'] = $datetime->event(); |
|
222 | - } |
|
223 | - return $datetime; |
|
224 | - } |
|
225 | - } |
|
226 | - return null; |
|
227 | - } |
|
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) |
|
237 | - { |
|
238 | - if ( ! empty($attributes['ticket_id']) && empty($attributes['event_id']) && empty($attributes['datetime_id'])) { |
|
239 | - $ticket = EEM_Ticket::instance()->get_one_by_ID($attributes['ticket_id']); |
|
240 | - if ($ticket instanceof EE_Ticket) { |
|
241 | - $this->query_params[0]['Registration.TKT_ID'] = $attributes['ticket_id']; |
|
242 | - if ( ! $this->template_args['event'] instanceof EE_Event) { |
|
243 | - $this->template_args['event'] = $ticket->first_datetime() instanceof EE_Datetime |
|
244 | - ? $ticket->first_datetime()->event() |
|
245 | - : null; |
|
246 | - } |
|
247 | - return $ticket; |
|
248 | - } |
|
249 | - } |
|
250 | - return null; |
|
251 | - } |
|
252 | - |
|
253 | - |
|
254 | - |
|
255 | - /** |
|
256 | - * @param array $attributes |
|
257 | - */ |
|
258 | - private function setAdditionalQueryParams(array $attributes) |
|
259 | - { |
|
260 | - $reg_status_array = EEM_Registration::reg_status_array(); |
|
261 | - if ($attributes['status'] !== 'all' && isset($reg_status_array[$attributes['status']])) { |
|
262 | - $this->query_params[0]['Registration.STS_ID'] = $attributes['status']; |
|
263 | - } |
|
264 | - $this->query_params['group_by'] = array('ATT_ID'); |
|
265 | - $this->query_params['order_by'] = (array) apply_filters( |
|
266 | - 'FHEE__EES_Espresso_Event_Attendees__process_shortcode__order_by', |
|
267 | - array('ATT_lname' => 'ASC', 'ATT_fname' => 'ASC') |
|
268 | - ); |
|
269 | - } |
|
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() |
|
48 | + { |
|
49 | + return 'ESPRESSO_EVENT_ATTENDEES'; |
|
50 | + } |
|
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() |
|
61 | + { |
|
62 | + return 0; |
|
63 | + } |
|
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() |
|
75 | + { |
|
76 | + $this->shortcodeHasBeenInitialized(); |
|
77 | + } |
|
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()) |
|
102 | + { |
|
103 | + // grab attributes and merge with defaults |
|
104 | + $attributes = $this->getAttributes((array)$attributes); |
|
105 | + // add attributes to template args |
|
106 | + $this->template_args['show_gravatar'] = $attributes['show_gravatar']; |
|
107 | + // add required objects: event, datetime, and ticket |
|
108 | + $this->template_args['event'] = $this->getEventAndQueryParams($attributes); |
|
109 | + $this->template_args['datetime'] = $this->getDatetimeAndQueryParams($attributes); |
|
110 | + $this->template_args['ticket'] = $this->getTicketAndQueryParams($attributes); |
|
111 | + |
|
112 | + // if any of the above objects is invalid or missing, |
|
113 | + // then there was an invalid parameter or the shortcode was used incorrectly |
|
114 | + // so when WP_DEBUG is set and true, we'll show a message, |
|
115 | + // otherwise we'll just return an empty string. |
|
116 | + if ( |
|
117 | + ! $this->template_args['event'] instanceof EE_Event |
|
118 | + || empty($this->query_params[0]) |
|
119 | + || ($attributes['datetime_id'] && ! $this->template_args['datetime'] instanceof EE_Datetime) |
|
120 | + || ($attributes['ticket_id'] && ! $this->template_args['ticket'] instanceof EE_Ticket) |
|
121 | + ) { |
|
122 | + if (WP_DEBUG) { |
|
123 | + return '<div class="important-notice ee-attention">' |
|
124 | + . esc_html__('The [ESPRESSO_EVENT_ATTENDEES] shortcode has been used incorrectly. Please double check the arguments you used for any typos. In the case of ID type arguments, its possible the given ID does not correspond to existing data in the database.', |
|
125 | + 'event_espresso') |
|
126 | + . '</div>'; |
|
127 | + } else { |
|
128 | + return ''; |
|
129 | + } |
|
130 | + } |
|
131 | + $this->setAdditionalQueryParams($attributes); |
|
132 | + //get contacts! |
|
133 | + $this->template_args['contacts'] = EEM_Attendee::instance()->get_all($this->query_params); |
|
134 | + //all set let's load up the template and return. |
|
135 | + return EEH_Template::locate_template('loop-espresso_event_attendees.php', $this->template_args, true, true); |
|
136 | + } |
|
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) |
|
147 | + { |
|
148 | + return array_merge( |
|
149 | + (array) apply_filters( |
|
150 | + 'EES_Espresso_Event_Attendees__process_shortcode__default_shortcode_atts', |
|
151 | + array( |
|
152 | + 'event_id' => null, |
|
153 | + 'datetime_id' => null, |
|
154 | + 'ticket_id' => null, |
|
155 | + 'status' => EEM_Registration::status_id_approved, |
|
156 | + 'show_gravatar' => false |
|
157 | + ) |
|
158 | + ), |
|
159 | + $attributes |
|
160 | + ); |
|
161 | + } |
|
162 | + |
|
163 | + |
|
164 | + |
|
165 | + /** |
|
166 | + * @param array $attributes |
|
167 | + * @return EE_Event|null |
|
168 | + * @throws \EE_Error |
|
169 | + */ |
|
170 | + private function getEventAndQueryParams(array $attributes){ |
|
171 | + if ( ! empty($attributes['event_id'])) { |
|
172 | + $event = EEM_Event::instance()->get_one_by_ID($attributes['event_id']); |
|
173 | + if ($event instanceof EE_Event) { |
|
174 | + $this->query_params[0]['Registration.EVT_ID'] = $attributes['event_id']; |
|
175 | + return $event; |
|
176 | + } |
|
177 | + } |
|
178 | + //seems like is_espresso_event_single() isn't working as expected. So using alternate method. |
|
179 | + if (is_single() && is_espresso_event()) { |
|
180 | + $event = EEH_Event_View::get_event(); |
|
181 | + if ($event instanceof EE_Event) { |
|
182 | + $this->query_params[0]['Registration.EVT_ID'] = $event->ID(); |
|
183 | + return $event; |
|
184 | + } |
|
185 | + } |
|
186 | + // one last shot... |
|
187 | + // try getting the earliest active event |
|
188 | + $events = EEM_Event::instance()->get_active_events(array( |
|
189 | + 'limit' => 1, |
|
190 | + 'order_by' => array('Datetime.DTT_EVT_start' => 'ASC') |
|
191 | + )); |
|
192 | + // if none then get the next upcoming |
|
193 | + $events = empty($events) |
|
194 | + ? EEM_Event::instance()->get_upcoming_events(array( |
|
195 | + 'limit' => 1, |
|
196 | + 'order_by' => array('Datetime.DTT_EVT_start' => 'ASC') |
|
197 | + )) |
|
198 | + : $events; |
|
199 | + $event = reset($events); |
|
200 | + if ($event instanceof EE_Event) { |
|
201 | + $this->query_params[0]['Registration.EVT_ID'] = $event->ID(); |
|
202 | + return $event; |
|
203 | + } |
|
204 | + return null; |
|
205 | + } |
|
206 | + |
|
207 | + |
|
208 | + |
|
209 | + /** |
|
210 | + * @param array $attributes |
|
211 | + * @return EE_Datetime|null |
|
212 | + */ |
|
213 | + private function getDatetimeAndQueryParams(array $attributes) |
|
214 | + { |
|
215 | + if ( ! empty($attributes['datetime_id'])) { |
|
216 | + $datetime = EEM_Datetime::instance()->get_one_by_ID($attributes['datetime_id']); |
|
217 | + if ($datetime instanceof EE_Datetime) { |
|
218 | + $this->query_params[0]['Registration.Ticket.Datetime.DTT_ID'] = $attributes['datetime_id']; |
|
219 | + $this->query_params['default_where_conditions'] = 'this_model_only'; |
|
220 | + if ( ! $this->template_args['event'] instanceof EE_Event) { |
|
221 | + $this->template_args['event'] = $datetime->event(); |
|
222 | + } |
|
223 | + return $datetime; |
|
224 | + } |
|
225 | + } |
|
226 | + return null; |
|
227 | + } |
|
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) |
|
237 | + { |
|
238 | + if ( ! empty($attributes['ticket_id']) && empty($attributes['event_id']) && empty($attributes['datetime_id'])) { |
|
239 | + $ticket = EEM_Ticket::instance()->get_one_by_ID($attributes['ticket_id']); |
|
240 | + if ($ticket instanceof EE_Ticket) { |
|
241 | + $this->query_params[0]['Registration.TKT_ID'] = $attributes['ticket_id']; |
|
242 | + if ( ! $this->template_args['event'] instanceof EE_Event) { |
|
243 | + $this->template_args['event'] = $ticket->first_datetime() instanceof EE_Datetime |
|
244 | + ? $ticket->first_datetime()->event() |
|
245 | + : null; |
|
246 | + } |
|
247 | + return $ticket; |
|
248 | + } |
|
249 | + } |
|
250 | + return null; |
|
251 | + } |
|
252 | + |
|
253 | + |
|
254 | + |
|
255 | + /** |
|
256 | + * @param array $attributes |
|
257 | + */ |
|
258 | + private function setAdditionalQueryParams(array $attributes) |
|
259 | + { |
|
260 | + $reg_status_array = EEM_Registration::reg_status_array(); |
|
261 | + if ($attributes['status'] !== 'all' && isset($reg_status_array[$attributes['status']])) { |
|
262 | + $this->query_params[0]['Registration.STS_ID'] = $attributes['status']; |
|
263 | + } |
|
264 | + $this->query_params['group_by'] = array('ATT_ID'); |
|
265 | + $this->query_params['order_by'] = (array) apply_filters( |
|
266 | + 'FHEE__EES_Espresso_Event_Attendees__process_shortcode__order_by', |
|
267 | + array('ATT_lname' => 'ASC', 'ATT_fname' => 'ASC') |
|
268 | + ); |
|
269 | + } |
|
270 | 270 | |
271 | 271 | |
272 | 272 |
@@ -8,33 +8,33 @@ |
||
8 | 8 | interface SetHooksInterface |
9 | 9 | { |
10 | 10 | |
11 | - /** |
|
12 | - * a place to add action and filter hooks for regular frontend requests |
|
13 | - * |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public function setHooks(); |
|
17 | - |
|
18 | - /** |
|
19 | - * a place to add action and filter hooks for regular WP admin requests |
|
20 | - * |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function setAdminHooks(); |
|
24 | - |
|
25 | - /** |
|
26 | - * a place to add action and filter hooks for AJAX requests |
|
27 | - * |
|
28 | - * @return void |
|
29 | - */ |
|
30 | - public function setAjaxHooks(); |
|
31 | - |
|
32 | - /** |
|
33 | - * a place to add action and filter hooks for REST API requests |
|
34 | - * |
|
35 | - * @return void |
|
36 | - */ |
|
37 | - public function setApiHooks(); |
|
11 | + /** |
|
12 | + * a place to add action and filter hooks for regular frontend requests |
|
13 | + * |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public function setHooks(); |
|
17 | + |
|
18 | + /** |
|
19 | + * a place to add action and filter hooks for regular WP admin requests |
|
20 | + * |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function setAdminHooks(); |
|
24 | + |
|
25 | + /** |
|
26 | + * a place to add action and filter hooks for AJAX requests |
|
27 | + * |
|
28 | + * @return void |
|
29 | + */ |
|
30 | + public function setAjaxHooks(); |
|
31 | + |
|
32 | + /** |
|
33 | + * a place to add action and filter hooks for REST API requests |
|
34 | + * |
|
35 | + * @return void |
|
36 | + */ |
|
37 | + public function setApiHooks(); |
|
38 | 38 | |
39 | 39 | } |
40 | 40 | // End of file SetHooksInterface.php |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param WP $WP |
32 | 32 | * @return void |
33 | 33 | */ |
34 | - public function run( WP $WP ) { |
|
34 | + public function run(WP $WP) { |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param array $attributes |
42 | 42 | * @return string |
43 | 43 | */ |
44 | - public function process_shortcode( $attributes = array() ) { |
|
44 | + public function process_shortcode($attributes = array()) { |
|
45 | 45 | \EE_Error::doing_it_wrong( |
46 | 46 | __METHOD__, |
47 | 47 | __( |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * ESPRESSO_EVENTS |
4 | 6 | * |
@@ -10,15 +10,15 @@ discard block |
||
10 | 10 | class EES_Espresso_Events extends EES_Shortcode { |
11 | 11 | |
12 | 12 | /** |
13 | - * @deprecated 4.9.27 |
|
14 | - * @return void |
|
13 | + * @deprecated 4.9.27 |
|
14 | + * @return void |
|
15 | 15 | */ |
16 | 16 | public static function set_hooks() { |
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
20 | - * @deprecated 4.9.27 |
|
21 | - * @return void |
|
20 | + * @deprecated 4.9.27 |
|
21 | + * @return void |
|
22 | 22 | */ |
23 | 23 | public static function set_hooks_admin() { |
24 | 24 | } |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | |
28 | 28 | /** |
29 | - * @deprecated 4.9.27 |
|
30 | - * @param WP $WP |
|
29 | + * @deprecated 4.9.27 |
|
30 | + * @param WP $WP |
|
31 | 31 | * @return void |
32 | 32 | */ |
33 | 33 | public function run( WP $WP ) { |
@@ -36,21 +36,21 @@ discard block |
||
36 | 36 | |
37 | 37 | |
38 | 38 | /** |
39 | - * @deprecated 4.9.27 |
|
40 | - * @param array $attributes |
|
39 | + * @deprecated 4.9.27 |
|
40 | + * @param array $attributes |
|
41 | 41 | * @return string |
42 | 42 | */ |
43 | 43 | public function process_shortcode( $attributes = array() ) { |
44 | - \EE_Error::doing_it_wrong( |
|
45 | - __METHOD__, |
|
46 | - __( |
|
47 | - 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoEvents instead.', |
|
48 | - 'event_espresso' |
|
49 | - ), |
|
50 | - '4.9.27' |
|
51 | - ); |
|
52 | - return ''; |
|
53 | - } |
|
44 | + \EE_Error::doing_it_wrong( |
|
45 | + __METHOD__, |
|
46 | + __( |
|
47 | + 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoEvents instead.', |
|
48 | + 'event_espresso' |
|
49 | + ), |
|
50 | + '4.9.27' |
|
51 | + ); |
|
52 | + return ''; |
|
53 | + } |
|
54 | 54 | |
55 | 55 | |
56 | 56 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @param WP $WP |
19 | 19 | * @return void |
20 | 20 | */ |
21 | - public function run( WP $WP ) {} |
|
21 | + public function run(WP $WP) {} |
|
22 | 22 | |
23 | 23 | |
24 | 24 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return string |
48 | 48 | * @throws \EE_Error |
49 | 49 | */ |
50 | - public function process_shortcode( $attributes = array() ) { |
|
50 | + public function process_shortcode($attributes = array()) { |
|
51 | 51 | \EE_Error::doing_it_wrong( |
52 | 52 | __METHOD__, |
53 | 53 | __( |
@@ -41,22 +41,22 @@ |
||
41 | 41 | |
42 | 42 | |
43 | 43 | |
44 | - /** |
|
45 | - * @deprecated 4.9.27 |
|
46 | - * @param array $attributes |
|
47 | - * @return string |
|
48 | - * @throws \EE_Error |
|
49 | - */ |
|
44 | + /** |
|
45 | + * @deprecated 4.9.27 |
|
46 | + * @param array $attributes |
|
47 | + * @return string |
|
48 | + * @throws \EE_Error |
|
49 | + */ |
|
50 | 50 | public function process_shortcode( $attributes = array() ) { |
51 | - \EE_Error::doing_it_wrong( |
|
52 | - __METHOD__, |
|
53 | - __( |
|
54 | - 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendeesShortcode instead.', |
|
55 | - 'event_espresso' |
|
56 | - ), |
|
57 | - '4.9.27' |
|
58 | - ); |
|
59 | - return ''; |
|
51 | + \EE_Error::doing_it_wrong( |
|
52 | + __METHOD__, |
|
53 | + __( |
|
54 | + 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendeesShortcode instead.', |
|
55 | + 'event_espresso' |
|
56 | + ), |
|
57 | + '4.9.27' |
|
58 | + ); |
|
59 | + return ''; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed');} |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed'); } |
|
2 | 2 | /** |
3 | 3 | * EES_Espresso_Txn_Page |
4 | 4 | * |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @throws \Exception |
58 | 58 | * @throws \EE_Error |
59 | 59 | */ |
60 | - public function run( WP $WP ) { |
|
60 | + public function run(WP $WP) { |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * @param array $attributes |
69 | 69 | * @return string |
70 | 70 | */ |
71 | - public function process_shortcode( $attributes = array() ) { |
|
72 | - return __( 'This is the Event Espresso Transactions page. This page receives instant payment notification (IPN) requests and should have a status of published, but should not be easily accessible by site visitors. Do not add it to your website\'s navigation menu or link to it from another page. Also, do not delete it or change its status to private.', 'event_espresso' ); |
|
71 | + public function process_shortcode($attributes = array()) { |
|
72 | + return __('This is the Event Espresso Transactions page. This page receives instant payment notification (IPN) requests and should have a status of published, but should not be easily accessible by site visitors. Do not add it to your website\'s navigation menu or link to it from another page. Also, do not delete it or change its status to private.', 'event_espresso'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 |
@@ -11,15 +11,15 @@ discard block |
||
11 | 11 | |
12 | 12 | |
13 | 13 | /** |
14 | - * @deprecated 4.9.27 |
|
15 | - * @return void |
|
14 | + * @deprecated 4.9.27 |
|
15 | + * @return void |
|
16 | 16 | */ |
17 | 17 | public static function set_hooks() { |
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | - * @deprecated 4.9.27 |
|
22 | - * @return void |
|
21 | + * @deprecated 4.9.27 |
|
22 | + * @return void |
|
23 | 23 | */ |
24 | 24 | public static function set_hooks_admin() { |
25 | 25 | } |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | |
28 | 28 | |
29 | 29 | /** |
30 | - * @deprecated 4.9.27 |
|
31 | - * @return void |
|
30 | + * @deprecated 4.9.27 |
|
31 | + * @return void |
|
32 | 32 | */ |
33 | 33 | public static function set_definitions() { |
34 | 34 | } |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | |
37 | 37 | |
38 | 38 | /** |
39 | - * @deprecated 4.9.27 |
|
40 | - * @param WP $WP |
|
39 | + * @deprecated 4.9.27 |
|
40 | + * @param WP $WP |
|
41 | 41 | * @return void |
42 | 42 | * @throws \Exception |
43 | 43 | * @throws \EE_Error |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | |
50 | 50 | |
51 | 51 | /** |
52 | - * @deprecated 4.9.27 |
|
53 | - * @param array $attributes |
|
52 | + * @deprecated 4.9.27 |
|
53 | + * @param array $attributes |
|
54 | 54 | * @return string |
55 | 55 | */ |
56 | 56 | public function process_shortcode( $attributes = array() ) { |
@@ -14,57 +14,57 @@ |
||
14 | 14 | class EES_Espresso_Cancelled extends EES_Shortcode |
15 | 15 | { |
16 | 16 | |
17 | - /** |
|
18 | - * @deprecated 4.9.27 |
|
19 | - * @return void |
|
20 | - */ |
|
21 | - public static function set_hooks() |
|
22 | - { |
|
23 | - } |
|
17 | + /** |
|
18 | + * @deprecated 4.9.27 |
|
19 | + * @return void |
|
20 | + */ |
|
21 | + public static function set_hooks() |
|
22 | + { |
|
23 | + } |
|
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * @deprecated 4.9.27 |
|
29 | - * @return void |
|
30 | - */ |
|
31 | - public static function set_hooks_admin() |
|
32 | - { |
|
33 | - } |
|
27 | + /** |
|
28 | + * @deprecated 4.9.27 |
|
29 | + * @return void |
|
30 | + */ |
|
31 | + public static function set_hooks_admin() |
|
32 | + { |
|
33 | + } |
|
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * @deprecated 4.9.27 |
|
39 | - * @param WP $WP |
|
40 | - * @return void |
|
41 | - */ |
|
42 | - public function run(WP $WP) |
|
43 | - { |
|
44 | - } |
|
37 | + /** |
|
38 | + * @deprecated 4.9.27 |
|
39 | + * @param WP $WP |
|
40 | + * @return void |
|
41 | + */ |
|
42 | + public function run(WP $WP) |
|
43 | + { |
|
44 | + } |
|
45 | 45 | |
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * process_shortcode - ESPRESSO_CANCELLED |
|
50 | - * |
|
51 | - * @deprecated 4.9.27 |
|
52 | - * @param array $attributes |
|
53 | - * @return string |
|
54 | - * @throws \EE_Error |
|
55 | - */ |
|
56 | - public function process_shortcode($attributes = array()) |
|
57 | - { |
|
58 | - \EE_Error::doing_it_wrong( |
|
59 | - __METHOD__, |
|
60 | - __( |
|
61 | - 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoCancelled instead.', |
|
62 | - 'event_espresso' |
|
63 | - ), |
|
64 | - '4.9.27' |
|
65 | - ); |
|
66 | - return ''; |
|
67 | - } |
|
48 | + /** |
|
49 | + * process_shortcode - ESPRESSO_CANCELLED |
|
50 | + * |
|
51 | + * @deprecated 4.9.27 |
|
52 | + * @param array $attributes |
|
53 | + * @return string |
|
54 | + * @throws \EE_Error |
|
55 | + */ |
|
56 | + public function process_shortcode($attributes = array()) |
|
57 | + { |
|
58 | + \EE_Error::doing_it_wrong( |
|
59 | + __METHOD__, |
|
60 | + __( |
|
61 | + 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoCancelled instead.', |
|
62 | + 'event_espresso' |
|
63 | + ), |
|
64 | + '4.9.27' |
|
65 | + ); |
|
66 | + return ''; |
|
67 | + } |
|
68 | 68 | |
69 | 69 | } |
70 | 70 | // End of file EES_Espresso_Cancelled.shortcode.php |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | class EES_Espresso_Ticket_Selector extends EES_Shortcode { |
11 | 11 | |
12 | 12 | /** |
13 | - * @deprecated 4.9.27 |
|
14 | - * @return void |
|
13 | + * @deprecated 4.9.27 |
|
14 | + * @return void |
|
15 | 15 | */ |
16 | 16 | public static function set_hooks() { |
17 | 17 | } |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | |
20 | 20 | |
21 | 21 | /** |
22 | - * @deprecated 4.9.27 |
|
23 | - * @return void |
|
22 | + * @deprecated 4.9.27 |
|
23 | + * @return void |
|
24 | 24 | */ |
25 | 25 | public static function set_hooks_admin() { |
26 | 26 | } |
@@ -28,29 +28,29 @@ discard block |
||
28 | 28 | |
29 | 29 | |
30 | 30 | /** |
31 | - * @deprecated 4.9.27 |
|
32 | - * @param \WP $WP |
|
31 | + * @deprecated 4.9.27 |
|
32 | + * @param \WP $WP |
|
33 | 33 | */ |
34 | 34 | public function run( WP $WP ) { |
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | /** |
39 | - * @deprecated 4.9.27 |
|
40 | - * @param array $attributes |
|
39 | + * @deprecated 4.9.27 |
|
40 | + * @param array $attributes |
|
41 | 41 | * @return string |
42 | 42 | */ |
43 | 43 | public function process_shortcode( $attributes = array() ) { |
44 | - \EE_Error::doing_it_wrong( |
|
45 | - __METHOD__, |
|
46 | - __( |
|
47 | - 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector instead.', |
|
48 | - 'event_espresso' |
|
49 | - ), |
|
50 | - '4.9.27' |
|
51 | - ); |
|
52 | - return ''; |
|
53 | - } |
|
44 | + \EE_Error::doing_it_wrong( |
|
45 | + __METHOD__, |
|
46 | + __( |
|
47 | + 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector instead.', |
|
48 | + 'event_espresso' |
|
49 | + ), |
|
50 | + '4.9.27' |
|
51 | + ); |
|
52 | + return ''; |
|
53 | + } |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | // End of file EES_Espresso_Ticket_Selector.shortcode.php |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @deprecated 4.9.27 |
32 | 32 | * @param \WP $WP |
33 | 33 | */ |
34 | - public function run( WP $WP ) { |
|
34 | + public function run(WP $WP) { |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param array $attributes |
41 | 41 | * @return string |
42 | 42 | */ |
43 | - public function process_shortcode( $attributes = array() ) { |
|
43 | + public function process_shortcode($attributes = array()) { |
|
44 | 44 | \EE_Error::doing_it_wrong( |
45 | 45 | __METHOD__, |
46 | 46 | __( |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * EES_Espresso_Ticket_Selector |
4 | 6 | * |