@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @type bool $show_gravatar whether to show gravatar or not. |
16 | 16 | */ |
17 | 17 | |
18 | -$no_attendees_message = apply_filters( 'FHEE__loop-espresso_attendees-shortcode__template__no_attendees_message', __('No Attendees Yet', 'event_espresso' ) ); |
|
18 | +$no_attendees_message = apply_filters('FHEE__loop-espresso_attendees-shortcode__template__no_attendees_message', __('No Attendees Yet', 'event_espresso')); |
|
19 | 19 | |
20 | 20 | |
21 | 21 | ?> |
@@ -31,16 +31,16 @@ discard block |
||
31 | 31 | $show_gravatar, |
32 | 32 | ) |
33 | 33 | ); ?> |
34 | - <?php if ( $contacts ) : ?> |
|
34 | + <?php if ($contacts) : ?> |
|
35 | 35 | <ul class="event-attendees-list"> |
36 | - <?php foreach( $contacts as $contact ) : |
|
37 | - EEH_Template::get_template_part( 'content', 'espresso_event_attendees', array( |
|
36 | + <?php foreach ($contacts as $contact) : |
|
37 | + EEH_Template::get_template_part('content', 'espresso_event_attendees', array( |
|
38 | 38 | 'contact' => $contact, |
39 | 39 | 'event' => $event, |
40 | 40 | 'datetime' => $datetime, |
41 | 41 | 'ticket' => $ticket, |
42 | 42 | 'show_gravatar' => $show_gravatar |
43 | - ) ); |
|
43 | + )); |
|
44 | 44 | endforeach; ?> |
45 | 45 | </ul> |
46 | 46 | <?php else : ?> |
@@ -22,15 +22,15 @@ discard block |
||
22 | 22 | |
23 | 23 | <div class="event-attendees"> |
24 | 24 | <?php do_action_ref_array( |
25 | - 'AHEE__loop-espresso_event_attendees__before', |
|
26 | - array( |
|
27 | - $contacts, |
|
28 | - $event, |
|
29 | - $datetime, |
|
30 | - $ticket, |
|
31 | - $show_gravatar, |
|
32 | - ) |
|
33 | - ); ?> |
|
25 | + 'AHEE__loop-espresso_event_attendees__before', |
|
26 | + array( |
|
27 | + $contacts, |
|
28 | + $event, |
|
29 | + $datetime, |
|
30 | + $ticket, |
|
31 | + $show_gravatar, |
|
32 | + ) |
|
33 | + ); ?> |
|
34 | 34 | <?php if ( $contacts ) : ?> |
35 | 35 | <ul class="event-attendees-list"> |
36 | 36 | <?php foreach( $contacts as $contact ) : |
@@ -47,13 +47,13 @@ discard block |
||
47 | 47 | <p><?php echo esc_html($no_attendees_message); ?></p> |
48 | 48 | <?php endif; ?> |
49 | 49 | <?php do_action_ref_array( |
50 | - 'AHEE__loop-espresso_event_attendees__after', |
|
51 | - array( |
|
52 | - $contacts, |
|
53 | - $event, |
|
54 | - $datetime, |
|
55 | - $ticket, |
|
56 | - $show_gravatar, |
|
57 | - ) |
|
58 | - ); ?> |
|
50 | + 'AHEE__loop-espresso_event_attendees__after', |
|
51 | + array( |
|
52 | + $contacts, |
|
53 | + $event, |
|
54 | + $datetime, |
|
55 | + $ticket, |
|
56 | + $show_gravatar, |
|
57 | + ) |
|
58 | + ); ?> |
|
59 | 59 | </div> |
60 | 60 | \ No newline at end of file |
@@ -43,8 +43,11 @@ |
||
43 | 43 | ) ); |
44 | 44 | endforeach; ?> |
45 | 45 | </ul> |
46 | - <?php else : ?> |
|
47 | - <p><?php echo esc_html($no_attendees_message); ?></p> |
|
46 | + <?php else { |
|
47 | + : ?> |
|
48 | + <p><?php echo esc_html($no_attendees_message); |
|
49 | +} |
|
50 | +?></p> |
|
48 | 51 | <?php endif; ?> |
49 | 52 | <?php do_action_ref_array( |
50 | 53 | 'AHEE__loop-espresso_event_attendees__after', |
@@ -16,129 +16,129 @@ |
||
16 | 16 | interface NoticesContainerInterface |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @param string $notice |
|
21 | - * @param bool $dismissible |
|
22 | - * @param string $file |
|
23 | - * @param string $func |
|
24 | - * @param string $line |
|
25 | - */ |
|
26 | - public function addInformation($notice, $dismissible = true, $file = '', $func = '', $line = ''); |
|
19 | + /** |
|
20 | + * @param string $notice |
|
21 | + * @param bool $dismissible |
|
22 | + * @param string $file |
|
23 | + * @param string $func |
|
24 | + * @param string $line |
|
25 | + */ |
|
26 | + public function addInformation($notice, $dismissible = true, $file = '', $func = '', $line = ''); |
|
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * @param string $notice |
|
31 | - * @param bool $dismissible |
|
32 | - * @param string $file |
|
33 | - * @param string $func |
|
34 | - * @param string $line |
|
35 | - * @return |
|
36 | - */ |
|
37 | - public function addAttention($notice, $dismissible = true, $file = '', $func = '', $line = ''); |
|
29 | + /** |
|
30 | + * @param string $notice |
|
31 | + * @param bool $dismissible |
|
32 | + * @param string $file |
|
33 | + * @param string $func |
|
34 | + * @param string $line |
|
35 | + * @return |
|
36 | + */ |
|
37 | + public function addAttention($notice, $dismissible = true, $file = '', $func = '', $line = ''); |
|
38 | 38 | |
39 | 39 | |
40 | 40 | |
41 | - /** |
|
42 | - * @param string $notice |
|
43 | - * @param bool $dismissible |
|
44 | - * @param string $file |
|
45 | - * @param string $func |
|
46 | - * @param string $line |
|
47 | - */ |
|
48 | - public function addError($notice, $dismissible = true, $file, $func, $line); |
|
41 | + /** |
|
42 | + * @param string $notice |
|
43 | + * @param bool $dismissible |
|
44 | + * @param string $file |
|
45 | + * @param string $func |
|
46 | + * @param string $line |
|
47 | + */ |
|
48 | + public function addError($notice, $dismissible = true, $file, $func, $line); |
|
49 | 49 | |
50 | 50 | |
51 | 51 | |
52 | - /** |
|
53 | - * @param string $notice |
|
54 | - * @param bool $dismissible |
|
55 | - * @param string $file |
|
56 | - * @param string $func |
|
57 | - * @param string $line |
|
58 | - */ |
|
59 | - public function addSuccess($notice, $dismissible = true, $file = '', $func = '', $line = ''); |
|
52 | + /** |
|
53 | + * @param string $notice |
|
54 | + * @param bool $dismissible |
|
55 | + * @param string $file |
|
56 | + * @param string $func |
|
57 | + * @param string $line |
|
58 | + */ |
|
59 | + public function addSuccess($notice, $dismissible = true, $file = '', $func = '', $line = ''); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | - /** |
|
64 | - * @return boolean |
|
65 | - */ |
|
66 | - public function hasInformation(); |
|
63 | + /** |
|
64 | + * @return boolean |
|
65 | + */ |
|
66 | + public function hasInformation(); |
|
67 | 67 | |
68 | 68 | |
69 | 69 | |
70 | - /** |
|
71 | - * @return boolean |
|
72 | - */ |
|
73 | - public function hasAttention(); |
|
70 | + /** |
|
71 | + * @return boolean |
|
72 | + */ |
|
73 | + public function hasAttention(); |
|
74 | 74 | |
75 | 75 | |
76 | 76 | |
77 | - /** |
|
78 | - * @return boolean |
|
79 | - */ |
|
80 | - public function hasError(); |
|
77 | + /** |
|
78 | + * @return boolean |
|
79 | + */ |
|
80 | + public function hasError(); |
|
81 | 81 | |
82 | 82 | |
83 | 83 | |
84 | - /** |
|
85 | - * @return boolean |
|
86 | - */ |
|
87 | - public function hasSuccess(); |
|
84 | + /** |
|
85 | + * @return boolean |
|
86 | + */ |
|
87 | + public function hasSuccess(); |
|
88 | 88 | |
89 | 89 | |
90 | 90 | |
91 | - /** |
|
92 | - * @return int |
|
93 | - */ |
|
94 | - public function countInformation(); |
|
91 | + /** |
|
92 | + * @return int |
|
93 | + */ |
|
94 | + public function countInformation(); |
|
95 | 95 | |
96 | 96 | |
97 | 97 | |
98 | - /** |
|
99 | - * @return int |
|
100 | - */ |
|
101 | - public function countAttention(); |
|
98 | + /** |
|
99 | + * @return int |
|
100 | + */ |
|
101 | + public function countAttention(); |
|
102 | 102 | |
103 | 103 | |
104 | 104 | |
105 | - /** |
|
106 | - * @return int |
|
107 | - */ |
|
108 | - public function countError(); |
|
105 | + /** |
|
106 | + * @return int |
|
107 | + */ |
|
108 | + public function countError(); |
|
109 | 109 | |
110 | 110 | |
111 | 111 | |
112 | - /** |
|
113 | - * @return int |
|
114 | - */ |
|
115 | - public function countSuccess(); |
|
112 | + /** |
|
113 | + * @return int |
|
114 | + */ |
|
115 | + public function countSuccess(); |
|
116 | 116 | |
117 | 117 | |
118 | 118 | |
119 | - /** |
|
120 | - * @return NoticeInterface[] |
|
121 | - */ |
|
122 | - public function getInformation(); |
|
119 | + /** |
|
120 | + * @return NoticeInterface[] |
|
121 | + */ |
|
122 | + public function getInformation(); |
|
123 | 123 | |
124 | 124 | |
125 | 125 | |
126 | - /** |
|
127 | - * @return NoticeInterface[] |
|
128 | - */ |
|
129 | - public function getAttention(); |
|
126 | + /** |
|
127 | + * @return NoticeInterface[] |
|
128 | + */ |
|
129 | + public function getAttention(); |
|
130 | 130 | |
131 | 131 | |
132 | 132 | |
133 | - /** |
|
134 | - * @return NoticeInterface[] |
|
135 | - */ |
|
136 | - public function getError(); |
|
133 | + /** |
|
134 | + * @return NoticeInterface[] |
|
135 | + */ |
|
136 | + public function getError(); |
|
137 | 137 | |
138 | 138 | |
139 | 139 | |
140 | - /** |
|
141 | - * @return NoticeInterface[] |
|
142 | - */ |
|
143 | - public function getSuccess(); |
|
140 | + /** |
|
141 | + * @return NoticeInterface[] |
|
142 | + */ |
|
143 | + public function getSuccess(); |
|
144 | 144 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $error_string = esc_html__('The following errors occurred:', 'event_espresso'); |
37 | 37 | foreach ($notices->getError() as $notice) { |
38 | 38 | if ($this->getThrowExceptions()) { |
39 | - $error_string .= '<br />' . $notice->message(); |
|
39 | + $error_string .= '<br />'.$notice->message(); |
|
40 | 40 | } else { |
41 | 41 | new AdminNotice($notice); |
42 | 42 | } |
@@ -14,42 +14,42 @@ |
||
14 | 14 | class ConvertNoticesToAdminNotices extends NoticeConverter |
15 | 15 | { |
16 | 16 | |
17 | - /** |
|
18 | - * Converts Notice objects into AdminNotice notifications |
|
19 | - * |
|
20 | - * @param NoticesContainerInterface $notices |
|
21 | - * @throws DomainException |
|
22 | - */ |
|
23 | - public function process(NoticesContainerInterface $notices) |
|
24 | - { |
|
25 | - if ($notices->hasAttention()) { |
|
26 | - foreach ($notices->getAttention() as $notice) { |
|
27 | - new AdminNotice($notice); |
|
28 | - } |
|
29 | - } |
|
30 | - if ($notices->hasError()) { |
|
31 | - $error_string = esc_html__('The following errors occurred:', 'event_espresso'); |
|
32 | - foreach ($notices->getError() as $notice) { |
|
33 | - if ($this->getThrowExceptions()) { |
|
34 | - $error_string .= '<br />' . $notice->message(); |
|
35 | - } else { |
|
36 | - new AdminNotice($notice); |
|
37 | - } |
|
38 | - } |
|
39 | - if ($this->getThrowExceptions()) { |
|
40 | - throw new DomainException($error_string); |
|
41 | - } |
|
42 | - } |
|
43 | - if ($notices->hasSuccess()) { |
|
44 | - foreach ($notices->getSuccess() as $notice) { |
|
45 | - new AdminNotice($notice); |
|
46 | - } |
|
47 | - } |
|
48 | - if ($notices->hasInformation()) { |
|
49 | - foreach ($notices->getInformation() as $notice) { |
|
50 | - new AdminNotice($notice); |
|
51 | - } |
|
52 | - } |
|
53 | - $this->clearNotices(); |
|
54 | - } |
|
17 | + /** |
|
18 | + * Converts Notice objects into AdminNotice notifications |
|
19 | + * |
|
20 | + * @param NoticesContainerInterface $notices |
|
21 | + * @throws DomainException |
|
22 | + */ |
|
23 | + public function process(NoticesContainerInterface $notices) |
|
24 | + { |
|
25 | + if ($notices->hasAttention()) { |
|
26 | + foreach ($notices->getAttention() as $notice) { |
|
27 | + new AdminNotice($notice); |
|
28 | + } |
|
29 | + } |
|
30 | + if ($notices->hasError()) { |
|
31 | + $error_string = esc_html__('The following errors occurred:', 'event_espresso'); |
|
32 | + foreach ($notices->getError() as $notice) { |
|
33 | + if ($this->getThrowExceptions()) { |
|
34 | + $error_string .= '<br />' . $notice->message(); |
|
35 | + } else { |
|
36 | + new AdminNotice($notice); |
|
37 | + } |
|
38 | + } |
|
39 | + if ($this->getThrowExceptions()) { |
|
40 | + throw new DomainException($error_string); |
|
41 | + } |
|
42 | + } |
|
43 | + if ($notices->hasSuccess()) { |
|
44 | + foreach ($notices->getSuccess() as $notice) { |
|
45 | + new AdminNotice($notice); |
|
46 | + } |
|
47 | + } |
|
48 | + if ($notices->hasInformation()) { |
|
49 | + foreach ($notices->getInformation() as $notice) { |
|
50 | + new AdminNotice($notice); |
|
51 | + } |
|
52 | + } |
|
53 | + $this->clearNotices(); |
|
54 | + } |
|
55 | 55 | } |
@@ -12,32 +12,32 @@ |
||
12 | 12 | class EE_Button_Display_Strategy extends EE_Display_Strategy_Base |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * @return string of html to display the input |
|
17 | - */ |
|
18 | - public function display() |
|
19 | - { |
|
20 | - $default_value = $this->_input->get_default(); |
|
21 | - if ($this->_input->get_normalization_strategy() instanceof EE_Normalization_Strategy_Base) { |
|
22 | - $default_value = $this->_input->get_normalization_strategy()->unnormalize($default_value); |
|
23 | - } |
|
24 | - $html = $this->_opening_tag('button'); |
|
25 | - $html .= $this->_attributes_string( |
|
26 | - array_merge( |
|
27 | - $this->_standard_attributes_array(), |
|
28 | - array( |
|
29 | - 'value' => $default_value, |
|
30 | - ) |
|
31 | - ) |
|
32 | - ); |
|
33 | - if ($this->_input instanceof EE_Button_Input) { |
|
34 | - $button_content = $this->_input->button_content(); |
|
35 | - } else { |
|
36 | - $button_content = $this->_input->get_default(); |
|
37 | - } |
|
38 | - $html .= '>'; |
|
39 | - $html .= $button_content; |
|
40 | - $html .= $this->_closing_tag(); |
|
41 | - return $html; |
|
42 | - } |
|
15 | + /** |
|
16 | + * @return string of html to display the input |
|
17 | + */ |
|
18 | + public function display() |
|
19 | + { |
|
20 | + $default_value = $this->_input->get_default(); |
|
21 | + if ($this->_input->get_normalization_strategy() instanceof EE_Normalization_Strategy_Base) { |
|
22 | + $default_value = $this->_input->get_normalization_strategy()->unnormalize($default_value); |
|
23 | + } |
|
24 | + $html = $this->_opening_tag('button'); |
|
25 | + $html .= $this->_attributes_string( |
|
26 | + array_merge( |
|
27 | + $this->_standard_attributes_array(), |
|
28 | + array( |
|
29 | + 'value' => $default_value, |
|
30 | + ) |
|
31 | + ) |
|
32 | + ); |
|
33 | + if ($this->_input instanceof EE_Button_Input) { |
|
34 | + $button_content = $this->_input->button_content(); |
|
35 | + } else { |
|
36 | + $button_content = $this->_input->get_default(); |
|
37 | + } |
|
38 | + $html .= '>'; |
|
39 | + $html .= $button_content; |
|
40 | + $html .= $this->_closing_tag(); |
|
41 | + return $html; |
|
42 | + } |
|
43 | 43 | } |
@@ -91,7 +91,7 @@ |
||
91 | 91 | public function __construct($slug, $description) |
92 | 92 | { |
93 | 93 | parent::__construct($slug, $description); |
94 | - if (! in_array($this->slug(), $this->validRequestTypes(), true)) { |
|
94 | + if ( ! in_array($this->slug(), $this->validRequestTypes(), true)) { |
|
95 | 95 | throw new InvalidArgumentException( |
96 | 96 | sprintf( |
97 | 97 | esc_html__( |
@@ -16,185 +16,185 @@ |
||
16 | 16 | class RequestTypeContext extends Context |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * indicates that the current request involves some form of activation |
|
21 | - */ |
|
22 | - const ACTIVATION = 'activation-request'; |
|
23 | - |
|
24 | - /** |
|
25 | - * indicates that the current request is for the admin but is not being made via AJAX |
|
26 | - */ |
|
27 | - const ADMIN = 'non-ajax-admin-request'; |
|
28 | - |
|
29 | - /** |
|
30 | - * indicates that the current request is for the admin AND is being made via AJAX |
|
31 | - */ |
|
32 | - const AJAX_ADMIN = 'admin-ajax-request'; |
|
33 | - |
|
34 | - /** |
|
35 | - * indicates that the current request is for the frontend AND is being made via AJAX |
|
36 | - */ |
|
37 | - const AJAX_FRONT = 'frontend-ajax-request'; |
|
38 | - |
|
39 | - /** |
|
40 | - * indicates that the current request is for the WP Heartbeat |
|
41 | - */ |
|
42 | - const AJAX_HEARTBEAT = 'admin-ajax-heartbeat'; |
|
43 | - |
|
44 | - /** |
|
45 | - * indicates that the current request is being made via AJAX, but is NOT for EE |
|
46 | - */ |
|
47 | - const AJAX_OTHER = 'other-ajax-request'; |
|
48 | - |
|
49 | - /** |
|
50 | - * indicates that the current request is for the EE REST API |
|
51 | - */ |
|
52 | - const API = 'rest-api'; |
|
53 | - |
|
54 | - /** |
|
55 | - * indicates that the current request is from the command line |
|
56 | - */ |
|
57 | - const CLI = 'command-line'; |
|
58 | - |
|
59 | - /** |
|
60 | - * indicates that the current request is for a WP_Cron |
|
61 | - */ |
|
62 | - const CRON = 'wp-cron'; |
|
63 | - |
|
64 | - /** |
|
65 | - * indicates that the current request is for a feed (ie: RSS) |
|
66 | - */ |
|
67 | - const FEED = 'feed-request'; |
|
68 | - |
|
69 | - /** |
|
70 | - * indicates that the current request is for the frontend but is not being made via AJAX |
|
71 | - */ |
|
72 | - const FRONTEND = 'non-ajax-frontend-request'; |
|
73 | - |
|
74 | - /** |
|
75 | - * indicates that the current request is for content that is to be displayed within an iframe |
|
76 | - */ |
|
77 | - const IFRAME = 'iframe-request'; |
|
78 | - |
|
79 | - /** |
|
80 | - * indicates that the current request is for the EE GraphQL manager |
|
81 | - */ |
|
82 | - const GQL = 'graphql'; |
|
83 | - |
|
84 | - /** |
|
85 | - * indicates that the current request is for the WP REST API |
|
86 | - */ |
|
87 | - const WP_API = 'wp-rest-api'; |
|
88 | - |
|
89 | - /** |
|
90 | - * indicates that the current request is a loopback sent from WP core to test for errors |
|
91 | - */ |
|
92 | - const WP_SCRAPE = 'wordpress-scrape'; |
|
93 | - |
|
94 | - /** |
|
95 | - * @var boolean $is_activation |
|
96 | - */ |
|
97 | - private $is_activation = false; |
|
98 | - |
|
99 | - /** |
|
100 | - * @var boolean $is_unit_testing |
|
101 | - */ |
|
102 | - private $is_unit_testing = false; |
|
103 | - |
|
104 | - /** |
|
105 | - * @var array $valid_request_types |
|
106 | - */ |
|
107 | - private $valid_request_types = array(); |
|
108 | - |
|
109 | - |
|
110 | - /** |
|
111 | - * RequestTypeContext constructor. |
|
112 | - * |
|
113 | - * @param string $slug |
|
114 | - * @param string $description |
|
115 | - * @throws InvalidArgumentException |
|
116 | - */ |
|
117 | - public function __construct($slug, $description) |
|
118 | - { |
|
119 | - parent::__construct($slug, $description); |
|
120 | - if (! in_array($this->slug(), $this->validRequestTypes(), true)) { |
|
121 | - throw new InvalidArgumentException( |
|
122 | - sprintf( |
|
123 | - esc_html__( |
|
124 | - 'The RequestTypeContext slug must be one of the following values: %1$s %2$s', |
|
125 | - 'event_espresso' |
|
126 | - ), |
|
127 | - '<br />', |
|
128 | - var_export($this->validRequestTypes(), true) |
|
129 | - ) |
|
130 | - ); |
|
131 | - } |
|
132 | - } |
|
133 | - |
|
134 | - |
|
135 | - /** |
|
136 | - * @return array |
|
137 | - */ |
|
138 | - public function validRequestTypes() |
|
139 | - { |
|
140 | - if (empty($this->valid_request_types)) { |
|
141 | - $this->valid_request_types = apply_filters( |
|
142 | - 'FHEE__EventEspresso_core_domain_entities_contexts_RequestTypeContext__validRequestTypes', |
|
143 | - array( |
|
144 | - RequestTypeContext::ACTIVATION, |
|
145 | - RequestTypeContext::ADMIN, |
|
146 | - RequestTypeContext::AJAX_ADMIN, |
|
147 | - RequestTypeContext::AJAX_FRONT, |
|
148 | - RequestTypeContext::AJAX_HEARTBEAT, |
|
149 | - RequestTypeContext::AJAX_OTHER, |
|
150 | - RequestTypeContext::API, |
|
151 | - RequestTypeContext::CLI, |
|
152 | - RequestTypeContext::CRON, |
|
153 | - RequestTypeContext::FEED, |
|
154 | - RequestTypeContext::FRONTEND, |
|
155 | - RequestTypeContext::GQL, |
|
156 | - RequestTypeContext::IFRAME, |
|
157 | - RequestTypeContext::WP_API, |
|
158 | - RequestTypeContext::WP_SCRAPE, |
|
159 | - ) |
|
160 | - ); |
|
161 | - } |
|
162 | - return $this->valid_request_types; |
|
163 | - } |
|
164 | - |
|
165 | - |
|
166 | - /** |
|
167 | - * @return bool |
|
168 | - */ |
|
169 | - public function isActivation() |
|
170 | - { |
|
171 | - return $this->is_activation; |
|
172 | - } |
|
173 | - |
|
174 | - |
|
175 | - /** |
|
176 | - * @param bool $is_activation |
|
177 | - */ |
|
178 | - public function setIsActivation($is_activation = false) |
|
179 | - { |
|
180 | - $this->is_activation = filter_var($is_activation, FILTER_VALIDATE_BOOLEAN); |
|
181 | - } |
|
182 | - |
|
183 | - |
|
184 | - /** |
|
185 | - * @return bool |
|
186 | - */ |
|
187 | - public function isUnitTesting() |
|
188 | - { |
|
189 | - return $this->is_unit_testing; |
|
190 | - } |
|
191 | - |
|
192 | - |
|
193 | - /** |
|
194 | - * @param bool $is_unit_testing |
|
195 | - */ |
|
196 | - public function setIsUnitTesting($is_unit_testing = false) |
|
197 | - { |
|
198 | - $this->is_unit_testing = filter_var($is_unit_testing, FILTER_VALIDATE_BOOLEAN); |
|
199 | - } |
|
19 | + /** |
|
20 | + * indicates that the current request involves some form of activation |
|
21 | + */ |
|
22 | + const ACTIVATION = 'activation-request'; |
|
23 | + |
|
24 | + /** |
|
25 | + * indicates that the current request is for the admin but is not being made via AJAX |
|
26 | + */ |
|
27 | + const ADMIN = 'non-ajax-admin-request'; |
|
28 | + |
|
29 | + /** |
|
30 | + * indicates that the current request is for the admin AND is being made via AJAX |
|
31 | + */ |
|
32 | + const AJAX_ADMIN = 'admin-ajax-request'; |
|
33 | + |
|
34 | + /** |
|
35 | + * indicates that the current request is for the frontend AND is being made via AJAX |
|
36 | + */ |
|
37 | + const AJAX_FRONT = 'frontend-ajax-request'; |
|
38 | + |
|
39 | + /** |
|
40 | + * indicates that the current request is for the WP Heartbeat |
|
41 | + */ |
|
42 | + const AJAX_HEARTBEAT = 'admin-ajax-heartbeat'; |
|
43 | + |
|
44 | + /** |
|
45 | + * indicates that the current request is being made via AJAX, but is NOT for EE |
|
46 | + */ |
|
47 | + const AJAX_OTHER = 'other-ajax-request'; |
|
48 | + |
|
49 | + /** |
|
50 | + * indicates that the current request is for the EE REST API |
|
51 | + */ |
|
52 | + const API = 'rest-api'; |
|
53 | + |
|
54 | + /** |
|
55 | + * indicates that the current request is from the command line |
|
56 | + */ |
|
57 | + const CLI = 'command-line'; |
|
58 | + |
|
59 | + /** |
|
60 | + * indicates that the current request is for a WP_Cron |
|
61 | + */ |
|
62 | + const CRON = 'wp-cron'; |
|
63 | + |
|
64 | + /** |
|
65 | + * indicates that the current request is for a feed (ie: RSS) |
|
66 | + */ |
|
67 | + const FEED = 'feed-request'; |
|
68 | + |
|
69 | + /** |
|
70 | + * indicates that the current request is for the frontend but is not being made via AJAX |
|
71 | + */ |
|
72 | + const FRONTEND = 'non-ajax-frontend-request'; |
|
73 | + |
|
74 | + /** |
|
75 | + * indicates that the current request is for content that is to be displayed within an iframe |
|
76 | + */ |
|
77 | + const IFRAME = 'iframe-request'; |
|
78 | + |
|
79 | + /** |
|
80 | + * indicates that the current request is for the EE GraphQL manager |
|
81 | + */ |
|
82 | + const GQL = 'graphql'; |
|
83 | + |
|
84 | + /** |
|
85 | + * indicates that the current request is for the WP REST API |
|
86 | + */ |
|
87 | + const WP_API = 'wp-rest-api'; |
|
88 | + |
|
89 | + /** |
|
90 | + * indicates that the current request is a loopback sent from WP core to test for errors |
|
91 | + */ |
|
92 | + const WP_SCRAPE = 'wordpress-scrape'; |
|
93 | + |
|
94 | + /** |
|
95 | + * @var boolean $is_activation |
|
96 | + */ |
|
97 | + private $is_activation = false; |
|
98 | + |
|
99 | + /** |
|
100 | + * @var boolean $is_unit_testing |
|
101 | + */ |
|
102 | + private $is_unit_testing = false; |
|
103 | + |
|
104 | + /** |
|
105 | + * @var array $valid_request_types |
|
106 | + */ |
|
107 | + private $valid_request_types = array(); |
|
108 | + |
|
109 | + |
|
110 | + /** |
|
111 | + * RequestTypeContext constructor. |
|
112 | + * |
|
113 | + * @param string $slug |
|
114 | + * @param string $description |
|
115 | + * @throws InvalidArgumentException |
|
116 | + */ |
|
117 | + public function __construct($slug, $description) |
|
118 | + { |
|
119 | + parent::__construct($slug, $description); |
|
120 | + if (! in_array($this->slug(), $this->validRequestTypes(), true)) { |
|
121 | + throw new InvalidArgumentException( |
|
122 | + sprintf( |
|
123 | + esc_html__( |
|
124 | + 'The RequestTypeContext slug must be one of the following values: %1$s %2$s', |
|
125 | + 'event_espresso' |
|
126 | + ), |
|
127 | + '<br />', |
|
128 | + var_export($this->validRequestTypes(), true) |
|
129 | + ) |
|
130 | + ); |
|
131 | + } |
|
132 | + } |
|
133 | + |
|
134 | + |
|
135 | + /** |
|
136 | + * @return array |
|
137 | + */ |
|
138 | + public function validRequestTypes() |
|
139 | + { |
|
140 | + if (empty($this->valid_request_types)) { |
|
141 | + $this->valid_request_types = apply_filters( |
|
142 | + 'FHEE__EventEspresso_core_domain_entities_contexts_RequestTypeContext__validRequestTypes', |
|
143 | + array( |
|
144 | + RequestTypeContext::ACTIVATION, |
|
145 | + RequestTypeContext::ADMIN, |
|
146 | + RequestTypeContext::AJAX_ADMIN, |
|
147 | + RequestTypeContext::AJAX_FRONT, |
|
148 | + RequestTypeContext::AJAX_HEARTBEAT, |
|
149 | + RequestTypeContext::AJAX_OTHER, |
|
150 | + RequestTypeContext::API, |
|
151 | + RequestTypeContext::CLI, |
|
152 | + RequestTypeContext::CRON, |
|
153 | + RequestTypeContext::FEED, |
|
154 | + RequestTypeContext::FRONTEND, |
|
155 | + RequestTypeContext::GQL, |
|
156 | + RequestTypeContext::IFRAME, |
|
157 | + RequestTypeContext::WP_API, |
|
158 | + RequestTypeContext::WP_SCRAPE, |
|
159 | + ) |
|
160 | + ); |
|
161 | + } |
|
162 | + return $this->valid_request_types; |
|
163 | + } |
|
164 | + |
|
165 | + |
|
166 | + /** |
|
167 | + * @return bool |
|
168 | + */ |
|
169 | + public function isActivation() |
|
170 | + { |
|
171 | + return $this->is_activation; |
|
172 | + } |
|
173 | + |
|
174 | + |
|
175 | + /** |
|
176 | + * @param bool $is_activation |
|
177 | + */ |
|
178 | + public function setIsActivation($is_activation = false) |
|
179 | + { |
|
180 | + $this->is_activation = filter_var($is_activation, FILTER_VALIDATE_BOOLEAN); |
|
181 | + } |
|
182 | + |
|
183 | + |
|
184 | + /** |
|
185 | + * @return bool |
|
186 | + */ |
|
187 | + public function isUnitTesting() |
|
188 | + { |
|
189 | + return $this->is_unit_testing; |
|
190 | + } |
|
191 | + |
|
192 | + |
|
193 | + /** |
|
194 | + * @param bool $is_unit_testing |
|
195 | + */ |
|
196 | + public function setIsUnitTesting($is_unit_testing = false) |
|
197 | + { |
|
198 | + $this->is_unit_testing = filter_var($is_unit_testing, FILTER_VALIDATE_BOOLEAN); |
|
199 | + } |
|
200 | 200 | } |
@@ -11,14 +11,14 @@ |
||
11 | 11 | |
12 | 12 | |
13 | 13 | |
14 | - /** |
|
15 | - * removes all tags which a WP Post wouldn't allow in its content normally |
|
16 | - * |
|
17 | - * @param string $value |
|
18 | - * @return string |
|
19 | - */ |
|
20 | - public function prepare_for_set($value) |
|
21 | - { |
|
22 | - return parent::prepare_for_set(wp_kses("$value", EEH_HTML::get_simple_tags())); |
|
23 | - } |
|
14 | + /** |
|
15 | + * removes all tags which a WP Post wouldn't allow in its content normally |
|
16 | + * |
|
17 | + * @param string $value |
|
18 | + * @return string |
|
19 | + */ |
|
20 | + public function prepare_for_set($value) |
|
21 | + { |
|
22 | + return parent::prepare_for_set(wp_kses("$value", EEH_HTML::get_simple_tags())); |
|
23 | + } |
|
24 | 24 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | */ |
52 | 52 | public function wp_user_obj() |
53 | 53 | { |
54 | - if (! $this->_wp_user_obj) { |
|
54 | + if ( ! $this->_wp_user_obj) { |
|
55 | 55 | $this->_wp_user_obj = get_user_by('ID', $this->ID()); |
56 | 56 | } |
57 | 57 | return $this->_wp_user_obj; |
@@ -13,111 +13,111 @@ |
||
13 | 13 | class EE_WP_User extends EE_Base_Class implements EEI_Admin_Links |
14 | 14 | { |
15 | 15 | |
16 | - /** |
|
17 | - * @var WP_User |
|
18 | - */ |
|
19 | - protected $_wp_user_obj; |
|
20 | - |
|
21 | - |
|
22 | - /** |
|
23 | - * @param array $props_n_values |
|
24 | - * @return EE_WP_User|mixed |
|
25 | - * @throws EE_Error |
|
26 | - * @throws ReflectionException |
|
27 | - */ |
|
28 | - public static function new_instance($props_n_values = []) |
|
29 | - { |
|
30 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
31 | - return $has_object ?: new self($props_n_values); |
|
32 | - } |
|
33 | - |
|
34 | - |
|
35 | - /** |
|
36 | - * @param array $props_n_values |
|
37 | - * @return EE_WP_User |
|
38 | - * @throws EE_Error |
|
39 | - * @throws ReflectionException |
|
40 | - */ |
|
41 | - public static function new_instance_from_db($props_n_values = []) |
|
42 | - { |
|
43 | - return new self($props_n_values, true); |
|
44 | - } |
|
45 | - |
|
46 | - |
|
47 | - /** |
|
48 | - * Return a normal WP_User object (caches the object for future calls) |
|
49 | - * |
|
50 | - * @return WP_User |
|
51 | - * @throws EE_Error |
|
52 | - * @throws ReflectionException |
|
53 | - */ |
|
54 | - public function wp_user_obj() |
|
55 | - { |
|
56 | - if (! $this->_wp_user_obj) { |
|
57 | - $this->_wp_user_obj = get_user_by('ID', $this->ID()); |
|
58 | - } |
|
59 | - return $this->_wp_user_obj; |
|
60 | - } |
|
61 | - |
|
62 | - |
|
63 | - /** |
|
64 | - * Return the link to the admin details for the object. |
|
65 | - * |
|
66 | - * @return string |
|
67 | - * @throws EE_Error |
|
68 | - * @throws ReflectionException |
|
69 | - */ |
|
70 | - public function get_admin_details_link() |
|
71 | - { |
|
72 | - return $this->get_admin_edit_link(); |
|
73 | - } |
|
74 | - |
|
75 | - |
|
76 | - /** |
|
77 | - * Returns the link to the editor for the object. Sometimes this is the same as the details. |
|
78 | - * |
|
79 | - * @return string |
|
80 | - * @throws EE_Error |
|
81 | - * @throws ReflectionException |
|
82 | - */ |
|
83 | - public function get_admin_edit_link() |
|
84 | - { |
|
85 | - /** @var RequestInterface $request */ |
|
86 | - $request = LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
87 | - return esc_url( |
|
88 | - add_query_arg( |
|
89 | - 'wp_http_referer', |
|
90 | - urlencode( |
|
91 | - wp_unslash( |
|
92 | - $request->getServerParam('REQUEST_URI') |
|
93 | - ) |
|
94 | - ), |
|
95 | - get_edit_user_link($this->ID()) |
|
96 | - ) |
|
97 | - ); |
|
98 | - } |
|
99 | - |
|
100 | - |
|
101 | - /** |
|
102 | - * Returns the link to a settings page for the object. |
|
103 | - * |
|
104 | - * @return string |
|
105 | - * @throws EE_Error |
|
106 | - * @throws ReflectionException |
|
107 | - */ |
|
108 | - public function get_admin_settings_link() |
|
109 | - { |
|
110 | - return $this->get_admin_edit_link(); |
|
111 | - } |
|
112 | - |
|
113 | - |
|
114 | - /** |
|
115 | - * Returns the link to the "overview" for the object (typically the "list table" view). |
|
116 | - * |
|
117 | - * @return string |
|
118 | - */ |
|
119 | - public function get_admin_overview_link() |
|
120 | - { |
|
121 | - return admin_url('users.php'); |
|
122 | - } |
|
16 | + /** |
|
17 | + * @var WP_User |
|
18 | + */ |
|
19 | + protected $_wp_user_obj; |
|
20 | + |
|
21 | + |
|
22 | + /** |
|
23 | + * @param array $props_n_values |
|
24 | + * @return EE_WP_User|mixed |
|
25 | + * @throws EE_Error |
|
26 | + * @throws ReflectionException |
|
27 | + */ |
|
28 | + public static function new_instance($props_n_values = []) |
|
29 | + { |
|
30 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
31 | + return $has_object ?: new self($props_n_values); |
|
32 | + } |
|
33 | + |
|
34 | + |
|
35 | + /** |
|
36 | + * @param array $props_n_values |
|
37 | + * @return EE_WP_User |
|
38 | + * @throws EE_Error |
|
39 | + * @throws ReflectionException |
|
40 | + */ |
|
41 | + public static function new_instance_from_db($props_n_values = []) |
|
42 | + { |
|
43 | + return new self($props_n_values, true); |
|
44 | + } |
|
45 | + |
|
46 | + |
|
47 | + /** |
|
48 | + * Return a normal WP_User object (caches the object for future calls) |
|
49 | + * |
|
50 | + * @return WP_User |
|
51 | + * @throws EE_Error |
|
52 | + * @throws ReflectionException |
|
53 | + */ |
|
54 | + public function wp_user_obj() |
|
55 | + { |
|
56 | + if (! $this->_wp_user_obj) { |
|
57 | + $this->_wp_user_obj = get_user_by('ID', $this->ID()); |
|
58 | + } |
|
59 | + return $this->_wp_user_obj; |
|
60 | + } |
|
61 | + |
|
62 | + |
|
63 | + /** |
|
64 | + * Return the link to the admin details for the object. |
|
65 | + * |
|
66 | + * @return string |
|
67 | + * @throws EE_Error |
|
68 | + * @throws ReflectionException |
|
69 | + */ |
|
70 | + public function get_admin_details_link() |
|
71 | + { |
|
72 | + return $this->get_admin_edit_link(); |
|
73 | + } |
|
74 | + |
|
75 | + |
|
76 | + /** |
|
77 | + * Returns the link to the editor for the object. Sometimes this is the same as the details. |
|
78 | + * |
|
79 | + * @return string |
|
80 | + * @throws EE_Error |
|
81 | + * @throws ReflectionException |
|
82 | + */ |
|
83 | + public function get_admin_edit_link() |
|
84 | + { |
|
85 | + /** @var RequestInterface $request */ |
|
86 | + $request = LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
87 | + return esc_url( |
|
88 | + add_query_arg( |
|
89 | + 'wp_http_referer', |
|
90 | + urlencode( |
|
91 | + wp_unslash( |
|
92 | + $request->getServerParam('REQUEST_URI') |
|
93 | + ) |
|
94 | + ), |
|
95 | + get_edit_user_link($this->ID()) |
|
96 | + ) |
|
97 | + ); |
|
98 | + } |
|
99 | + |
|
100 | + |
|
101 | + /** |
|
102 | + * Returns the link to a settings page for the object. |
|
103 | + * |
|
104 | + * @return string |
|
105 | + * @throws EE_Error |
|
106 | + * @throws ReflectionException |
|
107 | + */ |
|
108 | + public function get_admin_settings_link() |
|
109 | + { |
|
110 | + return $this->get_admin_edit_link(); |
|
111 | + } |
|
112 | + |
|
113 | + |
|
114 | + /** |
|
115 | + * Returns the link to the "overview" for the object (typically the "list table" view). |
|
116 | + * |
|
117 | + * @return string |
|
118 | + */ |
|
119 | + public function get_admin_overview_link() |
|
120 | + { |
|
121 | + return admin_url('users.php'); |
|
122 | + } |
|
123 | 123 | } |
@@ -9,24 +9,24 @@ |
||
9 | 9 | interface EEI_Request_Decorator |
10 | 10 | { |
11 | 11 | |
12 | - /** |
|
13 | - * converts a Request to a Response |
|
14 | - * can perform their logic either before or after the core application has run like so: |
|
15 | - * public function handle_request( EE_Request $request, EE_Response $response ) { |
|
16 | - * $this->request = $request; |
|
17 | - * $this->response = $response; |
|
18 | - * // logic performed BEFORE core app has run |
|
19 | - * $this->process_request_stack( $this->request, $this->response ); |
|
20 | - * // logic performed AFTER core app has run |
|
21 | - * return $response; |
|
22 | - * } |
|
23 | - * |
|
24 | - * @deprecated 4.9.53 |
|
25 | - * @param EE_Request $request |
|
26 | - * @param EE_Response $response |
|
27 | - * @return EE_Response |
|
28 | - */ |
|
29 | - public function handle_request(EE_Request $request, EE_Response $response); |
|
12 | + /** |
|
13 | + * converts a Request to a Response |
|
14 | + * can perform their logic either before or after the core application has run like so: |
|
15 | + * public function handle_request( EE_Request $request, EE_Response $response ) { |
|
16 | + * $this->request = $request; |
|
17 | + * $this->response = $response; |
|
18 | + * // logic performed BEFORE core app has run |
|
19 | + * $this->process_request_stack( $this->request, $this->response ); |
|
20 | + * // logic performed AFTER core app has run |
|
21 | + * return $response; |
|
22 | + * } |
|
23 | + * |
|
24 | + * @deprecated 4.9.53 |
|
25 | + * @param EE_Request $request |
|
26 | + * @param EE_Response $response |
|
27 | + * @return EE_Response |
|
28 | + */ |
|
29 | + public function handle_request(EE_Request $request, EE_Response $response); |
|
30 | 30 | |
31 | 31 | |
32 | 32 | } |
@@ -78,7 +78,7 @@ |
||
78 | 78 | public function preProductionVersionAdminNotice() |
79 | 79 | { |
80 | 80 | new PersistentAdminNotice( |
81 | - 'preProductionVersionAdminNotice_' . EVENT_ESPRESSO_VERSION, |
|
81 | + 'preProductionVersionAdminNotice_'.EVENT_ESPRESSO_VERSION, |
|
82 | 82 | $this->warningNotice() |
83 | 83 | ); |
84 | 84 | } |
@@ -18,91 +18,91 @@ |
||
18 | 18 | class PreProductionVersionWarning extends Middleware |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * converts a Request to a Response |
|
23 | - * |
|
24 | - * @param RequestInterface $request |
|
25 | - * @param ResponseInterface $response |
|
26 | - * @return ResponseInterface |
|
27 | - */ |
|
28 | - public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
29 | - { |
|
30 | - $this->request = $request; |
|
31 | - $this->response = $response; |
|
32 | - $this->displayPreProductionVersionWarning(); |
|
33 | - $this->response = $this->processRequestStack($this->request, $this->response); |
|
34 | - return $this->response; |
|
35 | - } |
|
21 | + /** |
|
22 | + * converts a Request to a Response |
|
23 | + * |
|
24 | + * @param RequestInterface $request |
|
25 | + * @param ResponseInterface $response |
|
26 | + * @return ResponseInterface |
|
27 | + */ |
|
28 | + public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
29 | + { |
|
30 | + $this->request = $request; |
|
31 | + $this->response = $response; |
|
32 | + $this->displayPreProductionVersionWarning(); |
|
33 | + $this->response = $this->processRequestStack($this->request, $this->response); |
|
34 | + return $this->response; |
|
35 | + } |
|
36 | 36 | |
37 | 37 | |
38 | - /** |
|
39 | - * displays message on frontend of site notifying admin that EE has been temporarily placed into maintenance mode |
|
40 | - * |
|
41 | - * @return void |
|
42 | - */ |
|
43 | - public function displayPreProductionVersionWarning() |
|
44 | - { |
|
45 | - // skip AJAX requests |
|
46 | - if ($this->request->isAjax()) { |
|
47 | - return; |
|
48 | - } |
|
49 | - // skip stable releases |
|
50 | - if (substr(EVENT_ESPRESSO_VERSION, -5) !== '.beta') { |
|
51 | - return; |
|
52 | - } |
|
53 | - // site admin has authorized use of non-stable release candidate for production |
|
54 | - if (defined('ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE') && ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE) { |
|
55 | - return; |
|
56 | - } |
|
57 | - // post release candidate warning |
|
58 | - if ($this->request->isAdmin()) { |
|
59 | - add_action('admin_notices', array($this, 'preProductionVersionAdminNotice'), -999); |
|
60 | - } else { |
|
61 | - add_action('shutdown', array($this, 'preProductionVersionWarningNotice'), 10); |
|
62 | - } |
|
63 | - } |
|
38 | + /** |
|
39 | + * displays message on frontend of site notifying admin that EE has been temporarily placed into maintenance mode |
|
40 | + * |
|
41 | + * @return void |
|
42 | + */ |
|
43 | + public function displayPreProductionVersionWarning() |
|
44 | + { |
|
45 | + // skip AJAX requests |
|
46 | + if ($this->request->isAjax()) { |
|
47 | + return; |
|
48 | + } |
|
49 | + // skip stable releases |
|
50 | + if (substr(EVENT_ESPRESSO_VERSION, -5) !== '.beta') { |
|
51 | + return; |
|
52 | + } |
|
53 | + // site admin has authorized use of non-stable release candidate for production |
|
54 | + if (defined('ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE') && ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE) { |
|
55 | + return; |
|
56 | + } |
|
57 | + // post release candidate warning |
|
58 | + if ($this->request->isAdmin()) { |
|
59 | + add_action('admin_notices', array($this, 'preProductionVersionAdminNotice'), -999); |
|
60 | + } else { |
|
61 | + add_action('shutdown', array($this, 'preProductionVersionWarningNotice'), 10); |
|
62 | + } |
|
63 | + } |
|
64 | 64 | |
65 | 65 | |
66 | - /** |
|
67 | - * displays admin notice that current version of EE is not a stable release |
|
68 | - * |
|
69 | - * @return void |
|
70 | - * @throws InvalidDataTypeException |
|
71 | - */ |
|
72 | - public function preProductionVersionAdminNotice() |
|
73 | - { |
|
74 | - new PersistentAdminNotice( |
|
75 | - 'preProductionVersionAdminNotice_' . EVENT_ESPRESSO_VERSION, |
|
76 | - $this->warningNotice() |
|
77 | - ); |
|
78 | - } |
|
66 | + /** |
|
67 | + * displays admin notice that current version of EE is not a stable release |
|
68 | + * |
|
69 | + * @return void |
|
70 | + * @throws InvalidDataTypeException |
|
71 | + */ |
|
72 | + public function preProductionVersionAdminNotice() |
|
73 | + { |
|
74 | + new PersistentAdminNotice( |
|
75 | + 'preProductionVersionAdminNotice_' . EVENT_ESPRESSO_VERSION, |
|
76 | + $this->warningNotice() |
|
77 | + ); |
|
78 | + } |
|
79 | 79 | |
80 | 80 | |
81 | - /** |
|
82 | - * displays message on frontend of site notifying admin that current version of EE is not a stable release |
|
83 | - * |
|
84 | - * @return void |
|
85 | - */ |
|
86 | - public function preProductionVersionWarningNotice() |
|
87 | - { |
|
88 | - echo '<div id="ee-release-candidate-notice-dv" class="ee-really-important-notice-dv"><p>'; |
|
89 | - echo $this->warningNotice(); // already escaped |
|
90 | - echo '</p></div>'; |
|
91 | - } |
|
81 | + /** |
|
82 | + * displays message on frontend of site notifying admin that current version of EE is not a stable release |
|
83 | + * |
|
84 | + * @return void |
|
85 | + */ |
|
86 | + public function preProductionVersionWarningNotice() |
|
87 | + { |
|
88 | + echo '<div id="ee-release-candidate-notice-dv" class="ee-really-important-notice-dv"><p>'; |
|
89 | + echo $this->warningNotice(); // already escaped |
|
90 | + echo '</p></div>'; |
|
91 | + } |
|
92 | 92 | |
93 | 93 | |
94 | - /** |
|
95 | - * @return string |
|
96 | - */ |
|
97 | - private function warningNotice() |
|
98 | - { |
|
99 | - return sprintf( |
|
100 | - esc_html__( |
|
101 | - 'This version of Event Espresso is for testing and/or evaluation purposes only. It is %1$snot%2$s considered a stable release and should therefore %1$snot%2$s be activated on a live or production website.', |
|
102 | - 'event_espresso' |
|
103 | - ), |
|
104 | - '<strong>', |
|
105 | - '</strong>' |
|
106 | - ); |
|
107 | - } |
|
94 | + /** |
|
95 | + * @return string |
|
96 | + */ |
|
97 | + private function warningNotice() |
|
98 | + { |
|
99 | + return sprintf( |
|
100 | + esc_html__( |
|
101 | + 'This version of Event Espresso is for testing and/or evaluation purposes only. It is %1$snot%2$s considered a stable release and should therefore %1$snot%2$s be activated on a live or production website.', |
|
102 | + 'event_espresso' |
|
103 | + ), |
|
104 | + '<strong>', |
|
105 | + '</strong>' |
|
106 | + ); |
|
107 | + } |
|
108 | 108 | } |