@@ -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,20 +29,20 @@ discard block |
||
29 | 29 | * @param EE_Registration|array $data |
30 | 30 | * @throws \EE_Error |
31 | 31 | */ |
32 | - public function __construct( $data ) { |
|
32 | + public function __construct($data) { |
|
33 | 33 | $filtered_reg_status = null; |
34 | 34 | |
35 | - if ( ! is_array( $data ) && $data instanceof EE_Registration ) { |
|
35 | + if ( ! is_array($data) && $data instanceof EE_Registration) { |
|
36 | 36 | $this->reg_obj = $data; |
37 | 37 | } else { |
38 | - $this->reg_obj = is_array( $data ) && isset( $data[0] ) && $data[0] instanceof EE_Registration ? $data[0] : null; |
|
39 | - $filtered_reg_status = is_array( $data ) && ! empty( $data[1] ) ? $data[1] : null; |
|
38 | + $this->reg_obj = is_array($data) && isset($data[0]) && $data[0] instanceof EE_Registration ? $data[0] : null; |
|
39 | + $filtered_reg_status = is_array($data) && ! empty($data[1]) ? $data[1] : null; |
|
40 | 40 | } |
41 | 41 | |
42 | - if ( ! $this->reg_obj instanceof EE_Registration ) { |
|
42 | + if ( ! $this->reg_obj instanceof EE_Registration) { |
|
43 | 43 | throw new EE_Error( |
44 | 44 | sprintf( |
45 | - __( '%1$s requires the incoming data argument to be an instance of %2$s or an array where the first value is an instance of %2$s', 'event_espresso'), |
|
45 | + __('%1$s requires the incoming data argument to be an instance of %2$s or an array where the first value is an instance of %2$s', 'event_espresso'), |
|
46 | 46 | 'EE_Messages_REG_incoming_data', |
47 | 47 | 'EE_Registration' |
48 | 48 | ) |
@@ -64,18 +64,18 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return array The prepped data for db |
66 | 66 | */ |
67 | - static public function convert_data_for_persistent_storage( $data ) { |
|
67 | + static public function convert_data_for_persistent_storage($data) { |
|
68 | 68 | $prepped_data = array(); |
69 | - if ( ! is_array( $data ) && $data instanceof EE_Registration ) { |
|
69 | + if ( ! is_array($data) && $data instanceof EE_Registration) { |
|
70 | 70 | $prepped_data['Registration'] = $data->ID(); |
71 | 71 | return $prepped_data; |
72 | - } elseif ( ! is_array( $data ) ) { |
|
72 | + } elseif ( ! is_array($data)) { |
|
73 | 73 | return array(); |
74 | 74 | } else { |
75 | - if ( $data[0] instanceof EE_Registration ) { |
|
75 | + if ($data[0] instanceof EE_Registration) { |
|
76 | 76 | $prepped_data['Registration'] = $data[0]; |
77 | 77 | } |
78 | - if ( ! empty( $data[1] ) ) { |
|
78 | + if ( ! empty($data[1])) { |
|
79 | 79 | $prepped_data['filter'] = $data[1]; |
80 | 80 | } |
81 | 81 | } |
@@ -91,17 +91,17 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @return mixed |
93 | 93 | */ |
94 | - static public function convert_data_from_persistent_storage( $data ) { |
|
94 | + static public function convert_data_from_persistent_storage($data) { |
|
95 | 95 | $registration = null; |
96 | 96 | //$data['Registration'] could be either an ID (back compat) or a registration object (prepped using old system). |
97 | - if ( isset( $data[ 'Registration' ] ) ) { |
|
98 | - $registration = $data[ 'Registration' ] instanceof EE_Registration |
|
99 | - ? $data[ 'Registration' ] |
|
100 | - : EEM_Registration::instance()->get_one_by_ID( $data[ 'Registration' ] ); |
|
97 | + if (isset($data['Registration'])) { |
|
98 | + $registration = $data['Registration'] instanceof EE_Registration |
|
99 | + ? $data['Registration'] |
|
100 | + : EEM_Registration::instance()->get_one_by_ID($data['Registration']); |
|
101 | 101 | } |
102 | 102 | $prepped_data = array( |
103 | 103 | 0 => $registration, |
104 | - 1 => isset( $data['filter'] ) ? $data['filter'] : null |
|
104 | + 1 => isset($data['filter']) ? $data['filter'] : null |
|
105 | 105 | ); |
106 | 106 | return $prepped_data; |
107 | 107 | } |
@@ -119,18 +119,18 @@ discard block |
||
119 | 119 | $this->txn = $this->reg_obj->transaction(); |
120 | 120 | //possible session stuff? |
121 | 121 | $session = $this->txn->session_data(); |
122 | - $session_data = $session instanceof EE_Session ? $session->get_session_data() : array(); |
|
122 | + $session_data = $session instanceof EE_Session ? $session->get_session_data() : array(); |
|
123 | 123 | |
124 | 124 | //other data from the session (if possible) |
125 | - $this->user_id = isset( $session_data['user_id'] ) ? $session_data['user_id'] : ''; |
|
126 | - $this->ip_address = isset( $session_data['ip_address'] ) ? $session_data['ip_address'] : ''; |
|
127 | - $this->user_agent = isset( $session_data['user_agent'] ) ? $session_data['user_agent'] : ''; |
|
125 | + $this->user_id = isset($session_data['user_id']) ? $session_data['user_id'] : ''; |
|
126 | + $this->ip_address = isset($session_data['ip_address']) ? $session_data['ip_address'] : ''; |
|
127 | + $this->user_agent = isset($session_data['user_agent']) ? $session_data['user_agent'] : ''; |
|
128 | 128 | $this->init_access = $this->last_access = ''; |
129 | 129 | |
130 | 130 | $this->payment = $this->txn->get_first_related('Payment'); |
131 | 131 | // if there is no payments associated with the transaction |
132 | 132 | // then we just create a default payment object for potential parsing. |
133 | - $this->payment = empty( $this->payment ) |
|
133 | + $this->payment = empty($this->payment) |
|
134 | 134 | ? EE_Payment::new_instance( |
135 | 135 | array( |
136 | 136 | 'STS_ID' => EEM_Payment::status_id_pending, |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'NO direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('NO direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | * about where to obtain the templates. |
110 | 110 | * |
111 | 111 | */ |
112 | - final private function _set_templates( $template_pack ) { |
|
112 | + final private function _set_templates($template_pack) { |
|
113 | 113 | |
114 | 114 | //get the corresponding template pack object (if present. If not then we just load the default and add a |
115 | 115 | //notice). The class name should be something like 'EE_Messages_Template_Pack_Default' where "default' would be |
116 | 116 | //the incoming template pack reference. |
117 | - $class_name = 'EE_Messages_Template_Pack_' . str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $template_pack ) ) ); |
|
117 | + $class_name = 'EE_Messages_Template_Pack_'.str_replace(' ', '_', ucwords(str_replace('_', ' ', $template_pack))); |
|
118 | 118 | |
119 | - if ( ! class_exists( $class_name ) ) { |
|
119 | + if ( ! class_exists($class_name)) { |
|
120 | 120 | EE_Error::add_error( |
121 | 121 | sprintf( |
122 | 122 | __( |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $template_pack = new $class_name; |
136 | 136 | |
137 | 137 | //get all the templates from the template pack. |
138 | - $this->_templates = $template_pack->get_templates( $this->_messenger, $this->_message_type ); |
|
138 | + $this->_templates = $template_pack->get_templates($this->_messenger, $this->_message_type); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -159,15 +159,15 @@ discard block |
||
159 | 159 | public function create_new_templates() { |
160 | 160 | $template_pack = 'default'; |
161 | 161 | //if we have the GRP_ID then let's use that to see if there is a set template pack and use that for the new templates. |
162 | - if ( ! empty( $this->_GRP_ID ) ) { |
|
163 | - $message_template_group = $this->_message_template_group_model->get_one_by_ID( $this->_GRP_ID ); |
|
162 | + if ( ! empty($this->_GRP_ID)) { |
|
163 | + $message_template_group = $this->_message_template_group_model->get_one_by_ID($this->_GRP_ID); |
|
164 | 164 | $template_pack = $message_template_group instanceof EE_Message_Template_Group |
165 | 165 | ? $message_template_group->get_template_pack_name() |
166 | 166 | : 'default'; |
167 | 167 | //we also need to reset the template variation to default |
168 | - $message_template_group->set_template_pack_variation( 'default' ); |
|
168 | + $message_template_group->set_template_pack_variation('default'); |
|
169 | 169 | } |
170 | - return $this->_create_new_templates( $template_pack ); |
|
170 | + return $this->_create_new_templates($template_pack); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | |
@@ -181,12 +181,12 @@ discard block |
||
181 | 181 | * which will contain information about where to obtain the templates. |
182 | 182 | * @return mixed (array|bool) success array or false. |
183 | 183 | */ |
184 | - protected function _create_new_templates( $template_pack ) { |
|
184 | + protected function _create_new_templates($template_pack) { |
|
185 | 185 | |
186 | - $this->_set_templates( $template_pack ); |
|
186 | + $this->_set_templates($template_pack); |
|
187 | 187 | |
188 | 188 | //necessary properties are set, let's save the default templates |
189 | - if ( empty( $this->_GRP_ID ) ) { |
|
189 | + if (empty($this->_GRP_ID)) { |
|
190 | 190 | $main_template_data = array( |
191 | 191 | 'MTP_messenger' => $this->_messenger->name, |
192 | 192 | 'MTP_message_type' => $this->_message_type->name, |
@@ -197,24 +197,24 @@ discard block |
||
197 | 197 | 'MTP_is_active' => 1, |
198 | 198 | ); |
199 | 199 | //let's insert the above and get our GRP_ID, then reset the template data array to just include the GRP_ID |
200 | - $grp_id = $this->_message_template_group_model->insert( $main_template_data ); |
|
201 | - if ( empty( $grp_id ) ) { |
|
200 | + $grp_id = $this->_message_template_group_model->insert($main_template_data); |
|
201 | + if (empty($grp_id)) { |
|
202 | 202 | return $grp_id; |
203 | 203 | } |
204 | 204 | $this->_GRP_ID = $grp_id; |
205 | 205 | } |
206 | 206 | |
207 | - $template_data = array( 'GRP_ID' => $this->_GRP_ID ); |
|
207 | + $template_data = array('GRP_ID' => $this->_GRP_ID); |
|
208 | 208 | |
209 | - foreach ( $this->_contexts as $context => $details ) { |
|
210 | - foreach ( $this->_fields as $field => $field_type ) { |
|
211 | - if ( $field != 'extra' ) { |
|
209 | + foreach ($this->_contexts as $context => $details) { |
|
210 | + foreach ($this->_fields as $field => $field_type) { |
|
211 | + if ($field != 'extra') { |
|
212 | 212 | $template_data['MTP_context'] = $context; |
213 | 213 | $template_data['MTP_template_field'] = $field; |
214 | - $template_data['MTP_content'] = $this->_templates[ $context ][ $field ]; |
|
214 | + $template_data['MTP_content'] = $this->_templates[$context][$field]; |
|
215 | 215 | |
216 | - $MTP = $this->_message_template_model->insert( $template_data ); |
|
217 | - if ( ! $MTP ) { |
|
216 | + $MTP = $this->_message_template_model->insert($template_data); |
|
217 | + if ( ! $MTP) { |
|
218 | 218 | EE_Error::add_error( |
219 | 219 | sprintf( |
220 | 220 | __( |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | |
239 | 239 | return array( |
240 | 240 | 'GRP_ID' => $this->_GRP_ID, |
241 | - 'MTP_context' => key( $this->_contexts ) |
|
241 | + 'MTP_context' => key($this->_contexts) |
|
242 | 242 | ); |
243 | 243 | } |
244 | 244 |
@@ -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. |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | protected function _set_valid_shortcodes() { |
78 | 78 | //remember by leaving the other fields not set, those fields will inherit the valid shortcodes from the message type. |
79 | 79 | $this->_valid_shortcodes = array( |
80 | - 'to' => array('email','event_author', 'primary_registration_details', 'recipient_details'), |
|
80 | + 'to' => array('email', 'event_author', 'primary_registration_details', 'recipient_details'), |
|
81 | 81 | 'from' => array('email', 'event_author', 'primary_registration_details', 'recipient_details') |
82 | 82 | ); |
83 | 83 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | 'shortcodes' => array('organization', 'primary_registration_details', 'event_author', 'primary_registration_details', 'recipient_details') |
112 | 112 | ), |
113 | 113 | 'content' => array( |
114 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger') |
|
114 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger') |
|
115 | 115 | ), |
116 | 116 | 'attendee_list' => array( |
117 | 117 | 'shortcodes' => array('attendee', 'event_list', 'ticket_list'), |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | 'required' => array('[EVENT_LIST]') |
123 | 123 | ), |
124 | 124 | 'ticket_list' => array( |
125 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'recipient_details'), |
|
125 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'recipient_details'), |
|
126 | 126 | 'required' => array('[TICKET_LIST]') |
127 | 127 | ), |
128 | 128 | 'datetime_list' => array( |
@@ -141,21 +141,21 @@ discard block |
||
141 | 141 | * |
142 | 142 | * @since 4.5.0 |
143 | 143 | */ |
144 | - public function do_secondary_messenger_hooks( $sending_messenger_name ) { |
|
145 | - if ( $sending_messenger_name = 'html' ) { |
|
146 | - add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 ); |
|
144 | + public function do_secondary_messenger_hooks($sending_messenger_name) { |
|
145 | + if ($sending_messenger_name = 'html') { |
|
146 | + add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | 150 | |
151 | 151 | |
152 | 152 | |
153 | - public function add_email_css( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack ) { |
|
153 | + public function add_email_css($variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack) { |
|
154 | 154 | //prevent recursion on this callback. |
155 | - remove_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10 ); |
|
156 | - $variation = $this->get_variation( $template_pack, $message_type, $url, 'main', $variation, FALSE ); |
|
155 | + remove_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10); |
|
156 | + $variation = $this->get_variation($template_pack, $message_type, $url, 'main', $variation, FALSE); |
|
157 | 157 | |
158 | - add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 ); |
|
158 | + add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8); |
|
159 | 159 | return $variation; |
160 | 160 | } |
161 | 161 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | 'required' => FALSE, |
188 | 188 | 'validation' => FALSE, |
189 | 189 | 'format' => '%s', |
190 | - 'value' => sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') ), |
|
190 | + 'value' => sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name')), |
|
191 | 191 | 'default'=> '', |
192 | 192 | 'css_class' => '' |
193 | 193 | ) |
@@ -349,16 +349,16 @@ discard block |
||
349 | 349 | * @return bool | WP_Error true if message delivered, false if it didn't deliver OR bubble up any error object if present. |
350 | 350 | */ |
351 | 351 | protected function _send_message() { |
352 | - $success = wp_mail( |
|
353 | - html_entity_decode( $this->_to, ENT_QUOTES, "UTF-8" ), |
|
354 | - stripslashes( html_entity_decode( $this->_subject, ENT_QUOTES, "UTF-8" )), |
|
352 | + $success = wp_mail( |
|
353 | + html_entity_decode($this->_to, ENT_QUOTES, "UTF-8"), |
|
354 | + stripslashes(html_entity_decode($this->_subject, ENT_QUOTES, "UTF-8")), |
|
355 | 355 | $this->_body(), |
356 | 356 | $this->_headers() |
357 | 357 | ); |
358 | - if ( ! $success ) { |
|
358 | + if ( ! $success) { |
|
359 | 359 | EE_Error::add_error( |
360 | 360 | sprintf( |
361 | - __( 'The email did not send successfully.%3$sThe WordPress wp_mail function is used for sending mails but does not give any useful information when an email fails to send.%3$sIt is possible the "to" address (%1$s) or "from" address (%2$s) is invalid.%3$s', 'event_espresso'), |
|
361 | + __('The email did not send successfully.%3$sThe WordPress wp_mail function is used for sending mails but does not give any useful information when an email fails to send.%3$sIt is possible the "to" address (%1$s) or "from" address (%2$s) is invalid.%3$s', 'event_espresso'), |
|
362 | 362 | $this->_to, |
363 | 363 | $this->_from, |
364 | 364 | '<br />' |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | * @return string html body of the message content and the related css. |
378 | 378 | */ |
379 | 379 | protected function _preview() { |
380 | - return $this->_body( true ); |
|
380 | + return $this->_body(true); |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | |
@@ -391,18 +391,18 @@ discard block |
||
391 | 391 | * @return string formatted header for email |
392 | 392 | */ |
393 | 393 | protected function _headers() { |
394 | - $from = stripslashes_deep( html_entity_decode($this->_from, ENT_QUOTES,"UTF-8" ) ); |
|
394 | + $from = stripslashes_deep(html_entity_decode($this->_from, ENT_QUOTES, "UTF-8")); |
|
395 | 395 | $headers = array( |
396 | 396 | 'MIME-Version: 1.0', |
397 | - 'From:' . $from, |
|
398 | - 'Reply-To:' . $from, |
|
397 | + 'From:'.$from, |
|
398 | + 'Reply-To:'.$from, |
|
399 | 399 | 'Content-Type:text/html; charset=utf-8' |
400 | 400 | ); |
401 | 401 | |
402 | 402 | //but wait! Header's for the from is NOT reliable because some plugins don't respect From: as set in the header. |
403 | - add_filter( 'wp_mail_from', array( $this, 'set_from_address' ), 100 ); |
|
404 | - add_filter( 'wp_mail_from_name', array( $this, 'set_from_name' ), 100 ); |
|
405 | - return apply_filters( 'FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this ); |
|
403 | + add_filter('wp_mail_from', array($this, 'set_from_address'), 100); |
|
404 | + add_filter('wp_mail_from_name', array($this, 'set_from_name'), 100); |
|
405 | + return apply_filters('FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this); |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | |
@@ -418,19 +418,19 @@ discard block |
||
418 | 418 | * @return array |
419 | 419 | */ |
420 | 420 | private function _parse_from() { |
421 | - if ( strpos( $this->_from, '<' ) !== false ) { |
|
422 | - $from_name = substr( $this->_from, 0, strpos( $this->_from, '<' ) - 1 ); |
|
423 | - $from_name = str_replace( '"', '', $from_name ); |
|
424 | - $from_name = trim( $from_name ); |
|
425 | - |
|
426 | - $from_email = substr( $this->_from, strpos( $this->_from, '<' ) + 1 ); |
|
427 | - $from_email = str_replace( '>', '', $from_email ); |
|
428 | - $from_email = trim( $from_email ); |
|
421 | + if (strpos($this->_from, '<') !== false) { |
|
422 | + $from_name = substr($this->_from, 0, strpos($this->_from, '<') - 1); |
|
423 | + $from_name = str_replace('"', '', $from_name); |
|
424 | + $from_name = trim($from_name); |
|
425 | + |
|
426 | + $from_email = substr($this->_from, strpos($this->_from, '<') + 1); |
|
427 | + $from_email = str_replace('>', '', $from_email); |
|
428 | + $from_email = trim($from_email); |
|
429 | 429 | } else { |
430 | 430 | $from_name = ''; |
431 | - $from_email = trim( $this->_from ); |
|
431 | + $from_email = trim($this->_from); |
|
432 | 432 | } |
433 | - return array( $from_name, $from_email ); |
|
433 | + return array($from_name, $from_email); |
|
434 | 434 | } |
435 | 435 | |
436 | 436 | |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | * |
444 | 444 | * @param string $from_email What the original from_email is. |
445 | 445 | */ |
446 | - public function set_from_address( $from_email ) { |
|
446 | + public function set_from_address($from_email) { |
|
447 | 447 | $parsed_from = $this->_parse_from(); |
448 | 448 | return $parsed_from[1]; |
449 | 449 | } |
@@ -458,13 +458,13 @@ discard block |
||
458 | 458 | * |
459 | 459 | * @param string $from_name The original from_name. |
460 | 460 | */ |
461 | - public function set_from_name( $from_name ) { |
|
461 | + public function set_from_name($from_name) { |
|
462 | 462 | $parsed_from = $this->_parse_from(); |
463 | - if ( is_array( $parsed_from) && ! empty( $parsed_from[0] ) ) { |
|
464 | - $from_name = $parsed_from[0]; |
|
463 | + if (is_array($parsed_from) && ! empty($parsed_from[0])) { |
|
464 | + $from_name = $parsed_from[0]; |
|
465 | 465 | } |
466 | 466 | |
467 | - return stripslashes_deep( html_entity_decode($from_name, ENT_QUOTES,"UTF-8" ) ); |
|
467 | + return stripslashes_deep(html_entity_decode($from_name, ENT_QUOTES, "UTF-8")); |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | |
@@ -475,14 +475,14 @@ discard block |
||
475 | 475 | * @param bool $preview will determine whether this is preview template or not. |
476 | 476 | * @return string formatted body for email. |
477 | 477 | */ |
478 | - protected function _body( $preview = false ) { |
|
478 | + protected function _body($preview = false) { |
|
479 | 479 | //setup template args! |
480 | 480 | $this->_template_args = array( |
481 | 481 | 'subject' => $this->_subject, |
482 | 482 | 'from' => $this->_from, |
483 | - 'main_body' => wpautop(stripslashes_deep( html_entity_decode($this->_content, ENT_QUOTES,"UTF-8" ) )) |
|
483 | + 'main_body' => wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8"))) |
|
484 | 484 | ); |
485 | - $body = $this->_get_main_template( $preview ); |
|
485 | + $body = $this->_get_main_template($preview); |
|
486 | 486 | |
487 | 487 | /** |
488 | 488 | * This filter allows one to bypass the CSSToInlineStyles tool and leave the body untouched. |
@@ -490,17 +490,17 @@ discard block |
||
490 | 490 | * @type bool $preview Indicates whether a preview is being generated or not. |
491 | 491 | * @return bool true indicates to use the inliner, false bypasses it. |
492 | 492 | */ |
493 | - if ( apply_filters( 'FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview ) ) { |
|
493 | + if (apply_filters('FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview)) { |
|
494 | 494 | |
495 | 495 | //require CssToInlineStyles library and its dependencies via composer autoloader |
496 | - require_once EE_THIRD_PARTY . 'cssinliner/vendor/autoload.php'; |
|
496 | + require_once EE_THIRD_PARTY.'cssinliner/vendor/autoload.php'; |
|
497 | 497 | |
498 | 498 | //now if this isn't a preview, let's setup the body so it has inline styles |
499 | - if ( ! $preview || ( $preview && defined( 'DOING_AJAX' ) ) ) { |
|
500 | - $style = file_get_contents( $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation ), TRUE ); |
|
501 | - $CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles( $body, $style ); |
|
502 | - $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. |
|
503 | - $body = ltrim( $body, "<?" ); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609 |
|
499 | + if ( ! $preview || ($preview && defined('DOING_AJAX'))) { |
|
500 | + $style = file_get_contents($this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation), TRUE); |
|
501 | + $CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles($body, $style); |
|
502 | + $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. |
|
503 | + $body = ltrim($body, "<?"); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609 |
|
504 | 504 | } |
505 | 505 | |
506 | 506 | } |
@@ -519,8 +519,8 @@ discard block |
||
519 | 519 | public function get_existing_test_settings() { |
520 | 520 | $settings = parent::get_existing_test_settings(); |
521 | 521 | //override subject if present because we always want it to be fresh. |
522 | - if ( is_array( $settings ) && ! empty( $settings['subject'] ) ) { |
|
523 | - $settings['subject'] = sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') ); |
|
522 | + if (is_array($settings) && ! empty($settings['subject'])) { |
|
523 | + $settings['subject'] = sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name')); |
|
524 | 524 | } |
525 | 525 | return $settings; |
526 | 526 | } |
@@ -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 |
@@ -197,8 +198,10 @@ discard block |
||
197 | 198 | $sc_to_verify = !empty($matches[0] ) ? $matches[0][0] . ']' : $shortcode; |
198 | 199 | |
199 | 200 | //first we want to make sure this is a valid shortcode |
200 | - if ( !array_key_exists($sc_to_verify, $this->_shortcodes ) ) |
|
201 | - return false; //get out, this parser doesn't handle the incoming shortcode. |
|
201 | + if ( !array_key_exists($sc_to_verify, $this->_shortcodes ) ) { |
|
202 | + return false; |
|
203 | + } |
|
204 | + //get out, this parser doesn't handle the incoming shortcode. |
|
202 | 205 | $this->_data = $data; |
203 | 206 | $this->_extra_data = $extra_data; |
204 | 207 | $this->_set_messages_properties(); |
@@ -276,8 +279,9 @@ discard block |
||
276 | 279 | } |
277 | 280 | |
278 | 281 | //next test to make sure we've got got a data index in the incoming data array |
279 | - if ( !isset( $this->_data['data'] ) ) |
|
280 | - throw new EE_Error( __('The incoming data does not have the required data index in its array', 'event_espresso') ); |
|
282 | + if ( !isset( $this->_data['data'] ) ) { |
|
283 | + throw new EE_Error( __('The incoming data does not have the required data index in its array', 'event_espresso') ); |
|
284 | + } |
|
281 | 285 | |
282 | 286 | //all is well let's make sure _extra_data always has the values needed. |
283 | 287 | //let's make sure that extra_data includes all templates (for later parsing if necessary) |
@@ -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 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | |
173 | 173 | public function get_shortcode_helper() { |
174 | - if ( ! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes ) { |
|
174 | + if ( ! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes) { |
|
175 | 175 | $this->_set_shortcode_helper(); |
176 | 176 | } |
177 | 177 | return $this->_shortcode_helper; |
@@ -185,25 +185,25 @@ discard block |
||
185 | 185 | * @param mixed (object|array) $extra_data extra incoming data (usually EE_Messages_Addressee) |
186 | 186 | * @return string parsed shortcode. |
187 | 187 | */ |
188 | - public function parser($shortcode, $data, $extra_data = array() ) { |
|
188 | + public function parser($shortcode, $data, $extra_data = array()) { |
|
189 | 189 | |
190 | 190 | //filter setup shortcodes |
191 | 191 | $this->_shortcodes = $this->get_shortcodes(); |
192 | 192 | |
193 | 193 | //we need to setup any dynamic shortcodes so that they work with the array_key_exists |
194 | - $sc = preg_match_all( '/(\[[A-Za-z0-9\_]+_\*)/', $shortcode, $matches ); |
|
195 | - $sc_to_verify = !empty($matches[0] ) ? $matches[0][0] . ']' : $shortcode; |
|
194 | + $sc = preg_match_all('/(\[[A-Za-z0-9\_]+_\*)/', $shortcode, $matches); |
|
195 | + $sc_to_verify = ! empty($matches[0]) ? $matches[0][0].']' : $shortcode; |
|
196 | 196 | |
197 | 197 | //first we want to make sure this is a valid shortcode |
198 | - if ( !array_key_exists($sc_to_verify, $this->_shortcodes ) ) |
|
198 | + if ( ! array_key_exists($sc_to_verify, $this->_shortcodes)) |
|
199 | 199 | return false; //get out, this parser doesn't handle the incoming shortcode. |
200 | 200 | $this->_data = $data; |
201 | 201 | $this->_extra_data = $extra_data; |
202 | 202 | $this->_set_messages_properties(); |
203 | - $parsed = apply_filters( 'FHEE__' . get_class($this) . '__parser_after', $this->_parser($shortcode), $shortcode, $data, $extra_data, $this ); |
|
203 | + $parsed = apply_filters('FHEE__'.get_class($this).'__parser_after', $this->_parser($shortcode), $shortcode, $data, $extra_data, $this); |
|
204 | 204 | |
205 | 205 | //note the below filter applies to ALL shortcode parsers... be careful! |
206 | - $parsed = apply_filters( 'FHEE__EE_Shortcodes__parser_after', $parsed, $shortcode, $data, $extra_data, $this ); |
|
206 | + $parsed = apply_filters('FHEE__EE_Shortcodes__parser_after', $parsed, $shortcode, $data, $extra_data, $this); |
|
207 | 207 | return $parsed; |
208 | 208 | } |
209 | 209 | |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | * @return array array of shortcodes => description pairs |
220 | 220 | */ |
221 | 221 | public function get_shortcodes() { |
222 | - $this->_shortcodes = apply_filters( 'FHEE__' . get_class($this) . '__shortcodes', $this->_shortcodes, $this ); |
|
222 | + $this->_shortcodes = apply_filters('FHEE__'.get_class($this).'__shortcodes', $this->_shortcodes, $this); |
|
223 | 223 | |
224 | 224 | //note the below filter applies to ALL shortcode parsers... be careful! |
225 | - $this->_shortcodes = apply_filters( 'FHEE__EE_Shortcodes__shortcodes', $this->_shortcodes, $this ); |
|
225 | + $this->_shortcodes = apply_filters('FHEE__EE_Shortcodes__shortcodes', $this->_shortcodes, $this); |
|
226 | 226 | |
227 | 227 | return $this->_shortcodes; |
228 | 228 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * @param mixed (object|array) $data incoming data for the parser. The data could be either an object or array because there are some shortcodes that might be replaced by prepared data that has multiple items in a list (i.e. list of attendees in an event and we're showing fname/lname for each attendee). In this case data will be in an array. Otherwise the data shoudl be in a properly formatted object. The EEH_Parse_Shortcodes.helper.php describes the data object we're expecting. |
253 | 253 | * @return string parsed shortcode |
254 | 254 | */ |
255 | - abstract protected function _parser( $shortcode ); |
|
255 | + abstract protected function _parser($shortcode); |
|
256 | 256 | |
257 | 257 | |
258 | 258 | |
@@ -264,22 +264,22 @@ discard block |
||
264 | 264 | protected function _validate_list_requirements() { |
265 | 265 | |
266 | 266 | //first test to make sure we've got an array! |
267 | - if ( !is_array($this->_data) ) { |
|
268 | - throw new EE_Error( sprintf( __('Expecting an array for the data sent to %s. Instead it was %s', 'event_espresso'), get_class($this), gettype( $this->_data ) ) ); |
|
267 | + if ( ! is_array($this->_data)) { |
|
268 | + throw new EE_Error(sprintf(__('Expecting an array for the data sent to %s. Instead it was %s', 'event_espresso'), get_class($this), gettype($this->_data))); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | //next test to make sure we've got the required template in the index! |
272 | - if ( !isset( $this->_data['template'] ) ) { |
|
273 | - throw new EE_Error( sprintf( __('The incoming data does not have the required template index in its array', 'event_espresso') ) ); |
|
272 | + if ( ! isset($this->_data['template'])) { |
|
273 | + throw new EE_Error(sprintf(__('The incoming data does not have the required template index in its array', 'event_espresso'))); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | //next test to make sure we've got got a data index in the incoming data array |
277 | - if ( !isset( $this->_data['data'] ) ) |
|
278 | - throw new EE_Error( __('The incoming data does not have the required data index in its array', 'event_espresso') ); |
|
277 | + if ( ! isset($this->_data['data'])) |
|
278 | + throw new EE_Error(__('The incoming data does not have the required data index in its array', 'event_espresso')); |
|
279 | 279 | |
280 | 280 | //all is well let's make sure _extra_data always has the values needed. |
281 | 281 | //let's make sure that extra_data includes all templates (for later parsing if necessary) |
282 | - if ( empty( $this->_extra_data ) || ( empty( $this->_extra_data['data'] ) && empty( $this->_extra_data['template'] ) ) ) { |
|
282 | + if (empty($this->_extra_data) || (empty($this->_extra_data['data']) && empty($this->_extra_data['template']))) { |
|
283 | 283 | $this->_extra_data['data'] = $this->_data['data']; |
284 | 284 | $this->_extra_data['template'] = $this->_data['template']; |
285 | 285 | } |
@@ -296,16 +296,16 @@ discard block |
||
296 | 296 | * |
297 | 297 | * @return array An array with the attributes |
298 | 298 | */ |
299 | - protected function _get_shortcode_attrs( $shortcode ) { |
|
299 | + protected function _get_shortcode_attrs($shortcode) { |
|
300 | 300 | //make sure the required wp helper function is present |
301 | 301 | //require the shortcode file if necessary |
302 | - if ( ! function_exists( 'shortcode_parse_atts' ) ) { |
|
303 | - require_once( ABSPATH . WPINC . '/shortcodes.php'); |
|
302 | + if ( ! function_exists('shortcode_parse_atts')) { |
|
303 | + require_once(ABSPATH.WPINC.'/shortcodes.php'); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | //let's get any attributes that may be present and set the defaults. |
307 | - $shortcode_to_parse = str_replace( '[', '', str_replace( ']', '', $shortcode ) ); |
|
308 | - return shortcode_parse_atts( $shortcode_to_parse ); |
|
307 | + $shortcode_to_parse = str_replace('[', '', str_replace(']', '', $shortcode)); |
|
308 | + return shortcode_parse_atts($shortcode_to_parse); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | */ |
321 | 321 | protected function _set_messages_properties() { |
322 | 322 | //should be in _extra_data |
323 | - if ( isset( $this->_extra_data['messenger'] ) ) { |
|
323 | + if (isset($this->_extra_data['messenger'])) { |
|
324 | 324 | $this->_messenger = $this->_extra_data['messenger']; |
325 | 325 | $this->_message_type = $this->_extra_data['message_type']; |
326 | 326 | $this->_context = $this->_extra_data['message'] instanceof EE_Message ? $this->_extra_data['message']->context() : ''; |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | * date_format and the second value is the time format |
38 | 38 | * @return EE_Question |
39 | 39 | */ |
40 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
41 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
42 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
40 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
41 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
42 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | * the website will be used. |
51 | 51 | * @return EE_Question |
52 | 52 | */ |
53 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
54 | - return new self( $props_n_values, TRUE, $timezone ); |
|
53 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
54 | + return new self($props_n_values, TRUE, $timezone); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | * @access public |
63 | 63 | * @param string $QST_display_text |
64 | 64 | */ |
65 | - public function set_display_text( $QST_display_text = '' ) { |
|
66 | - $this->set( 'QST_display_text', $QST_display_text ); |
|
65 | + public function set_display_text($QST_display_text = '') { |
|
66 | + $this->set('QST_display_text', $QST_display_text); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | * @access public |
75 | 75 | * @param string $QST_admin_label |
76 | 76 | */ |
77 | - public function set_admin_label( $QST_admin_label = '' ) { |
|
78 | - $this->set( 'QST_admin_label', $QST_admin_label ); |
|
77 | + public function set_admin_label($QST_admin_label = '') { |
|
78 | + $this->set('QST_admin_label', $QST_admin_label); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | * @access public |
87 | 87 | * @param mixed $QST_system |
88 | 88 | */ |
89 | - public function set_system_ID( $QST_system = '' ) { |
|
90 | - $this->set( 'QST_system', $QST_system ); |
|
89 | + public function set_system_ID($QST_system = '') { |
|
90 | + $this->set('QST_system', $QST_system); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | * @access public |
99 | 99 | * @param string $QST_type |
100 | 100 | */ |
101 | - public function set_question_type( $QST_type = '' ) { |
|
102 | - $this->set( 'QST_type', $QST_type ); |
|
101 | + public function set_question_type($QST_type = '') { |
|
102 | + $this->set('QST_type', $QST_type); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | * @access public |
111 | 111 | * @param bool $QST_required |
112 | 112 | */ |
113 | - public function set_required( $QST_required = FALSE ) { |
|
114 | - $this->set( 'QST_required', $QST_required ); |
|
113 | + public function set_required($QST_required = FALSE) { |
|
114 | + $this->set('QST_required', $QST_required); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | * @access public |
123 | 123 | * @param string $QST_required_text |
124 | 124 | */ |
125 | - public function set_required_text( $QST_required_text = '' ) { |
|
126 | - $this->set( 'QST_required_text', $QST_required_text ); |
|
125 | + public function set_required_text($QST_required_text = '') { |
|
126 | + $this->set('QST_required_text', $QST_required_text); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | * @access public |
135 | 135 | * @param int $QST_order |
136 | 136 | */ |
137 | - public function set_order( $QST_order = 0 ) { |
|
138 | - $this->set( 'QST_order', $QST_order ); |
|
137 | + public function set_order($QST_order = 0) { |
|
138 | + $this->set('QST_order', $QST_order); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | * @access public |
147 | 147 | * @param bool $QST_admin_only |
148 | 148 | */ |
149 | - public function set_admin_only( $QST_admin_only = FALSE ) { |
|
150 | - $this->set( 'QST_admin_only', $QST_admin_only ); |
|
149 | + public function set_admin_only($QST_admin_only = FALSE) { |
|
150 | + $this->set('QST_admin_only', $QST_admin_only); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | * @access public |
159 | 159 | * @param int $QST_wp_user |
160 | 160 | */ |
161 | - public function set_wp_user( $QST_wp_user = 1 ) { |
|
162 | - $this->set( 'QST_wp_user', $QST_wp_user ); |
|
161 | + public function set_wp_user($QST_wp_user = 1) { |
|
162 | + $this->set('QST_wp_user', $QST_wp_user); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | * @access public |
176 | 176 | * @param bool $QST_deleted |
177 | 177 | */ |
178 | - public function set_deleted( $QST_deleted = FALSE ) { |
|
179 | - $this->set( 'QST_deleted', $QST_deleted ); |
|
178 | + public function set_deleted($QST_deleted = FALSE) { |
|
179 | + $this->set('QST_deleted', $QST_deleted); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @return string |
188 | 188 | */ |
189 | 189 | public function display_text() { |
190 | - return $this->get( 'QST_display_text' ); |
|
190 | + return $this->get('QST_display_text'); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @return string |
199 | 199 | */ |
200 | 200 | public function admin_label() { |
201 | - return $this->get( 'QST_admin_label' ); |
|
201 | + return $this->get('QST_admin_label'); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * @return string |
210 | 210 | */ |
211 | 211 | public function system_ID() { |
212 | - return $this->get( 'QST_system' ); |
|
212 | + return $this->get('QST_system'); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * @return boolean |
221 | 221 | */ |
222 | 222 | public function required() { |
223 | - return $this->get( 'QST_required' ); |
|
223 | + return $this->get('QST_required'); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @return string |
233 | 233 | */ |
234 | 234 | public function required_text() { |
235 | - return $this->get( 'QST_required_text' ); |
|
235 | + return $this->get('QST_required_text'); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @return string |
244 | 244 | */ |
245 | 245 | public function type() { |
246 | - return $this->get( 'QST_type' ); |
|
246 | + return $this->get('QST_type'); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * @return int |
256 | 256 | */ |
257 | 257 | public function order() { |
258 | - return $this->get( 'QST_order' ); |
|
258 | + return $this->get('QST_order'); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @return boolean |
268 | 268 | */ |
269 | 269 | public function admin_only() { |
270 | - return $this->get( 'QST_admin_only' ); |
|
270 | + return $this->get('QST_admin_only'); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * @return int |
279 | 279 | */ |
280 | 280 | public function wp_user() { |
281 | - return $this->get( 'QST_wp_user' ); |
|
281 | + return $this->get('QST_wp_user'); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @return boolean |
290 | 290 | */ |
291 | 291 | public function deleted() { |
292 | - return $this->get( 'QST_deleted' ); |
|
292 | + return $this->get('QST_deleted'); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | * @return EE_Answer[] |
300 | 300 | */ |
301 | 301 | public function answers() { |
302 | - return $this->get_many_related( 'Answer' ); |
|
302 | + return $this->get_many_related('Answer'); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | * @return boolean true = has answers, false = no answers. |
310 | 310 | */ |
311 | 311 | public function has_answers() { |
312 | - return $this->count_related( 'Answer' ) > 0 ? TRUE : FALSE; |
|
312 | + return $this->count_related('Answer') > 0 ? TRUE : FALSE; |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @return EE_Question_Group[] |
320 | 320 | */ |
321 | 321 | public function question_groups() { |
322 | - return $this->get_many_related( 'Question_Group' ); |
|
322 | + return $this->get_many_related('Question_Group'); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | |
@@ -333,24 +333,24 @@ discard block |
||
333 | 333 | * whether it was trashed or not. |
334 | 334 | * @return EE_Question_Option[] |
335 | 335 | */ |
336 | - public function options( $notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL ) { |
|
337 | - if ( ! $this->ID() ) { |
|
336 | + public function options($notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL) { |
|
337 | + if ( ! $this->ID()) { |
|
338 | 338 | return array(); |
339 | 339 | } |
340 | 340 | $query_params = array(); |
341 | - if ( $selected_value_to_always_include ) { |
|
342 | - if ( is_array( $selected_value_to_always_include ) ) { |
|
343 | - $query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = array( 'IN', $selected_value_to_always_include ); |
|
341 | + if ($selected_value_to_always_include) { |
|
342 | + if (is_array($selected_value_to_always_include)) { |
|
343 | + $query_params[0]['OR*options-query']['QSO_value'] = array('IN', $selected_value_to_always_include); |
|
344 | 344 | } else { |
345 | - $query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = $selected_value_to_always_include; |
|
345 | + $query_params[0]['OR*options-query']['QSO_value'] = $selected_value_to_always_include; |
|
346 | 346 | } |
347 | 347 | } |
348 | - if ( $notDeletedOptionsOnly ) { |
|
349 | - $query_params[ 0 ][ 'OR*options-query' ][ 'QSO_deleted' ] = FALSE; |
|
348 | + if ($notDeletedOptionsOnly) { |
|
349 | + $query_params[0]['OR*options-query']['QSO_deleted'] = FALSE; |
|
350 | 350 | } |
351 | 351 | //order by QSO_order |
352 | - $query_params[ 'order_by' ] = array( 'QSO_order' => 'ASC' ); |
|
353 | - return $this->get_many_related( 'Question_Option', $query_params ); |
|
352 | + $query_params['order_by'] = array('QSO_order' => 'ASC'); |
|
353 | + return $this->get_many_related('Question_Option', $query_params); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | * @return \EE_Question_Option[] |
361 | 361 | */ |
362 | 362 | public function temp_options() { |
363 | - return $this->_model_relations[ 'Question_Option' ]; |
|
363 | + return $this->_model_relations['Question_Option']; |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | |
@@ -371,8 +371,8 @@ discard block |
||
371 | 371 | * @param EE_Question_Option $option |
372 | 372 | * @return boolean success |
373 | 373 | */ |
374 | - public function add_option( EE_Question_Option $option ) { |
|
375 | - return $this->_add_relation_to( $option, 'Question_Option' ); |
|
374 | + public function add_option(EE_Question_Option $option) { |
|
375 | + return $this->_add_relation_to($option, 'Question_Option'); |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | |
@@ -382,8 +382,8 @@ discard block |
||
382 | 382 | * @param EE_Question_Option $option |
383 | 383 | * @return boolean success |
384 | 384 | */ |
385 | - public function add_temp_option( EE_Question_Option $option ) { |
|
386 | - $this->_model_relations[ 'Question_Option' ][ ] = $option; |
|
385 | + public function add_temp_option(EE_Question_Option $option) { |
|
386 | + $this->_model_relations['Question_Option'][] = $option; |
|
387 | 387 | return TRUE; |
388 | 388 | } |
389 | 389 | |
@@ -394,8 +394,8 @@ discard block |
||
394 | 394 | * @param EE_Question_Option $option |
395 | 395 | * @return boolean success |
396 | 396 | */ |
397 | - public function remove_option( EE_Question_Option $option ) { |
|
398 | - return $this->_remove_relation_to( $option, 'Question_Option' ); |
|
397 | + public function remove_option(EE_Question_Option $option) { |
|
398 | + return $this->_remove_relation_to($option, 'Question_Option'); |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | |
@@ -404,8 +404,8 @@ discard block |
||
404 | 404 | * @return bool |
405 | 405 | */ |
406 | 406 | public function is_system_question() { |
407 | - $system_ID = $this->get( 'QST_system' ); |
|
408 | - return ! empty( $system_ID ) ? TRUE : FALSE; |
|
407 | + $system_ID = $this->get('QST_system'); |
|
408 | + return ! empty($system_ID) ? TRUE : FALSE; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | |
@@ -418,8 +418,8 @@ discard block |
||
418 | 418 | */ |
419 | 419 | public function set_order_to_latest() { |
420 | 420 | $latest_order = $this->get_model()->get_latest_question_order(); |
421 | - $latest_order ++; |
|
422 | - $this->set( 'QST_order', $latest_order ); |
|
421 | + $latest_order++; |
|
422 | + $this->set('QST_order', $latest_order); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | |
@@ -438,20 +438,20 @@ discard block |
||
438 | 438 | * Duplicates this question and its question options |
439 | 439 | * @return \EE_Question |
440 | 440 | */ |
441 | - public function duplicate( $options = array() ) { |
|
441 | + public function duplicate($options = array()) { |
|
442 | 442 | $new_question = clone $this; |
443 | - $new_question->set( 'QST_ID', null ); |
|
444 | - $new_question->set_display_text( sprintf( __( '%s **Duplicate**', 'event_espresso' ), $this->display_text() ) ); |
|
445 | - $new_question->set_admin_label( sprintf( __( '%s **Duplicate**', 'event_espresso' ), $this->admin_label() ) ); |
|
446 | - $new_question->set_system_ID( null ); |
|
447 | - $new_question->set_wp_user( get_current_user_id() ); |
|
443 | + $new_question->set('QST_ID', null); |
|
444 | + $new_question->set_display_text(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->display_text())); |
|
445 | + $new_question->set_admin_label(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->admin_label())); |
|
446 | + $new_question->set_system_ID(null); |
|
447 | + $new_question->set_wp_user(get_current_user_id()); |
|
448 | 448 | //if we're duplicating a trashed question, assume we don't want the new one to be trashed |
449 | - $new_question->set_deleted( false ); |
|
449 | + $new_question->set_deleted(false); |
|
450 | 450 | $success = $new_question->save(); |
451 | - if( $success ) { |
|
451 | + if ($success) { |
|
452 | 452 | //we don't totally want to duplicate the question options, because we want them to be for the NEW question |
453 | - foreach( $this->options() as $question_option ) { |
|
454 | - $question_option->duplicate( array( 'QST_ID' => $new_question->ID() ) ); |
|
453 | + foreach ($this->options() as $question_option) { |
|
454 | + $question_option->duplicate(array('QST_ID' => $new_question->ID())); |
|
455 | 455 | } |
456 | 456 | return $new_question; |
457 | 457 | } else { |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | * @return int|float |
465 | 465 | */ |
466 | 466 | public function max() { |
467 | - return $this->get( 'QST_max' ); |
|
467 | + return $this->get('QST_max'); |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | /** |
@@ -472,8 +472,8 @@ discard block |
||
472 | 472 | * @param int|float $new_max |
473 | 473 | * @return void |
474 | 474 | */ |
475 | - public function set_max( $new_max ) { |
|
476 | - $this->set( 'QST_max', $new_max ); |
|
475 | + public function set_max($new_max) { |
|
476 | + $this->set('QST_max', $new_max); |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | * @param array $input_constructor_args |
486 | 486 | * @return EE_Form_Input_Base |
487 | 487 | */ |
488 | - public function generate_form_input( $registration = null, $answer = null, $input_constructor_args = array() ) { |
|
488 | + public function generate_form_input($registration = null, $answer = null, $input_constructor_args = array()) { |
|
489 | 489 | $identifier = $this->is_system_question() ? $this->system_ID() : $this->ID(); |
490 | 490 | |
491 | 491 | $input_constructor_args = array_merge( |
@@ -496,27 +496,27 @@ discard block |
||
496 | 496 | ), |
497 | 497 | $input_constructor_args |
498 | 498 | ); |
499 | - if( ! $answer instanceof EE_Answer && $registration instanceof EE_Registration ) { |
|
500 | - $answer = EEM_Answer::instance()->get_registration_question_answer_object( $registration, $this->ID() ); |
|
499 | + if ( ! $answer instanceof EE_Answer && $registration instanceof EE_Registration) { |
|
500 | + $answer = EEM_Answer::instance()->get_registration_question_answer_object($registration, $this->ID()); |
|
501 | 501 | } |
502 | 502 | // has this question been answered ? |
503 | - if ( $answer instanceof EE_Answer ) { |
|
503 | + if ($answer instanceof EE_Answer) { |
|
504 | 504 | //answer gets htmlspecialchars called on it, undo that please |
505 | 505 | //beceause the form input's display strategy may call esc_attr too |
506 | 506 | //which also does html special characters |
507 | 507 | $values_with_html_special_chars = $answer->value(); |
508 | - if( is_array( $values_with_html_special_chars ) ) { |
|
509 | - $default_value = array_map( 'htmlspecialchars_decode', $values_with_html_special_chars ); |
|
508 | + if (is_array($values_with_html_special_chars)) { |
|
509 | + $default_value = array_map('htmlspecialchars_decode', $values_with_html_special_chars); |
|
510 | 510 | } else { |
511 | - $default_value = htmlspecialchars_decode( $values_with_html_special_chars ); |
|
511 | + $default_value = htmlspecialchars_decode($values_with_html_special_chars); |
|
512 | 512 | } |
513 | 513 | $input_constructor_args['default'] = $default_value; |
514 | 514 | } |
515 | - $max_max_for_question = EEM_Question::instance()->absolute_max_for_system_question( $this->system_ID() ); |
|
516 | - if( EEM_Question::instance()->question_type_is_in_category( $this->type(), 'text' ) ) { |
|
517 | - $input_constructor_args[ 'validation_strategies' ][] = new EE_Max_Length_Validation_Strategy( |
|
515 | + $max_max_for_question = EEM_Question::instance()->absolute_max_for_system_question($this->system_ID()); |
|
516 | + if (EEM_Question::instance()->question_type_is_in_category($this->type(), 'text')) { |
|
517 | + $input_constructor_args['validation_strategies'][] = new EE_Max_Length_Validation_Strategy( |
|
518 | 518 | null, |
519 | - min( $max_max_for_question, $this->max() ) |
|
519 | + min($max_max_for_question, $this->max()) |
|
520 | 520 | ); |
521 | 521 | } |
522 | 522 | $input_constructor_args = apply_filters( |
@@ -528,22 +528,22 @@ discard block |
||
528 | 528 | ); |
529 | 529 | |
530 | 530 | $result = null; |
531 | - switch ( $this->type() ) { |
|
531 | + switch ($this->type()) { |
|
532 | 532 | // Text |
533 | 533 | case EEM_Question::QST_type_text : |
534 | - $result = new EE_Text_Input( $input_constructor_args ); |
|
534 | + $result = new EE_Text_Input($input_constructor_args); |
|
535 | 535 | break; |
536 | 536 | // Textarea |
537 | 537 | case EEM_Question::QST_type_textarea : |
538 | - $result = new EE_Text_Area_Input( $input_constructor_args ); |
|
538 | + $result = new EE_Text_Area_Input($input_constructor_args); |
|
539 | 539 | break; |
540 | 540 | // Radio Buttons |
541 | 541 | case EEM_Question::QST_type_radio : |
542 | - $result = new EE_Radio_Button_Input( $this->options(), $input_constructor_args ); |
|
542 | + $result = new EE_Radio_Button_Input($this->options(), $input_constructor_args); |
|
543 | 543 | break; |
544 | 544 | // Dropdown |
545 | 545 | case EEM_Question::QST_type_dropdown : |
546 | - $result = new EE_Select_Input( $this->options(), $input_constructor_args ); |
|
546 | + $result = new EE_Select_Input($this->options(), $input_constructor_args); |
|
547 | 547 | break; |
548 | 548 | // State Dropdown |
549 | 549 | case EEM_Question::QST_type_state : |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $registration, |
555 | 555 | $answer |
556 | 556 | ); |
557 | - $result = new EE_State_Select_Input( $state_options, $input_constructor_args ); |
|
557 | + $result = new EE_State_Select_Input($state_options, $input_constructor_args); |
|
558 | 558 | break; |
559 | 559 | // Country Dropdown |
560 | 560 | case EEM_Question::QST_type_country : |
@@ -565,49 +565,49 @@ discard block |
||
565 | 565 | $registration, |
566 | 566 | $answer |
567 | 567 | ); |
568 | - $result = new EE_Country_Select_Input( $country_options, $input_constructor_args ); |
|
568 | + $result = new EE_Country_Select_Input($country_options, $input_constructor_args); |
|
569 | 569 | break; |
570 | 570 | // Checkboxes |
571 | 571 | case EEM_Question::QST_type_checkbox : |
572 | - $result = new EE_Checkbox_Multi_Input( $this->options(), $input_constructor_args ); |
|
572 | + $result = new EE_Checkbox_Multi_Input($this->options(), $input_constructor_args); |
|
573 | 573 | break; |
574 | 574 | // Date |
575 | 575 | case EEM_Question::QST_type_date : |
576 | - $result = new EE_Datepicker_Input( $input_constructor_args ); |
|
576 | + $result = new EE_Datepicker_Input($input_constructor_args); |
|
577 | 577 | break; |
578 | 578 | case EEM_Question::QST_type_html_textarea : |
579 | - $input_constructor_args[ 'validation_strategies' ][] = new EE_Simple_HTML_Validation_Strategy(); |
|
580 | - $result = new EE_Text_Area_Input( $input_constructor_args ); |
|
581 | - $result->remove_validation_strategy( 'EE_Plaintext_Validation_Strategy' ); |
|
579 | + $input_constructor_args['validation_strategies'][] = new EE_Simple_HTML_Validation_Strategy(); |
|
580 | + $result = new EE_Text_Area_Input($input_constructor_args); |
|
581 | + $result->remove_validation_strategy('EE_Plaintext_Validation_Strategy'); |
|
582 | 582 | break; |
583 | 583 | case EEM_Question::QST_type_email : |
584 | - $result = new EE_Email_Input( $input_constructor_args ); |
|
584 | + $result = new EE_Email_Input($input_constructor_args); |
|
585 | 585 | break; |
586 | 586 | case EEM_Question::QST_type_us_phone : |
587 | - $result = new EE_Phone_Input( $input_constructor_args ); |
|
587 | + $result = new EE_Phone_Input($input_constructor_args); |
|
588 | 588 | break; |
589 | 589 | case EEM_Question::QST_type_int : |
590 | - $input_constructor_args[ 'validation_strategies' ][] = new EE_Int_Validation_Strategy(); |
|
591 | - $result = new EE_Text_Input( $input_constructor_args ); |
|
590 | + $input_constructor_args['validation_strategies'][] = new EE_Int_Validation_Strategy(); |
|
591 | + $result = new EE_Text_Input($input_constructor_args); |
|
592 | 592 | break; |
593 | 593 | case EEM_Question::QST_type_decimal : |
594 | - $input_constructor_args[ 'validation_strategies' ][] = new EE_Float_Validation_Strategy(); |
|
595 | - $result = new EE_Text_Input( $input_constructor_args ); |
|
594 | + $input_constructor_args['validation_strategies'][] = new EE_Float_Validation_Strategy(); |
|
595 | + $result = new EE_Text_Input($input_constructor_args); |
|
596 | 596 | break; |
597 | 597 | case EEM_Question::QST_type_url : |
598 | - $input_constructor_args[ 'validation_strategies' ][] = new EE_URL_Validation_Strategy(); |
|
599 | - $result = new EE_Text_Input( $input_constructor_args ); |
|
598 | + $input_constructor_args['validation_strategies'][] = new EE_URL_Validation_Strategy(); |
|
599 | + $result = new EE_Text_Input($input_constructor_args); |
|
600 | 600 | break; |
601 | 601 | case EEM_Question::QST_type_year : |
602 | 602 | $result = new EE_Year_Input( |
603 | 603 | $input_constructor_args, |
604 | - apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__four_digit', true, $this ), |
|
605 | - apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__early_range', 100, $this ), |
|
606 | - apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__end_range', 100, $this ) |
|
604 | + apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__four_digit', true, $this), |
|
605 | + apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__early_range', 100, $this), |
|
606 | + apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__end_range', 100, $this) |
|
607 | 607 | ); |
608 | 608 | break; |
609 | 609 | case EEM_Question::QST_type_multi_select : |
610 | - $result = new EE_Select_Multiple_Input( $this->options(), $input_constructor_args ); |
|
610 | + $result = new EE_Select_Multiple_Input($this->options(), $input_constructor_args); |
|
611 | 611 | break; |
612 | 612 | // fallback |
613 | 613 | default : |
@@ -618,12 +618,12 @@ discard block |
||
618 | 618 | $this, |
619 | 619 | $input_constructor_args |
620 | 620 | ); |
621 | - if( ! $default_input ){ |
|
622 | - $default_input = new EE_Text_Input( $input_constructor_args ); |
|
621 | + if ( ! $default_input) { |
|
622 | + $default_input = new EE_Text_Input($input_constructor_args); |
|
623 | 623 | } |
624 | 624 | $result = $default_input; |
625 | 625 | } |
626 | - return apply_filters( 'FHEE__EE_Question__generate_form_input__return', $result, $registration, $this, $answer ); |
|
626 | + return apply_filters('FHEE__EE_Question__generate_form_input__return', $result, $registration, $this, $answer); |
|
627 | 627 | } |
628 | 628 | |
629 | 629 |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | * Adds an option for this question. Note: if the option were previously associated with a different |
370 | 370 | * Question, that relationship will be overwritten. |
371 | 371 | * @param EE_Question_Option $option |
372 | - * @return boolean success |
|
372 | + * @return EE_Base_Class success |
|
373 | 373 | */ |
374 | 374 | public function add_option( EE_Question_Option $option ) { |
375 | 375 | return $this->_add_relation_to( $option, 'Question_Option' ); |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | /** |
393 | 393 | * Marks the option as deleted. |
394 | 394 | * @param EE_Question_Option $option |
395 | - * @return boolean success |
|
395 | + * @return EE_Base_Class success |
|
396 | 396 | */ |
397 | 397 | public function remove_option( EE_Question_Option $option ) { |
398 | 398 | return $this->_remove_relation_to( $option, 'Question_Option' ); |
@@ -50,79 +50,79 @@ discard block |
||
50 | 50 | * @throws \EE_Error |
51 | 51 | * } |
52 | 52 | */ |
53 | - public static function register( $mt_name = NULL, $setup_args = array() ) { |
|
53 | + public static function register($mt_name = NULL, $setup_args = array()) { |
|
54 | 54 | //required fields MUST be present, so let's make sure they are. |
55 | 55 | if ( |
56 | - ! isset( $mt_name ) |
|
57 | - || ! is_array( $setup_args ) |
|
58 | - || empty( $setup_args['mtfilename'] ) || empty( $setup_args['autoloadpaths'] ) |
|
59 | - ){ |
|
56 | + ! isset($mt_name) |
|
57 | + || ! is_array($setup_args) |
|
58 | + || empty($setup_args['mtfilename']) || empty($setup_args['autoloadpaths']) |
|
59 | + ) { |
|
60 | 60 | throw new EE_Error( |
61 | - __( 'In order to register a message type with EE_Register_Message_Type::register, you must include a unique name for the message type, plus an array containing the following keys: "mtfilename", "autoloadpaths"', 'event_espresso' ) |
|
61 | + __('In order to register a message type with EE_Register_Message_Type::register, you must include a unique name for the message type, plus an array containing the following keys: "mtfilename", "autoloadpaths"', 'event_espresso') |
|
62 | 62 | ); |
63 | 63 | } |
64 | 64 | |
65 | 65 | //make sure we don't register twice |
66 | - if( isset( self::$_ee_message_type_registry[ $mt_name ] ) ){ |
|
66 | + if (isset(self::$_ee_message_type_registry[$mt_name])) { |
|
67 | 67 | return; |
68 | 68 | } |
69 | 69 | |
70 | 70 | //make sure this was called in the right place! |
71 | 71 | if ( |
72 | - ! did_action( 'EE_Brewing_Regular___messages_caf' ) |
|
73 | - || did_action( 'AHEE__EE_System__perform_activations_upgrades_and_migrations' ) |
|
72 | + ! did_action('EE_Brewing_Regular___messages_caf') |
|
73 | + || did_action('AHEE__EE_System__perform_activations_upgrades_and_migrations') |
|
74 | 74 | ) { |
75 | 75 | EE_Error::doing_it_wrong( |
76 | 76 | __METHOD__, |
77 | 77 | sprintf( |
78 | - __('A message type named "%s" has been attempted to be registered with the EE Messages System. It may or may not work because it should be only called on the "EE_Brewing_Regular___messages_caf" hook.','event_espresso'), |
|
78 | + __('A message type named "%s" has been attempted to be registered with the EE Messages System. It may or may not work because it should be only called on the "EE_Brewing_Regular___messages_caf" hook.', 'event_espresso'), |
|
79 | 79 | $mt_name |
80 | 80 | ), |
81 | 81 | '4.3.0' |
82 | 82 | ); |
83 | 83 | } |
84 | 84 | //setup $__ee_message_type_registry array from incoming values. |
85 | - self::$_ee_message_type_registry[ $mt_name ] = array( |
|
85 | + self::$_ee_message_type_registry[$mt_name] = array( |
|
86 | 86 | 'mtfilename' => (string) $setup_args['mtfilename'], |
87 | 87 | 'autoloadpaths' => (array) $setup_args['autoloadpaths'], |
88 | - 'messengers_to_activate_with' => ! empty( $setup_args['messengers_to_activate_with'] ) |
|
88 | + 'messengers_to_activate_with' => ! empty($setup_args['messengers_to_activate_with']) |
|
89 | 89 | ? (array) $setup_args['messengers_to_activate_with'] |
90 | 90 | : array(), |
91 | - 'messengers_to_validate_with' => ! empty( $setup_args['messengers_to_validate_with'] ) |
|
91 | + 'messengers_to_validate_with' => ! empty($setup_args['messengers_to_validate_with']) |
|
92 | 92 | ? (array) $setup_args['messengers_to_validate_with'] |
93 | 93 | : array(), |
94 | - 'force_activation' => ! empty( $setup_args['force_activation'] ) |
|
94 | + 'force_activation' => ! empty($setup_args['force_activation']) |
|
95 | 95 | ? (bool) $setup_args['force_activation'] |
96 | 96 | : array() |
97 | 97 | ); |
98 | 98 | //add filters |
99 | 99 | add_filter( |
100 | 100 | 'FHEE__EED_Messages___set_messages_paths___MSG_PATHS', |
101 | - array( 'EE_Register_Message_Type', 'register_msgs_autoload_paths' ), |
|
101 | + array('EE_Register_Message_Type', 'register_msgs_autoload_paths'), |
|
102 | 102 | 10 |
103 | 103 | ); |
104 | 104 | add_filter( |
105 | 105 | 'FHEE__EE_messages__get_installed__messagetype_files', |
106 | - array( 'EE_Register_Message_Type', 'register_messagetype_files' ), |
|
106 | + array('EE_Register_Message_Type', 'register_messagetype_files'), |
|
107 | 107 | 10, |
108 | 108 | 1 |
109 | 109 | ); |
110 | 110 | add_filter( |
111 | 111 | 'FHEE__EE_messenger__get_default_message_types__default_types', |
112 | - array( 'EE_Register_Message_Type', 'register_messengers_to_activate_mt_with' ), |
|
112 | + array('EE_Register_Message_Type', 'register_messengers_to_activate_mt_with'), |
|
113 | 113 | 10, |
114 | 114 | 2 |
115 | 115 | ); |
116 | 116 | add_filter( |
117 | 117 | 'FHEE__EE_messenger__get_valid_message_types__valid_types', |
118 | - array( 'EE_Register_Message_Type', 'register_messengers_to_validate_mt_with' ), |
|
118 | + array('EE_Register_Message_Type', 'register_messengers_to_validate_mt_with'), |
|
119 | 119 | 10, |
120 | 120 | 2 |
121 | 121 | ); |
122 | 122 | //actions |
123 | 123 | add_action( |
124 | 124 | 'AHEE__EE_Addon__initialize_default_data__begin', |
125 | - array( 'EE_Register_Message_Type', 'set_defaults' ) |
|
125 | + array('EE_Register_Message_Type', 'set_defaults') |
|
126 | 126 | ); |
127 | 127 | } |
128 | 128 | |
@@ -133,15 +133,15 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public static function set_defaults() { |
135 | 135 | /** @type EE_Message_Resource_Manager $message_resource_manager */ |
136 | - $message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
136 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
137 | 137 | |
138 | 138 | //for any message types with force activation, let's ensure they are activated |
139 | - foreach ( self::$_ee_message_type_registry as $message_type_name => $settings ) { |
|
140 | - if ( $settings['force_activation'] ) { |
|
141 | - foreach ( $settings['messengers_to_activate_with'] as $messenger ) { |
|
139 | + foreach (self::$_ee_message_type_registry as $message_type_name => $settings) { |
|
140 | + if ($settings['force_activation']) { |
|
141 | + foreach ($settings['messengers_to_activate_with'] as $messenger) { |
|
142 | 142 | //DO not force activation if this message type has already been activated in the system |
143 | - if ( ! $message_resource_manager->has_message_type_been_activated_for_messenger( $message_type_name, $messenger ) ) { |
|
144 | - $message_resource_manager->ensure_message_type_is_active( $message_type_name, $messenger ); |
|
143 | + if ( ! $message_resource_manager->has_message_type_been_activated_for_messenger($message_type_name, $messenger)) { |
|
144 | + $message_resource_manager->ensure_message_type_is_active($message_type_name, $messenger); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | } |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | * @param string $message_type_name the name for the message type that was previously registered |
159 | 159 | * @return void |
160 | 160 | */ |
161 | - public static function deregister( $message_type_name = null ) { |
|
162 | - if ( ! empty( self::$_ee_message_type_registry[ $message_type_name ] ) ) { |
|
161 | + public static function deregister($message_type_name = null) { |
|
162 | + if ( ! empty(self::$_ee_message_type_registry[$message_type_name])) { |
|
163 | 163 | //let's make sure that we remove any place this message type was made active |
164 | 164 | /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
165 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
166 | - $Message_Resource_Manager->deactivate_message_type( $message_type_name ); |
|
167 | - unset( self::$_ee_message_type_registry[ $message_type_name ] ); |
|
165 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
166 | + $Message_Resource_Manager->deactivate_message_type($message_type_name); |
|
167 | + unset(self::$_ee_message_type_registry[$message_type_name]); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
@@ -178,12 +178,12 @@ discard block |
||
178 | 178 | * @param array $messagetype_files The current array of message type file names |
179 | 179 | * @return array Array of message type file names |
180 | 180 | */ |
181 | - public static function register_messagetype_files( $messagetype_files ) { |
|
182 | - if ( empty( self::$_ee_message_type_registry ) ) { |
|
181 | + public static function register_messagetype_files($messagetype_files) { |
|
182 | + if (empty(self::$_ee_message_type_registry)) { |
|
183 | 183 | return $messagetype_files; |
184 | 184 | } |
185 | - foreach ( self::$_ee_message_type_registry as $mt_reg ) { |
|
186 | - if ( empty( $mt_reg['mtfilename' ] ) ) { |
|
185 | + foreach (self::$_ee_message_type_registry as $mt_reg) { |
|
186 | + if (empty($mt_reg['mtfilename'])) { |
|
187 | 187 | continue; |
188 | 188 | } |
189 | 189 | $messagetype_files[] = $mt_reg['mtfilename']; |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | * @param array $paths array of paths to be checked by EE_messages autoloader. |
204 | 204 | * @return array |
205 | 205 | */ |
206 | - public static function register_msgs_autoload_paths( $paths ) { |
|
207 | - if ( ! empty( self::$_ee_message_type_registry ) ) { |
|
208 | - foreach ( self::$_ee_message_type_registry as $mt_reg ) { |
|
209 | - if ( empty( $mt_reg['autoloadpaths'] ) ) { |
|
206 | + public static function register_msgs_autoload_paths($paths) { |
|
207 | + if ( ! empty(self::$_ee_message_type_registry)) { |
|
208 | + foreach (self::$_ee_message_type_registry as $mt_reg) { |
|
209 | + if (empty($mt_reg['autoloadpaths'])) { |
|
210 | 210 | continue; |
211 | 211 | } |
212 | - $paths = array_merge( $paths, $mt_reg['autoloadpaths'] ); |
|
212 | + $paths = array_merge($paths, $mt_reg['autoloadpaths']); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 | return $paths; |
@@ -228,18 +228,18 @@ discard block |
||
228 | 228 | * @param EE_messenger $messenger The EE_messenger the filter is called from. |
229 | 229 | * @return array |
230 | 230 | */ |
231 | - public static function register_messengers_to_activate_mt_with( $default_types, EE_messenger $messenger ) { |
|
232 | - if ( empty( self::$_ee_message_type_registry ) ) { |
|
231 | + public static function register_messengers_to_activate_mt_with($default_types, EE_messenger $messenger) { |
|
232 | + if (empty(self::$_ee_message_type_registry)) { |
|
233 | 233 | return $default_types; |
234 | 234 | } |
235 | - foreach ( self::$_ee_message_type_registry as $message_type_name => $mt_reg ) { |
|
236 | - if ( empty( $mt_reg['messengers_to_activate_with'] ) || empty( $mt_reg['mtfilename'] ) ) { |
|
235 | + foreach (self::$_ee_message_type_registry as $message_type_name => $mt_reg) { |
|
236 | + if (empty($mt_reg['messengers_to_activate_with']) || empty($mt_reg['mtfilename'])) { |
|
237 | 237 | continue; |
238 | 238 | } |
239 | 239 | // loop through each of the messengers and if it matches the loaded class |
240 | 240 | // then we add this message type to the |
241 | - foreach ( $mt_reg['messengers_to_activate_with'] as $msgr ) { |
|
242 | - if ( $messenger->name == $msgr ) { |
|
241 | + foreach ($mt_reg['messengers_to_activate_with'] as $msgr) { |
|
242 | + if ($messenger->name == $msgr) { |
|
243 | 243 | $default_types[] = $message_type_name; |
244 | 244 | } |
245 | 245 | } |
@@ -259,18 +259,18 @@ discard block |
||
259 | 259 | * @param EE_messenger $messenger The EE_messenger the filter is called from. |
260 | 260 | * @return array |
261 | 261 | */ |
262 | - public static function register_messengers_to_validate_mt_with( $valid_types, EE_messenger $messenger ) { |
|
263 | - if ( empty( self::$_ee_message_type_registry ) ) { |
|
262 | + public static function register_messengers_to_validate_mt_with($valid_types, EE_messenger $messenger) { |
|
263 | + if (empty(self::$_ee_message_type_registry)) { |
|
264 | 264 | return $valid_types; |
265 | 265 | } |
266 | - foreach ( self::$_ee_message_type_registry as $message_type_name => $mt_reg ) { |
|
267 | - if ( empty( $mt_reg['messengers_to_validate_with'] ) || empty( $mt_reg['mtfilename'] ) ) { |
|
266 | + foreach (self::$_ee_message_type_registry as $message_type_name => $mt_reg) { |
|
267 | + if (empty($mt_reg['messengers_to_validate_with']) || empty($mt_reg['mtfilename'])) { |
|
268 | 268 | continue; |
269 | 269 | } |
270 | 270 | // loop through each of the messengers and if it matches the loaded class |
271 | 271 | // then we add this message type to the |
272 | - foreach ( $mt_reg['messengers_to_validate_with'] as $msgr ) { |
|
273 | - if ( $messenger->name == $msgr ) { |
|
272 | + foreach ($mt_reg['messengers_to_validate_with'] as $msgr) { |
|
273 | + if ($messenger->name == $msgr) { |
|
274 | 274 | $valid_types[] = $message_type_name; |
275 | 275 | } |
276 | 276 | } |
@@ -251,14 +251,14 @@ |
||
251 | 251 | |
252 | 252 | |
253 | 253 | /** |
254 | - * callback for FHEE__EE_messenger__get_valid_message_types__default_types filter. |
|
255 | - * |
|
256 | - * @since 4.3.0 |
|
257 | - * @param array $valid_types array of message types valid with messenger ( |
|
258 | - * corresponds to the $name property of message type) |
|
259 | - * @param EE_messenger $messenger The EE_messenger the filter is called from. |
|
260 | - * @return array |
|
261 | - */ |
|
254 | + * callback for FHEE__EE_messenger__get_valid_message_types__default_types filter. |
|
255 | + * |
|
256 | + * @since 4.3.0 |
|
257 | + * @param array $valid_types array of message types valid with messenger ( |
|
258 | + * corresponds to the $name property of message type) |
|
259 | + * @param EE_messenger $messenger The EE_messenger the filter is called from. |
|
260 | + * @return array |
|
261 | + */ |
|
262 | 262 | public static function register_messengers_to_validate_mt_with( $valid_types, EE_messenger $messenger ) { |
263 | 263 | if ( empty( self::$_ee_message_type_registry ) ) { |
264 | 264 | return $valid_types; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param mixed $info |
40 | 40 | * @return bool |
41 | 41 | */ |
42 | - public function add( $object, $info = null ) { |
|
43 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
44 | - return parent::add( $object, $info ); |
|
42 | + public function add($object, $info = null) { |
|
43 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
44 | + return parent::add($object, $info); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | * @param mixed $info |
58 | 58 | * @return bool |
59 | 59 | */ |
60 | - public function set_info( $object, $info = null ) { |
|
61 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
62 | - return parent::set_info( $object, $info ); |
|
60 | + public function set_info($object, $info = null) { |
|
61 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
62 | + return parent::set_info($object, $info); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | * @param mixed |
75 | 75 | * @return null | object |
76 | 76 | */ |
77 | - public function get_by_info( $info ) { |
|
78 | - return parent::get_by_info( str_replace( ' ', '_', strtolower( $info ) ) ); |
|
77 | + public function get_by_info($info) { |
|
78 | + return parent::get_by_info(str_replace(' ', '_', strtolower($info))); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | * @param object $object |
90 | 90 | * @return bool |
91 | 91 | */ |
92 | - public function has( $object ) { |
|
93 | - return parent::has( $object ); |
|
92 | + public function has($object) { |
|
93 | + return parent::has($object); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | * @param string $message_type_name |
105 | 105 | * @return bool |
106 | 106 | */ |
107 | - public function has_by_name( $message_type_name ) { |
|
108 | - return $this->get_by_info( $message_type_name ) instanceof $this->interface ? true : false; |
|
107 | + public function has_by_name($message_type_name) { |
|
108 | + return $this->get_by_info($message_type_name) instanceof $this->interface ? true : false; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | * @param $object |
120 | 120 | * @return bool |
121 | 121 | */ |
122 | - public function remove( $object ) { |
|
123 | - return parent::remove( $object ); |
|
122 | + public function remove($object) { |
|
123 | + return parent::remove($object); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | * @param $object |
135 | 135 | * @return void |
136 | 136 | */ |
137 | - public function set_current( $object ) { |
|
138 | - parent::set_current( $object ); |
|
137 | + public function set_current($object) { |
|
138 | + parent::set_current($object); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | * @param $info |
150 | 150 | * @return void |
151 | 151 | */ |
152 | - public function set_current_by_info( $info ) { |
|
153 | - parent::set_current_by_info( $info ); |
|
152 | + public function set_current_by_info($info) { |
|
153 | + parent::set_current_by_info($info); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -164,10 +164,10 @@ discard block |
||
164 | 164 | * @return void |
165 | 165 | */ |
166 | 166 | public function show_collection_classes() { |
167 | - if ( WP_DEBUG ) { |
|
167 | + if (WP_DEBUG) { |
|
168 | 168 | $this->rewind(); |
169 | - while ( $this->valid() ) { |
|
170 | - echo '<h5 style="color:#2EA2CC;">' . __CLASS__ . ' class : <span style="color:#E76700">' . $this->getInfo() . '</span></h5>'; |
|
169 | + while ($this->valid()) { |
|
170 | + echo '<h5 style="color:#2EA2CC;">'.__CLASS__.' class : <span style="color:#E76700">'.$this->getInfo().'</span></h5>'; |
|
171 | 171 | $this->next(); |
172 | 172 | } |
173 | 173 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param mixed $info |
40 | 40 | * @return bool |
41 | 41 | */ |
42 | - public function add( $object, $info = null ) { |
|
43 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
44 | - return parent::add( $object, $info ); |
|
42 | + public function add($object, $info = null) { |
|
43 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
44 | + return parent::add($object, $info); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | * @param mixed $info |
58 | 58 | * @return bool |
59 | 59 | */ |
60 | - public function set_info( $object, $info = null ) { |
|
61 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
62 | - return parent::set_info( $object, $info ); |
|
60 | + public function set_info($object, $info = null) { |
|
61 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
62 | + return parent::set_info($object, $info); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | * @param mixed |
75 | 75 | * @return null | object |
76 | 76 | */ |
77 | - public function get_by_info( $info ) { |
|
78 | - return parent::get_by_info( str_replace( ' ', '_', strtolower( $info ) ) ); |
|
77 | + public function get_by_info($info) { |
|
78 | + return parent::get_by_info(str_replace(' ', '_', strtolower($info))); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | * @param object $object |
90 | 90 | * @return bool |
91 | 91 | */ |
92 | - public function has( $object ) { |
|
93 | - return parent::has( $object ); |
|
92 | + public function has($object) { |
|
93 | + return parent::has($object); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | * @param string $messenger_name |
105 | 105 | * @return bool |
106 | 106 | */ |
107 | - public function has_by_name( $messenger_name ) { |
|
108 | - return $this->get_by_info( $messenger_name ) instanceof $this->interface ? true : false; |
|
107 | + public function has_by_name($messenger_name) { |
|
108 | + return $this->get_by_info($messenger_name) instanceof $this->interface ? true : false; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | * @param $object |
120 | 120 | * @return bool |
121 | 121 | */ |
122 | - public function remove( $object ) { |
|
123 | - return parent::remove( $object ); |
|
122 | + public function remove($object) { |
|
123 | + return parent::remove($object); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | * @param $object |
149 | 149 | * @return void |
150 | 150 | */ |
151 | - public function set_current( $object ) { |
|
152 | - parent::set_current( $object ); |
|
151 | + public function set_current($object) { |
|
152 | + parent::set_current($object); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | * @param $info |
164 | 164 | * @return void |
165 | 165 | */ |
166 | - public function set_current_by_info( $info ) { |
|
167 | - parent::set_current_by_info( $info ); |
|
166 | + public function set_current_by_info($info) { |
|
167 | + parent::set_current_by_info($info); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | * @return void |
179 | 179 | */ |
180 | 180 | public function show_collection_classes() { |
181 | - if ( WP_DEBUG ) { |
|
181 | + if (WP_DEBUG) { |
|
182 | 182 | $this->rewind(); |
183 | - while ( $this->valid() ) { |
|
184 | - echo '<h5 style="color:#2EA2CC;">' . __CLASS__ . ' class : . <span style="color:#E76700">' . $this->getInfo() . '</span></h5>'; |
|
183 | + while ($this->valid()) { |
|
184 | + echo '<h5 style="color:#2EA2CC;">'.__CLASS__.' class : . <span style="color:#E76700">'.$this->getInfo().'</span></h5>'; |
|
185 | 185 | $this->next(); |
186 | 186 | } |
187 | 187 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | * @author Mike Nelson |
16 | 16 | * |
17 | 17 | */ |
18 | -class EE_Phone_Input extends EE_Text_Input{ |
|
18 | +class EE_Phone_Input extends EE_Text_Input { |
|
19 | 19 | /** |
20 | 20 | * @param array $options |
21 | 21 | */ |
22 | - function __construct($options = array()){ |
|
22 | + function __construct($options = array()) { |
|
23 | 23 | $this->_add_validation_strategy( |
24 | 24 | new EE_Text_Validation_Strategy( |
25 | - __( 'Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso' ), |
|
25 | + __('Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso'), |
|
26 | 26 | '~^([\d]{10})|([\d]{3}-[\d]{3}-[\d]{4})$~' |
27 | 27 | ) |
28 | 28 | ); |
29 | - parent::__construct( $options ); |
|
29 | + parent::__construct($options); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 |