@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | * date_format and the second value is the time format |
51 | 51 | * @return EE_Event |
52 | 52 | */ |
53 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
54 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
55 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
53 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
54 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
55 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * the website will be used. |
64 | 64 | * @return EE_Event |
65 | 65 | */ |
66 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
67 | - return new self( $props_n_values, TRUE, $timezone ); |
|
66 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
67 | + return new self($props_n_values, TRUE, $timezone); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @param array $query_params like EEM_Base::get_all |
76 | 76 | * @return EE_Datetime[] |
77 | 77 | */ |
78 | - public function datetimes( $query_params = array() ) { |
|
79 | - return $this->get_many_related( 'Datetime', $query_params ); |
|
78 | + public function datetimes($query_params = array()) { |
|
79 | + return $this->get_many_related('Datetime', $query_params); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @return EE_Datetime[] |
88 | 88 | */ |
89 | 89 | public function datetimes_in_chronological_order() { |
90 | - return $this->get_many_related( 'Datetime', array( 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) ) ); |
|
90 | + return $this->get_many_related('Datetime', array('order_by' => array('DTT_EVT_start' => 'ASC'))); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | * @param null $limit |
104 | 104 | * @return \EE_Datetime[] |
105 | 105 | */ |
106 | - public function datetimes_ordered( $show_expired = true, $show_deleted = false, $limit = null ) { |
|
107 | - return EEM_Datetime::instance( $this->_timezone )->get_datetimes_for_event_ordered_by_DTT_order( $this->ID(), $show_expired, $show_deleted, $limit ); |
|
106 | + public function datetimes_ordered($show_expired = true, $show_deleted = false, $limit = null) { |
|
107 | + return EEM_Datetime::instance($this->_timezone)->get_datetimes_for_event_ordered_by_DTT_order($this->ID(), $show_expired, $show_deleted, $limit); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @return EE_Datetime |
115 | 115 | */ |
116 | 116 | public function first_datetime() { |
117 | - return $this->get_first_related( 'Datetime' ); |
|
117 | + return $this->get_first_related('Datetime'); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | * @param bool $try_to_exclude_deleted |
126 | 126 | * @return EE_Datetime |
127 | 127 | */ |
128 | - public function primary_datetime( $try_to_exclude_expired = TRUE, $try_to_exclude_deleted = TRUE ) { |
|
129 | - if ( !empty ( $this->_Primary_Datetime ) ) { |
|
128 | + public function primary_datetime($try_to_exclude_expired = TRUE, $try_to_exclude_deleted = TRUE) { |
|
129 | + if ( ! empty ($this->_Primary_Datetime)) { |
|
130 | 130 | return $this->_Primary_Datetime; |
131 | 131 | } |
132 | - $this->_Primary_Datetime = EEM_Datetime::instance( $this->_timezone )->get_primary_datetime_for_event( $this->ID(), $try_to_exclude_expired, $try_to_exclude_deleted ); |
|
132 | + $this->_Primary_Datetime = EEM_Datetime::instance($this->_timezone)->get_primary_datetime_for_event($this->ID(), $try_to_exclude_expired, $try_to_exclude_deleted); |
|
133 | 133 | return $this->_Primary_Datetime; |
134 | 134 | } |
135 | 135 | |
@@ -140,30 +140,30 @@ discard block |
||
140 | 140 | * @param array $query_params like EEM_Base::get_all |
141 | 141 | * @return EE_Ticket[] |
142 | 142 | */ |
143 | - public function tickets( $query_params = array() ) { |
|
143 | + public function tickets($query_params = array()) { |
|
144 | 144 | //first get all datetimes |
145 | 145 | $datetimes = $this->datetimes_ordered(); |
146 | - if ( ! $datetimes ) { |
|
146 | + if ( ! $datetimes) { |
|
147 | 147 | return array(); |
148 | 148 | } |
149 | 149 | |
150 | 150 | $datetime_ids = array(); |
151 | - foreach ( $datetimes as $datetime ) { |
|
151 | + foreach ($datetimes as $datetime) { |
|
152 | 152 | $datetime_ids[] = $datetime->ID(); |
153 | 153 | } |
154 | 154 | |
155 | - $where_params = array( 'Datetime.DTT_ID' => array( 'IN', $datetime_ids ) ); |
|
155 | + $where_params = array('Datetime.DTT_ID' => array('IN', $datetime_ids)); |
|
156 | 156 | |
157 | 157 | //if incoming $query_params has where conditions let's merge but not override existing. |
158 | - if ( is_array( $query_params ) && isset( $query_params[0]) ) { |
|
159 | - $where_params = array_merge( $query_params[0], $where_params ); |
|
160 | - unset( $query_params[0] ); |
|
158 | + if (is_array($query_params) && isset($query_params[0])) { |
|
159 | + $where_params = array_merge($query_params[0], $where_params); |
|
160 | + unset($query_params[0]); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | //now add $where_params to $query_params |
164 | 164 | $query_params[0] = $where_params; |
165 | 165 | |
166 | - return EEM_Ticket::instance()->get_all( $query_params ); |
|
166 | + return EEM_Ticket::instance()->get_all($query_params); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @return bool |
173 | 173 | */ |
174 | 174 | function additional_limit() { |
175 | - return $this->get( 'EVT_additional_limit' ); |
|
175 | + return $this->get('EVT_additional_limit'); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | * @return bool |
182 | 182 | */ |
183 | 183 | function allow_overflow() { |
184 | - return $this->get( 'EVT_allow_overflow' ); |
|
184 | + return $this->get('EVT_allow_overflow'); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @return bool |
191 | 191 | */ |
192 | 192 | function created() { |
193 | - return $this->get( 'EVT_created' ); |
|
193 | + return $this->get('EVT_created'); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @return bool |
200 | 200 | */ |
201 | 201 | function description() { |
202 | - return $this->get( 'EVT_desc' ); |
|
202 | + return $this->get('EVT_desc'); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * @return string of html |
210 | 210 | */ |
211 | 211 | function description_filtered() { |
212 | - return $this->get_pretty( 'EVT_desc' ); |
|
212 | + return $this->get_pretty('EVT_desc'); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @return bool |
219 | 219 | */ |
220 | 220 | function display_description() { |
221 | - return $this->get( 'EVT_display_desc' ); |
|
221 | + return $this->get('EVT_display_desc'); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * @return bool |
228 | 228 | */ |
229 | 229 | function display_ticket_selector() { |
230 | - return (bool)$this->get( 'EVT_display_ticket_selector' ); |
|
230 | + return (bool) $this->get('EVT_display_ticket_selector'); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | * @return bool |
237 | 237 | */ |
238 | 238 | function external_url() { |
239 | - return $this->get( 'EVT_external_URL' ); |
|
239 | + return $this->get('EVT_external_URL'); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @return bool |
246 | 246 | */ |
247 | 247 | function member_only() { |
248 | - return $this->get( 'EVT_member_only' ); |
|
248 | + return $this->get('EVT_member_only'); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | * @return bool |
255 | 255 | */ |
256 | 256 | function phone() { |
257 | - return $this->get( 'EVT_phone' ); |
|
257 | + return $this->get('EVT_phone'); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * @return bool |
264 | 264 | */ |
265 | 265 | function modified() { |
266 | - return $this->get( 'EVT_modified' ); |
|
266 | + return $this->get('EVT_modified'); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * @return bool |
273 | 273 | */ |
274 | 274 | function name() { |
275 | - return $this->get( 'EVT_name' ); |
|
275 | + return $this->get('EVT_name'); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | * @return bool |
282 | 282 | */ |
283 | 283 | function order() { |
284 | - return $this->get( 'EVT_order' ); |
|
284 | + return $this->get('EVT_order'); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | * @return bool|string |
291 | 291 | */ |
292 | 292 | function default_registration_status() { |
293 | - $event_default_registration_status = $this->get( 'EVT_default_registration_status' ); |
|
294 | - return !empty( $event_default_registration_status ) ? $event_default_registration_status : EE_Registry::instance()->CFG->registration->default_STS_ID; |
|
293 | + $event_default_registration_status = $this->get('EVT_default_registration_status'); |
|
294 | + return ! empty($event_default_registration_status) ? $event_default_registration_status : EE_Registry::instance()->CFG->registration->default_STS_ID; |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | |
@@ -302,14 +302,14 @@ discard block |
||
302 | 302 | * @param bool $not_full_desc |
303 | 303 | * @return bool|string |
304 | 304 | */ |
305 | - function short_description( $num_words = 55, $more = NULL, $not_full_desc = FALSE ) { |
|
306 | - $short_desc = $this->get( 'EVT_short_desc' ); |
|
307 | - if ( !empty( $short_desc ) || $not_full_desc ) { |
|
305 | + function short_description($num_words = 55, $more = NULL, $not_full_desc = FALSE) { |
|
306 | + $short_desc = $this->get('EVT_short_desc'); |
|
307 | + if ( ! empty($short_desc) || $not_full_desc) { |
|
308 | 308 | return $short_desc; |
309 | 309 | } |
310 | 310 | else { |
311 | - $full_desc = $this->get( 'EVT_desc' ); |
|
312 | - return wp_trim_words( $full_desc, $num_words, $more ); |
|
311 | + $full_desc = $this->get('EVT_desc'); |
|
312 | + return wp_trim_words($full_desc, $num_words, $more); |
|
313 | 313 | } |
314 | 314 | } |
315 | 315 | |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @return bool |
320 | 320 | */ |
321 | 321 | function slug() { |
322 | - return $this->get( 'EVT_slug' ); |
|
322 | + return $this->get('EVT_slug'); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | * @return bool |
329 | 329 | */ |
330 | 330 | function timezone_string() { |
331 | - return $this->get( 'EVT_timezone_string' ); |
|
331 | + return $this->get('EVT_timezone_string'); |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @return bool |
338 | 338 | */ |
339 | 339 | function visible_on() { |
340 | - return $this->get( 'EVT_visible_on' ); |
|
340 | + return $this->get('EVT_visible_on'); |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | * @return bool |
347 | 347 | */ |
348 | 348 | function wp_user() { |
349 | - return $this->get( 'EVT_wp_user' ); |
|
349 | + return $this->get('EVT_wp_user'); |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | * @return bool |
356 | 356 | */ |
357 | 357 | function donations() { |
358 | - return $this->get( 'EVT_donations' ); |
|
358 | + return $this->get('EVT_donations'); |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | |
@@ -363,8 +363,8 @@ discard block |
||
363 | 363 | /** |
364 | 364 | * @param $limit |
365 | 365 | */ |
366 | - function set_additional_limit( $limit ) { |
|
367 | - $this->set( 'EVT_additional_limit', $limit ); |
|
366 | + function set_additional_limit($limit) { |
|
367 | + $this->set('EVT_additional_limit', $limit); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | |
@@ -372,8 +372,8 @@ discard block |
||
372 | 372 | /** |
373 | 373 | * @param $created |
374 | 374 | */ |
375 | - function set_created( $created ) { |
|
376 | - $this->set( 'EVT_created', $created ); |
|
375 | + function set_created($created) { |
|
376 | + $this->set('EVT_created', $created); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | |
@@ -381,8 +381,8 @@ discard block |
||
381 | 381 | /** |
382 | 382 | * @param $desc |
383 | 383 | */ |
384 | - function set_description( $desc ) { |
|
385 | - $this->set( 'EVT_desc', $desc ); |
|
384 | + function set_description($desc) { |
|
385 | + $this->set('EVT_desc', $desc); |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | |
@@ -390,8 +390,8 @@ discard block |
||
390 | 390 | /** |
391 | 391 | * @param $display_desc |
392 | 392 | */ |
393 | - function set_display_description( $display_desc ) { |
|
394 | - $this->set( 'EVT_display_desc', $display_desc ); |
|
393 | + function set_display_description($display_desc) { |
|
394 | + $this->set('EVT_display_desc', $display_desc); |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | |
@@ -399,8 +399,8 @@ discard block |
||
399 | 399 | /** |
400 | 400 | * @param $display_ticket_selector |
401 | 401 | */ |
402 | - function set_display_ticket_selector( $display_ticket_selector ) { |
|
403 | - $this->set( 'EVT_display_ticket_selector', $display_ticket_selector ); |
|
402 | + function set_display_ticket_selector($display_ticket_selector) { |
|
403 | + $this->set('EVT_display_ticket_selector', $display_ticket_selector); |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | |
@@ -408,8 +408,8 @@ discard block |
||
408 | 408 | /** |
409 | 409 | * @param $external_url |
410 | 410 | */ |
411 | - function set_external_url( $external_url ) { |
|
412 | - $this->set( 'EVT_external_URL', $external_url ); |
|
411 | + function set_external_url($external_url) { |
|
412 | + $this->set('EVT_external_URL', $external_url); |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | /** |
418 | 418 | * @param $member_only |
419 | 419 | */ |
420 | - function set_member_only( $member_only ) { |
|
421 | - $this->set( 'EVT_member_only', $member_only ); |
|
420 | + function set_member_only($member_only) { |
|
421 | + $this->set('EVT_member_only', $member_only); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | /** |
427 | 427 | * @param $event_phone |
428 | 428 | */ |
429 | - function set_event_phone( $event_phone ) { |
|
430 | - $this->set( 'EVT_phone', $event_phone ); |
|
429 | + function set_event_phone($event_phone) { |
|
430 | + $this->set('EVT_phone', $event_phone); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | |
@@ -435,8 +435,8 @@ discard block |
||
435 | 435 | /** |
436 | 436 | * @param $modified |
437 | 437 | */ |
438 | - function set_modified( $modified ) { |
|
439 | - $this->set( 'EVT_modified', $modified ); |
|
438 | + function set_modified($modified) { |
|
439 | + $this->set('EVT_modified', $modified); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | |
@@ -444,8 +444,8 @@ discard block |
||
444 | 444 | /** |
445 | 445 | * @param $name |
446 | 446 | */ |
447 | - function set_name( $name ) { |
|
448 | - $this->set( 'EVT_name', $name ); |
|
447 | + function set_name($name) { |
|
448 | + $this->set('EVT_name', $name); |
|
449 | 449 | } |
450 | 450 | |
451 | 451 | |
@@ -453,8 +453,8 @@ discard block |
||
453 | 453 | /** |
454 | 454 | * @param $order |
455 | 455 | */ |
456 | - function set_order( $order ) { |
|
457 | - $this->set( 'EVT_order', $order ); |
|
456 | + function set_order($order) { |
|
457 | + $this->set('EVT_order', $order); |
|
458 | 458 | } |
459 | 459 | |
460 | 460 | |
@@ -462,8 +462,8 @@ discard block |
||
462 | 462 | /** |
463 | 463 | * @param $short_desc |
464 | 464 | */ |
465 | - function set_short_description( $short_desc ) { |
|
466 | - $this->set( 'EVT_short_desc', $short_desc ); |
|
465 | + function set_short_description($short_desc) { |
|
466 | + $this->set('EVT_short_desc', $short_desc); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | |
@@ -471,8 +471,8 @@ discard block |
||
471 | 471 | /** |
472 | 472 | * @param $slug |
473 | 473 | */ |
474 | - function set_slug( $slug ) { |
|
475 | - $this->set( 'EVT_slug', $slug ); |
|
474 | + function set_slug($slug) { |
|
475 | + $this->set('EVT_slug', $slug); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | |
@@ -480,8 +480,8 @@ discard block |
||
480 | 480 | /** |
481 | 481 | * @param $timezone_string |
482 | 482 | */ |
483 | - function set_timezone_string( $timezone_string ) { |
|
484 | - $this->set( 'EVT_timezone_string', $timezone_string ); |
|
483 | + function set_timezone_string($timezone_string) { |
|
484 | + $this->set('EVT_timezone_string', $timezone_string); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | |
@@ -489,8 +489,8 @@ discard block |
||
489 | 489 | /** |
490 | 490 | * @param $visible_on |
491 | 491 | */ |
492 | - function set_visible_on( $visible_on ) { |
|
493 | - $this->set( 'EVT_visible_on', $visible_on ); |
|
492 | + function set_visible_on($visible_on) { |
|
493 | + $this->set('EVT_visible_on', $visible_on); |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | |
@@ -498,8 +498,8 @@ discard block |
||
498 | 498 | /** |
499 | 499 | * @param $wp_user |
500 | 500 | */ |
501 | - function set_wp_user( $wp_user ) { |
|
502 | - $this->set( 'EVT_wp_user', $wp_user ); |
|
501 | + function set_wp_user($wp_user) { |
|
502 | + $this->set('EVT_wp_user', $wp_user); |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | |
@@ -507,8 +507,8 @@ discard block |
||
507 | 507 | /** |
508 | 508 | * @param $default_registration_status |
509 | 509 | */ |
510 | - function set_default_registration_status( $default_registration_status ) { |
|
511 | - $this->set( 'EVT_default_registration_status', $default_registration_status ); |
|
510 | + function set_default_registration_status($default_registration_status) { |
|
511 | + $this->set('EVT_default_registration_status', $default_registration_status); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | |
@@ -516,8 +516,8 @@ discard block |
||
516 | 516 | /** |
517 | 517 | * @param $donations |
518 | 518 | */ |
519 | - function set_donations( $donations ) { |
|
520 | - $this->set( 'EVT_donations', $donations ); |
|
519 | + function set_donations($donations) { |
|
520 | + $this->set('EVT_donations', $donations); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | |
@@ -527,8 +527,8 @@ discard block |
||
527 | 527 | * @param EE_Venue /int $venue_id_or_obj |
528 | 528 | * @return EE_Venue |
529 | 529 | */ |
530 | - function add_venue( $venue_id_or_obj ) { |
|
531 | - return $this->_add_relation_to( $venue_id_or_obj, 'Venue' ); |
|
530 | + function add_venue($venue_id_or_obj) { |
|
531 | + return $this->_add_relation_to($venue_id_or_obj, 'Venue'); |
|
532 | 532 | } |
533 | 533 | |
534 | 534 | |
@@ -538,8 +538,8 @@ discard block |
||
538 | 538 | * @param EE_Venue /int $venue_id_or_obj |
539 | 539 | * @return EE_Venue |
540 | 540 | */ |
541 | - function remove_venue( $venue_id_or_obj ) { |
|
542 | - return $this->_remove_relation_to( $venue_id_or_obj, 'Venue' ); |
|
541 | + function remove_venue($venue_id_or_obj) { |
|
542 | + return $this->_remove_relation_to($venue_id_or_obj, 'Venue'); |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | |
@@ -549,8 +549,8 @@ discard block |
||
549 | 549 | * @param array $query_params like EEM_Base::get_all's $query_params |
550 | 550 | * @return EE_Venue[] |
551 | 551 | */ |
552 | - function venues( $query_params = array() ) { |
|
553 | - return $this->get_many_related( 'Venue', $query_params ); |
|
552 | + function venues($query_params = array()) { |
|
553 | + return $this->get_many_related('Venue', $query_params); |
|
554 | 554 | } |
555 | 555 | |
556 | 556 | |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | */ |
563 | 563 | private function _has_ID_and_is_published() { |
564 | 564 | // first check if event id is present and not NULL, then check if this event is published (or any of the equivalent "published" statuses) |
565 | - return ( $this->ID() && $this->ID() !== NULL && ( $this->status() == 'publish' || $this->status() == EEM_Event::sold_out || $this->status() == EEM_Event::postponed || $this->status() == EEM_Event::cancelled ) ) ? TRUE : FALSE; |
|
565 | + return ($this->ID() && $this->ID() !== NULL && ($this->status() == 'publish' || $this->status() == EEM_Event::sold_out || $this->status() == EEM_Event::postponed || $this->status() == EEM_Event::cancelled)) ? TRUE : FALSE; |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | |
@@ -574,21 +574,21 @@ discard block |
||
574 | 574 | */ |
575 | 575 | public function is_upcoming() { |
576 | 576 | // check if event id is present and if this event is published |
577 | - if ( $this->is_inactive() ) { |
|
577 | + if ($this->is_inactive()) { |
|
578 | 578 | return FALSE; |
579 | 579 | } |
580 | 580 | // set initial value |
581 | 581 | $upcoming = FALSE; |
582 | 582 | //next let's get all datetimes and loop through them |
583 | 583 | $datetimes = $this->datetimes_in_chronological_order(); |
584 | - foreach ( $datetimes as $datetime ) { |
|
585 | - if ( $datetime instanceof EE_Datetime ) { |
|
584 | + foreach ($datetimes as $datetime) { |
|
585 | + if ($datetime instanceof EE_Datetime) { |
|
586 | 586 | //if this dtt is expired then we continue cause one of the other datetimes might be upcoming. |
587 | - if ( $datetime->is_expired() ) { |
|
587 | + if ($datetime->is_expired()) { |
|
588 | 588 | continue; |
589 | 589 | } |
590 | 590 | //if this dtt is active then we return false. |
591 | - if ( $datetime->is_active() ) { |
|
591 | + if ($datetime->is_active()) { |
|
592 | 592 | return FALSE; |
593 | 593 | } |
594 | 594 | //otherwise let's check upcoming status |
@@ -605,21 +605,21 @@ discard block |
||
605 | 605 | */ |
606 | 606 | public function is_active() { |
607 | 607 | // check if event id is present and if this event is published |
608 | - if ( $this->is_inactive() ) { |
|
608 | + if ($this->is_inactive()) { |
|
609 | 609 | return FALSE; |
610 | 610 | } |
611 | 611 | // set initial value |
612 | 612 | $active = FALSE; |
613 | 613 | //next let's get all datetimes and loop through them |
614 | 614 | $datetimes = $this->datetimes_in_chronological_order(); |
615 | - foreach ( $datetimes as $datetime ) { |
|
616 | - if ( $datetime instanceof EE_Datetime ) { |
|
615 | + foreach ($datetimes as $datetime) { |
|
616 | + if ($datetime instanceof EE_Datetime) { |
|
617 | 617 | //if this dtt is expired then we continue cause one of the other datetimes might be active. |
618 | - if ( $datetime->is_expired() ) { |
|
618 | + if ($datetime->is_expired()) { |
|
619 | 619 | continue; |
620 | 620 | } |
621 | 621 | //if this dtt is upcoming then we return false. |
622 | - if ( $datetime->is_upcoming() ) { |
|
622 | + if ($datetime->is_upcoming()) { |
|
623 | 623 | return FALSE; |
624 | 624 | } |
625 | 625 | //otherwise let's check active status |
@@ -636,17 +636,17 @@ discard block |
||
636 | 636 | */ |
637 | 637 | public function is_expired() { |
638 | 638 | // check if event id is present and if this event is published |
639 | - if ( $this->is_inactive() ) { |
|
639 | + if ($this->is_inactive()) { |
|
640 | 640 | return FALSE; |
641 | 641 | } |
642 | 642 | // set initial value |
643 | 643 | $expired = FALSE; |
644 | 644 | //first let's get all datetimes and loop through them |
645 | 645 | $datetimes = $this->datetimes_in_chronological_order(); |
646 | - foreach ( $datetimes as $datetime ) { |
|
647 | - if ( $datetime instanceof EE_Datetime ) { |
|
646 | + foreach ($datetimes as $datetime) { |
|
647 | + if ($datetime instanceof EE_Datetime) { |
|
648 | 648 | //if this dtt is upcoming or active then we return false. |
649 | - if ( $datetime->is_upcoming() || $datetime->is_active() ) { |
|
649 | + if ($datetime->is_upcoming() || $datetime->is_active()) { |
|
650 | 650 | return FALSE; |
651 | 651 | } |
652 | 652 | //otherwise let's check active status |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | */ |
664 | 664 | public function is_inactive() { |
665 | 665 | // check if event id is present and if this event is published |
666 | - if ( $this->_has_ID_and_is_published() ) { |
|
666 | + if ($this->_has_ID_and_is_published()) { |
|
667 | 667 | return FALSE; |
668 | 668 | } |
669 | 669 | return TRUE; |
@@ -681,26 +681,26 @@ discard block |
||
681 | 681 | */ |
682 | 682 | public function perform_sold_out_status_check() { |
683 | 683 | // get all unexpired untrashed tickets |
684 | - $tickets = $this->tickets( array( |
|
684 | + $tickets = $this->tickets(array( |
|
685 | 685 | array( |
686 | - 'TKT_end_date' => array( '>=', EEM_Ticket::instance()->current_time_for_query( 'TKT_end_date' ) ), |
|
686 | + 'TKT_end_date' => array('>=', EEM_Ticket::instance()->current_time_for_query('TKT_end_date')), |
|
687 | 687 | 'TKT_deleted' => false |
688 | 688 | ) |
689 | 689 | )); |
690 | 690 | // if all the tickets are just expired, then don't update the event status to sold out |
691 | - if ( empty( $tickets )) { |
|
691 | + if (empty($tickets)) { |
|
692 | 692 | return true; |
693 | 693 | } |
694 | 694 | // set initial value |
695 | 695 | $spaces_remaining = 0; |
696 | - foreach( $tickets as $ticket ) { |
|
697 | - if ( $ticket instanceof EE_Ticket ) { |
|
698 | - $spaces_remaining += $ticket->qty( 'saleable' ); |
|
696 | + foreach ($tickets as $ticket) { |
|
697 | + if ($ticket instanceof EE_Ticket) { |
|
698 | + $spaces_remaining += $ticket->qty('saleable'); |
|
699 | 699 | } |
700 | 700 | } |
701 | - if ( $spaces_remaining === 0 ) { |
|
702 | - $this->set_status( EEM_Event::sold_out ); |
|
703 | - if ( !is_admin() || ( is_admin() && defined( 'DOING_AJAX' ) ) ) { |
|
701 | + if ($spaces_remaining === 0) { |
|
702 | + $this->set_status(EEM_Event::sold_out); |
|
703 | + if ( ! is_admin() || (is_admin() && defined('DOING_AJAX'))) { |
|
704 | 704 | $this->save(); |
705 | 705 | } |
706 | 706 | $sold_out = TRUE; |
@@ -728,15 +728,15 @@ discard block |
||
728 | 728 | */ |
729 | 729 | public function spaces_remaining_for_sale() { |
730 | 730 | //first get total available spaces including consideration for tickets that have already sold. |
731 | - $spaces_available = $this->total_available_spaces( true ); |
|
731 | + $spaces_available = $this->total_available_spaces(true); |
|
732 | 732 | |
733 | 733 | //if total available = 0, then exit right away because that means everything is expired. |
734 | - if ( $spaces_available === 0 ) { |
|
734 | + if ($spaces_available === 0) { |
|
735 | 735 | return 0; |
736 | 736 | } |
737 | 737 | |
738 | 738 | //subtract total approved registrations from spaces available to get how many are remaining. |
739 | - $spots_taken = EEM_Registration::instance()->count( array( array( 'EVT_ID' => $this->ID(), 'STS_ID' => EEM_Registration::status_id_approved ) ), 'REG_ID', true ); |
|
739 | + $spots_taken = EEM_Registration::instance()->count(array(array('EVT_ID' => $this->ID(), 'STS_ID' => EEM_Registration::status_id_approved)), 'REG_ID', true); |
|
740 | 740 | $spaces_remaining = $spaces_available - $spots_taken; |
741 | 741 | |
742 | 742 | return $spaces_remaining > 0 ? $spaces_remaining : 0; |
@@ -769,29 +769,29 @@ discard block |
||
769 | 769 | * |
770 | 770 | * @return int|float (Note: if EE_INF is returned its considered a float by PHP) |
771 | 771 | */ |
772 | - public function total_available_spaces( $current_total_available = false ) { |
|
772 | + public function total_available_spaces($current_total_available = false) { |
|
773 | 773 | $spaces_available = 0; |
774 | 774 | |
775 | 775 | //first get all tickets on the event and include expired tickets |
776 | - $tickets = $this->tickets( array( 'default_where_conditions' => 'none' ) ); |
|
776 | + $tickets = $this->tickets(array('default_where_conditions' => 'none')); |
|
777 | 777 | $ticket_sums = array(); |
778 | 778 | $datetime_limits = array(); |
779 | 779 | |
780 | 780 | //loop through tickets and normalize them |
781 | - foreach ( $tickets as $ticket ) { |
|
782 | - $datetimes = $ticket->datetimes( array( 'order_by' => array( 'DTT_reg_limit' => 'ASC' ) ) ); |
|
781 | + foreach ($tickets as $ticket) { |
|
782 | + $datetimes = $ticket->datetimes(array('order_by' => array('DTT_reg_limit' => 'ASC'))); |
|
783 | 783 | |
784 | - if ( empty( $datetimes ) ) { |
|
784 | + if (empty($datetimes)) { |
|
785 | 785 | continue; |
786 | 786 | } |
787 | 787 | |
788 | 788 | //first datetime should be the lowest datetime |
789 | - $least_datetime = reset( $datetimes ); |
|
789 | + $least_datetime = reset($datetimes); |
|
790 | 790 | |
791 | 791 | //lets reset the ticket quantity to be the lower of either the lowest datetime reg limit or the ticket quantity |
792 | 792 | //IF datetimes sold (and we're not doing current live total available, then use spaces remaining for datetime, not reg_limit. |
793 | - if ( $current_total_available ) { |
|
794 | - if ( $ticket->is_remaining() ) { |
|
793 | + if ($current_total_available) { |
|
794 | + if ($ticket->is_remaining()) { |
|
795 | 795 | $remaining = $ticket->remaining(); |
796 | 796 | } else { |
797 | 797 | $spaces_available += $ticket->sold(); |
@@ -799,23 +799,23 @@ discard block |
||
799 | 799 | continue; |
800 | 800 | } |
801 | 801 | } else { |
802 | - $remaining = min( $ticket->qty(), $least_datetime->reg_limit() ); |
|
802 | + $remaining = min($ticket->qty(), $least_datetime->reg_limit()); |
|
803 | 803 | } |
804 | 804 | |
805 | 805 | //if $ticket_limit == infinity then let's drop out right away and just return that because any infinity amount trumps all other "available" amounts. |
806 | - if ( $remaining == EE_INF ) { |
|
806 | + if ($remaining == EE_INF) { |
|
807 | 807 | return EE_INF; |
808 | 808 | } |
809 | 809 | |
810 | 810 | //multiply normalized $tkt quantity by the number of datetimes on the ticket as the "sum" |
811 | 811 | //also include the sum of all the datetime reg limits on the ticket for breaking ties. |
812 | - $ticket_sums[$ticket->ID()]['sum'] = $remaining * count( $datetimes ); |
|
812 | + $ticket_sums[$ticket->ID()]['sum'] = $remaining * count($datetimes); |
|
813 | 813 | $ticket_sums[$ticket->ID()]['datetime_sums'] = 0; |
814 | - foreach ( $datetimes as $datetime ) { |
|
815 | - if ( $datetime->reg_limit() === EE_INF ) { |
|
814 | + foreach ($datetimes as $datetime) { |
|
815 | + if ($datetime->reg_limit() === EE_INF) { |
|
816 | 816 | $ticket_sums[$ticket->ID()]['datetime_sums'] = EE_INF; |
817 | 817 | } else { |
818 | - $ticket_sums[ $ticket->ID() ]['datetime_sums'] += $current_total_available ? $datetime->spaces_remaining() : $datetime->reg_limit(); |
|
818 | + $ticket_sums[$ticket->ID()]['datetime_sums'] += $current_total_available ? $datetime->spaces_remaining() : $datetime->reg_limit(); |
|
819 | 819 | } |
820 | 820 | $datetime_limits[$datetime->ID()] = $current_total_available ? $datetime->spaces_remaining() : $datetime->reg_limit(); |
821 | 821 | } |
@@ -826,74 +826,74 @@ discard block |
||
826 | 826 | //ticket quantity by the number of datetimes on the ticket). For tie-breakers, then the next sort is based on the |
827 | 827 | //ticket with the greatest sum of all remaining datetime->spaces_remaining() ( or $datetime->reg_limit() if not |
828 | 828 | //$current_total_available ) for the datetimes on the ticket. |
829 | - usort( $ticket_sums, function( $a, $b ) { |
|
830 | - if ( $a['sum'] == $b['sum'] ) { |
|
831 | - if ( $a['datetime_sums'] == $b['datetime_sums'] ) { |
|
829 | + usort($ticket_sums, function($a, $b) { |
|
830 | + if ($a['sum'] == $b['sum']) { |
|
831 | + if ($a['datetime_sums'] == $b['datetime_sums']) { |
|
832 | 832 | return 0; |
833 | 833 | } |
834 | 834 | |
835 | 835 | return $a['datetime_sums'] < $b['datetime_sums'] ? 1 : -1; |
836 | 836 | } |
837 | - return ( $a['sum'] < $b['sum'] ) ? -1 : 1; |
|
837 | + return ($a['sum'] < $b['sum']) ? -1 : 1; |
|
838 | 838 | }); |
839 | 839 | |
840 | 840 | //now let's loop through the sorted tickets and simulate sellouts |
841 | - foreach ( $ticket_sums as $ticket_info ) { |
|
842 | - if ( $ticket_info['ticket'] instanceof EE_Ticket ) { |
|
841 | + foreach ($ticket_sums as $ticket_info) { |
|
842 | + if ($ticket_info['ticket'] instanceof EE_Ticket) { |
|
843 | 843 | |
844 | - $datetimes = $ticket_info['ticket']->datetimes( array( 'order_by' => array( 'DTT_reg_limit' => 'ASC' ) ) ); |
|
844 | + $datetimes = $ticket_info['ticket']->datetimes(array('order_by' => array('DTT_reg_limit' => 'ASC'))); |
|
845 | 845 | //need to sort these $datetimes by remaining (only if $current_total_available) |
846 | 846 | //setup datetimes for simulation |
847 | 847 | $ticket_datetimes_remaining = array(); |
848 | - foreach( $datetimes as $datetime ) { |
|
848 | + foreach ($datetimes as $datetime) { |
|
849 | 849 | $ticket_datetimes_remaining[$datetime->ID()]['rem'] = $datetime_limits[$datetime->ID()]; |
850 | 850 | $ticket_datetimes_remaining[$datetime->ID()]['datetime'] = $datetime; |
851 | 851 | } |
852 | - usort( $ticket_datetimes_remaining, function( $a, $b ) { |
|
853 | - if ( $a['rem'] == $b['rem'] ) { |
|
852 | + usort($ticket_datetimes_remaining, function($a, $b) { |
|
853 | + if ($a['rem'] == $b['rem']) { |
|
854 | 854 | return 0; |
855 | 855 | } |
856 | - return ( $a['rem'] < $b['rem'] ) ? -1 : 1; |
|
856 | + return ($a['rem'] < $b['rem']) ? -1 : 1; |
|
857 | 857 | }); |
858 | 858 | |
859 | 859 | |
860 | 860 | //get the remaining on the first datetime (which should be the one with the least remaining) and that is |
861 | 861 | //what we add to the spaces_available running total. Then we need to decrease the remaining on our datetime tracker. |
862 | - $lowest_datetime = reset( $ticket_datetimes_remaining ); |
|
862 | + $lowest_datetime = reset($ticket_datetimes_remaining); |
|
863 | 863 | |
864 | 864 | //need to get the lower of; what the remaining is on the lowest datetime, and the remaining on the ticket. |
865 | 865 | // If this ends up being 0 (because of previous tickets in our simulation selling out), then it has already |
866 | 866 | // been tracked on $spaces available and this ticket is now sold out for the simulation, so we can continue |
867 | 867 | // to the next ticket. |
868 | - if ( $current_total_available ) { |
|
869 | - $remaining = min( $lowest_datetime['rem'], $ticket_info['ticket']->remaining() ); |
|
868 | + if ($current_total_available) { |
|
869 | + $remaining = min($lowest_datetime['rem'], $ticket_info['ticket']->remaining()); |
|
870 | 870 | } else { |
871 | - $remaining = min( $lowest_datetime['rem'], $ticket_info['ticket']->qty() ); |
|
871 | + $remaining = min($lowest_datetime['rem'], $ticket_info['ticket']->qty()); |
|
872 | 872 | } |
873 | 873 | |
874 | 874 | //if $remaining is infinite that means that all datetimes on this ticket are infinite but we've made it here because all |
875 | 875 | //tickets have a quantity. So we don't have to track datetimes, we can just use ticket quantities for total |
876 | 876 | //available. |
877 | - if ( $remaining === EE_INF ) { |
|
877 | + if ($remaining === EE_INF) { |
|
878 | 878 | $spaces_available += $ticket_info['ticket']->qty(); |
879 | 879 | continue; |
880 | 880 | } |
881 | 881 | |
882 | 882 | //if ticket has sold amounts then we also need to add that (but only if doing live counts) |
883 | - if ( $current_total_available ) { |
|
883 | + if ($current_total_available) { |
|
884 | 884 | $spaces_available += $ticket_info['ticket']->sold(); |
885 | 885 | } |
886 | 886 | |
887 | - if ( $remaining <= 0 ) { |
|
887 | + if ($remaining <= 0) { |
|
888 | 888 | continue; |
889 | 889 | } else { |
890 | 890 | $spaces_available += $remaining; |
891 | 891 | } |
892 | 892 | |
893 | 893 | //loop through the datetimes and sell them out! |
894 | - foreach ( $ticket_datetimes_remaining as $datetime_info ) { |
|
895 | - if ( $datetime_info['datetime'] instanceof EE_Datetime ) { |
|
896 | - $datetime_limits[ $datetime_info['datetime']->ID() ] += - $remaining; |
|
894 | + foreach ($ticket_datetimes_remaining as $datetime_info) { |
|
895 | + if ($datetime_info['datetime'] instanceof EE_Datetime) { |
|
896 | + $datetime_limits[$datetime_info['datetime']->ID()] += - $remaining; |
|
897 | 897 | } |
898 | 898 | } |
899 | 899 | } |
@@ -909,8 +909,8 @@ discard block |
||
909 | 909 | * @param bool $actual whether or not to perform calculations to not only figure the actual status but also to flip the status if necessary to sold out If false, we just check the existing status of the event |
910 | 910 | * @return boolean |
911 | 911 | */ |
912 | - public function is_sold_out( $actual = FALSE ) { |
|
913 | - if ( ! $actual ) { |
|
912 | + public function is_sold_out($actual = FALSE) { |
|
913 | + if ( ! $actual) { |
|
914 | 914 | return $this->status() == EEM_Event::sold_out; |
915 | 915 | } |
916 | 916 | else { |
@@ -948,36 +948,36 @@ discard block |
||
948 | 948 | * @param bool $reset |
949 | 949 | * @return bool | string - based on EE_Datetime active constants or FALSE if error. |
950 | 950 | */ |
951 | - public function get_active_status( $reset = FALSE ) { |
|
951 | + public function get_active_status($reset = FALSE) { |
|
952 | 952 | // if the active status has already been set, then just use that value (unless we are resetting it) |
953 | - if ( ! empty( $this->_active_status ) && ! $reset ) { |
|
953 | + if ( ! empty($this->_active_status) && ! $reset) { |
|
954 | 954 | return $this->_active_status; |
955 | 955 | } |
956 | 956 | //first check if event id is present on this object |
957 | - if ( ! $this->ID() ) { |
|
957 | + if ( ! $this->ID()) { |
|
958 | 958 | return FALSE; |
959 | 959 | } |
960 | 960 | //first get all datetimes ordered by date |
961 | 961 | $datetimes = $this->datetimes_in_chronological_order(); |
962 | 962 | //next loop through $datetimes and setup status array |
963 | 963 | $status_array = array(); |
964 | - foreach ( $datetimes as $datetime ) { |
|
965 | - if ( $datetime instanceof EE_Datetime ) { |
|
964 | + foreach ($datetimes as $datetime) { |
|
965 | + if ($datetime instanceof EE_Datetime) { |
|
966 | 966 | $status_array[] = $datetime->get_active_status(); |
967 | 967 | } |
968 | 968 | } |
969 | 969 | //now we can conditionally determine status |
970 | - if ( $this->status() == 'publish' ) { |
|
971 | - if ( in_array( EE_Datetime::active, $status_array ) ) { |
|
970 | + if ($this->status() == 'publish') { |
|
971 | + if (in_array(EE_Datetime::active, $status_array)) { |
|
972 | 972 | $this->_active_status = EE_Datetime::active; |
973 | 973 | } else { |
974 | - if ( in_array( EE_Datetime::upcoming, $status_array ) ) { |
|
974 | + if (in_array(EE_Datetime::upcoming, $status_array)) { |
|
975 | 975 | $this->_active_status = EE_Datetime::upcoming; |
976 | 976 | } else { |
977 | - if ( in_array( EE_Datetime::expired, $status_array ) ) { |
|
977 | + if (in_array(EE_Datetime::expired, $status_array)) { |
|
978 | 978 | $this->_active_status = EE_Datetime::expired; |
979 | 979 | } else { |
980 | - if ( in_array( EE_Datetime::sold_out, $status_array ) ) { |
|
980 | + if (in_array(EE_Datetime::sold_out, $status_array)) { |
|
981 | 981 | $this->_active_status = EE_Datetime::sold_out; |
982 | 982 | } else { |
983 | 983 | $this->_active_status = EE_Datetime::expired; //catchall |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | } |
987 | 987 | } |
988 | 988 | } else { |
989 | - switch ( $this->status() ) { |
|
989 | + switch ($this->status()) { |
|
990 | 990 | case EEM_Event::sold_out : |
991 | 991 | $this->_active_status = EE_Datetime::sold_out; |
992 | 992 | break; |
@@ -1012,10 +1012,10 @@ discard block |
||
1012 | 1012 | * @param boolean $echo whether to return (FALSE), or echo out the result (TRUE) |
1013 | 1013 | * @return mixed void|string |
1014 | 1014 | */ |
1015 | - public function pretty_active_status( $echo = TRUE ) { |
|
1015 | + public function pretty_active_status($echo = TRUE) { |
|
1016 | 1016 | $active_status = $this->get_active_status(); |
1017 | - $status = '<span class="ee-status event-active-status-' . $active_status . '">' . EEH_Template::pretty_status( $active_status, FALSE, 'sentence' ) . '</span>'; |
|
1018 | - if ( $echo ) { |
|
1017 | + $status = '<span class="ee-status event-active-status-'.$active_status.'">'.EEH_Template::pretty_status($active_status, FALSE, 'sentence').'</span>'; |
|
1018 | + if ($echo) { |
|
1019 | 1019 | echo $status; |
1020 | 1020 | return ''; |
1021 | 1021 | } |
@@ -1029,12 +1029,12 @@ discard block |
||
1029 | 1029 | */ |
1030 | 1030 | public function get_number_of_tickets_sold() { |
1031 | 1031 | $tkt_sold = 0; |
1032 | - if ( !$this->ID() ) { |
|
1032 | + if ( ! $this->ID()) { |
|
1033 | 1033 | return 0; |
1034 | 1034 | } |
1035 | 1035 | $datetimes = $this->datetimes(); |
1036 | - foreach ( $datetimes as $datetime ) { |
|
1037 | - if ( $datetime instanceof EE_Datetime ) { |
|
1036 | + foreach ($datetimes as $datetime) { |
|
1037 | + if ($datetime instanceof EE_Datetime) { |
|
1038 | 1038 | $tkt_sold += $datetime->sold(); |
1039 | 1039 | } |
1040 | 1040 | } |
@@ -1049,7 +1049,7 @@ discard block |
||
1049 | 1049 | * @return int |
1050 | 1050 | */ |
1051 | 1051 | public function get_count_of_all_registrations() { |
1052 | - return EEM_Event::instance()->count_related( $this, 'Registration' ); |
|
1052 | + return EEM_Event::instance()->count_related($this, 'Registration'); |
|
1053 | 1053 | } |
1054 | 1054 | |
1055 | 1055 | |
@@ -1059,9 +1059,9 @@ discard block |
||
1059 | 1059 | * @return EE_Ticket |
1060 | 1060 | */ |
1061 | 1061 | public function get_ticket_with_earliest_start_time() { |
1062 | - $where[ 'Datetime.EVT_ID' ] = $this->ID(); |
|
1063 | - $query_params = array( $where, 'order_by' => array( 'TKT_start_date' => 'ASC' ) ); |
|
1064 | - return EE_Registry::instance()->load_model( 'Ticket' )->get_one( $query_params ); |
|
1062 | + $where['Datetime.EVT_ID'] = $this->ID(); |
|
1063 | + $query_params = array($where, 'order_by' => array('TKT_start_date' => 'ASC')); |
|
1064 | + return EE_Registry::instance()->load_model('Ticket')->get_one($query_params); |
|
1065 | 1065 | } |
1066 | 1066 | |
1067 | 1067 | |
@@ -1071,9 +1071,9 @@ discard block |
||
1071 | 1071 | * @return EE_Ticket |
1072 | 1072 | */ |
1073 | 1073 | public function get_ticket_with_latest_end_time() { |
1074 | - $where[ 'Datetime.EVT_ID' ] = $this->ID(); |
|
1075 | - $query_params = array( $where, 'order_by' => array( 'TKT_end_date' => 'DESC' ) ); |
|
1076 | - return EE_Registry::instance()->load_model( 'Ticket' )->get_one( $query_params ); |
|
1074 | + $where['Datetime.EVT_ID'] = $this->ID(); |
|
1075 | + $query_params = array($where, 'order_by' => array('TKT_end_date' => 'DESC')); |
|
1076 | + return EE_Registry::instance()->load_model('Ticket')->get_one($query_params); |
|
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | |
@@ -1085,11 +1085,11 @@ discard block |
||
1085 | 1085 | public function tickets_on_sale() { |
1086 | 1086 | $earliest_ticket = $this->get_ticket_with_earliest_start_time(); |
1087 | 1087 | $latest_ticket = $this->get_ticket_with_latest_end_time(); |
1088 | - if ( !$latest_ticket instanceof EE_Ticket && !$earliest_ticket instanceof EE_Ticket ) { |
|
1088 | + if ( ! $latest_ticket instanceof EE_Ticket && ! $earliest_ticket instanceof EE_Ticket) { |
|
1089 | 1089 | return FALSE; |
1090 | 1090 | } |
1091 | 1091 | //check on sale for these two tickets. |
1092 | - if ( $latest_ticket->is_on_sale() || $earliest_ticket->is_on_sale() ) { |
|
1092 | + if ($latest_ticket->is_on_sale() || $earliest_ticket->is_on_sale()) { |
|
1093 | 1093 | return TRUE; |
1094 | 1094 | } |
1095 | 1095 | return FALSE; |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | * @return string |
1104 | 1104 | */ |
1105 | 1105 | public function get_permalink() { |
1106 | - if ( $this->external_url() ) { |
|
1106 | + if ($this->external_url()) { |
|
1107 | 1107 | return $this->external_url(); |
1108 | 1108 | } |
1109 | 1109 | else { |
@@ -1118,10 +1118,10 @@ discard block |
||
1118 | 1118 | * @param array $query_params like EEM_Base::get_all |
1119 | 1119 | * @return EE_Term |
1120 | 1120 | */ |
1121 | - public function first_event_category( $query_params = array() ) { |
|
1122 | - $query_params[ 0 ][ 'Term_Taxonomy.taxonomy' ] = 'espresso_event_categories'; |
|
1123 | - $query_params[ 0 ][ 'Term_Taxonomy.Event.EVT_ID' ] = $this->ID(); |
|
1124 | - return EEM_Term::instance()->get_one( $query_params ); |
|
1121 | + public function first_event_category($query_params = array()) { |
|
1122 | + $query_params[0]['Term_Taxonomy.taxonomy'] = 'espresso_event_categories'; |
|
1123 | + $query_params[0]['Term_Taxonomy.Event.EVT_ID'] = $this->ID(); |
|
1124 | + return EEM_Term::instance()->get_one($query_params); |
|
1125 | 1125 | } |
1126 | 1126 | |
1127 | 1127 | |
@@ -1131,10 +1131,10 @@ discard block |
||
1131 | 1131 | * @param array $query_params |
1132 | 1132 | * @return EE_Term[] |
1133 | 1133 | */ |
1134 | - public function get_all_event_categories( $query_params = array() ) { |
|
1135 | - $query_params[ 0 ][ 'Term_Taxonomy.taxonomy' ] = 'espresso_event_categories'; |
|
1136 | - $query_params[ 0 ][ 'Term_Taxonomy.Event.EVT_ID' ] = $this->ID(); |
|
1137 | - return EEM_Term::instance()->get_all( $query_params ); |
|
1134 | + public function get_all_event_categories($query_params = array()) { |
|
1135 | + $query_params[0]['Term_Taxonomy.taxonomy'] = 'espresso_event_categories'; |
|
1136 | + $query_params[0]['Term_Taxonomy.Event.EVT_ID'] = $this->ID(); |
|
1137 | + return EEM_Term::instance()->get_all($query_params); |
|
1138 | 1138 | } |
1139 | 1139 | |
1140 | 1140 | /** |
@@ -1142,8 +1142,8 @@ discard block |
||
1142 | 1142 | * @param array $query_params @see EEM_Base::get_all |
1143 | 1143 | * @return EE_Question_Group[] |
1144 | 1144 | */ |
1145 | - public function question_groups($query_params = array()){ |
|
1146 | - $query_params = ! empty( $query_params ) ? $query_params : array( 'order_by' => array( 'QSG_order' => 'ASC' )); |
|
1145 | + public function question_groups($query_params = array()) { |
|
1146 | + $query_params = ! empty($query_params) ? $query_params : array('order_by' => array('QSG_order' => 'ASC')); |
|
1147 | 1147 | return $this->get_many_related('Question_Group', $query_params); |
1148 | 1148 | } |
1149 | 1149 | |
@@ -1183,12 +1183,12 @@ discard block |
||
1183 | 1183 | */ |
1184 | 1184 | public function get_admin_edit_link() { |
1185 | 1185 | EE_Registry::instance()->load_helper('URL'); |
1186 | - return EEH_URL::add_query_args_and_nonce( array( |
|
1186 | + return EEH_URL::add_query_args_and_nonce(array( |
|
1187 | 1187 | 'page' => 'espresso_events', |
1188 | 1188 | 'action' => 'edit', |
1189 | 1189 | 'post' => $this->ID() |
1190 | 1190 | ), |
1191 | - admin_url( 'admin.php' ) |
|
1191 | + admin_url('admin.php') |
|
1192 | 1192 | ); |
1193 | 1193 | } |
1194 | 1194 | |
@@ -1201,11 +1201,11 @@ discard block |
||
1201 | 1201 | */ |
1202 | 1202 | public function get_admin_settings_link() { |
1203 | 1203 | EE_Registry::instance()->load_helper('URL'); |
1204 | - return EEH_URL::add_query_args_and_nonce( array( |
|
1204 | + return EEH_URL::add_query_args_and_nonce(array( |
|
1205 | 1205 | 'page' => 'espresso_events', |
1206 | 1206 | 'action' => 'default_event_settings' |
1207 | 1207 | ), |
1208 | - admin_url( 'admin.php' ) |
|
1208 | + admin_url('admin.php') |
|
1209 | 1209 | ); |
1210 | 1210 | } |
1211 | 1211 | |
@@ -1221,11 +1221,11 @@ discard block |
||
1221 | 1221 | public function get_admin_overview_link() { |
1222 | 1222 | |
1223 | 1223 | EE_Registry::instance()->load_helper('URL'); |
1224 | - return EEH_URL::add_query_args_and_nonce( array( |
|
1224 | + return EEH_URL::add_query_args_and_nonce(array( |
|
1225 | 1225 | 'page' => 'espresso_events', |
1226 | 1226 | 'action' => 'default' |
1227 | 1227 | ), |
1228 | - admin_url( 'admin.php' ) |
|
1228 | + admin_url('admin.php') |
|
1229 | 1229 | ); |
1230 | 1230 | } |
1231 | 1231 |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | * |
22 | 22 | * ------------------------------------------------------------------------ |
23 | 23 | */ |
24 | -require_once ( EE_MODELS . 'EEM_Base.model.php' ); |
|
24 | +require_once (EE_MODELS.'EEM_Base.model.php'); |
|
25 | 25 | |
26 | 26 | class EEM_Venue extends EEM_CPT_Base { |
27 | 27 | |
28 | 28 | // private instance of the Attendee object |
29 | 29 | protected static $_instance = NULL; |
30 | 30 | |
31 | - protected function __construct( $timezone = NULL ) { |
|
32 | - $this->singular_item = __('Venue','event_espresso'); |
|
33 | - $this->plural_item = __('Venues','event_espresso'); |
|
31 | + protected function __construct($timezone = NULL) { |
|
32 | + $this->singular_item = __('Venue', 'event_espresso'); |
|
33 | + $this->plural_item = __('Venues', 'event_espresso'); |
|
34 | 34 | $this->_tables = array( |
35 | 35 | 'Venue_CPT'=> new EE_Primary_Table('posts', 'ID'), |
36 | 36 | 'Venue_Meta'=>new EE_Secondary_Table('esp_venue_meta', 'VNUM_ID', 'VNU_ID') |
@@ -39,32 +39,32 @@ discard block |
||
39 | 39 | 'Venue_CPT'=>array( |
40 | 40 | 'VNU_ID'=>new EE_Primary_Key_Int_Field('ID', __("Venue ID", "event_espresso")), |
41 | 41 | 'VNU_name'=>new EE_Plain_Text_Field('post_title', __("Venue Name", "event_espresso"), false, ''), |
42 | - 'VNU_desc'=>new EE_Post_Content_Field('post_content', __("Venue Description", "event_espresso"), false,''), |
|
43 | - 'VNU_identifier'=>new EE_Slug_Field('post_name', __("Venue Identifier", "event_espresso"), false,''), |
|
44 | - 'VNU_created'=>new EE_Datetime_Field('post_date', __("Date Venue Created", "event_espresso"), FALSE,time()), |
|
45 | - 'VNU_short_desc'=>new EE_Plain_Text_Field('post_excerpt', __("Short Description of Venue", "event_espresso"), true,''), |
|
46 | - 'VNU_modified'=>new EE_Datetime_Field('post_modified', __("Venue Modified Date", "event_espresso"), FALSE,time()), |
|
47 | - 'VNU_wp_user'=>new EE_WP_User_Field('post_author', __("Venue Creator ID", "event_espresso"), false ), |
|
48 | - 'parent'=>new EE_Integer_Field('post_parent', __("Venue Parent ID", "event_espresso"), false,0), |
|
42 | + 'VNU_desc'=>new EE_Post_Content_Field('post_content', __("Venue Description", "event_espresso"), false, ''), |
|
43 | + 'VNU_identifier'=>new EE_Slug_Field('post_name', __("Venue Identifier", "event_espresso"), false, ''), |
|
44 | + 'VNU_created'=>new EE_Datetime_Field('post_date', __("Date Venue Created", "event_espresso"), FALSE, time()), |
|
45 | + 'VNU_short_desc'=>new EE_Plain_Text_Field('post_excerpt', __("Short Description of Venue", "event_espresso"), true, ''), |
|
46 | + 'VNU_modified'=>new EE_Datetime_Field('post_modified', __("Venue Modified Date", "event_espresso"), FALSE, time()), |
|
47 | + 'VNU_wp_user'=>new EE_WP_User_Field('post_author', __("Venue Creator ID", "event_espresso"), false), |
|
48 | + 'parent'=>new EE_Integer_Field('post_parent', __("Venue Parent ID", "event_espresso"), false, 0), |
|
49 | 49 | 'VNU_order'=>new EE_Integer_Field('menu_order', __("Venue order", "event_espresso"), false, 1), |
50 | - 'post_type'=>new EE_WP_Post_Type_Field('espresso_venues'),// EE_Plain_Text_Field('post_type', __("Venue post type", "event_espresso"), false, 'espresso_venues'), |
|
50 | + 'post_type'=>new EE_WP_Post_Type_Field('espresso_venues'), // EE_Plain_Text_Field('post_type', __("Venue post type", "event_espresso"), false, 'espresso_venues'), |
|
51 | 51 | ), |
52 | 52 | 'Venue_Meta'=>array( |
53 | 53 | 'VNUM_ID'=>new EE_DB_Only_Int_Field('VNUM_ID', __("ID of Venue Meta Row", "event_espresso"), false), |
54 | 54 | 'VNU_ID_fk'=>new EE_DB_Only_Int_Field('VNU_ID', __("Foreign Key to Venue Post ", "event_espresso"), false), |
55 | 55 | 'VNU_address'=>new EE_Plain_Text_Field('VNU_address', __("Venue Address line 1", "event_espresso"), true, ''), |
56 | - 'VNU_address2'=>new EE_Plain_Text_Field('VNU_address2', __("Venue Address line 2", "event_espresso"), true,''), |
|
56 | + 'VNU_address2'=>new EE_Plain_Text_Field('VNU_address2', __("Venue Address line 2", "event_espresso"), true, ''), |
|
57 | 57 | 'VNU_city'=>new EE_Plain_Text_Field('VNU_city', __("Venue City", "event_espresso"), true, ''), |
58 | 58 | 'STA_ID'=>new EE_Foreign_Key_Int_Field('STA_ID', __("State ID", "event_espresso"), true, null, 'State'), |
59 | 59 | 'CNT_ISO'=>new EE_Foreign_Key_String_Field('CNT_ISO', __("Country Code", "event_espresso"), true, null, 'Country'), |
60 | 60 | 'VNU_zip'=>new EE_Plain_Text_Field('VNU_zip', __("Venue Zip/Postal Code", "event_espresso"), true), |
61 | 61 | 'VNU_phone'=>new EE_Plain_Text_Field('VNU_phone', __("Venue Phone", "event_espresso"), true), |
62 | - 'VNU_capacity'=>new EE_Infinite_Integer_Field('VNU_capacity', __("Venue Capacity", "event_espresso"), true,EE_INF), |
|
62 | + 'VNU_capacity'=>new EE_Infinite_Integer_Field('VNU_capacity', __("Venue Capacity", "event_espresso"), true, EE_INF), |
|
63 | 63 | 'VNU_url'=>new EE_Plain_Text_Field('VNU_url', __('Venue Website', 'event_espresso'), true), |
64 | 64 | 'VNU_virtual_phone'=>new EE_Plain_Text_Field('VNU_virtual_phone', __('Call in Number', 'event_espresso'), true), |
65 | - 'VNU_virtual_url'=>new EE_Plain_Text_Field('VNU_virtual_url', __('Virtual URL', 'event_espresso'), true ), |
|
66 | - 'VNU_google_map_link'=>new EE_Plain_Text_Field('VNU_google_map_link', __('Google Map Link', 'event_espresso'), true ), |
|
67 | - 'VNU_enable_for_gmap'=>new EE_Boolean_Field('VNU_enable_for_gmap', __('Show Google Map?', 'event_espresso'), false, false ) |
|
65 | + 'VNU_virtual_url'=>new EE_Plain_Text_Field('VNU_virtual_url', __('Virtual URL', 'event_espresso'), true), |
|
66 | + 'VNU_google_map_link'=>new EE_Plain_Text_Field('VNU_google_map_link', __('Google Map Link', 'event_espresso'), true), |
|
67 | + 'VNU_enable_for_gmap'=>new EE_Boolean_Field('VNU_enable_for_gmap', __('Show Google Map?', 'event_espresso'), false, false) |
|
68 | 68 | |
69 | 69 | )); |
70 | 70 | $this->_model_relations = array( |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | ); |
77 | 77 | $this->_default_where_conditions_strategy = new EE_CPT_Where_Conditions('espresso_venues', 'VNUM_ID'); |
78 | 78 | //this model is generally available for reading |
79 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public(); |
|
80 | - parent::__construct( $timezone ); |
|
79 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public(); |
|
80 | + parent::__construct($timezone); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | } |
@@ -7,32 +7,32 @@ discard block |
||
7 | 7 | * other than explicitly setting it to EE_INF. |
8 | 8 | * Makes use of constant EE_INF_IN_DB set in espresso.php, and EE_INF, which is a PHP constant definedin the ether |
9 | 9 | */ |
10 | -class EE_Infinite_Integer_Field extends EE_Model_Field_Base{ |
|
11 | - function get_wpdb_data_type(){ |
|
10 | +class EE_Infinite_Integer_Field extends EE_Model_Field_Base { |
|
11 | + function get_wpdb_data_type() { |
|
12 | 12 | return '%d'; |
13 | 13 | } |
14 | 14 | function prepare_for_use_in_db($value_of_field_on_model_object) { |
15 | - if($value_of_field_on_model_object === EE_INF){ |
|
15 | + if ($value_of_field_on_model_object === EE_INF) { |
|
16 | 16 | return EE_INF_IN_DB; |
17 | - }else{ |
|
17 | + } else { |
|
18 | 18 | return intval($value_of_field_on_model_object); |
19 | 19 | } |
20 | 20 | } |
21 | 21 | function prepare_for_set($value_inputted_for_field_on_model_object) { |
22 | - if($value_inputted_for_field_on_model_object === EE_INF_IN_DB || |
|
22 | + if ($value_inputted_for_field_on_model_object === EE_INF_IN_DB || |
|
23 | 23 | $value_inputted_for_field_on_model_object === EE_INF || |
24 | 24 | $value_inputted_for_field_on_model_object === "EE_INF" |
25 | - ){ |
|
25 | + ) { |
|
26 | 26 | return EE_INF; |
27 | - }else{ |
|
27 | + } else { |
|
28 | 28 | return intval($value_inputted_for_field_on_model_object); |
29 | 29 | } |
30 | 30 | } |
31 | 31 | function prepare_for_set_from_db($value_inputted_for_field_on_model_object) { |
32 | 32 | $intval = intval($value_inputted_for_field_on_model_object); |
33 | - if($intval == EE_INF_IN_DB){ |
|
33 | + if ($intval == EE_INF_IN_DB) { |
|
34 | 34 | return EE_INF; |
35 | - }else{ |
|
35 | + } else { |
|
36 | 36 | return $intval; |
37 | 37 | } |
38 | 38 | } |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | * @param string $schema input, symbol, text; or any string you want to show if the value equals EE_INF |
46 | 46 | * @return string |
47 | 47 | */ |
48 | - function prepare_for_pretty_echoing( $value_on_field_to_be_outputted, $schema = null ) { |
|
49 | - if( $value_on_field_to_be_outputted === EE_INF ){ |
|
50 | - switch($schema){ |
|
48 | + function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null) { |
|
49 | + if ($value_on_field_to_be_outputted === EE_INF) { |
|
50 | + switch ($schema) { |
|
51 | 51 | case 'input': |
52 | 52 | return ''; |
53 | 53 | case 'symbol': |
@@ -40,27 +40,27 @@ discard block |
||
40 | 40 | * @param int $EVT_ID |
41 | 41 | * @return object |
42 | 42 | */ |
43 | - public static function get_event( $EVT_ID = 0 ) { |
|
44 | - $EVT_ID = $EVT_ID instanceof WP_Post ? $EVT_ID->ID : absint( $EVT_ID ); |
|
43 | + public static function get_event($EVT_ID = 0) { |
|
44 | + $EVT_ID = $EVT_ID instanceof WP_Post ? $EVT_ID->ID : absint($EVT_ID); |
|
45 | 45 | // do we already have the Event you are looking for? |
46 | - if ( EEH_Event_View::$_event instanceof EE_Event && $EVT_ID && EEH_Event_View::$_event->ID() === $EVT_ID ) { |
|
46 | + if (EEH_Event_View::$_event instanceof EE_Event && $EVT_ID && EEH_Event_View::$_event->ID() === $EVT_ID) { |
|
47 | 47 | return EEH_Event_View::$_event; |
48 | 48 | } |
49 | 49 | EEH_Event_View::$_event = NULL; |
50 | 50 | // international newspaper? |
51 | 51 | global $post; |
52 | 52 | // if this is being called from an EE_Event post, then we can just grab the attached EE_Event object |
53 | - if ( isset( $post->post_type ) && $post->post_type == 'espresso_events' || $EVT_ID ) { |
|
53 | + if (isset($post->post_type) && $post->post_type == 'espresso_events' || $EVT_ID) { |
|
54 | 54 | // d( $post ); |
55 | 55 | // grab the event we're looking for |
56 | - if ( isset( $post->EE_Event ) && ( $EVT_ID == 0 || ( $EVT_ID == $post->ID ))) { |
|
56 | + if (isset($post->EE_Event) && ($EVT_ID == 0 || ($EVT_ID == $post->ID))) { |
|
57 | 57 | EEH_Event_View::$_event = $post->EE_Event; |
58 | 58 | // d( EEH_Event_View::$_event ); |
59 | 59 | } |
60 | 60 | // now if we STILL do NOT have an EE_Event model object, BUT we have an Event ID... |
61 | - if ( ! EEH_Event_View::$_event instanceof EE_Event && $EVT_ID ) { |
|
61 | + if ( ! EEH_Event_View::$_event instanceof EE_Event && $EVT_ID) { |
|
62 | 62 | // sigh... pull it from the db |
63 | - EEH_Event_View::$_event = EEM_Event::instance()->get_one_by_ID( $EVT_ID ); |
|
63 | + EEH_Event_View::$_event = EEM_Event::instance()->get_one_by_ID($EVT_ID); |
|
64 | 64 | // d( EEH_Event_View::$_event ); |
65 | 65 | } |
66 | 66 | } |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | * @param int $EVT_ID |
77 | 77 | * @return boolean |
78 | 78 | */ |
79 | - public static function display_ticket_selector( $EVT_ID = 0 ) { |
|
80 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
79 | + public static function display_ticket_selector($EVT_ID = 0) { |
|
80 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
81 | 81 | return $event instanceof EE_Event ? $event->display_ticket_selector() : FALSE; |
82 | 82 | } |
83 | 83 | |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | * @param int $EVT_ID |
91 | 91 | * @return string |
92 | 92 | */ |
93 | - public static function event_status( $EVT_ID = 0 ) { |
|
94 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
95 | - return $event instanceof EE_Event ? $event->pretty_active_status( FALSE ) : ''; |
|
93 | + public static function event_status($EVT_ID = 0) { |
|
94 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
95 | + return $event instanceof EE_Event ? $event->pretty_active_status(FALSE) : ''; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | * @param int $EVT_ID |
105 | 105 | * @return string |
106 | 106 | */ |
107 | - public static function event_active_status( $EVT_ID = 0 ) { |
|
108 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
107 | + public static function event_active_status($EVT_ID = 0) { |
|
108 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
109 | 109 | return $event instanceof EE_Event ? $event->pretty_active_status() : 'inactive'; |
110 | 110 | } |
111 | 111 | |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | * @param int $EVT_ID |
119 | 119 | * @return string |
120 | 120 | */ |
121 | - public static function event_has_content_or_excerpt( $EVT_ID = 0 ) { |
|
122 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
121 | + public static function event_has_content_or_excerpt($EVT_ID = 0) { |
|
122 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
123 | 123 | $has_content_or_excerpt = FALSE; |
124 | - if ( $event instanceof EE_Event ) { |
|
125 | - $has_content_or_excerpt = $event->description() != '' || $event->short_description( NULL, NULL, TRUE ) != '' ? TRUE : FALSE; |
|
124 | + if ($event instanceof EE_Event) { |
|
125 | + $has_content_or_excerpt = $event->description() != '' || $event->short_description(NULL, NULL, TRUE) != '' ? TRUE : FALSE; |
|
126 | 126 | } |
127 | - if ( is_archive() && ! ( espresso_display_full_description_in_event_list() || espresso_display_excerpt_in_event_list() )) { |
|
127 | + if (is_archive() && ! (espresso_display_full_description_in_event_list() || espresso_display_excerpt_in_event_list())) { |
|
128 | 128 | $has_content_or_excerpt = FALSE; |
129 | 129 | } |
130 | 130 | return $has_content_or_excerpt; |
@@ -140,45 +140,45 @@ discard block |
||
140 | 140 | * @param null $more |
141 | 141 | * @return string |
142 | 142 | */ |
143 | - public static function event_content_or_excerpt( $num_words = NULL, $more = NULL ) { |
|
143 | + public static function event_content_or_excerpt($num_words = NULL, $more = NULL) { |
|
144 | 144 | global $post; |
145 | 145 | |
146 | 146 | ob_start(); |
147 | - if (( is_single() ) || ( is_archive() && espresso_display_full_description_in_event_list() )) { |
|
147 | + if ((is_single()) || (is_archive() && espresso_display_full_description_in_event_list())) { |
|
148 | 148 | |
149 | 149 | // admin has chosen "full description" for the "Event Espresso - Events > Templates > Display Description" option |
150 | 150 | the_content(); |
151 | 151 | |
152 | - } else if (( is_archive() && has_excerpt( $post->ID ) && espresso_display_excerpt_in_event_list() ) ) { |
|
152 | + } else if ((is_archive() && has_excerpt($post->ID) && espresso_display_excerpt_in_event_list())) { |
|
153 | 153 | |
154 | 154 | // admin has chosen "excerpt (short desc)" for the "Event Espresso - Events > Templates > Display Description" option |
155 | 155 | // AND an excerpt actually exists |
156 | 156 | the_excerpt(); |
157 | 157 | |
158 | - } else if (( is_archive() && ! has_excerpt( $post->ID ) && espresso_display_excerpt_in_event_list() )) { |
|
158 | + } else if ((is_archive() && ! has_excerpt($post->ID) && espresso_display_excerpt_in_event_list())) { |
|
159 | 159 | |
160 | 160 | // admin has chosen "excerpt (short desc)" for the "Event Espresso - Events > Templates > Display Description" option |
161 | 161 | // but NO excerpt actually exists, so we need to create one |
162 | - if ( ! empty( $num_words )) { |
|
163 | - if ( empty( $more )) { |
|
164 | - $more_link_text = __( '(more…)' ); |
|
165 | - $more = ' <a href="' . get_permalink() . '" class="more-link">' . $more_link_text . '</a>'; |
|
166 | - $more = apply_filters( 'the_content_more_link', $more, $more_link_text ); |
|
162 | + if ( ! empty($num_words)) { |
|
163 | + if (empty($more)) { |
|
164 | + $more_link_text = __('(more…)'); |
|
165 | + $more = ' <a href="'.get_permalink().'" class="more-link">'.$more_link_text.'</a>'; |
|
166 | + $more = apply_filters('the_content_more_link', $more, $more_link_text); |
|
167 | 167 | } |
168 | - $content = str_replace( 'NOMORELINK', '', get_the_content( 'NOMORELINK' )); |
|
168 | + $content = str_replace('NOMORELINK', '', get_the_content('NOMORELINK')); |
|
169 | 169 | |
170 | - $content = wp_trim_words( $content, $num_words, ' ' ) . $more; |
|
170 | + $content = wp_trim_words($content, $num_words, ' ').$more; |
|
171 | 171 | } else { |
172 | - $content = get_the_content(); |
|
172 | + $content = get_the_content(); |
|
173 | 173 | } |
174 | 174 | global $allowedtags; |
175 | - $content = wp_kses( $content, $allowedtags ); |
|
176 | - $content = strip_shortcodes( $content ); |
|
177 | - echo apply_filters( 'the_content', $content ); |
|
175 | + $content = wp_kses($content, $allowedtags); |
|
176 | + $content = strip_shortcodes($content); |
|
177 | + echo apply_filters('the_content', $content); |
|
178 | 178 | |
179 | 179 | } else { |
180 | 180 | // admin has chosen "none" for the "Event Espresso - Events > Templates > Display Description" option |
181 | - echo apply_filters( 'the_content', '' ); |
|
181 | + echo apply_filters('the_content', ''); |
|
182 | 182 | } |
183 | 183 | return ob_get_clean(); |
184 | 184 | } |
@@ -192,13 +192,13 @@ discard block |
||
192 | 192 | * @param int $EVT_ID |
193 | 193 | * @return EE_Ticket[] |
194 | 194 | */ |
195 | - public static function event_tickets_available( $EVT_ID = 0 ) { |
|
196 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
195 | + public static function event_tickets_available($EVT_ID = 0) { |
|
196 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
197 | 197 | $tickets_available_for_purchase = array(); |
198 | - if( $event instanceof EE_Event ) { |
|
199 | - $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, FALSE ); |
|
200 | - foreach( $datetimes as $datetime ) { |
|
201 | - $tickets_available_for_purchase = array_merge( $tickets_available_for_purchase, $datetime->ticket_types_available_for_purchase() ); |
|
198 | + if ($event instanceof EE_Event) { |
|
199 | + $datetimes = EEH_Event_View::get_all_date_obj($EVT_ID, FALSE); |
|
200 | + foreach ($datetimes as $datetime) { |
|
201 | + $tickets_available_for_purchase = array_merge($tickets_available_for_purchase, $datetime->ticket_types_available_for_purchase()); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | return $tickets_available_for_purchase; |
@@ -214,22 +214,22 @@ discard block |
||
214 | 214 | * @param bool $hide_uncategorized |
215 | 215 | * @return string |
216 | 216 | */ |
217 | - public static function event_categories( $EVT_ID = 0, $hide_uncategorized = TRUE ) { |
|
217 | + public static function event_categories($EVT_ID = 0, $hide_uncategorized = TRUE) { |
|
218 | 218 | $category_links = array(); |
219 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
220 | - if ( $event instanceof EE_Event ) { |
|
221 | - $event_categories = get_the_terms( $event->ID(), 'espresso_event_categories' ); |
|
222 | - if ( $event_categories ) { |
|
219 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
220 | + if ($event instanceof EE_Event) { |
|
221 | + $event_categories = get_the_terms($event->ID(), 'espresso_event_categories'); |
|
222 | + if ($event_categories) { |
|
223 | 223 | // loop thru terms and create links |
224 | - foreach ( $event_categories as $term ) { |
|
225 | - $url = get_term_link( $term, 'espresso_venue_categories' ); |
|
226 | - if ( ! is_wp_error( $url ) && (( $hide_uncategorized && strtolower( $term->name ) != __( 'uncategorized', 'event_espresso' )) || ! $hide_uncategorized )) { |
|
227 | - $category_links[] = '<a href="' . esc_url( $url ) . '" rel="tag">' . $term->name . '</a>'; |
|
224 | + foreach ($event_categories as $term) { |
|
225 | + $url = get_term_link($term, 'espresso_venue_categories'); |
|
226 | + if ( ! is_wp_error($url) && (($hide_uncategorized && strtolower($term->name) != __('uncategorized', 'event_espresso')) || ! $hide_uncategorized)) { |
|
227 | + $category_links[] = '<a href="'.esc_url($url).'" rel="tag">'.$term->name.'</a>'; |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | } |
231 | 231 | } |
232 | - return implode( ', ', $category_links ); |
|
232 | + return implode(', ', $category_links); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | * @param int $EVT_ID |
244 | 244 | * @return string |
245 | 245 | */ |
246 | - public static function the_event_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
247 | - $datetime = EEH_Event_View::get_primary_date_obj( $EVT_ID ); |
|
248 | - $format = ! empty( $dt_frmt ) && ! empty( $tm_frmt ) ? $dt_frmt . ' ' . $tm_frmt : $dt_frmt . $tm_frmt; |
|
249 | - return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime( 'DTT_EVT_start', $format ) : ''; |
|
246 | + public static function the_event_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
247 | + $datetime = EEH_Event_View::get_primary_date_obj($EVT_ID); |
|
248 | + $format = ! empty($dt_frmt) && ! empty($tm_frmt) ? $dt_frmt.' '.$tm_frmt : $dt_frmt.$tm_frmt; |
|
249 | + return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime('DTT_EVT_start', $format) : ''; |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | * @param int $EVT_ID |
261 | 261 | * @return string |
262 | 262 | */ |
263 | - public static function the_event_end_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
264 | - $datetime = EEH_Event_View::get_last_date_obj( $EVT_ID ); |
|
265 | - $format = ! empty( $dt_frmt ) && ! empty( $tm_frmt ) ? $dt_frmt . ' ' . $tm_frmt : $dt_frmt . $tm_frmt; |
|
266 | - return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime( 'DTT_EVT_end', $format ) : ''; |
|
263 | + public static function the_event_end_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
264 | + $datetime = EEH_Event_View::get_last_date_obj($EVT_ID); |
|
265 | + $format = ! empty($dt_frmt) && ! empty($tm_frmt) ? $dt_frmt.' '.$tm_frmt : $dt_frmt.$tm_frmt; |
|
266 | + return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime('DTT_EVT_end', $format) : ''; |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | |
@@ -277,10 +277,10 @@ discard block |
||
277 | 277 | * @param int $EVT_ID |
278 | 278 | * @return string |
279 | 279 | */ |
280 | - public static function the_earliest_event_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
281 | - $datetime = EEH_Event_View::get_earliest_date_obj( $EVT_ID ); |
|
282 | - $format = ! empty( $dt_frmt ) && ! empty( $tm_frmt ) ? $dt_frmt . ' ' . $tm_frmt : $dt_frmt . $tm_frmt; |
|
283 | - return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime( 'DTT_EVT_start', $format ) : ''; |
|
280 | + public static function the_earliest_event_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
281 | + $datetime = EEH_Event_View::get_earliest_date_obj($EVT_ID); |
|
282 | + $format = ! empty($dt_frmt) && ! empty($tm_frmt) ? $dt_frmt.' '.$tm_frmt : $dt_frmt.$tm_frmt; |
|
283 | + return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime('DTT_EVT_start', $format) : ''; |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | |
@@ -294,10 +294,10 @@ discard block |
||
294 | 294 | * @param int $EVT_ID |
295 | 295 | * @return string |
296 | 296 | */ |
297 | - public static function the_latest_event_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
298 | - $datetime = EEH_Event_View::get_last_date_obj( $EVT_ID ); |
|
299 | - $format = ! empty( $dt_frmt ) && ! empty( $tm_frmt ) ? $dt_frmt . ' ' . $tm_frmt : $dt_frmt . $tm_frmt; |
|
300 | - return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime( 'DTT_EVT_end', $format ) : ''; |
|
297 | + public static function the_latest_event_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
298 | + $datetime = EEH_Event_View::get_last_date_obj($EVT_ID); |
|
299 | + $format = ! empty($dt_frmt) && ! empty($tm_frmt) ? $dt_frmt.' '.$tm_frmt : $dt_frmt.$tm_frmt; |
|
300 | + return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime('DTT_EVT_end', $format) : ''; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | |
@@ -309,13 +309,13 @@ discard block |
||
309 | 309 | * @param int $EVT_ID |
310 | 310 | * @return string |
311 | 311 | */ |
312 | - public static function event_date_as_calendar_page( $EVT_ID = 0 ) { |
|
313 | - $datetime = EEH_Event_View::get_primary_date_obj( $EVT_ID ); |
|
314 | - if ( $datetime instanceof EE_Datetime ) { |
|
312 | + public static function event_date_as_calendar_page($EVT_ID = 0) { |
|
313 | + $datetime = EEH_Event_View::get_primary_date_obj($EVT_ID); |
|
314 | + if ($datetime instanceof EE_Datetime) { |
|
315 | 315 | ?> |
316 | 316 | <div class="event-date-calendar-page-dv"> |
317 | - <div class="event-date-calendar-page-month-dv"><?php echo $datetime->get_i18n_datetime( 'DTT_EVT_start', 'M' );?></div> |
|
318 | - <div class="event-date-calendar-page-day-dv"><?php echo $datetime->start_date( 'd' );?></div> |
|
317 | + <div class="event-date-calendar-page-month-dv"><?php echo $datetime->get_i18n_datetime('DTT_EVT_start', 'M'); ?></div> |
|
318 | + <div class="event-date-calendar-page-day-dv"><?php echo $datetime->start_date('d'); ?></div> |
|
319 | 319 | </div> |
320 | 320 | <?php |
321 | 321 | } |
@@ -330,17 +330,17 @@ discard block |
||
330 | 330 | * @param int $EVT_ID |
331 | 331 | * @return string |
332 | 332 | */ |
333 | - public static function get_primary_date_obj( $EVT_ID = 0 ) { |
|
334 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
335 | - if ( $event instanceof EE_Event ) { |
|
333 | + public static function get_primary_date_obj($EVT_ID = 0) { |
|
334 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
335 | + if ($event instanceof EE_Event) { |
|
336 | 336 | $datetimes = $event->get_many_related( |
337 | 337 | 'Datetime', |
338 | 338 | array( |
339 | 339 | 'limit' => 1, |
340 | - 'order_by' => array( 'DTT_order' => 'ASC' ) |
|
340 | + 'order_by' => array('DTT_order' => 'ASC') |
|
341 | 341 | ) |
342 | 342 | ); |
343 | - return reset( $datetimes ); |
|
343 | + return reset($datetimes); |
|
344 | 344 | } else { |
345 | 345 | return FALSE; |
346 | 346 | } |
@@ -355,17 +355,17 @@ discard block |
||
355 | 355 | * @param int $EVT_ID |
356 | 356 | * @return string |
357 | 357 | */ |
358 | - public static function get_last_date_obj( $EVT_ID = 0 ) { |
|
359 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
360 | - if ( $event instanceof EE_Event ) { |
|
358 | + public static function get_last_date_obj($EVT_ID = 0) { |
|
359 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
360 | + if ($event instanceof EE_Event) { |
|
361 | 361 | $datetimes = $event->get_many_related( |
362 | 362 | 'Datetime', |
363 | 363 | array( |
364 | 364 | 'limit' => 1, |
365 | - 'order_by' => array( 'DTT_order' => 'DESC' ) |
|
365 | + 'order_by' => array('DTT_order' => 'DESC') |
|
366 | 366 | ) |
367 | 367 | ); |
368 | - return end( $datetimes ); |
|
368 | + return end($datetimes); |
|
369 | 369 | } else { |
370 | 370 | return FALSE; |
371 | 371 | } |
@@ -380,17 +380,17 @@ discard block |
||
380 | 380 | * @param int $EVT_ID |
381 | 381 | * @return string |
382 | 382 | */ |
383 | - public static function get_earliest_date_obj( $EVT_ID = 0 ) { |
|
384 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
385 | - if ( $event instanceof EE_Event ) { |
|
383 | + public static function get_earliest_date_obj($EVT_ID = 0) { |
|
384 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
385 | + if ($event instanceof EE_Event) { |
|
386 | 386 | $datetimes = $event->get_many_related( |
387 | 387 | 'Datetime', |
388 | 388 | array( |
389 | 389 | 'limit' => 1, |
390 | - 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) |
|
390 | + 'order_by' => array('DTT_EVT_start' => 'ASC') |
|
391 | 391 | ) |
392 | 392 | ); |
393 | - return reset( $datetimes ); |
|
393 | + return reset($datetimes); |
|
394 | 394 | } else { |
395 | 395 | return FALSE; |
396 | 396 | } |
@@ -405,17 +405,17 @@ discard block |
||
405 | 405 | * @param int $EVT_ID |
406 | 406 | * @return string |
407 | 407 | */ |
408 | - public static function get_latest_date_obj( $EVT_ID = 0 ) { |
|
409 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
410 | - if ( $event instanceof EE_Event ) { |
|
408 | + public static function get_latest_date_obj($EVT_ID = 0) { |
|
409 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
410 | + if ($event instanceof EE_Event) { |
|
411 | 411 | $datetimes = $event->get_many_related( |
412 | 412 | 'Datetime', |
413 | 413 | array( |
414 | 414 | 'limit' => 1, |
415 | - 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) |
|
415 | + 'order_by' => array('DTT_EVT_start' => 'DESC') |
|
416 | 416 | ) |
417 | 417 | ); |
418 | - return end( $datetimes ); |
|
418 | + return end($datetimes); |
|
419 | 419 | } else { |
420 | 420 | return FALSE; |
421 | 421 | } |
@@ -433,17 +433,17 @@ discard block |
||
433 | 433 | * @param null $limit |
434 | 434 | * @return EE_Datetime[] |
435 | 435 | */ |
436 | - public static function get_all_date_obj( $EVT_ID = 0, $include_expired = null, $include_deleted = false, $limit = NULL ) { |
|
437 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
438 | - if($include_expired === null){ |
|
439 | - if($event instanceof EE_Event && $event->is_expired()){ |
|
436 | + public static function get_all_date_obj($EVT_ID = 0, $include_expired = null, $include_deleted = false, $limit = NULL) { |
|
437 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
438 | + if ($include_expired === null) { |
|
439 | + if ($event instanceof EE_Event && $event->is_expired()) { |
|
440 | 440 | $include_expired = true; |
441 | - }else{ |
|
441 | + } else { |
|
442 | 442 | $include_expired = false; |
443 | 443 | } |
444 | 444 | } |
445 | 445 | |
446 | - if ( $event instanceof EE_Event ) { |
|
446 | + if ($event instanceof EE_Event) { |
|
447 | 447 | return $event->datetimes_ordered($include_expired, $include_deleted, $limit); |
448 | 448 | } else { |
449 | 449 | return array(); |
@@ -459,11 +459,11 @@ discard block |
||
459 | 459 | * @param int $EVT_ID |
460 | 460 | * @return string |
461 | 461 | */ |
462 | - public static function event_link_url( $EVT_ID = 0 ) { |
|
463 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
464 | - if ( $event instanceof EE_Event ) { |
|
465 | - $url = $event->external_url() !== NULL && $event->external_url() !== '' ? $event->external_url() : get_permalink( $event->ID() ); |
|
466 | - return preg_match( "~^(?:f|ht)tps?://~i", $url ) ? $url : 'http://' . $url; |
|
462 | + public static function event_link_url($EVT_ID = 0) { |
|
463 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
464 | + if ($event instanceof EE_Event) { |
|
465 | + $url = $event->external_url() !== NULL && $event->external_url() !== '' ? $event->external_url() : get_permalink($event->ID()); |
|
466 | + return preg_match("~^(?:f|ht)tps?://~i", $url) ? $url : 'http://'.$url; |
|
467 | 467 | } |
468 | 468 | return NULL; |
469 | 469 | } |
@@ -477,11 +477,11 @@ discard block |
||
477 | 477 | * @param int $EVT_ID |
478 | 478 | * @return string |
479 | 479 | */ |
480 | - public static function event_phone( $EVT_ID = 0 ) { |
|
481 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
482 | - if ( $event instanceof EE_Event ) { |
|
483 | - EE_Registry::instance()->load_helper( 'Formatter' ); |
|
484 | - return EEH_Schema::telephone( $event->phone() ); |
|
480 | + public static function event_phone($EVT_ID = 0) { |
|
481 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
482 | + if ($event instanceof EE_Event) { |
|
483 | + EE_Registry::instance()->load_helper('Formatter'); |
|
484 | + return EEH_Schema::telephone($event->phone()); |
|
485 | 485 | } |
486 | 486 | return NULL; |
487 | 487 | } |
@@ -498,23 +498,23 @@ discard block |
||
498 | 498 | * @param string $after |
499 | 499 | * @return string |
500 | 500 | */ |
501 | - public static function edit_event_link( $EVT_ID = 0, $link = '', $before = '', $after = '' ) { |
|
502 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
503 | - if ( $event instanceof EE_Event ) { |
|
501 | + public static function edit_event_link($EVT_ID = 0, $link = '', $before = '', $after = '') { |
|
502 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
503 | + if ($event instanceof EE_Event) { |
|
504 | 504 | // can the user edit this post ? |
505 | - if ( current_user_can( 'edit_post', $event->ID() )) { |
|
505 | + if (current_user_can('edit_post', $event->ID())) { |
|
506 | 506 | // set link text |
507 | - $link = ! empty( $link ) ? $link : __('edit this event'); |
|
507 | + $link = ! empty($link) ? $link : __('edit this event'); |
|
508 | 508 | // generate nonce |
509 | - $nonce = wp_create_nonce( 'edit_nonce' ); |
|
509 | + $nonce = wp_create_nonce('edit_nonce'); |
|
510 | 510 | // generate url to event editor for this event |
511 | - $url = add_query_arg( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event->ID(), 'edit_nonce' => $nonce ), admin_url() ); |
|
511 | + $url = add_query_arg(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event->ID(), 'edit_nonce' => $nonce), admin_url()); |
|
512 | 512 | // get edit CPT text |
513 | - $post_type_obj = get_post_type_object( 'espresso_events' ); |
|
513 | + $post_type_obj = get_post_type_object('espresso_events'); |
|
514 | 514 | // build final link html |
515 | - $link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $link . '</a>'; |
|
515 | + $link = '<a class="post-edit-link" href="'.$url.'" title="'.esc_attr($post_type_obj->labels->edit_item).'">'.$link.'</a>'; |
|
516 | 516 | // put it all together |
517 | - return $before . apply_filters( 'edit_post_link', $link, $event->ID() ) . $after; |
|
517 | + return $before.apply_filters('edit_post_link', $link, $event->ID()).$after; |
|
518 | 518 | } |
519 | 519 | } |
520 | 520 | return ''; |
@@ -8,32 +8,32 @@ |
||
8 | 8 | * @subpackage Expression package is undefined on line 19, column 19 in Templates/Scripting/PHPClass.php. |
9 | 9 | * @author Mike Nelson |
10 | 10 | */ |
11 | -class EE_Max_Length_Validation_Strategy extends EE_Validation_Strategy_Base{ |
|
11 | +class EE_Max_Length_Validation_Strategy extends EE_Validation_Strategy_Base { |
|
12 | 12 | |
13 | 13 | protected $_max_length; |
14 | 14 | |
15 | - public function __construct( $validation_error_message = NULL, $max_length = EE_INF ) { |
|
15 | + public function __construct($validation_error_message = NULL, $max_length = EE_INF) { |
|
16 | 16 | $this->_max_length = $max_length; |
17 | - parent::__construct( $validation_error_message ); |
|
17 | + parent::__construct($validation_error_message); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | 21 | * @param $normalized_value |
22 | 22 | */ |
23 | 23 | public function validate($normalized_value) { |
24 | - if( $this->_max_length !== EE_INF && |
|
24 | + if ($this->_max_length !== EE_INF && |
|
25 | 25 | $normalized_value && |
26 | - is_string( $normalized_value ) && |
|
27 | - strlen( $normalized_value ) > $this->_max_length){ |
|
28 | - throw new EE_Validation_Error( $this->get_validation_error_message(), 'maxlength' ); |
|
26 | + is_string($normalized_value) && |
|
27 | + strlen($normalized_value) > $this->_max_length) { |
|
28 | + throw new EE_Validation_Error($this->get_validation_error_message(), 'maxlength'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @return array |
34 | 34 | */ |
35 | - function get_jquery_validation_rule_array(){ |
|
36 | - return array( 'maxlength'=> $this->_max_length, 'messages' => array( 'maxlength' => $this->get_validation_error_message() ) ); |
|
35 | + function get_jquery_validation_rule_array() { |
|
36 | + return array('maxlength'=> $this->_max_length, 'messages' => array('maxlength' => $this->get_validation_error_message())); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @return EED_Event_Single |
36 | 36 | */ |
37 | 37 | public static function instance() { |
38 | - return parent::get_instance( __CLASS__ ); |
|
38 | + return parent::get_instance(__CLASS__); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | * @return void |
48 | 48 | */ |
49 | 49 | public static function set_hooks() { |
50 | - add_filter( 'FHEE_run_EE_wp', '__return_true' ); |
|
51 | - add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 ); |
|
52 | - EE_Config::register_route( __( 'event', 'event_espresso' ), 'Event_Single', 'run' ); |
|
50 | + add_filter('FHEE_run_EE_wp', '__return_true'); |
|
51 | + add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2); |
|
52 | + EE_Config::register_route(__('event', 'event_espresso'), 'Event_Single', 'run'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @return void |
60 | 60 | */ |
61 | 61 | public static function set_hooks_admin() { |
62 | - add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 ); |
|
62 | + add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | * @return void |
74 | 74 | */ |
75 | 75 | public static function set_definitions() { |
76 | - define( 'EVENT_SINGLE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
77 | - define( 'EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS ); |
|
76 | + define('EVENT_SINGLE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
77 | + define('EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @void |
86 | 86 | */ |
87 | - protected function set_config(){ |
|
88 | - $this->set_config_section( 'template_settings' ); |
|
89 | - $this->set_config_class( 'EE_Event_Single_Config' ); |
|
90 | - $this->set_config_name( 'EED_Event_Single' ); |
|
87 | + protected function set_config() { |
|
88 | + $this->set_config_section('template_settings'); |
|
89 | + $this->set_config_class('EE_Event_Single_Config'); |
|
90 | + $this->set_config_name('EED_Event_Single'); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -100,35 +100,35 @@ discard block |
||
100 | 100 | * @param \EE_Event_Single_Config $config |
101 | 101 | * @return \EE_Template_Part_Manager |
102 | 102 | */ |
103 | - public function initialize_template_parts( EE_Event_Single_Config $config = null ) { |
|
103 | + public function initialize_template_parts(EE_Event_Single_Config $config = null) { |
|
104 | 104 | $config = $config instanceof EE_Event_Single_Config ? $config : $this->config(); |
105 | 105 | EEH_Autoloader::instance()->register_template_part_autoloaders(); |
106 | 106 | $template_parts = new EE_Template_Part_Manager(); |
107 | 107 | $template_parts->add_template_part( |
108 | 108 | 'tickets', |
109 | - __( 'Ticket Selector', 'event_espresso' ), |
|
109 | + __('Ticket Selector', 'event_espresso'), |
|
110 | 110 | 'content-espresso_events-tickets.php', |
111 | 111 | $config->display_order_tickets |
112 | 112 | ); |
113 | 113 | $template_parts->add_template_part( |
114 | 114 | 'datetimes', |
115 | - __( 'Dates and Times', 'event_espresso' ), |
|
115 | + __('Dates and Times', 'event_espresso'), |
|
116 | 116 | 'content-espresso_events-datetimes.php', |
117 | 117 | $config->display_order_datetimes |
118 | 118 | ); |
119 | 119 | $template_parts->add_template_part( |
120 | 120 | 'event', |
121 | - __( 'Event Description', 'event_espresso' ), |
|
121 | + __('Event Description', 'event_espresso'), |
|
122 | 122 | 'content-espresso_events-details.php', |
123 | 123 | $config->display_order_event |
124 | 124 | ); |
125 | 125 | $template_parts->add_template_part( |
126 | 126 | 'venue', |
127 | - __( 'Venue Information', 'event_espresso' ), |
|
127 | + __('Venue Information', 'event_espresso'), |
|
128 | 128 | 'content-espresso_events-venues.php', |
129 | 129 | $config->display_order_venue |
130 | 130 | ); |
131 | - do_action( 'AHEE__EED_Event_Single__initialize_template_parts', $template_parts ); |
|
131 | + do_action('AHEE__EED_Event_Single__initialize_template_parts', $template_parts); |
|
132 | 132 | return $template_parts; |
133 | 133 | } |
134 | 134 | |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | * @param WP $WP |
143 | 143 | * @return void |
144 | 144 | */ |
145 | - public function run( $WP ) { |
|
145 | + public function run($WP) { |
|
146 | 146 | // ensure valid EE_Events_Single_Config() object exists |
147 | 147 | $this->set_config(); |
148 | 148 | // check what template is loaded |
149 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
150 | - add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
149 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
150 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
151 | 151 | // load css |
152 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
153 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
152 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
153 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -162,25 +162,25 @@ discard block |
||
162 | 162 | * @param string $template |
163 | 163 | * @return string |
164 | 164 | */ |
165 | - public function template_include( $template ) { |
|
165 | + public function template_include($template) { |
|
166 | 166 | global $post; |
167 | 167 | /** @type EE_Event_Single_Config $config */ |
168 | 168 | $config = $this->config(); |
169 | - if ( $config->display_status_banner_single ) { |
|
170 | - add_filter( 'the_title', array( 'EED_Event_Single', 'the_title' ), 100, 2 ); |
|
169 | + if ($config->display_status_banner_single) { |
|
170 | + add_filter('the_title', array('EED_Event_Single', 'the_title'), 100, 2); |
|
171 | 171 | } |
172 | 172 | // not a custom template? |
173 | 173 | if ( |
174 | 174 | EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_events.php' |
175 | - && ! post_password_required( $post ) |
|
175 | + && ! post_password_required($post) |
|
176 | 176 | ) { |
177 | 177 | EEH_Template::load_espresso_theme_functions(); |
178 | 178 | // then add extra event data via hooks |
179 | - add_action( 'loop_start', array( 'EED_Event_Single', 'loop_start' )); |
|
180 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
181 | - add_action( 'loop_end', array( 'EED_Event_Single', 'loop_end' )); |
|
179 | + add_action('loop_start', array('EED_Event_Single', 'loop_start')); |
|
180 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
181 | + add_action('loop_end', array('EED_Event_Single', 'loop_end')); |
|
182 | 182 | // don't display entry meta because the existing theme will take car of that |
183 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
183 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
184 | 184 | } |
185 | 185 | return $template; |
186 | 186 | } |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | * @param array $wp_query_array an array containing the WP_Query object |
195 | 195 | * @return void |
196 | 196 | */ |
197 | - public static function loop_start( $wp_query_array ) { |
|
197 | + public static function loop_start($wp_query_array) { |
|
198 | 198 | global $post; |
199 | - do_action( 'AHEE_event_details_before_post', $post, $wp_query_array ); |
|
199 | + do_action('AHEE_event_details_before_post', $post, $wp_query_array); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | * @param int $id |
210 | 210 | * @return string |
211 | 211 | */ |
212 | - public static function the_title( $title = '', $id = 0 ) { |
|
212 | + public static function the_title($title = '', $id = 0) { |
|
213 | 213 | global $post; |
214 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
214 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * @param string $content |
223 | 223 | * @return string |
224 | 224 | */ |
225 | - public static function event_details( $content ) { |
|
225 | + public static function event_details($content) { |
|
226 | 226 | global $post; |
227 | 227 | static $current_post_ID = 0; |
228 | 228 | if ( |
@@ -236,15 +236,15 @@ discard block |
||
236 | 236 | // We want to allow those plugins to still do their thing and have access to our content, but depending on |
237 | 237 | // how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice, |
238 | 238 | // so the following allows this filter to be applied multiple times, but only once for real |
239 | - $current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0; |
|
240 | - if ( EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order ) { |
|
239 | + $current_post_ID = did_action('loop_start') ? $post->ID : 0; |
|
240 | + if (EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order) { |
|
241 | 241 | // we need to first remove this callback from being applied to the_content() |
242 | 242 | // (otherwise it will recurse and blow up the interweb) |
243 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
243 | + remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
244 | 244 | EED_Event_Single::instance()->template_parts = EED_Event_Single::instance()->initialize_template_parts(); |
245 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
246 | - $content = EED_Event_Single::instance()->template_parts->apply_template_part_filters( $content ); |
|
247 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
245 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
246 | + $content = EED_Event_Single::instance()->template_parts->apply_template_part_filters($content); |
|
247 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
248 | 248 | } else { |
249 | 249 | $content = EED_Event_Single::use_filterable_display_order(); |
250 | 250 | } |
@@ -265,19 +265,19 @@ discard block |
||
265 | 265 | // it uses the_content() for displaying the $post->post_content |
266 | 266 | // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
267 | 267 | // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
268 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
268 | + remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
269 | 269 | //now add additional content |
270 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110, 1 ); |
|
271 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120, 1 ); |
|
272 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130, 1 ); |
|
273 | - do_action( 'AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters' ); |
|
270 | + add_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110, 1); |
|
271 | + add_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120, 1); |
|
272 | + add_filter('the_content', array('EED_Event_Single', 'event_venues'), 130, 1); |
|
273 | + do_action('AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters'); |
|
274 | 274 | // now load our template |
275 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
275 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
276 | 276 | //now add our filter back in, plus some others |
277 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
278 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 ); |
|
279 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 ); |
|
280 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130 ); |
|
277 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
278 | + remove_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110); |
|
279 | + remove_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120); |
|
280 | + remove_filter('the_content', array('EED_Event_Single', 'event_venues'), 130); |
|
281 | 281 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
282 | 282 | return $content; |
283 | 283 | } |
@@ -291,8 +291,8 @@ discard block |
||
291 | 291 | * @param string $content |
292 | 292 | * @return string |
293 | 293 | */ |
294 | - public static function event_datetimes( $content ) { |
|
295 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
294 | + public static function event_datetimes($content) { |
|
295 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | |
@@ -304,8 +304,8 @@ discard block |
||
304 | 304 | * @param string $content |
305 | 305 | * @return string |
306 | 306 | */ |
307 | - public static function event_tickets( $content ) { |
|
308 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
307 | + public static function event_tickets($content) { |
|
308 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | |
@@ -317,8 +317,8 @@ discard block |
||
317 | 317 | * @param string $content |
318 | 318 | * @return string |
319 | 319 | */ |
320 | - public static function event_venue( $content ) { |
|
321 | - return EED_Event_Single::event_venues( $content ); |
|
320 | + public static function event_venue($content) { |
|
321 | + return EED_Event_Single::event_venues($content); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | |
@@ -330,8 +330,8 @@ discard block |
||
330 | 330 | * @param string $content |
331 | 331 | * @return string |
332 | 332 | */ |
333 | - public static function event_venues( $content ) { |
|
334 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
333 | + public static function event_venues($content) { |
|
334 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | |
@@ -343,9 +343,9 @@ discard block |
||
343 | 343 | * @param array $wp_query_array an array containing the WP_Query object |
344 | 344 | * @return void |
345 | 345 | */ |
346 | - public static function loop_end( $wp_query_array ) { |
|
346 | + public static function loop_end($wp_query_array) { |
|
347 | 347 | global $post; |
348 | - do_action( 'AHEE_event_details_after_post', $post, $wp_query_array ); |
|
348 | + do_action('AHEE_event_details_after_post', $post, $wp_query_array); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
@@ -358,18 +358,18 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function wp_enqueue_scripts() { |
360 | 360 | // get some style |
361 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && apply_filters( 'FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE )) { |
|
362 | - EE_Registry::instance()->load_helper( 'File' ); |
|
361 | + if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && apply_filters('FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE)) { |
|
362 | + EE_Registry::instance()->load_helper('File'); |
|
363 | 363 | // first check uploads folder |
364 | - if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
365 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
364 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
365 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
366 | 366 | } else { |
367 | - wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
367 | + wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
368 | 368 | } |
369 | - wp_enqueue_script( $this->theme ); |
|
370 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
371 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
372 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
369 | + wp_enqueue_script($this->theme); |
|
370 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
371 | + EE_Registry::instance()->load_helper('Maps'); |
|
372 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
373 | 373 | } |
374 | 374 | } |
375 | 375 | } |
@@ -388,12 +388,12 @@ discard block |
||
388 | 388 | * @return bool |
389 | 389 | */ |
390 | 390 | public static function display_venue() { |
391 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
391 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
392 | 392 | /** @type EE_Event_Single_Config $config */ |
393 | 393 | $config = EED_Event_Single::instance()->config(); |
394 | - $display_venue= isset( $config->display_venue ) ? $config->display_venue : TRUE; |
|
394 | + $display_venue = isset($config->display_venue) ? $config->display_venue : TRUE; |
|
395 | 395 | $venue_name = EEH_Venue_View::venue_name(); |
396 | - return $display_venue && ! empty( $venue_name ) ? TRUE : FALSE; |
|
396 | + return $display_venue && ! empty($venue_name) ? TRUE : FALSE; |
|
397 | 397 | } |
398 | 398 | |
399 | 399 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @return EED_Events_Archive |
39 | 39 | */ |
40 | 40 | public static function instance() { |
41 | - return parent::get_instance( __CLASS__ ); |
|
41 | + return parent::get_instance(__CLASS__); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | * @return void |
51 | 51 | */ |
52 | 52 | public static function set_hooks() { |
53 | - EE_Config::register_route( EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run' ); |
|
54 | - EE_Config::register_route( 'event_list', 'Events_Archive', 'event_list' ); |
|
55 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
53 | + EE_Config::register_route(EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run'); |
|
54 | + EE_Config::register_route('event_list', 'Events_Archive', 'event_list'); |
|
55 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @return void |
63 | 63 | */ |
64 | 64 | public static function set_hooks_admin() { |
65 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
65 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @return void |
76 | 76 | */ |
77 | 77 | public static function set_definitions() { |
78 | - define( 'EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
79 | - define( 'EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
78 | + define('EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
79 | + define('EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return \EE_Events_Archive_Config |
88 | 88 | */ |
89 | - protected function set_config(){ |
|
90 | - $this->set_config_section( 'template_settings' ); |
|
91 | - $this->set_config_class( 'EE_Events_Archive_Config' ); |
|
92 | - $this->set_config_name( 'EED_Events_Archive' ); |
|
89 | + protected function set_config() { |
|
90 | + $this->set_config_section('template_settings'); |
|
91 | + $this->set_config_class('EE_Events_Archive_Config'); |
|
92 | + $this->set_config_name('EED_Events_Archive'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -101,35 +101,35 @@ discard block |
||
101 | 101 | * @param \EE_Events_Archive_Config $config |
102 | 102 | * @return \EE_Template_Part_Manager |
103 | 103 | */ |
104 | - public function initialize_template_parts( EE_Events_Archive_Config $config = null ) { |
|
104 | + public function initialize_template_parts(EE_Events_Archive_Config $config = null) { |
|
105 | 105 | $config = $config instanceof EE_Events_Archive_Config ? $config : $this->config(); |
106 | 106 | EEH_Autoloader::instance()->register_template_part_autoloaders(); |
107 | 107 | $template_parts = new EE_Template_Part_Manager(); |
108 | 108 | $template_parts->add_template_part( |
109 | 109 | 'tickets', |
110 | - __( 'Ticket Selector', 'event_espresso' ), |
|
110 | + __('Ticket Selector', 'event_espresso'), |
|
111 | 111 | 'content-espresso_events-tickets.php', |
112 | 112 | $config->display_order_tickets |
113 | 113 | ); |
114 | 114 | $template_parts->add_template_part( |
115 | 115 | 'datetimes', |
116 | - __( 'Dates and Times', 'event_espresso' ), |
|
116 | + __('Dates and Times', 'event_espresso'), |
|
117 | 117 | 'content-espresso_events-datetimes.php', |
118 | 118 | $config->display_order_datetimes |
119 | 119 | ); |
120 | 120 | $template_parts->add_template_part( |
121 | 121 | 'event', |
122 | - __( 'Event Description', 'event_espresso' ), |
|
122 | + __('Event Description', 'event_espresso'), |
|
123 | 123 | 'content-espresso_events-details.php', |
124 | 124 | $config->display_order_event |
125 | 125 | ); |
126 | 126 | $template_parts->add_template_part( |
127 | 127 | 'venue', |
128 | - __( 'Venue Information', 'event_espresso' ), |
|
128 | + __('Venue Information', 'event_espresso'), |
|
129 | 129 | 'content-espresso_events-venues.php', |
130 | 130 | $config->display_order_venue |
131 | 131 | ); |
132 | - do_action( 'AHEE__EED_Event_Archive__initialize_template_parts', $template_parts ); |
|
132 | + do_action('AHEE__EED_Event_Archive__initialize_template_parts', $template_parts); |
|
133 | 133 | return $template_parts; |
134 | 134 | } |
135 | 135 | |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | * @param WP $WP |
143 | 143 | * @return void |
144 | 144 | */ |
145 | - public function run( $WP ) { |
|
146 | - do_action( 'AHEE__EED_Events_Archive__before_run' ); |
|
145 | + public function run($WP) { |
|
146 | + do_action('AHEE__EED_Events_Archive__before_run'); |
|
147 | 147 | // ensure valid EE_Events_Archive_Config() object exists |
148 | 148 | $this->set_config(); |
149 | 149 | /** @type EE_Events_Archive_Config $config */ |
@@ -151,19 +151,19 @@ discard block |
||
151 | 151 | // load other required components |
152 | 152 | $this->load_event_list_assets(); |
153 | 153 | // filter the WP posts_join, posts_where, and posts_orderby SQL clauses |
154 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
154 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
155 | 155 | //add query filters |
156 | 156 | EEH_Event_Query::add_query_filters(); |
157 | 157 | // set params that will get used by the filters |
158 | 158 | EEH_Event_Query::set_query_params( |
159 | - '', // month |
|
160 | - '', // category |
|
161 | - $config->display_expired_events, // show_expired |
|
162 | - 'start_date', // orderby |
|
159 | + '', // month |
|
160 | + '', // category |
|
161 | + $config->display_expired_events, // show_expired |
|
162 | + 'start_date', // orderby |
|
163 | 163 | 'ASC' // sort |
164 | 164 | ); |
165 | 165 | // check what template is loaded |
166 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
166 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -195,30 +195,30 @@ discard block |
||
195 | 195 | * @param string $template |
196 | 196 | * @return string |
197 | 197 | */ |
198 | - public function template_include( $template = '' ) { |
|
198 | + public function template_include($template = '') { |
|
199 | 199 | // don't add content filter for dedicated EE child themes or private posts |
200 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
201 | - if ( ! EEH_Template::is_espresso_theme() ) { |
|
200 | + EE_Registry::instance()->load_helper('Template'); |
|
201 | + if ( ! EEH_Template::is_espresso_theme()) { |
|
202 | 202 | /** @type EE_Events_Archive_Config $config */ |
203 | 203 | $config = $this->config(); |
204 | 204 | // add status banner ? |
205 | - if ( $config->display_status_banner ) { |
|
206 | - add_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100, 2 ); |
|
205 | + if ($config->display_status_banner) { |
|
206 | + add_filter('the_title', array('EED_Events_Archive', 'the_title'), 100, 2); |
|
207 | 207 | } |
208 | 208 | // if NOT a custom template |
209 | - if ( EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php' ) { |
|
209 | + if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php') { |
|
210 | 210 | // don't display entry meta because the existing theme will take care of that |
211 | - add_filter( 'FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true' ); |
|
211 | + add_filter('FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true'); |
|
212 | 212 | // load functions.php file for the theme (loaded by WP if using child theme) |
213 | 213 | EEH_Template::load_espresso_theme_functions(); |
214 | 214 | // because we don't know if the theme is using the_excerpt() |
215 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
215 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
216 | 216 | // or the_content |
217 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
217 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
218 | 218 | // and just in case they are running get_the_excerpt() which DESTROYS things |
219 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
219 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
220 | 220 | // don't display entry meta because the existing theme will take care of that |
221 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
221 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
222 | 222 | } |
223 | 223 | } |
224 | 224 | return $template; |
@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | * @param string $excerpt |
234 | 234 | * @return string |
235 | 235 | */ |
236 | - public static function get_the_excerpt( $excerpt = '' ) { |
|
237 | - if ( post_password_required() ) { |
|
236 | + public static function get_the_excerpt($excerpt = '') { |
|
237 | + if (post_password_required()) { |
|
238 | 238 | return $excerpt; |
239 | 239 | } |
240 | - if ( apply_filters( 'FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false ) ) { |
|
241 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
242 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
243 | - $excerpt = EED_Events_Archive::event_details( $excerpt ); |
|
240 | + if (apply_filters('FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false)) { |
|
241 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
242 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
243 | + $excerpt = EED_Events_Archive::event_details($excerpt); |
|
244 | 244 | } |
245 | 245 | return $excerpt; |
246 | 246 | } |
@@ -255,10 +255,10 @@ discard block |
||
255 | 255 | * @param string $id |
256 | 256 | * @return string |
257 | 257 | */ |
258 | - public static function the_title( $title = '', $id = '' ) { |
|
258 | + public static function the_title($title = '', $id = '') { |
|
259 | 259 | global $post; |
260 | - if ( $post instanceof WP_Post ) { |
|
261 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
260 | + if ($post instanceof WP_Post) { |
|
261 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
262 | 262 | } |
263 | 263 | return $title; |
264 | 264 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * @param string $content |
273 | 273 | * @return string |
274 | 274 | */ |
275 | - public static function event_details( $content ) { |
|
275 | + public static function event_details($content) { |
|
276 | 276 | global $post; |
277 | 277 | static $current_post_ID = 0; |
278 | 278 | if ( |
@@ -280,8 +280,8 @@ discard block |
||
280 | 280 | $post->post_type == 'espresso_events' && |
281 | 281 | ! post_password_required() && |
282 | 282 | ( |
283 | - apply_filters( 'FHEE__EES_Espresso_Events__process_shortcode__true', false ) |
|
284 | - || ! apply_filters( 'FHEE__content_espresso_events__template_loaded', false ) |
|
283 | + apply_filters('FHEE__EES_Espresso_Events__process_shortcode__true', false) |
|
284 | + || ! apply_filters('FHEE__content_espresso_events__template_loaded', false) |
|
285 | 285 | ) |
286 | 286 | ) { |
287 | 287 | // Set current post ID to prevent showing content twice, but only if headers have definitely been sent. |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | // We want to allow those plugins to still do their thing and have access to our content, but depending on |
291 | 291 | // how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice, |
292 | 292 | // so the following allows this filter to be applied multiple times, but only once for real |
293 | - $current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0; |
|
294 | - if ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order ) { |
|
293 | + $current_post_ID = did_action('loop_start') ? $post->ID : 0; |
|
294 | + if (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order) { |
|
295 | 295 | $content = \EED_Events_Archive::use_sortable_display_order(); |
296 | 296 | } else { |
297 | 297 | $content = \EED_Events_Archive::use_filterable_display_order(); |
@@ -310,20 +310,20 @@ discard block |
||
310 | 310 | */ |
311 | 311 | protected static function use_sortable_display_order() { |
312 | 312 | // no further password checks required atm |
313 | - add_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
313 | + add_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
314 | 314 | // we need to first remove this callback from being applied to the_content() or the_excerpt() (otherwise it will recurse and blow up the interweb) |
315 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
316 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
317 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
315 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
316 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
317 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
318 | 318 | // now add additional content depending on whether event is using the_excerpt() or the_content() |
319 | 319 | EED_Events_Archive::instance()->template_parts = EED_Events_Archive::instance()->initialize_template_parts(); |
320 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
321 | - $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters( $content ); |
|
320 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
321 | + $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters($content); |
|
322 | 322 | // re-add our main filters (or else the next event won't have them) |
323 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
324 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
325 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
326 | - remove_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
323 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
324 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
325 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
326 | + remove_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
327 | 327 | return $content; |
328 | 328 | } |
329 | 329 | |
@@ -338,22 +338,22 @@ discard block |
||
338 | 338 | protected static function use_filterable_display_order() { |
339 | 339 | // we need to first remove this callback from being applied to the_content() |
340 | 340 | // (otherwise it will recurse and blow up the interweb) |
341 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
342 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
343 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
341 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
342 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
343 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
344 | 344 | //now add additional content depending on whether event is using the_excerpt() or the_content() |
345 | 345 | EED_Events_Archive::_add_additional_excerpt_filters(); |
346 | 346 | EED_Events_Archive::_add_additional_content_filters(); |
347 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters' ); |
|
347 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters'); |
|
348 | 348 | // now load our template |
349 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
349 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
350 | 350 | // re-add our main filters (or else the next event won't have them) |
351 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
352 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
353 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
351 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
352 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
353 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
354 | 354 | // but remove the other filters so that they don't get applied to the next post |
355 | 355 | EED_Events_Archive::_remove_additional_events_archive_filters(); |
356 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters' ); |
|
356 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters'); |
|
357 | 357 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
358 | 358 | //return ! empty( $template ) ? $template : $content; |
359 | 359 | return $content; |
@@ -368,11 +368,11 @@ discard block |
||
368 | 368 | * @param string $content |
369 | 369 | * @return string |
370 | 370 | */ |
371 | - public static function event_datetimes( $content ) { |
|
372 | - if ( post_password_required() ) { |
|
371 | + public static function event_datetimes($content) { |
|
372 | + if (post_password_required()) { |
|
373 | 373 | return $content; |
374 | 374 | } |
375 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
375 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | /** |
@@ -382,11 +382,11 @@ discard block |
||
382 | 382 | * @param string $content |
383 | 383 | * @return string |
384 | 384 | */ |
385 | - public static function event_tickets( $content ) { |
|
386 | - if ( post_password_required() ) { |
|
385 | + public static function event_tickets($content) { |
|
386 | + if (post_password_required()) { |
|
387 | 387 | return $content; |
388 | 388 | } |
389 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
389 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | |
@@ -398,8 +398,8 @@ discard block |
||
398 | 398 | * @param string $content |
399 | 399 | * @return string |
400 | 400 | */ |
401 | - public static function event_venue( $content ) { |
|
402 | - return EED_Events_Archive::event_venues( $content ); |
|
401 | + public static function event_venue($content) { |
|
402 | + return EED_Events_Archive::event_venues($content); |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | /** |
@@ -409,11 +409,11 @@ discard block |
||
409 | 409 | * @param string $content |
410 | 410 | * @return string |
411 | 411 | */ |
412 | - public static function event_venues( $content ) { |
|
413 | - if ( post_password_required() ) { |
|
412 | + public static function event_venues($content) { |
|
413 | + if (post_password_required()) { |
|
414 | 414 | return $content; |
415 | 415 | } |
416 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
416 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | |
@@ -425,9 +425,9 @@ discard block |
||
425 | 425 | * @return void |
426 | 426 | */ |
427 | 427 | private static function _add_additional_excerpt_filters() { |
428 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
429 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
430 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
428 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
429 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
430 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | |
@@ -439,9 +439,9 @@ discard block |
||
439 | 439 | * @return void |
440 | 440 | */ |
441 | 441 | private static function _add_additional_content_filters() { |
442 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
443 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
444 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
442 | + add_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
443 | + add_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
444 | + add_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | |
@@ -453,12 +453,12 @@ discard block |
||
453 | 453 | * @return void |
454 | 454 | */ |
455 | 455 | private static function _remove_additional_events_archive_filters() { |
456 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
457 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
458 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
459 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
460 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
461 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
456 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
457 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
458 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
459 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
460 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
461 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | |
@@ -471,17 +471,17 @@ discard block |
||
471 | 471 | */ |
472 | 472 | public static function remove_all_events_archive_filters() { |
473 | 473 | //remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
474 | - remove_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100 ); |
|
475 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
476 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
477 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
478 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
479 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
480 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
481 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
482 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
474 | + remove_filter('the_title', array('EED_Events_Archive', 'the_title'), 100); |
|
475 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
476 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
477 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
478 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
479 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
480 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
481 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
482 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
483 | 483 | // don't display entry meta because the existing theme will take care of that |
484 | - remove_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
484 | + remove_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | |
@@ -496,15 +496,15 @@ discard block |
||
496 | 496 | * @return void |
497 | 497 | */ |
498 | 498 | public function load_event_list_assets() { |
499 | - do_action( 'AHEE__EED_Events_Archive__before_load_assets' ); |
|
500 | - add_filter( 'FHEE_load_EE_Session', '__return_true' ); |
|
501 | - add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
502 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
503 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
504 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
505 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
499 | + do_action('AHEE__EED_Events_Archive__before_load_assets'); |
|
500 | + add_filter('FHEE_load_EE_Session', '__return_true'); |
|
501 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
502 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
503 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
504 | + EE_Registry::instance()->load_helper('Maps'); |
|
505 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
506 | 506 | } |
507 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
507 | + EE_Registry::instance()->load_helper('Event_View'); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | |
@@ -520,14 +520,14 @@ discard block |
||
520 | 520 | */ |
521 | 521 | public function wp_enqueue_scripts() { |
522 | 522 | // get some style |
523 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', FALSE ) ) { |
|
523 | + if (apply_filters('FHEE_enable_default_espresso_css', FALSE)) { |
|
524 | 524 | // first check uploads folder |
525 | - EE_Registry::instance()->load_helper( 'File' ); |
|
526 | - if ( EEH_File::is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
527 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
525 | + EE_Registry::instance()->load_helper('File'); |
|
526 | + if (EEH_File::is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
527 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
528 | 528 | } else { |
529 | 529 | } |
530 | - wp_enqueue_style( $this->theme ); |
|
530 | + wp_enqueue_style($this->theme); |
|
531 | 531 | |
532 | 532 | } |
533 | 533 | } |
@@ -545,8 +545,8 @@ discard block |
||
545 | 545 | */ |
546 | 546 | public static function template_settings_form() { |
547 | 547 | $template_settings = EE_Registry::instance()->CFG->template_settings; |
548 | - $template_settings->EED_Events_Archive = isset( $template_settings->EED_Events_Archive ) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
549 | - $template_settings->EED_Events_Archive = apply_filters( 'FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive ); |
|
548 | + $template_settings->EED_Events_Archive = isset($template_settings->EED_Events_Archive) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
549 | + $template_settings->EED_Events_Archive = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive); |
|
550 | 550 | $events_archive_settings = array( |
551 | 551 | 'display_status_banner' => 0, |
552 | 552 | 'display_description' => 1, |
@@ -555,8 +555,8 @@ discard block |
||
555 | 555 | 'display_venue' => 0, |
556 | 556 | 'display_expired_events' => 0 |
557 | 557 | ); |
558 | - $events_archive_settings = array_merge( $events_archive_settings, (array)$template_settings->EED_Events_Archive ); |
|
559 | - EEH_Template::display_template( EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $events_archive_settings ); |
|
558 | + $events_archive_settings = array_merge($events_archive_settings, (array) $template_settings->EED_Events_Archive); |
|
559 | + EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', $events_archive_settings); |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | |
@@ -572,16 +572,16 @@ discard block |
||
572 | 572 | * @param EE_Request_Handler $REQ |
573 | 573 | * @return EE_Template_Config |
574 | 574 | */ |
575 | - public static function update_template_settings( $CFG, $REQ ) { |
|
575 | + public static function update_template_settings($CFG, $REQ) { |
|
576 | 576 | $CFG->EED_Events_Archive = new EE_Events_Archive_Config(); |
577 | 577 | // unless we are resetting the config... |
578 | - if ( ! isset( $REQ['EED_Events_Archive_reset_event_list_settings'] ) || absint( $REQ['EED_Events_Archive_reset_event_list_settings'] ) !== 1 ) { |
|
579 | - $CFG->EED_Events_Archive->display_status_banner = isset( $REQ['EED_Events_Archive_display_status_banner'] ) ? absint( $REQ['EED_Events_Archive_display_status_banner'] ) : 0; |
|
580 | - $CFG->EED_Events_Archive->display_description = isset( $REQ['EED_Events_Archive_display_description'] ) ? absint( $REQ['EED_Events_Archive_display_description'] ) : 1; |
|
581 | - $CFG->EED_Events_Archive->display_ticket_selector = isset( $REQ['EED_Events_Archive_display_ticket_selector'] ) ? absint( $REQ['EED_Events_Archive_display_ticket_selector'] ) : 0; |
|
582 | - $CFG->EED_Events_Archive->display_datetimes = isset( $REQ['EED_Events_Archive_display_datetimes'] ) ? absint( $REQ['EED_Events_Archive_display_datetimes'] ) : 1; |
|
583 | - $CFG->EED_Events_Archive->display_venue = isset( $REQ['EED_Events_Archive_display_venue'] ) ? absint( $REQ['EED_Events_Archive_display_venue'] ) : 0; |
|
584 | - $CFG->EED_Events_Archive->display_expired_events = isset( $REQ['EED_Events_Archive_display_expired_events'] ) ? absint( $REQ['EED_Events_Archive_display_expired_events'] ) : 0; } |
|
578 | + if ( ! isset($REQ['EED_Events_Archive_reset_event_list_settings']) || absint($REQ['EED_Events_Archive_reset_event_list_settings']) !== 1) { |
|
579 | + $CFG->EED_Events_Archive->display_status_banner = isset($REQ['EED_Events_Archive_display_status_banner']) ? absint($REQ['EED_Events_Archive_display_status_banner']) : 0; |
|
580 | + $CFG->EED_Events_Archive->display_description = isset($REQ['EED_Events_Archive_display_description']) ? absint($REQ['EED_Events_Archive_display_description']) : 1; |
|
581 | + $CFG->EED_Events_Archive->display_ticket_selector = isset($REQ['EED_Events_Archive_display_ticket_selector']) ? absint($REQ['EED_Events_Archive_display_ticket_selector']) : 0; |
|
582 | + $CFG->EED_Events_Archive->display_datetimes = isset($REQ['EED_Events_Archive_display_datetimes']) ? absint($REQ['EED_Events_Archive_display_datetimes']) : 1; |
|
583 | + $CFG->EED_Events_Archive->display_venue = isset($REQ['EED_Events_Archive_display_venue']) ? absint($REQ['EED_Events_Archive_display_venue']) : 0; |
|
584 | + $CFG->EED_Events_Archive->display_expired_events = isset($REQ['EED_Events_Archive_display_expired_events']) ? absint($REQ['EED_Events_Archive_display_expired_events']) : 0; } |
|
585 | 585 | return $CFG; |
586 | 586 | } |
587 | 587 | |
@@ -594,10 +594,10 @@ discard block |
||
594 | 594 | * @param string $extra_class |
595 | 595 | * @return string |
596 | 596 | */ |
597 | - public static function event_list_css( $extra_class = '' ) { |
|
598 | - $event_list_css = ! empty( $extra_class ) ? array( $extra_class ) : array(); |
|
597 | + public static function event_list_css($extra_class = '') { |
|
598 | + $event_list_css = ! empty($extra_class) ? array($extra_class) : array(); |
|
599 | 599 | $event_list_css[] = 'espresso-event-list-event'; |
600 | - return implode( ' ', $event_list_css ); |
|
600 | + return implode(' ', $event_list_css); |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | |
@@ -624,9 +624,9 @@ discard block |
||
624 | 624 | * @param $value |
625 | 625 | * @return bool |
626 | 626 | */ |
627 | - public static function display_description( $value ) { |
|
627 | + public static function display_description($value) { |
|
628 | 628 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
629 | - $display_description= isset( $config->display_description ) ? $config->display_description : 1; |
|
629 | + $display_description = isset($config->display_description) ? $config->display_description : 1; |
|
630 | 630 | return $display_description === $value ? TRUE : FALSE; |
631 | 631 | } |
632 | 632 | |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | */ |
640 | 640 | public static function display_ticket_selector() { |
641 | 641 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
642 | - return isset( $config->display_ticket_selector ) && $config->display_ticket_selector ? TRUE : FALSE; |
|
642 | + return isset($config->display_ticket_selector) && $config->display_ticket_selector ? TRUE : FALSE; |
|
643 | 643 | } |
644 | 644 | |
645 | 645 | |
@@ -651,9 +651,9 @@ discard block |
||
651 | 651 | * @return bool |
652 | 652 | */ |
653 | 653 | public static function display_venue() { |
654 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
654 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
655 | 655 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
656 | - return isset( $config->display_venue ) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
656 | + return isset($config->display_venue) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
657 | 657 | } |
658 | 658 | |
659 | 659 | |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | */ |
666 | 666 | public static function display_datetimes() { |
667 | 667 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
668 | - return isset( $config->display_datetimes ) && $config->display_datetimes ? TRUE : FALSE; |
|
668 | + return isset($config->display_datetimes) && $config->display_datetimes ? TRUE : FALSE; |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | * @return string |
681 | 681 | */ |
682 | 682 | public static function event_list_title() { |
683 | - return apply_filters( 'FHEE__archive_espresso_events_template__upcoming_events_h1', __( 'Upcoming Events', 'event_espresso' )); |
|
683 | + return apply_filters('FHEE__archive_espresso_events_template__upcoming_events_h1', __('Upcoming Events', 'event_espresso')); |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | |
@@ -689,11 +689,11 @@ discard block |
||
689 | 689 | /** |
690 | 690 | * @since 4.4.0 |
691 | 691 | */ |
692 | - public static function _doing_it_wrong_notice( $function = '' ) { |
|
692 | + public static function _doing_it_wrong_notice($function = '') { |
|
693 | 693 | EE_Error::doing_it_wrong( |
694 | 694 | __FUNCTION__, |
695 | 695 | sprintf( |
696 | - __( 'EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso' ), |
|
696 | + __('EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso'), |
|
697 | 697 | $function, |
698 | 698 | '<br />', |
699 | 699 | '4.6.0' |
@@ -709,107 +709,107 @@ discard block |
||
709 | 709 | * @since 4.4.0 |
710 | 710 | */ |
711 | 711 | public function get_post_data() { |
712 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
712 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
713 | 713 | EEH_Event_Query::set_query_params(); |
714 | 714 | } |
715 | 715 | /** |
716 | 716 | * @deprecated |
717 | 717 | * @since 4.4.0 |
718 | 718 | */ |
719 | - public function posts_fields( $SQL, WP_Query $wp_query ) { |
|
720 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
721 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
722 | - return EEH_Event_Query::posts_fields( $SQL, $wp_query ); |
|
719 | + public function posts_fields($SQL, WP_Query $wp_query) { |
|
720 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
721 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
722 | + return EEH_Event_Query::posts_fields($SQL, $wp_query); |
|
723 | 723 | } |
724 | 724 | /** |
725 | 725 | * @deprecated |
726 | 726 | * @since 4.4.0 |
727 | 727 | */ |
728 | - public static function posts_fields_sql_for_orderby( $orderby_params = array() ) { |
|
729 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
730 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
731 | - return EEH_Event_Query::posts_fields_sql_for_orderby( $orderby_params ); |
|
728 | + public static function posts_fields_sql_for_orderby($orderby_params = array()) { |
|
729 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
730 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
731 | + return EEH_Event_Query::posts_fields_sql_for_orderby($orderby_params); |
|
732 | 732 | } |
733 | 733 | /** |
734 | 734 | * @deprecated |
735 | 735 | * @since 4.4.0 |
736 | 736 | */ |
737 | - public function posts_join( $SQL, WP_Query $wp_query ) { |
|
738 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
739 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
740 | - return EEH_Event_Query::posts_join( $SQL, $wp_query ); |
|
737 | + public function posts_join($SQL, WP_Query $wp_query) { |
|
738 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
739 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
740 | + return EEH_Event_Query::posts_join($SQL, $wp_query); |
|
741 | 741 | } |
742 | 742 | /** |
743 | 743 | * @deprecated |
744 | 744 | * @since 4.4.0 |
745 | 745 | */ |
746 | - public static function posts_join_sql_for_terms( $join_terms = NULL ) { |
|
747 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
748 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
749 | - return EEH_Event_Query::posts_join_sql_for_terms( $join_terms ); |
|
746 | + public static function posts_join_sql_for_terms($join_terms = NULL) { |
|
747 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
748 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
749 | + return EEH_Event_Query::posts_join_sql_for_terms($join_terms); |
|
750 | 750 | } |
751 | 751 | /** |
752 | 752 | * @deprecated |
753 | 753 | * @since 4.4.0 |
754 | 754 | */ |
755 | - public static function posts_join_for_orderby( $orderby_params = array() ) { |
|
756 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
757 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
758 | - return EEH_Event_Query::posts_join_for_orderby( $orderby_params ); |
|
755 | + public static function posts_join_for_orderby($orderby_params = array()) { |
|
756 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
757 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
758 | + return EEH_Event_Query::posts_join_for_orderby($orderby_params); |
|
759 | 759 | } |
760 | 760 | /** |
761 | 761 | * @deprecated |
762 | 762 | * @since 4.4.0 |
763 | 763 | */ |
764 | - public function posts_where( $SQL, WP_Query $wp_query ) { |
|
765 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
766 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
767 | - return EEH_Event_Query::posts_where( $SQL, $wp_query ); |
|
764 | + public function posts_where($SQL, WP_Query $wp_query) { |
|
765 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
766 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
767 | + return EEH_Event_Query::posts_where($SQL, $wp_query); |
|
768 | 768 | } |
769 | 769 | /** |
770 | 770 | * @deprecated |
771 | 771 | * @since 4.4.0 |
772 | 772 | */ |
773 | - public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) { |
|
774 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
775 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
776 | - return EEH_Event_Query::posts_where_sql_for_show_expired( $show_expired ); |
|
773 | + public static function posts_where_sql_for_show_expired($show_expired = FALSE) { |
|
774 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
775 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
776 | + return EEH_Event_Query::posts_where_sql_for_show_expired($show_expired); |
|
777 | 777 | } |
778 | 778 | /** |
779 | 779 | * @deprecated |
780 | 780 | * @since 4.4.0 |
781 | 781 | */ |
782 | - public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) { |
|
783 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
784 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
785 | - return EEH_Event_Query::posts_where_sql_for_event_category_slug( $event_category_slug ); |
|
782 | + public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) { |
|
783 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
784 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
785 | + return EEH_Event_Query::posts_where_sql_for_event_category_slug($event_category_slug); |
|
786 | 786 | } |
787 | 787 | /** |
788 | 788 | * @deprecated |
789 | 789 | * @since 4.4.0 |
790 | 790 | */ |
791 | - public static function posts_where_sql_for_event_list_month( $month = NULL ) { |
|
792 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
793 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
794 | - return EEH_Event_Query::posts_where_sql_for_event_list_month( $month ); |
|
791 | + public static function posts_where_sql_for_event_list_month($month = NULL) { |
|
792 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
793 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
794 | + return EEH_Event_Query::posts_where_sql_for_event_list_month($month); |
|
795 | 795 | } |
796 | 796 | /** |
797 | 797 | * @deprecated |
798 | 798 | * @since 4.4.0 |
799 | 799 | */ |
800 | - public function posts_orderby( $SQL, WP_Query $wp_query ) { |
|
801 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
802 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
803 | - return EEH_Event_Query::posts_orderby( $SQL, $wp_query ); |
|
800 | + public function posts_orderby($SQL, WP_Query $wp_query) { |
|
801 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
802 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
803 | + return EEH_Event_Query::posts_orderby($SQL, $wp_query); |
|
804 | 804 | } |
805 | 805 | /** |
806 | 806 | * @deprecated |
807 | 807 | * @since 4.4.0 |
808 | 808 | */ |
809 | - public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) { |
|
810 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
811 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
812 | - return EEH_Event_Query::posts_orderby_sql( $orderby_params, $sort ); |
|
809 | + public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') { |
|
810 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
811 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
812 | + return EEH_Event_Query::posts_orderby_sql($orderby_params, $sort); |
|
813 | 813 | } |
814 | 814 | |
815 | 815 | |
@@ -840,8 +840,8 @@ discard block |
||
840 | 840 | * @param string $extra_class |
841 | 841 | * @return string |
842 | 842 | */ |
843 | -function espresso_event_list_css( $extra_class = '' ) { |
|
844 | - return EED_Events_Archive::event_list_css( $extra_class ); |
|
843 | +function espresso_event_list_css($extra_class = '') { |
|
844 | + return EED_Events_Archive::event_list_css($extra_class); |
|
845 | 845 | } |
846 | 846 | |
847 | 847 | /** |
@@ -855,14 +855,14 @@ discard block |
||
855 | 855 | * @return bool |
856 | 856 | */ |
857 | 857 | function espresso_display_full_description_in_event_list() { |
858 | - return EED_Events_Archive::display_description( 2 ); |
|
858 | + return EED_Events_Archive::display_description(2); |
|
859 | 859 | } |
860 | 860 | |
861 | 861 | /** |
862 | 862 | * @return bool |
863 | 863 | */ |
864 | 864 | function espresso_display_excerpt_in_event_list() { |
865 | - return EED_Events_Archive::display_description( 1 ); |
|
865 | + return EED_Events_Archive::display_description(1); |
|
866 | 866 | } |
867 | 867 | |
868 | 868 | /** |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This template will display a single event - copy it to your theme folder |
|
4 | - * |
|
5 | - * @ package Event Espresso |
|
6 | - * @ author Seth Shoultes |
|
7 | - * @ copyright (c) 2008-2013 Event Espresso All Rights Reserved. |
|
8 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
9 | - * @ link http://www.eventespresso.com |
|
10 | - * @ version 4+ |
|
11 | - */ |
|
3 | + * This template will display a single event - copy it to your theme folder |
|
4 | + * |
|
5 | + * @ package Event Espresso |
|
6 | + * @ author Seth Shoultes |
|
7 | + * @ copyright (c) 2008-2013 Event Espresso All Rights Reserved. |
|
8 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
9 | + * @ link http://www.eventespresso.com |
|
10 | + * @ version 4+ |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | /*************************** IMPORTANT ************************* |
14 | 14 | * if you are creating a custom template based on this file, |
@@ -21,22 +21,22 @@ discard block |
||
21 | 21 | * and/or use any of the template tags functions found in: |
22 | 22 | * \wp-content\plugins\event-espresso-core\public\template_tags.php |
23 | 23 | ************************** IMPORTANT **************************/ |
24 | -add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_false' ); |
|
24 | +add_filter('FHEE__content_espresso_events__template_loaded', '__return_false'); |
|
25 | 25 | |
26 | 26 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
27 | 27 | |
28 | 28 | global $post; |
29 | -$event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : ''; |
|
30 | -$event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class ); |
|
29 | +$event_class = has_excerpt($post->ID) ? ' has-excerpt' : ''; |
|
30 | +$event_class = apply_filters('FHEE__content_espresso_events__event_class', $event_class); |
|
31 | 31 | ?> |
32 | -<?php do_action( 'AHEE_event_details_before_post', $post ); ?> |
|
33 | -<article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>> |
|
32 | +<?php do_action('AHEE_event_details_before_post', $post); ?> |
|
33 | +<article id="post-<?php the_ID(); ?>" <?php post_class($event_class); ?>> |
|
34 | 34 | |
35 | -<?php if ( is_single() ) : ?> |
|
35 | +<?php if (is_single()) : ?> |
|
36 | 36 | |
37 | - <div id="espresso-event-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
38 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
39 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
37 | + <div id="espresso-event-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
38 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
39 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
40 | 40 | </div> |
41 | 41 | |
42 | 42 | <div class="espresso-event-wrapper-dv"> |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | <?php //espresso_get_template_part( 'content', 'espresso_events-details' ); ?> |
47 | 47 | <?php //espresso_get_template_part( 'content', 'espresso_events-venues' ); ?> |
48 | 48 | <footer class="event-meta"> |
49 | - <?php do_action( 'AHEE_event_details_footer_top', $post ); ?> |
|
50 | - <?php do_action( 'AHEE_event_details_footer_bottom', $post ); ?> |
|
49 | + <?php do_action('AHEE_event_details_footer_top', $post); ?> |
|
50 | + <?php do_action('AHEE_event_details_footer_bottom', $post); ?> |
|
51 | 51 | </footer> |
52 | 52 | </div> |
53 | 53 | |
54 | -<?php elseif ( is_archive() ) : ?> |
|
54 | +<?php elseif (is_archive()) : ?> |
|
55 | 55 | |
56 | - <div id="espresso-event-list-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
57 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
58 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
56 | + <div id="espresso-event-list-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
57 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
58 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
59 | 59 | </div> |
60 | 60 | |
61 | 61 | <div class="espresso-event-list-wrapper-dv"> |
@@ -70,5 +70,5 @@ discard block |
||
70 | 70 | |
71 | 71 | </article> |
72 | 72 | <!-- #post --> |
73 | -<?php do_action( 'AHEE_event_details_after_post', $post ); |
|
73 | +<?php do_action('AHEE_event_details_after_post', $post); |
|
74 | 74 |
@@ -1,54 +1,54 @@ |
||
1 | 1 | <?php |
2 | 2 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
3 | -if (( is_single() && espresso_display_venue_in_event_details() ) || ( is_archive() && espresso_display_venue_in_event_list() ) ) : |
|
3 | +if ((is_single() && espresso_display_venue_in_event_details()) || (is_archive() && espresso_display_venue_in_event_list())) : |
|
4 | 4 | global $post; |
5 | - do_action( 'AHEE_event_details_before_venue_details', $post ); |
|
6 | - $venue_name = espresso_venue_name( 0, 'details', FALSE ); |
|
7 | - if ( empty( $venue_name ) && espresso_is_venue_private() ) { |
|
8 | - do_action( 'AHEE_event_details_after_venue_details', $post ); |
|
5 | + do_action('AHEE_event_details_before_venue_details', $post); |
|
6 | + $venue_name = espresso_venue_name(0, 'details', FALSE); |
|
7 | + if (empty($venue_name) && espresso_is_venue_private()) { |
|
8 | + do_action('AHEE_event_details_after_venue_details', $post); |
|
9 | 9 | return ''; |
10 | 10 | } |
11 | 11 | ?> |
12 | 12 | |
13 | 13 | <div class="espresso-venue-dv<?php echo espresso_is_venue_private() ? ' espresso-private-venue-dv' : ''; ?>"> |
14 | 14 | <h3 class="event-venues-h3 ee-event-h3"> |
15 | - <?php _e( 'Location', 'event_espresso' ); ?> |
|
15 | + <?php _e('Location', 'event_espresso'); ?> |
|
16 | 16 | </h3> |
17 | - <h4><strong><?php _e( 'Venue:', 'event_espresso' ); ?></strong> <strong> <?php echo $venue_name; ?></strong></h4> |
|
17 | + <h4><strong><?php _e('Venue:', 'event_espresso'); ?></strong> <strong> <?php echo $venue_name; ?></strong></h4> |
|
18 | 18 | <p><span class="smaller-text tags-links"><?php echo espresso_venue_categories(); ?></span></p> |
19 | -<?php if ( $venue_phone = espresso_venue_phone( $post->ID, FALSE )) : ?> |
|
19 | +<?php if ($venue_phone = espresso_venue_phone($post->ID, FALSE)) : ?> |
|
20 | 20 | <p> |
21 | - <span class="small-text"><strong><?php _e( 'Venue Phone:', 'event_espresso' ); ?></strong></span> <?php echo $venue_phone; ?> |
|
21 | + <span class="small-text"><strong><?php _e('Venue Phone:', 'event_espresso'); ?></strong></span> <?php echo $venue_phone; ?> |
|
22 | 22 | </p> |
23 | -<?php endif; ?> |
|
24 | -<?php if ( espresso_venue_has_address( $post->ID )) : ?> |
|
25 | - <strong><span class="dashicons dashicons-location-alt"></span><?php _e( 'Address:', 'event_espresso' ); ?></strong> |
|
26 | - <?php espresso_venue_address( 'inline' ); ?> |
|
27 | - <?php espresso_venue_gmap( $post->ID ); ?> |
|
23 | +<?php endif; ?> |
|
24 | +<?php if (espresso_venue_has_address($post->ID)) : ?> |
|
25 | + <strong><span class="dashicons dashicons-location-alt"></span><?php _e('Address:', 'event_espresso'); ?></strong> |
|
26 | + <?php espresso_venue_address('inline'); ?> |
|
27 | + <?php espresso_venue_gmap($post->ID); ?> |
|
28 | 28 | <div class="clear"><br/></div> |
29 | -<?php endif; ?> |
|
29 | +<?php endif; ?> |
|
30 | 30 | |
31 | - <?php $VNU_ID = espresso_venue_id( $post->ID ); ?> |
|
32 | - <?php if ( is_single() ) : ?> |
|
33 | - <?php $venue_description = espresso_venue_description( $VNU_ID, FALSE ); ?> |
|
34 | - <?php if ( $venue_description ) : ?> |
|
31 | + <?php $VNU_ID = espresso_venue_id($post->ID); ?> |
|
32 | + <?php if (is_single()) : ?> |
|
33 | + <?php $venue_description = espresso_venue_description($VNU_ID, FALSE); ?> |
|
34 | + <?php if ($venue_description) : ?> |
|
35 | 35 | <p> |
36 | - <strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/> |
|
37 | - <?php echo do_shortcode( $venue_description ); ?> |
|
36 | + <strong><?php _e('Description:', 'event_espresso'); ?></strong><br/> |
|
37 | + <?php echo do_shortcode($venue_description); ?> |
|
38 | 38 | </p> |
39 | - <?php endif; ?> |
|
39 | + <?php endif; ?> |
|
40 | 40 | <?php else : ?> |
41 | - <?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?> |
|
42 | - <?php if ( $venue_excerpt ) : ?> |
|
41 | + <?php $venue_excerpt = espresso_venue_excerpt($VNU_ID, FALSE); ?> |
|
42 | + <?php if ($venue_excerpt) : ?> |
|
43 | 43 | <p> |
44 | - <strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/> |
|
44 | + <strong><?php _e('Description:', 'event_espresso'); ?></strong><br/> |
|
45 | 45 | <?php echo $venue_excerpt; ?> |
46 | 46 | </p> |
47 | - <?php endif; ?> |
|
48 | - <?php endif; ?> |
|
47 | + <?php endif; ?> |
|
48 | + <?php endif; ?> |
|
49 | 49 | </div> |
50 | 50 | <!-- .espresso-venue-dv --> |
51 | 51 | <?php |
52 | -do_action( 'AHEE_event_details_after_venue_details', $post ); |
|
52 | +do_action('AHEE_event_details_after_venue_details', $post); |
|
53 | 53 | endif; |
54 | 54 | ?> |