@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -93,7 +93,7 @@ |
||
93 | 93 | * |
94 | 94 | * @abstract |
95 | 95 | * @access protected |
96 | - * @return array |
|
96 | + * @return string[] |
|
97 | 97 | */ |
98 | 98 | protected function _get_table_filters() { |
99 | 99 | $filters = array(); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * This sets up the email messenger for the EE_messages (notifications) subsystem in EE. |
31 | 31 | */ |
32 | -class EE_Email_messenger extends EE_messenger { |
|
32 | +class EE_Email_messenger extends EE_messenger { |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * The following are the properties that email requires for the message going out. |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | protected function _set_valid_shortcodes() { |
76 | 76 | //remember by leaving the other fields not set, those fields will inherit the valid shortcodes from the message type. |
77 | 77 | $this->_valid_shortcodes = array( |
78 | - 'to' => array('email','event_author', 'primary_registration_details', 'recipient_details'), |
|
78 | + 'to' => array('email', 'event_author', 'primary_registration_details', 'recipient_details'), |
|
79 | 79 | 'from' => array('email', 'event_author', 'primary_registration_details', 'recipient_details') |
80 | 80 | ); |
81 | 81 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | 'shortcodes' => array('organization', 'primary_registration_details', 'event_author', 'primary_registration_details', 'recipient_details') |
110 | 110 | ), |
111 | 111 | 'content' => array( |
112 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger') |
|
112 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger') |
|
113 | 113 | ), |
114 | 114 | 'attendee_list' => array( |
115 | 115 | 'shortcodes' => array('attendee', 'event_list', 'ticket_list'), |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'required' => array('[EVENT_LIST]') |
121 | 121 | ), |
122 | 122 | 'ticket_list' => array( |
123 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'recipient_details'), |
|
123 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'recipient_details'), |
|
124 | 124 | 'required' => array('[TICKET_LIST]') |
125 | 125 | ), |
126 | 126 | 'datetime_list' => array( |
@@ -139,21 +139,21 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @since 4.5.0 |
141 | 141 | */ |
142 | - public function do_secondary_messenger_hooks( $sending_messenger_name ) { |
|
143 | - if ( $sending_messenger_name = 'html' ) { |
|
144 | - add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 ); |
|
142 | + public function do_secondary_messenger_hooks($sending_messenger_name) { |
|
143 | + if ($sending_messenger_name = 'html') { |
|
144 | + add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | 148 | |
149 | 149 | |
150 | 150 | |
151 | - public function add_email_css( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack ) { |
|
151 | + public function add_email_css($variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack) { |
|
152 | 152 | //prevent recursion on this callback. |
153 | - remove_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10 ); |
|
154 | - $variation = $this->get_variation( $template_pack, $message_type, $url, 'main', $variation, FALSE ); |
|
153 | + remove_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10); |
|
154 | + $variation = $this->get_variation($template_pack, $message_type, $url, 'main', $variation, FALSE); |
|
155 | 155 | |
156 | - add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 ); |
|
156 | + add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8); |
|
157 | 157 | return $variation; |
158 | 158 | } |
159 | 159 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | 'required' => FALSE, |
186 | 186 | 'validation' => FALSE, |
187 | 187 | 'format' => '%s', |
188 | - 'value' => sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') ), |
|
188 | + 'value' => sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name')), |
|
189 | 189 | 'default'=> '', |
190 | 190 | 'css_class' => '' |
191 | 191 | ) |
@@ -348,8 +348,8 @@ discard block |
||
348 | 348 | */ |
349 | 349 | protected function _send_message() { |
350 | 350 | return wp_mail( |
351 | - html_entity_decode( $this->_to, ENT_QUOTES, "UTF-8" ), |
|
352 | - stripslashes( html_entity_decode( $this->_subject, ENT_QUOTES, "UTF-8" )), |
|
351 | + html_entity_decode($this->_to, ENT_QUOTES, "UTF-8"), |
|
352 | + stripslashes(html_entity_decode($this->_subject, ENT_QUOTES, "UTF-8")), |
|
353 | 353 | $this->_body(), |
354 | 354 | $this->_headers() |
355 | 355 | ); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | * @return string html body of the message content and the related css. |
364 | 364 | */ |
365 | 365 | protected function _preview() { |
366 | - return $this->_body( TRUE ); |
|
366 | + return $this->_body(TRUE); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | |
@@ -377,18 +377,18 @@ discard block |
||
377 | 377 | * @return string formatted header for email |
378 | 378 | */ |
379 | 379 | protected function _headers() { |
380 | - $from = stripslashes_deep( html_entity_decode($this->_from, ENT_QUOTES,"UTF-8" ) ); |
|
380 | + $from = stripslashes_deep(html_entity_decode($this->_from, ENT_QUOTES, "UTF-8")); |
|
381 | 381 | $headers = array( |
382 | 382 | 'MIME-Version: 1.0', |
383 | - 'From:' . $from, |
|
384 | - 'Reply-To:' . $from, |
|
383 | + 'From:'.$from, |
|
384 | + 'Reply-To:'.$from, |
|
385 | 385 | 'Content-Type:text/html; charset=utf-8' |
386 | 386 | ); |
387 | 387 | |
388 | 388 | //but wait! Header's for the from is NOT reliable because some plugins don't respect From: as set in the header. |
389 | - add_filter( 'wp_mail_from', array( $this, 'set_from_address' ), 100 ); |
|
390 | - add_filter( 'wp_mail_from_name', array( $this, 'set_from_name' ), 100 ); |
|
391 | - return apply_filters( 'FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this ); |
|
389 | + add_filter('wp_mail_from', array($this, 'set_from_address'), 100); |
|
390 | + add_filter('wp_mail_from_name', array($this, 'set_from_name'), 100); |
|
391 | + return apply_filters('FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this); |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | |
@@ -404,19 +404,19 @@ discard block |
||
404 | 404 | * @return array |
405 | 405 | */ |
406 | 406 | private function _parse_from() { |
407 | - if ( strpos( $this->_from, '<' ) !== false ) { |
|
408 | - $from_name = substr( $this->_from, 0, strpos( $this->_from, '<' ) - 1 ); |
|
409 | - $from_name = str_replace( '"', '', $from_name ); |
|
410 | - $from_name = trim( $from_name ); |
|
411 | - |
|
412 | - $from_email = substr( $this->_from, strpos( $this->_from, '<' ) + 1 ); |
|
413 | - $from_email = str_replace( '>', '', $from_email ); |
|
414 | - $from_email = trim( $from_email ); |
|
407 | + if (strpos($this->_from, '<') !== false) { |
|
408 | + $from_name = substr($this->_from, 0, strpos($this->_from, '<') - 1); |
|
409 | + $from_name = str_replace('"', '', $from_name); |
|
410 | + $from_name = trim($from_name); |
|
411 | + |
|
412 | + $from_email = substr($this->_from, strpos($this->_from, '<') + 1); |
|
413 | + $from_email = str_replace('>', '', $from_email); |
|
414 | + $from_email = trim($from_email); |
|
415 | 415 | } else { |
416 | 416 | $from_name = ''; |
417 | - $from_email = trim( $this->_from ); |
|
417 | + $from_email = trim($this->_from); |
|
418 | 418 | } |
419 | - return array( $from_name, $from_email ); |
|
419 | + return array($from_name, $from_email); |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | * |
430 | 430 | * @param string $from_email What the original from_email is. |
431 | 431 | */ |
432 | - public function set_from_address( $from_email ) { |
|
432 | + public function set_from_address($from_email) { |
|
433 | 433 | $parsed_from = $this->_parse_from(); |
434 | 434 | return $parsed_from[1]; |
435 | 435 | } |
@@ -444,13 +444,13 @@ discard block |
||
444 | 444 | * |
445 | 445 | * @param string $from_name The original from_name. |
446 | 446 | */ |
447 | - public function set_from_name( $from_name ) { |
|
447 | + public function set_from_name($from_name) { |
|
448 | 448 | $parsed_from = $this->_parse_from(); |
449 | - if ( is_array( $parsed_from) && ! empty( $parsed_from[0] ) ) { |
|
450 | - $from_name = $parsed_from[0]; |
|
449 | + if (is_array($parsed_from) && ! empty($parsed_from[0])) { |
|
450 | + $from_name = $parsed_from[0]; |
|
451 | 451 | } |
452 | 452 | |
453 | - return stripslashes_deep( html_entity_decode($from_name, ENT_QUOTES,"UTF-8" ) ); |
|
453 | + return stripslashes_deep(html_entity_decode($from_name, ENT_QUOTES, "UTF-8")); |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | |
@@ -461,14 +461,14 @@ discard block |
||
461 | 461 | * @param bool $preview will determine whether this is preview template or not. |
462 | 462 | * @return string formatted body for email. |
463 | 463 | */ |
464 | - protected function _body( $preview = FALSE ) { |
|
464 | + protected function _body($preview = FALSE) { |
|
465 | 465 | //setup template args! |
466 | 466 | $this->_template_args = array( |
467 | 467 | 'subject' => $this->_subject, |
468 | 468 | 'from' => $this->_from, |
469 | - 'main_body' => wpautop(stripslashes_deep( html_entity_decode($this->_content, ENT_QUOTES,"UTF-8" ) )) |
|
469 | + 'main_body' => wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8"))) |
|
470 | 470 | ); |
471 | - $body = $this->_get_main_template( $preview ); |
|
471 | + $body = $this->_get_main_template($preview); |
|
472 | 472 | |
473 | 473 | /** |
474 | 474 | * This filter allows one to bypass the CSSToInlineStyles tool and leave the body untouched. |
@@ -476,17 +476,17 @@ discard block |
||
476 | 476 | * @type bool $preview Indicates whether a preview is being generated or not. |
477 | 477 | * @return bool true indicates to use the inliner, false bypasses it. |
478 | 478 | */ |
479 | - if ( apply_filters( 'FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview ) ) { |
|
479 | + if (apply_filters('FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview)) { |
|
480 | 480 | |
481 | 481 | //require CssToInlineStyles library and its dependencies via composer autoloader |
482 | - require_once EE_THIRD_PARTY . 'cssinliner/vendor/autoload.php'; |
|
482 | + require_once EE_THIRD_PARTY.'cssinliner/vendor/autoload.php'; |
|
483 | 483 | |
484 | 484 | //now if this isn't a preview, let's setup the body so it has inline styles |
485 | - if ( ! $preview || ( $preview && defined( 'DOING_AJAX' ) ) ) { |
|
486 | - $style = file_get_contents( $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation ), TRUE ); |
|
487 | - $CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles( $body, $style ); |
|
488 | - $body = ltrim( $CSS->convert( true ), ">\n" ); //for some reason the library has a bracket and new line at the beginning. This takes care of that. |
|
489 | - $body = ltrim( $body, "<?" ); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609 |
|
485 | + if ( ! $preview || ($preview && defined('DOING_AJAX'))) { |
|
486 | + $style = file_get_contents($this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation), TRUE); |
|
487 | + $CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles($body, $style); |
|
488 | + $body = ltrim($CSS->convert(true), ">\n"); //for some reason the library has a bracket and new line at the beginning. This takes care of that. |
|
489 | + $body = ltrim($body, "<?"); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609 |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | } |
@@ -505,8 +505,8 @@ discard block |
||
505 | 505 | public function get_existing_test_settings() { |
506 | 506 | $settings = parent::get_existing_test_settings(); |
507 | 507 | //override subject if present because we always want it to be fresh. |
508 | - if ( is_array( $settings ) && ! empty( $settings['subject'] ) ) { |
|
509 | - $settings['subject'] = sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') ); |
|
508 | + if (is_array($settings) && ! empty($settings['subject'])) { |
|
509 | + $settings['subject'] = sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name')); |
|
510 | 510 | } |
511 | 511 | return $settings; |
512 | 512 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Registration_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'registration'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
48 | 48 | 'required' => array('[EVENT_LIST]') |
49 | 49 | ); |
50 | - $this->_MSGR->set_validator_config( $new_config ); |
|
50 | + $this->_MSGR->set_validator_config($new_config); |
|
51 | 51 | |
52 | - if ( $this->_context != 'admin' ) |
|
52 | + if ($this->_context != 'admin') |
|
53 | 53 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
54 | 54 | |
55 | 55 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | ); |
50 | 51 | $this->_MSGR->set_validator_config( $new_config ); |
51 | 52 | |
52 | - if ( $this->_context != 'admin' ) |
|
53 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
53 | + if ( $this->_context != 'admin' ) { |
|
54 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
56 | 58 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Payment_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'payment'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | |
46 | 46 | //modify just event_list |
47 | 47 | $new_config['event_list'] = array( |
48 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
48 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
49 | 49 | ); |
50 | 50 | $new_config['ticket_list'] = array( |
51 | 51 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
52 | 52 | ); |
53 | 53 | $new_config['content'] = array( |
54 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
54 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
55 | 55 | ); |
56 | - $this->_MSGR->set_validator_config( $new_config ); |
|
56 | + $this->_MSGR->set_validator_config($new_config); |
|
57 | 57 | |
58 | - if ( $this->_context != 'admin' ) |
|
58 | + if ($this->_context != 'admin') |
|
59 | 59 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
60 | 60 | |
61 | 61 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | ); |
50 | 51 | $this->_MSGR->set_validator_config( $new_config ); |
51 | 52 | |
52 | - if ( $this->_context != 'admin' ) |
|
53 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
53 | + if ( $this->_context != 'admin' ) { |
|
54 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
56 | 58 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Registration_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'registration'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
48 | 48 | 'required' => array('[EVENT_LIST]') |
49 | 49 | ); |
50 | - $this->_MSGR->set_validator_config( $new_config ); |
|
50 | + $this->_MSGR->set_validator_config($new_config); |
|
51 | 51 | |
52 | - if ( $this->_context != 'admin' ) |
|
52 | + if ($this->_context != 'admin') |
|
53 | 53 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
54 | 54 | |
55 | 55 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | ); |
50 | 51 | $this->_MSGR->set_validator_config( $new_config ); |
51 | 52 | |
52 | - if ( $this->_context != 'admin' ) |
|
53 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
53 | + if ( $this->_context != 'admin' ) { |
|
54 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
56 | 58 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Registration_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'registration'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
48 | 48 | 'required' => array('[EVENT_LIST]') |
49 | 49 | ); |
50 | - $this->_MSGR->set_validator_config( $new_config ); |
|
50 | + $this->_MSGR->set_validator_config($new_config); |
|
51 | 51 | |
52 | - if ( $this->_context != 'admin' ) |
|
52 | + if ($this->_context != 'admin') |
|
53 | 53 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
54 | 54 | |
55 | 55 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | ); |
50 | 51 | $this->_MSGR->set_validator_config( $new_config ); |
51 | 52 | |
52 | - if ( $this->_context != 'admin' ) |
|
53 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
53 | + if ( $this->_context != 'admin' ) { |
|
54 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
56 | 58 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | 11 | |
12 | 12 | /** |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | */ |
25 | 25 | class EE_Messages_Html_Receipt_Validator extends EE_Messages_Validator { |
26 | 26 | |
27 | - public function __construct( $fields, $context ) { |
|
27 | + public function __construct($fields, $context) { |
|
28 | 28 | $this->_m_name = 'html'; |
29 | 29 | $this->_mt_name = 'receipt'; |
30 | 30 | |
31 | - parent::__construct( $fields, $context ); |
|
31 | + parent::__construct($fields, $context); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This contains the class for the Html+Invoice Message Template Validator. |
|
4 | - * |
|
5 | - * @since 4.5.0 |
|
6 | - * @package Event Espresso |
|
7 | - * @subpackage messages |
|
8 | - */ |
|
3 | + * This contains the class for the Html+Invoice Message Template Validator. |
|
4 | + * |
|
5 | + * @since 4.5.0 |
|
6 | + * @package Event Espresso |
|
7 | + * @subpackage messages |
|
8 | + */ |
|
9 | 9 | if (!defined('EVENT_ESPRESSO_VERSION') ) |
10 | 10 | exit('NO direct script access allowed'); |
11 | 11 |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | * @param string $shortcode |
62 | 62 | * @return string |
63 | 63 | */ |
64 | - protected function _parser( $shortcode ) { |
|
64 | + protected function _parser($shortcode) { |
|
65 | 65 | |
66 | - if ( ! $this->_data instanceof EE_Datetime ) { |
|
66 | + if ( ! $this->_data instanceof EE_Datetime) { |
|
67 | 67 | return ''; //get out cause we can only parse with the datetime object. |
68 | 68 | } |
69 | 69 | |
70 | - switch ( $shortcode ) { |
|
70 | + switch ($shortcode) { |
|
71 | 71 | |
72 | 72 | case '[DATETIME_START]' : |
73 | 73 | return $this->_data->get_i18n_datetime('DTT_EVT_start'); |
@@ -81,27 +81,27 @@ discard block |
||
81 | 81 | return $this->_data->get_timezone(); |
82 | 82 | break; |
83 | 83 | case '[DATE_START]' : |
84 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'date_format' ) ); |
|
84 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('date_format')); |
|
85 | 85 | break; |
86 | 86 | case '[DATE_END]' : |
87 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'date_format' ) ); |
|
87 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('date_format')); |
|
88 | 88 | break; |
89 | 89 | case '[TIME_START]' : |
90 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'time_format' ) ); |
|
90 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('time_format')); |
|
91 | 91 | break; |
92 | 92 | case '[TIME_END]' : |
93 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'time_format' ) ); |
|
93 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('time_format')); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | |
97 | - if ( strpos( $shortcode, '[ICAL_LINK_*') !== FALSE ) { |
|
98 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
97 | + if (strpos($shortcode, '[ICAL_LINK_*') !== FALSE) { |
|
98 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
99 | 99 | |
100 | - $link_text = empty( $attrs['link_text'] ) ? __( 'Add to iCal Calendar', 'event_espresso' ) : $attrs['link_text']; |
|
100 | + $link_text = empty($attrs['link_text']) ? __('Add to iCal Calendar', 'event_espresso') : $attrs['link_text']; |
|
101 | 101 | |
102 | - $URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $this->_data->ID() ), site_url() ); |
|
102 | + $URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $this->_data->ID()), site_url()); |
|
103 | 103 | |
104 | - return '<a class="ee-ical" href="' . $URL . '">' . $link_text . '</a>'; |
|
104 | + return '<a class="ee-ical" href="'.$URL.'">'.$link_text.'</a>'; |
|
105 | 105 | |
106 | 106 | } |
107 | 107 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -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 |