Completed
Branch BUG-10177-stop-bot-txns (65cfc6)
by
unknown
152:38 queued 129:47
created
caffeinated/EE_Caf_Messages.class.php 1 patch
Spacing   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @since            4.3.2
16 16
  * @author          Darren Ethier
17 17
  */
18
-class EE_Caf_Messages  {
18
+class EE_Caf_Messages {
19 19
 
20 20
 
21 21
 	/**
@@ -34,36 +34,36 @@  discard block
 block discarded – undo
34 34
 	 * @return void
35 35
 	 */
36 36
 	private function _caf_hooks() {
37
-		add_filter('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', array( $this, 'messages_autoload_paths'), 5 );
38
-		add_filter('FHEE__EE_Email_messenger__get_validator_config', array( $this, 'email_messenger_validator_config'), 5, 2 );
39
-		add_filter('FHEE__EE_Email_messenger__get_template_fields', array( $this, 'email_messenger_template_fields'), 5, 2 );
40
-		add_filter( 'FHEE__EE_Html_messenger__get_template_fields', array( $this, 'html_messenger_template_fields' ), 5, 2 );
41
-		add_filter( 'FHEE__EE_Html_messenger__get_validator_config', array( $this, 'html_messenger_validator_config' ), 5, 2 );
42
-		add_filter( 'FHEE__EE_Pdf_messenger__get_template_fields', array( $this, 'pdf_messenger_template_fields' ), 5, 2 );
43
-		add_filter( 'FHEE__EE_Pdf_messenger__get_validator_config', array( $this, 'pdf_messenger_validator_config' ), 5, 2 );
44
-		add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', array( $this, 'new_default_templates'), 5, 7 );
45
-		add_filter('FHEE__EE_Messages_Base__get_valid_shortcodes', array( $this, 'message_types_valid_shortcodes'), 5, 2 );
37
+		add_filter('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', array($this, 'messages_autoload_paths'), 5);
38
+		add_filter('FHEE__EE_Email_messenger__get_validator_config', array($this, 'email_messenger_validator_config'), 5, 2);
39
+		add_filter('FHEE__EE_Email_messenger__get_template_fields', array($this, 'email_messenger_template_fields'), 5, 2);
40
+		add_filter('FHEE__EE_Html_messenger__get_template_fields', array($this, 'html_messenger_template_fields'), 5, 2);
41
+		add_filter('FHEE__EE_Html_messenger__get_validator_config', array($this, 'html_messenger_validator_config'), 5, 2);
42
+		add_filter('FHEE__EE_Pdf_messenger__get_template_fields', array($this, 'pdf_messenger_template_fields'), 5, 2);
43
+		add_filter('FHEE__EE_Pdf_messenger__get_validator_config', array($this, 'pdf_messenger_validator_config'), 5, 2);
44
+		add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', array($this, 'new_default_templates'), 5, 7);
45
+		add_filter('FHEE__EE_Messages_Base__get_valid_shortcodes', array($this, 'message_types_valid_shortcodes'), 5, 2);
46 46
 
47 47
 		//shortcode parsers
48
-		add_filter('FHEE__EE_Attendee_Shortcodes__shortcodes', array( $this, 'additional_attendee_shortcodes'), 5, 2 );
49
-		add_filter('FHEE__EE_Attendee_Shortcodes__parser_after', array( $this, 'additional_attendee_parser'), 5, 5 );
50
-		add_filter('FHEE__EE_Recipient_List_Shortcodes__shortcodes', array( $this, 'additional_recipient_details_shortcodes'), 5, 2 );
51
-		add_filter('FHEE__EE_Recipient_List_Shortcodes__parser_after', array( $this, 'additional_recipient_details_parser'), 5, 5 );
52
-		add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__shortcodes', array( $this, 'additional_primary_registration_details_shortcodes'), 5, 2 );
53
-		add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__parser_after', array( $this, 'additional_primary_registration_details_parser'), 5, 5 );
48
+		add_filter('FHEE__EE_Attendee_Shortcodes__shortcodes', array($this, 'additional_attendee_shortcodes'), 5, 2);
49
+		add_filter('FHEE__EE_Attendee_Shortcodes__parser_after', array($this, 'additional_attendee_parser'), 5, 5);
50
+		add_filter('FHEE__EE_Recipient_List_Shortcodes__shortcodes', array($this, 'additional_recipient_details_shortcodes'), 5, 2);
51
+		add_filter('FHEE__EE_Recipient_List_Shortcodes__parser_after', array($this, 'additional_recipient_details_parser'), 5, 5);
52
+		add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__shortcodes', array($this, 'additional_primary_registration_details_shortcodes'), 5, 2);
53
+		add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__parser_after', array($this, 'additional_primary_registration_details_parser'), 5, 5);
54 54
 
55 55
 		/**
56 56
 		 * @since 4.2.0
57 57
 		 */
58
-		add_filter( 'FHEE__EE_Datetime_Shortcodes__shortcodes', array( $this, 'additional_datetime_shortcodes'), 10, 2 );
59
-		add_filter( 'FHEE__EE_Datetime_Shortcodes__parser_after', array( $this, 'additional_datetime_parser'), 10, 5 );
58
+		add_filter('FHEE__EE_Datetime_Shortcodes__shortcodes', array($this, 'additional_datetime_shortcodes'), 10, 2);
59
+		add_filter('FHEE__EE_Datetime_Shortcodes__parser_after', array($this, 'additional_datetime_parser'), 10, 5);
60 60
 
61 61
 		/**
62 62
 		 * @since 4.3.0
63 63
 		 */
64 64
 		//eat our own dog food!
65
-		add_action('EE_Brewing_Regular___messages_caf', array( $this, 'register_caf_message_types' ) );
66
-		add_action('EE_Brewing_Regular___messages_caf', array( $this, 'register_caf_shortcodes' ) );
65
+		add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_message_types'));
66
+		add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_shortcodes'));
67 67
 		do_action('EE_Brewing_Regular___messages_caf');
68 68
 	}
69 69
 
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 	 * @param  array  $dir_ref original array of paths
75 75
 	 * @return array           appended paths
76 76
 	 */
77
-	public function messages_autoload_paths( $dir_ref ) {
78
-		$dir_ref[] = EE_CAF_LIBRARIES . 'shortcodes/';
77
+	public function messages_autoload_paths($dir_ref) {
78
+		$dir_ref[] = EE_CAF_LIBRARIES.'shortcodes/';
79 79
 		return $dir_ref;
80 80
 	}
81 81
 
82 82
 
83 83
 
84
-	public function email_messenger_validator_config( $validator_config, EE_Email_messenger $messenger ) {
84
+	public function email_messenger_validator_config($validator_config, EE_Email_messenger $messenger) {
85 85
 		$validator_config['attendee_list'] = array(
86 86
 				'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'),
87 87
 				'required' => array('[ATTENDEE_LIST]')
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 
97 97
 
98
-	public function html_messenger_validator_config( $validator_config, EE_Html_messenger $messenger ) {
98
+	public function html_messenger_validator_config($validator_config, EE_Html_messenger $messenger) {
99 99
 		$validator_config['attendee_list'] = array(
100 100
 			'shortcodes' => array('attendee', 'question_list'),
101 101
 			'required' => array('[ATTENDEE_LIST]')
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 
111 111
 
112
-	public function pdf_messenger_validator_config( $validator_config, EE_Pdf_messenger $messenger ) {
112
+	public function pdf_messenger_validator_config($validator_config, EE_Pdf_messenger $messenger) {
113 113
 		$validator_config['attendee_list'] = array(
114 114
 			'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'),
115 115
 			'required' => array('[ATTENDEE_LIST]')
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
 
126 126
 
127
-	public function email_messenger_template_fields( $template_fields, EE_Email_messenger $messenger ) {
127
+	public function email_messenger_template_fields($template_fields, EE_Email_messenger $messenger) {
128 128
 		$template_fields['extra']['content']['question_list'] = array(
129 129
 						'input' => 'textarea',
130 130
 						'label' => '[QUESTION_LIST]',
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	}
141 141
 
142 142
 
143
-	public function html_messenger_template_fields( $template_fields, EE_Html_messenger $messenger ) {
143
+	public function html_messenger_template_fields($template_fields, EE_Html_messenger $messenger) {
144 144
 		$template_fields['extra']['content']['question_list'] = array(
145 145
 			'input' => 'textarea',
146 146
 			'label' => '[QUESTION_LIST]',
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
 
159 159
 
160
-	public function pdf_messenger_template_fields( $template_fields, EE_Pdf_messenger $messenger ) {
160
+	public function pdf_messenger_template_fields($template_fields, EE_Pdf_messenger $messenger) {
161 161
 		$template_fields['extra']['content']['question_list'] = array(
162 162
 			'input' => 'textarea',
163 163
 			'label' => '[QUESTION_LIST]',
@@ -174,39 +174,39 @@  discard block
 block discarded – undo
174 174
 
175 175
 
176 176
 
177
-	public function new_default_templates( $contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack  ) {
177
+	public function new_default_templates($contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack) {
178 178
 
179 179
 		//we're only modifying templates for the default template pack
180
-		if ( ! $template_pack instanceof EE_Messages_Template_Pack_Default ) {
180
+		if ( ! $template_pack instanceof EE_Messages_Template_Pack_Default) {
181 181
 			return $contents;
182 182
 		}
183 183
 
184 184
 		//the template file name we're replacing contents for.
185
-		$template_file_prefix = $field . '_' . $context;
186
-		$msg_prefix = $messenger->name . '_' . $message_type->name . '_' ;
185
+		$template_file_prefix = $field.'_'.$context;
186
+		$msg_prefix = $messenger->name.'_'.$message_type->name.'_';
187 187
 
188
-		$base_path = EE_CAF_LIBRARIES . 'messages/defaults/default/';
188
+		$base_path = EE_CAF_LIBRARIES.'messages/defaults/default/';
189 189
 
190
-		if ( $messenger->name == 'email' && $message_type->name == 'registration' ) {
190
+		if ($messenger->name == 'email' && $message_type->name == 'registration') {
191 191
 
192
-			switch ( $template_file_prefix ) {
192
+			switch ($template_file_prefix) {
193 193
 
194 194
 				case 'question_list_admin' :
195 195
 				case 'question_list_attendee' :
196 196
 				case 'question_list_primary_attendee' :
197
-					$path = $base_path . $msg_prefix . 'question_list.template.php';
198
-					$contents = EEH_Template::display_template( $path, array(), true );
197
+					$path = $base_path.$msg_prefix.'question_list.template.php';
198
+					$contents = EEH_Template::display_template($path, array(), true);
199 199
 					break;
200 200
 
201 201
 				case 'attendee_list_primary_attendee' :
202
-					$path = $base_path . $msg_prefix . 'attendee_list.template.php';
203
-					$contents = EEH_Template::display_template( $path, array(), true );
202
+					$path = $base_path.$msg_prefix.'attendee_list.template.php';
203
+					$contents = EEH_Template::display_template($path, array(), true);
204 204
 					break;
205 205
 
206 206
 				case 'attendee_list_admin' :
207
-					$path = $base_path . $msg_prefix . 'attendee_list_admin.template.php';
208
-					$contents = EEH_Template::display_template( $path,
209
-						array(), true );
207
+					$path = $base_path.$msg_prefix.'attendee_list_admin.template.php';
208
+					$contents = EEH_Template::display_template($path,
209
+						array(), true);
210 210
 					break;
211 211
 
212 212
 				case 'attendee_list_attendee' :
@@ -214,33 +214,33 @@  discard block
 block discarded – undo
214 214
 					break;
215 215
 
216 216
 				case 'event_list_attendee' :
217
-					$path = $base_path . $msg_prefix . 'event_list_attendee.template.php';
218
-					$contents = EEH_Template::display_template( $path, array(), true );
217
+					$path = $base_path.$msg_prefix.'event_list_attendee.template.php';
218
+					$contents = EEH_Template::display_template($path, array(), true);
219 219
 					break;
220 220
 			}
221
-		} elseif ( $messenger->name == 'email' && $message_type->name == 'newsletter' ) {
222
-			switch( $template_file_prefix ) {
221
+		} elseif ($messenger->name == 'email' && $message_type->name == 'newsletter') {
222
+			switch ($template_file_prefix) {
223 223
 
224 224
 				case 'content_attendee' :
225
-					$path = $base_path . $msg_prefix . 'content.template.php';
226
-					$contents = EEH_Template::display_template( $path, array(), true );
225
+					$path = $base_path.$msg_prefix.'content.template.php';
226
+					$contents = EEH_Template::display_template($path, array(), true);
227 227
 					break;
228 228
 
229 229
 				case 'newsletter_content_attendee' :
230
-					$path = $base_path . $msg_prefix . 'newsletter_content.template.php';
231
-					$contents = EEH_Template::display_template( $path, array(), true );
230
+					$path = $base_path.$msg_prefix.'newsletter_content.template.php';
231
+					$contents = EEH_Template::display_template($path, array(), true);
232 232
 					break;
233 233
 
234 234
 				case 'newsletter_subject_attendee' :
235
-					$path = $base_path . $msg_prefix . 'subject.template.php';
236
-					$contents = EEH_Template::display_template( $path, array(), true );
235
+					$path = $base_path.$msg_prefix.'subject.template.php';
236
+					$contents = EEH_Template::display_template($path, array(), true);
237 237
 					break;
238 238
 			}
239
-		} elseif ( $messenger->name == 'html' && $message_type->name == 'receipt' ) {
240
-			switch  ( $template_file_prefix ) {
239
+		} elseif ($messenger->name == 'html' && $message_type->name == 'receipt') {
240
+			switch ($template_file_prefix) {
241 241
 				case 'attendee_list_purchaser' :
242
-					$path = $base_path . $msg_prefix . 'attendee_list.template.php';
243
-					$contents = EEH_Template::display_template( $path, array(), true );
242
+					$path = $base_path.$msg_prefix.'attendee_list.template.php';
243
+					$contents = EEH_Template::display_template($path, array(), true);
244 244
 					break;
245 245
 			}
246 246
 		}
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
 
253 253
 
254
-	public function message_types_valid_shortcodes( $valid_shortcodes, EE_Messages_Base $msg ) {
254
+	public function message_types_valid_shortcodes($valid_shortcodes, EE_Messages_Base $msg) {
255 255
 		//make sure question_list and question are ONLY added for the core message types.  Any other message types will have to explicitly set question_list as a valid shortcode.
256 256
 		$include_with = array(
257 257
 			'registration',
@@ -268,9 +268,9 @@  discard block
 block discarded – undo
268 268
 			'invoice',
269 269
 			'receipt'
270 270
 			);
271
-		if ( $msg instanceof EE_message_type && in_array( $msg->name, $include_with )) {
271
+		if ($msg instanceof EE_message_type && in_array($msg->name, $include_with)) {
272 272
 			$contexts = array_keys($msg->get_contexts());
273
-				foreach ( $contexts as $context ) {
273
+				foreach ($contexts as $context) {
274 274
 					$valid_shortcodes[$context][] = 'question_list';
275 275
 					$valid_shortcodes[$context][] = 'question';
276 276
 				}
@@ -282,40 +282,40 @@  discard block
 block discarded – undo
282 282
 
283 283
 
284 284
 
285
-	public function additional_attendee_shortcodes( $shortcodes, $shortcode_parser ) {
285
+	public function additional_attendee_shortcodes($shortcodes, $shortcode_parser) {
286 286
 		$shortcodes['[ANSWER_*]'] = __('This is a special dynamic shortcode. Right after the "*", add the exact text of a existing question, and if there is an answer for that question for this registrant, that will take the place of this shortcode.', 'event_espresso');
287 287
 		return $shortcodes;
288 288
 	}
289 289
 
290 290
 
291 291
 
292
-	public function additional_attendee_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
292
+	public function additional_attendee_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) {
293 293
 
294
-		if ( strpos( $shortcode, '[ANSWER_*' ) === FALSE || !isset( $extra_data['data']->questions) || !isset( $extra_data['data']->registrations) )
294
+		if (strpos($shortcode, '[ANSWER_*') === FALSE || ! isset($extra_data['data']->questions) || ! isset($extra_data['data']->registrations))
295 295
 			return $parsed;
296 296
 
297 297
 		//let's get the question from the code.
298 298
 		$shortcode = str_replace('[ANSWER_*', '', $shortcode);
299
-		$shortcode = trim( str_replace(']', '', $shortcode) );
299
+		$shortcode = trim(str_replace(']', '', $shortcode));
300 300
 
301 301
 		$registration = $data instanceof EE_Registration ? $data : null;
302
-		$registration = ! $registration instanceof EE_Registration && is_array( $extra_data ) && isset( $extra_data['data'] ) && $extra_data['data'] instanceof EE_Registration ? $extra_data['data'] : $registration;
302
+		$registration = ! $registration instanceof EE_Registration && is_array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Registration ? $extra_data['data'] : $registration;
303 303
 
304 304
 		$aee = $data instanceof EE_Messages_Addressee ? $data : null;
305
-		$aee = ! $aee instanceof EE_Messages_Addressee && is_array( $extra_data ) && isset( $extra_data['data'] ) ? $extra_data['data'] : $aee;
305
+		$aee = ! $aee instanceof EE_Messages_Addressee && is_array($extra_data) && isset($extra_data['data']) ? $extra_data['data'] : $aee;
306 306
 
307
-		if ( ! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee ) {
307
+		if ( ! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee) {
308 308
 			return $parsed;
309 309
 		}
310 310
 
311 311
 		//now let's figure out which question has this text.
312
-		foreach ( $aee->questions as $ansid => $question ) {
312
+		foreach ($aee->questions as $ansid => $question) {
313 313
 			if (
314 314
 				$question instanceof EE_Question
315
-				&& trim( $question->display_text() ) == trim( $shortcode )
316
-				&& isset( $aee->registrations[ $registration->ID() ]['ans_objs'][ $ansid ] )
315
+				&& trim($question->display_text()) == trim($shortcode)
316
+				&& isset($aee->registrations[$registration->ID()]['ans_objs'][$ansid])
317 317
 			) {
318
-				return $aee->registrations[ $registration->ID() ]['ans_objs'][ $ansid ]->get_pretty('ANS_value', 'no_wpautop');
318
+				return $aee->registrations[$registration->ID()]['ans_objs'][$ansid]->get_pretty('ANS_value', 'no_wpautop');
319 319
 			}
320 320
 		}
321 321
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	 * @return array                   						array of shortcodes and
337 337
 	 *                                             			descriptions
338 338
 	 */
339
-	public function additional_datetime_shortcodes( $shortcodes, $shortcode_parser ) {
339
+	public function additional_datetime_shortcodes($shortcodes, $shortcode_parser) {
340 340
 		$shortcodes['[DTT_NAME]'] = __('This will be parsed to the Title given for a Datetime', 'event_espresso');
341 341
 		$shortcodes['[DTT_DESCRIPTION]'] = __('This will be parsed to the description for a Datetime', 'event_espresso');
342 342
 		$shortcodes['[DTT_NAME_OR_DATES]'] = __('When parsed, if the Datetime has a name, it is used, otherwise a formatted string including the start date and end date will be used.', 'event_espresso');
@@ -358,13 +358,13 @@  discard block
 block discarded – undo
358 358
 	 * @param  EE_Datetime_Shortcodes $shortcode_parser
359 359
 	 * @return string                   The new parsed string.
360 360
 	 */
361
-	public function additional_datetime_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
361
+	public function additional_datetime_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) {
362 362
 
363
-		if ( ! $data instanceof EE_Datetime ) {
363
+		if ( ! $data instanceof EE_Datetime) {
364 364
 			return ''; //get out because we can only parse with the datetime object.
365 365
 		}
366 366
 
367
-		switch ( $shortcode ) {
367
+		switch ($shortcode) {
368 368
 			case '[DTT_NAME]' :
369 369
 				return $data->name();
370 370
 				break;
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 				return $data->description();
373 373
 				break;
374 374
 			case '[DTT_NAME_OR_DATES]' :
375
-				return $data->get_dtt_display_name( TRUE );
375
+				return $data->get_dtt_display_name(TRUE);
376 376
 				break;
377 377
 			default :
378 378
 				return $parsed;
@@ -384,40 +384,40 @@  discard block
 block discarded – undo
384 384
 
385 385
 
386 386
 
387
-	public function additional_recipient_details_shortcodes( $shortcodes, $shortcode_parser ) {
387
+	public function additional_recipient_details_shortcodes($shortcodes, $shortcode_parser) {
388 388
 		$shortcodes['[RECIPIENT_QUESTION_LIST]'] = __('This is used to indicate where you want the list of questions and answers to show for the person receiving the message.', 'event_espresso');
389 389
 		return $shortcodes;
390 390
 	}
391 391
 
392 392
 
393
-	public function additional_recipient_details_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
393
+	public function additional_recipient_details_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) {
394 394
 
395
-		if ( array($data) && ! isset( $data['data'] ) )
395
+		if (array($data) && ! isset($data['data']))
396 396
 			return $parsed;
397 397
 
398 398
 		$recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : NULL;
399
-		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset( $extra_data['data'] ) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
399
+		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
400 400
 
401
-		if ( ! $recipient instanceof EE_Messages_Addressee )
401
+		if ( ! $recipient instanceof EE_Messages_Addressee)
402 402
 			return $parsed;
403 403
 
404
-		switch ( $shortcode ) {
404
+		switch ($shortcode) {
405 405
 			case '[RECIPIENT_QUESTION_LIST]' :
406 406
 				$att = $recipient->att_obj;
407 407
 				$registrations_on_attendee = $att instanceof EE_Attendee ? $recipient->attendees[$att->ID()]['reg_objs'] : array();
408
-				$registrations_on_attendee = empty( $registrations_on_attendee ) && $recipient->reg_obj instanceof EE_Registration ? array( $recipient->reg_obj ) : $registrations_on_attendee;
408
+				$registrations_on_attendee = empty($registrations_on_attendee) && $recipient->reg_obj instanceof EE_Registration ? array($recipient->reg_obj) : $registrations_on_attendee;
409 409
 				$answers = array();
410 410
 
411
-				$template = is_array($data['template'] ) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list'];
411
+				$template = is_array($data['template']) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list'];
412 412
 				$valid_shortcodes = array('question');
413 413
 
414 414
 				//if the context is main_content then get all answers for all registrations on this attendee
415
-				if ( $data['data'] instanceof EE_Messages_Addressee ) {
416
-					foreach ( $registrations_on_attendee as $reg ) {
417
-						if ( $reg instanceof EE_Registration ) {
418
-							$anss = !empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array();
419
-							foreach( $anss as $ans ) {
420
-								if ( $ans instanceof EE_Answer ) {
415
+				if ($data['data'] instanceof EE_Messages_Addressee) {
416
+					foreach ($registrations_on_attendee as $reg) {
417
+						if ($reg instanceof EE_Registration) {
418
+							$anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array();
419
+							foreach ($anss as $ans) {
420
+								if ($ans instanceof EE_Answer) {
421 421
 									$answers[$ans->ID()] = $ans;
422 422
 								}
423 423
 							}
@@ -426,13 +426,13 @@  discard block
 block discarded – undo
426 426
 				}
427 427
 
428 428
 				//if the context is the event list parser, then let's return just the answers for all registrations attached to the recipient for that event.
429
-				if ( $data['data'] instanceof EE_Event ) {
429
+				if ($data['data'] instanceof EE_Event) {
430 430
 					$event = $data['data'];
431
-					foreach( $registrations_on_attendee as $reg ) {
432
-						if ( $reg instanceof EE_Registration && $reg->event_ID() == $event->ID() ) {
433
-							$anss = !empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array();
434
-							foreach( $anss as $ans ) {
435
-								if ( $ans instanceof EE_Answer ) {
431
+					foreach ($registrations_on_attendee as $reg) {
432
+						if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
433
+							$anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array();
434
+							foreach ($anss as $ans) {
435
+								if ($ans instanceof EE_Answer) {
436 436
 									$answers[$ans->ID()] = $ans;
437 437
 								}
438 438
 							}
@@ -442,13 +442,13 @@  discard block
 block discarded – undo
442 442
 
443 443
 				$question_list = '';
444 444
 				$shortcode_helper = $shortcode_parser->get_shortcode_helper();
445
-				foreach ( $answers as $answer ) {
446
-					if ( $answer instanceof EE_Answer ) {
445
+				foreach ($answers as $answer) {
446
+					if ($answer instanceof EE_Answer) {
447 447
 						$question = $answer->question();
448
-						if ( ! $question instanceof EE_Question || ( $question instanceof EE_Question && $question->admin_only() ) ) {
448
+						if ( ! $question instanceof EE_Question || ($question instanceof EE_Question && $question->admin_only())) {
449 449
 							continue;
450 450
 						}
451
-						$question_list .= $shortcode_helper->parse_question_list_template( $template, $answer, $valid_shortcodes, $extra_data);
451
+						$question_list .= $shortcode_helper->parse_question_list_template($template, $answer, $valid_shortcodes, $extra_data);
452 452
 					}
453 453
 				}
454 454
 				return $question_list;
@@ -461,41 +461,41 @@  discard block
 block discarded – undo
461 461
 	}
462 462
 
463 463
 
464
-	public function additional_primary_registration_details_shortcodes( $shortcodes, $shortcode_parser ) {
464
+	public function additional_primary_registration_details_shortcodes($shortcodes, $shortcode_parser) {
465 465
 		$shortcodes['[PRIMARY_REGISTRANT_QUESTION_LIST]'] = __('This is used to indicate the questions and answers for the primary_registrant. It should be placed in the "[attendee_list]" field', 'event_espresso');
466 466
 		return $shortcodes;
467 467
 	}
468 468
 
469 469
 
470
-	public function additional_primary_registration_details_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
471
-		if ( array($data) && ! isset( $data['data'] ) )
470
+	public function additional_primary_registration_details_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) {
471
+		if (array($data) && ! isset($data['data']))
472 472
 			return $parsed;
473 473
 
474 474
 		$recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : NULL;
475
-		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset( $extra_data['data'] ) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
475
+		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
476 476
 
477
-		if ( ! $recipient instanceof EE_Messages_Addressee )
477
+		if ( ! $recipient instanceof EE_Messages_Addressee)
478 478
 			return $parsed;
479 479
 
480 480
 		$send_data = ! $data['data'] instanceof EE_Messages_Addressee ? $extra_data : $data;
481 481
 
482
-		switch ( $shortcode ) {
482
+		switch ($shortcode) {
483 483
 			case '[RECIPIENT_QUESTION_LIST]' :
484
-				if ( ! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration )
484
+				if ( ! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration)
485 485
 					return '';
486 486
 				$registration = $recipient->primary_reg_obj;
487
-				$template = is_array($data['template'] ) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list'];
487
+				$template = is_array($data['template']) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list'];
488 488
 				$valid_shortcodes = array('question');
489 489
 				$shortcode_helper = $shortcode_parser->get_shortcode_helper();
490 490
 				$answers = $recipient->registrations[$registration->ID()]['ans_objs'];
491 491
 				$question_list = '';
492
-				foreach ( $answers as $answer ) {
493
-					if ( $answer instanceof EE_Answer ) {
492
+				foreach ($answers as $answer) {
493
+					if ($answer instanceof EE_Answer) {
494 494
 						$question = $answer->question();
495
-						if ( $question instanceof EE_Question and $question->admin_only() ) {
495
+						if ($question instanceof EE_Question and $question->admin_only()) {
496 496
 							continue;
497 497
 						}
498
-						$question_list .= $shortcode_helper->parse_question_list_template( $template, $answer, $valid_shortcodes, $send_data);
498
+						$question_list .= $shortcode_helper->parse_question_list_template($template, $answer, $valid_shortcodes, $send_data);
499 499
 					}
500 500
 				}
501 501
 				return $question_list;
@@ -521,67 +521,67 @@  discard block
 block discarded – undo
521 521
 		$setup_args = array(
522 522
 			'mtfilename' => 'EE_Newsletter_message_type.class.php',
523 523
 			'autoloadpaths' => array(
524
-				EE_CAF_LIBRARIES . 'messages/message_type/newsletter/'
524
+				EE_CAF_LIBRARIES.'messages/message_type/newsletter/'
525 525
 				),
526
-			'messengers_to_activate_with' => array( 'email' ),
527
-			'messengers_to_validate_with' => array( 'email' )
526
+			'messengers_to_activate_with' => array('email'),
527
+			'messengers_to_validate_with' => array('email')
528 528
 			);
529
-		EE_Register_Message_Type::register( 'newsletter', $setup_args );
529
+		EE_Register_Message_Type::register('newsletter', $setup_args);
530 530
 
531 531
 		//register payment reminder message type
532 532
 		$setup_args = array(
533 533
 			'mtfilename' => 'EE_Payment_Reminder_message_type.class.php',
534
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/payment_reminder/' ),
535
-			'messengers_to_activate_with' => array( 'email' ),
536
-			'messengers_to_validate_with' => array( 'email' )
534
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_reminder/'),
535
+			'messengers_to_activate_with' => array('email'),
536
+			'messengers_to_validate_with' => array('email')
537 537
 			);
538
-		EE_Register_Message_Type::register( 'payment_reminder', $setup_args );
538
+		EE_Register_Message_Type::register('payment_reminder', $setup_args);
539 539
 
540 540
 		//register payment declined message type
541 541
 		$setup_args = array(
542 542
 			'mtfilename' => 'EE_Payment_Declined_message_type.class.php',
543
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/payment_declined/' ),
544
-			'messengers_to_activate_with' => array( 'email' ),
545
-			'messengers_to_validate_with' => array( 'email' )
543
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_declined/'),
544
+			'messengers_to_activate_with' => array('email'),
545
+			'messengers_to_validate_with' => array('email')
546 546
 			);
547
-		EE_Register_Message_Type::register( 'payment_declined', $setup_args );
547
+		EE_Register_Message_Type::register('payment_declined', $setup_args);
548 548
 
549 549
 		//register registration declined message type
550 550
 		$setup_args = array(
551 551
 			'mtfilename' => 'EE_Declined_Registration_message_type.class.php',
552
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/declined_registration/' ),
553
-			'messengers_to_activate_with' => array( 'email' ),
554
-			'messengers_to_validate_with' => array( 'email' )
552
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/declined_registration/'),
553
+			'messengers_to_activate_with' => array('email'),
554
+			'messengers_to_validate_with' => array('email')
555 555
 			);
556
-		EE_Register_Message_Type::register( 'declined_registration', $setup_args );
556
+		EE_Register_Message_Type::register('declined_registration', $setup_args);
557 557
 
558 558
 		//register registration cancelled message type
559 559
 		$setup_args = array(
560 560
 			'mtfilename' => 'EE_Cancelled_Registration_message_type.class.php',
561
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/cancelled_registration/' ),
562
-			'messengers_to_activate_with' => array( 'email' ),
563
-			'messengers_to_validate_with' => array( 'email' )
561
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/cancelled_registration/'),
562
+			'messengers_to_activate_with' => array('email'),
563
+			'messengers_to_validate_with' => array('email')
564 564
 			);
565
-		EE_Register_Message_Type::register( 'cancelled_registration', $setup_args );
565
+		EE_Register_Message_Type::register('cancelled_registration', $setup_args);
566 566
 
567 567
 
568 568
 		//register payment failed message type
569 569
 		$setup_args = array(
570 570
 			'mtfilename' => 'EE_Payment_Failed_message_type.class.php',
571
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/payment_failed/' ),
572
-			'messengers_to_activate_with' => array( 'email' ),
573
-			'messengers_to_validate_with' => array( 'email' )
571
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_failed/'),
572
+			'messengers_to_activate_with' => array('email'),
573
+			'messengers_to_validate_with' => array('email')
574 574
 			);
575
-		EE_Register_Message_Type::register( 'payment_failed', $setup_args );
575
+		EE_Register_Message_Type::register('payment_failed', $setup_args);
576 576
 
577 577
 		//register payment declined message type
578 578
 		$setup_args = array(
579 579
 			'mtfilename' => 'EE_Payment_Cancelled_message_type.class.php',
580
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/payment_cancelled/' ),
581
-			'messengers_to_activate_with' => array( 'email' ),
582
-			'messengers_to_validate_with' => array( 'email' )
580
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_cancelled/'),
581
+			'messengers_to_activate_with' => array('email'),
582
+			'messengers_to_validate_with' => array('email')
583 583
 			);
584
-		EE_Register_Message_Type::register( 'payment_cancelled', $setup_args );
584
+		EE_Register_Message_Type::register('payment_cancelled', $setup_args);
585 585
 	}
586 586
 
587 587
 
@@ -597,12 +597,12 @@  discard block
 block discarded – undo
597 597
 	public function register_caf_shortcodes() {
598 598
 		$setup_args = array(
599 599
 			'autoloadpaths' => array(
600
-				EE_CAF_LIBRARIES . 'shortcodes/'
600
+				EE_CAF_LIBRARIES.'shortcodes/'
601 601
 				),
602
-			'msgr_validator_callback' => array( 'EE_Newsletter_Shortcodes', 'messenger_validator_config' ),
603
-			'msgr_template_fields_callback' => array( 'EE_Newsletter_Shortcodes', 'messenger_template_fields' ),
604
-			'list_type_shortcodes' => array( '[NEWSLETTER_CONTENT]' )
602
+			'msgr_validator_callback' => array('EE_Newsletter_Shortcodes', 'messenger_validator_config'),
603
+			'msgr_template_fields_callback' => array('EE_Newsletter_Shortcodes', 'messenger_template_fields'),
604
+			'list_type_shortcodes' => array('[NEWSLETTER_CONTENT]')
605 605
 			);
606
-		EE_Register_Messages_Shortcode_Library::register( 'newsletter', $setup_args );
606
+		EE_Register_Messages_Shortcode_Library::register('newsletter', $setup_args);
607 607
 	}
608 608
 }
Please login to merge, or discard this patch.
libraries/shortcodes/EE_Primary_Registration_Details_Shortcodes.lib.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 /**
@@ -45,32 +45,32 @@  discard block
 block discarded – undo
45 45
 			'[PRIMARY_REGISTRANT_ADDRESS2]' => __('Whatever was in the address 2 field for the primary registrant for the transaction.', 'event_espresso'),
46 46
 			'[PRIMARY_REGISTRANT_CITY]' => __('The city for the primary registrant for the transaction.', 'event_espresso'),
47 47
 			'[PRIMARY_REGISTRANT_ZIP_PC]' => __('The ZIP (or Postal) Code for the primary registrant for the transaction.', 'event_espresso'),
48
-			'[PRIMARY_REGISTRANT_ADDRESS_STATE]' => __('The state/province for the primary registrant for the transaction.', 'event_espresso' ),
48
+			'[PRIMARY_REGISTRANT_ADDRESS_STATE]' => __('The state/province for the primary registrant for the transaction.', 'event_espresso'),
49 49
 			'[PRIMARY_REGISTRANT_COUNTRY]' => __('The country for the primary registrant for the transaction.', 'event_espresso'),
50 50
 			'[PRIMARY_REGISTRANT_REGISTRATION_DATE]' => __('The date the registration occured for the primary registration.', 'event_espresso'),
51 51
 			'[PRIMARY_REGISTRANT_FRONTEND_EDIT_REG_LINK]' => __('Generates a link for the given registration to edit this registration details on the frontend.', 'event_espresso'),
52
-			'[PRIMARY_REGISTRANT_ANSWER_*]' => __('This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this primary registrant, then it will be output in place of this shortcode.', 'event_espresso' )
52
+			'[PRIMARY_REGISTRANT_ANSWER_*]' => __('This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this primary registrant, then it will be output in place of this shortcode.', 'event_espresso')
53 53
 			);
54 54
 	}
55 55
 
56 56
 
57 57
 
58
-	protected function _parser( $shortcode ) {
58
+	protected function _parser($shortcode) {
59 59
 		//make sure we end up with a copy of the EE_Messages_Addressee object
60 60
 		$primary_registration = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL;
61
-		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && is_array($this->_data) && isset( $this->_data['data'] ) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $primary_registration;
62
-		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && !empty( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $primary_registration;
61
+		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && is_array($this->_data) && isset($this->_data['data']) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $primary_registration;
62
+		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && ! empty($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $primary_registration;
63 63
 
64
-		if ( ! $primary_registration instanceof EE_Messages_Addressee )
64
+		if ( ! $primary_registration instanceof EE_Messages_Addressee)
65 65
 			return '';
66 66
 
67 67
 		$attendee = $primary_registration->primary_att_obj;
68 68
 		$primary_reg = $primary_registration->primary_reg_obj;
69 69
 
70
-		if ( ! $attendee instanceof EE_Attendee || ! $primary_reg instanceof EE_Registration )
70
+		if ( ! $attendee instanceof EE_Attendee || ! $primary_reg instanceof EE_Registration)
71 71
 			return '';
72 72
 
73
-		switch ( $shortcode ) {
73
+		switch ($shortcode) {
74 74
 			case '[PRIMARY_REGISTRANT_FNAME]' :
75 75
 				return $attendee->fname();
76 76
 				break;
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 				break;
119 119
 
120 120
 			case '[PRIMARY_REGISTRANT_REGISTRATION_DATE]' :
121
-				if ( ! $primary_registration->primary_reg_obj instanceof EE_Registration )
121
+				if ( ! $primary_registration->primary_reg_obj instanceof EE_Registration)
122 122
 					return '';
123
-				return $primary_registration->primary_reg_obj->get_i18n_datetime( 'REG_date', get_option( 'date_format' ) );
123
+				return $primary_registration->primary_reg_obj->get_i18n_datetime('REG_date', get_option('date_format'));
124 124
 				break;
125 125
 
126 126
 			case '[PRIMARY_REGISTRANT_FRONTEND_EDIT_REG_LINK]' :
@@ -128,22 +128,22 @@  discard block
 block discarded – undo
128 128
 				break;
129 129
 		}
130 130
 
131
-		if ( strpos( $shortcode, '[PRIMARY_REGISTRANT_ANSWER_*' ) !== false ) {
132
-			$shortcode = str_replace( '[PRIMARY_REGISTRANT_ANSWER_*', '', $shortcode );
133
-			$shortcode = trim( str_replace( ']', '', $shortcode ) );
131
+		if (strpos($shortcode, '[PRIMARY_REGISTRANT_ANSWER_*') !== false) {
132
+			$shortcode = str_replace('[PRIMARY_REGISTRANT_ANSWER_*', '', $shortcode);
133
+			$shortcode = trim(str_replace(']', '', $shortcode));
134 134
 
135 135
 
136 136
 			//now let's figure out what question has this text
137
-			if ( empty( $primary_registration->questions ) ) {
137
+			if (empty($primary_registration->questions)) {
138 138
 				return '';
139 139
 			}
140 140
 
141
-			foreach ( $primary_registration->questions as $ansid => $question ) {
141
+			foreach ($primary_registration->questions as $ansid => $question) {
142 142
 				if (
143
-					trim( $question->get( 'QST_display_text' ) ) == trim( $shortcode )
144
-					&& isset( $primary_registration->registrations[ $primary_reg->ID() ]['ans_objs'][ $ansid ] )
143
+					trim($question->get('QST_display_text')) == trim($shortcode)
144
+					&& isset($primary_registration->registrations[$primary_reg->ID()]['ans_objs'][$ansid])
145 145
 				) {
146
-					return $primary_registration->registrations[ $primary_reg->ID() ]['ans_objs'][ $ansid ]->get_pretty( 'ANS_value', 'no_wpautop' );
146
+					return $primary_registration->registrations[$primary_reg->ID()]['ans_objs'][$ansid]->get_pretty('ANS_value', 'no_wpautop');
147 147
 				}
148 148
 			}
149 149
 		}
Please login to merge, or discard this patch.
admin_pages/support/Support_Admin_Page.core.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 class Support_Admin_Page extends EE_Admin_Page {
31 31
 
32 32
 
33
-	public function __construct( $routing = TRUE ) {
34
-		parent::__construct( $routing );
33
+	public function __construct($routing = TRUE) {
34
+		parent::__construct($routing);
35 35
 	}
36 36
 
37 37
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 				'nav' => array(
85 85
 					'label' => __('Support', 'event_espresso'),
86 86
 					'order' => 30),
87
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_support_boxes' ) ),
87
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')),
88 88
 				'require_nonce' => FALSE
89 89
 				),
90 90
 			'developers' => array(
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 				'nav' => array(
99 99
 					'label' => __('Shortcodes', 'event_espresso'),
100 100
 					'order' => 60),
101
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_shortcodes_boxes' ) ),
101
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')),
102 102
 				'require_nonce' => FALSE
103 103
 				),
104 104
 			);
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 
120 120
 
121 121
 	protected function _installation() {
122
-		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php';
123
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, '', TRUE);
122
+		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_installation.template.php';
123
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, '', TRUE);
124 124
 		$this->display_admin_page_with_sidebar();
125 125
 	}
126 126
 
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 			'other_resources' => __('Other Resources', 'event_espresso')
146 146
 			);
147 147
 
148
-		foreach ( $boxes as $box => $label ) {
149
-			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_' . $box . '.template.php';
148
+		foreach ($boxes as $box => $label) {
149
+			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_'.$box.'.template.php';
150 150
 			$callback_args = array('template_path' => $template_path);
151
-			add_meta_box( 'espresso_' . $box . '_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args);
151
+			add_meta_box('espresso_'.$box.'_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args);
152 152
 		}
153 153
 	}
154 154
 
@@ -169,15 +169,15 @@  discard block
 block discarded – undo
169 169
 			'shortcodes_event_listings' => __('Event Listings', 'event_espresso'),
170 170
 			'shortcodes_ticket_selector' => __('Event Ticket Selector', 'event_espresso'),
171 171
 			'shortcodes_category' => __('Event Categories', 'event_espresso'),
172
-			'shortcodes_attendee' => __( 'Event Attendees', 'event_espresso' )
172
+			'shortcodes_attendee' => __('Event Attendees', 'event_espresso')
173 173
 			/*'shortcodes_single_events' => __('Single Events', 'event_espresso'),*/
174 174
 			/*'shortcodes_attendee_listings' => __('Attendee Listings', 'event_espresso'),*/
175 175
 			);
176 176
 
177
-		foreach ( $boxes as $box => $label ) {
178
-			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_' . $box . '.template.php';
177
+		foreach ($boxes as $box => $label) {
178
+			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_'.$box.'.template.php';
179 179
 			$callback_args = array('template_path' => $template_path);
180
-			add_meta_box( 'espresso_' . $box . '_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args);
180
+			add_meta_box('espresso_'.$box.'_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args);
181 181
 		}
182 182
 	}
183 183
 
@@ -196,17 +196,17 @@  discard block
 block discarded – undo
196 196
 			'important_information' => __('Important Information', 'event_espresso')
197 197
 			);
198 198
 
199
-		foreach ( $boxes as $box => $label ) {
200
-			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_' . $box . '.template.php';
199
+		foreach ($boxes as $box => $label) {
200
+			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_'.$box.'.template.php';
201 201
 			$callback_args = array('template_path' => $template_path, 'template_args' => $this->_template_args);
202
-			add_meta_box( 'espresso_' . $box . '_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], $metabox["args"]["template_args"], TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args);
202
+			add_meta_box('espresso_'.$box.'_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], $metabox["args"]["template_args"], TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args);
203 203
 		}
204 204
 	}
205 205
 
206 206
 
207 207
 	protected function _developers() {
208
-		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php';
209
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, array(), true );
208
+		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'developers_admin_details.template.php';
209
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, array(), true);
210 210
 		$this->display_admin_page_with_sidebar();
211 211
 	}
212 212
 } //end Support_Admin_Page class
Please login to merge, or discard this patch.
support/templates/support_admin_details_additional_information.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <div class="padding">
2
-	<p><?php printf( esc_html__( 'Check out the %1$sroadmap for Event Espresso%2$s.', 'event_espresso' ), '<a href="https://trello.com/b/zg9DCIpe/event-espresso-public-roadmap" target="_blank">','</a>' ); ?></p>
2
+	<p><?php printf(esc_html__('Check out the %1$sroadmap for Event Espresso%2$s.', 'event_espresso'), '<a href="https://trello.com/b/zg9DCIpe/event-espresso-public-roadmap" target="_blank">', '</a>'); ?></p>
3 3
 </div>
4 4
\ No newline at end of file
Please login to merge, or discard this patch.
admin/extend/support/templates/support_admin_details_faq.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <div class="padding">
2
-	<h3><?php esc_html_e( 'Frequently Asked Questions about Event Espresso', 'event_espresso' ); ?></h3>
2
+	<h3><?php esc_html_e('Frequently Asked Questions about Event Espresso', 'event_espresso'); ?></h3>
3 3
 	
4
-	<h4><?php esc_html_e( 'New to Event Espresso?', 'event_espresso' ); ?></h4>
4
+	<h4><?php esc_html_e('New to Event Espresso?', 'event_espresso'); ?></h4>
5 5
 
6
-	<p><?php printf( esc_html__( 'Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', 'event_espresso' ), '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">','</a>','<em>','</em>' ); ?></p>
6
+	<p><?php printf(esc_html__('Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', 'event_espresso'), '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">', '</a>', '<em>', '</em>'); ?></p>
7 7
 </div>
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
support/templates/support_admin_details_contact_support.template.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,29 +1,29 @@
 block discarded – undo
1 1
 <div class="padding">
2 2
 	<h3><?php esc_html_e('Need help with Event Espresso?', 'event_espresso'); ?></h3>
3 3
 	
4
-	<h4><?php esc_html_e( 'You may be able to find an answer for your question or concern here:', 'event_espresso' ); ?></h4>
4
+	<h4><?php esc_html_e('You may be able to find an answer for your question or concern here:', 'event_espresso'); ?></h4>
5 5
 				<ol>
6
-					<li><strong><em><?php esc_html_e( 'A known issue.', 'event_espresso' ); ?></em></strong>  <?php printf( esc_html__( 'Some themes and plugins have %1$sknown conflicts%2$s with Event Espresso. (You can also browse the %3$sEvent Espresso support pages%2$s or %4$sEvent Espresso support forums%2$s to see if other members have experienced and solved the problem.)', 'event_espresso' ), '<a href="https://eventespresso.com/wiki/known-third-party-plugin-theme-conflicts/" target="_blank">','</a>', '<a href="https://eventespresso.com/support/documentation/versioned-docs/?doc_ver=ee4" target="_blank">', '<a href="https://eventespresso.com/support/forums/" target="_blank">' ); ?></li>
7
-					<li><strong><em><?php esc_html_e( 'A plugin conflict.', 'event_espresso' ); ?></em></strong>  <?php esc_html_e( 'You can check to see if there is a plugin conflict by temporarily deactivating all plugins except for Event Espresso. If the problem goes away, then reactivate your plugins one by one until the issue returns. This will help you pinpoint the source of the conflict.', 'event_espresso' ); ?></li>
6
+					<li><strong><em><?php esc_html_e('A known issue.', 'event_espresso'); ?></em></strong>  <?php printf(esc_html__('Some themes and plugins have %1$sknown conflicts%2$s with Event Espresso. (You can also browse the %3$sEvent Espresso support pages%2$s or %4$sEvent Espresso support forums%2$s to see if other members have experienced and solved the problem.)', 'event_espresso'), '<a href="https://eventespresso.com/wiki/known-third-party-plugin-theme-conflicts/" target="_blank">', '</a>', '<a href="https://eventespresso.com/support/documentation/versioned-docs/?doc_ver=ee4" target="_blank">', '<a href="https://eventespresso.com/support/forums/" target="_blank">'); ?></li>
7
+					<li><strong><em><?php esc_html_e('A plugin conflict.', 'event_espresso'); ?></em></strong>  <?php esc_html_e('You can check to see if there is a plugin conflict by temporarily deactivating all plugins except for Event Espresso. If the problem goes away, then reactivate your plugins one by one until the issue returns. This will help you pinpoint the source of the conflict.', 'event_espresso'); ?></li>
8 8
 					<li>
9
-						<strong><em><?php esc_html_e( 'A theme conflict.', 'event_espresso' ); ?></em></strong>
9
+						<strong><em><?php esc_html_e('A theme conflict.', 'event_espresso'); ?></em></strong>
10 10
 						<?php
11
-							$default_theme = wp_get_theme( WP_DEFAULT_THEME );
11
+							$default_theme = wp_get_theme(WP_DEFAULT_THEME);
12 12
 
13
-							if ( $default_theme->exists() ) {
14
-								 printf( esc_html__( 'If your problem is not a known issue or caused by a plugin, then try activating %s (the default WordPress theme).', 'event_espresso' ), $default_theme->get( 'Name' ) );
13
+							if ($default_theme->exists()) {
14
+								 printf(esc_html__('If your problem is not a known issue or caused by a plugin, then try activating %s (the default WordPress theme).', 'event_espresso'), $default_theme->get('Name'));
15 15
 							} else {
16
-								esc_html_e( 'If your problem is not a known issue or caused by a plugin, then try activating the default WordPress theme.', 'event_espresso' );
16
+								esc_html_e('If your problem is not a known issue or caused by a plugin, then try activating the default WordPress theme.', 'event_espresso');
17 17
 							}
18 18
 						?>
19
-						<?php esc_html_e( 'If this solves the problem for you, then something in your theme is causing this issue. Check to see if an update is available for your WordPress theme or reach out to the theme author.', 'event_espresso' ); ?>
19
+						<?php esc_html_e('If this solves the problem for you, then something in your theme is causing this issue. Check to see if an update is available for your WordPress theme or reach out to the theme author.', 'event_espresso'); ?>
20 20
 					</li>
21 21
 				</ol>
22 22
 				
23
-	<p><?php esc_html_e( 'If none of the suggestions above help you find a solution, then feel free to reach out to the support team at Event Espresso.', 'event_espresso' ); ?></p>
24
-	<p><?php printf( esc_html__( 'Login to your account on EventEspresso.com and %1$screate a support post in our member support forums%2$s. Use a %3$sclear and descriptive title%4$s in your support post, %3$sdescribe the issue to the best of your knowledge%4$s, and %3$snever post any sensitive information such as login details%4$s. Be sure to also include %5$simportant information in the section below%2$s about your WordPress site.', 'event_espresso' ), '<a href="https://eventespresso.com/support/forums/" target="_blank">','</a>','<strong>','</strong>','<a href="#espresso_important_information_settings">' ); ?></p>
23
+	<p><?php esc_html_e('If none of the suggestions above help you find a solution, then feel free to reach out to the support team at Event Espresso.', 'event_espresso'); ?></p>
24
+	<p><?php printf(esc_html__('Login to your account on EventEspresso.com and %1$screate a support post in our member support forums%2$s. Use a %3$sclear and descriptive title%4$s in your support post, %3$sdescribe the issue to the best of your knowledge%4$s, and %3$snever post any sensitive information such as login details%4$s. Be sure to also include %5$simportant information in the section below%2$s about your WordPress site.', 'event_espresso'), '<a href="https://eventespresso.com/support/forums/" target="_blank">', '</a>', '<strong>', '</strong>', '<a href="#espresso_important_information_settings">'); ?></p>
25 25
 
26
-	<h4><?php esc_html_e( 'Have an emergency?', 'event_espresso' ); ?></h4>
26
+	<h4><?php esc_html_e('Have an emergency?', 'event_espresso'); ?></h4>
27 27
 
28
-	<p><?php printf( esc_html__( 'We offer support tokens to members that need help with a time-sensitive issue. A support token will provide you with up to 30 minutes of one-on-one time with a team member at Event Espresso. If you have an emergency and need help quickly, then please %1$spurchase a support token%2$s.', 'event_espresso' ), '<a href="https://eventespresso.com/product/premium-support-token/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">','</a>' ); ?></p>
28
+	<p><?php printf(esc_html__('We offer support tokens to members that need help with a time-sensitive issue. A support token will provide you with up to 30 minutes of one-on-one time with a team member at Event Espresso. If you have an emergency and need help quickly, then please %1$spurchase a support token%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/product/premium-support-token/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">', '</a>'); ?></p>
29 29
 </div>
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
admin_pages/support/templates/developers_admin_details.template.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1 1
 <div class="padding">
2
-	<?php esc_html_e( 'If you want to integrate with Event Espresso or participate in building code, then you are in the right place. The following resources can help you get started.', 'event_espresso' ); ?>
3
-	<h2><?php esc_html_e( 'Developer Resources', 'event_espresso' ); ?></h2>
2
+	<?php esc_html_e('If you want to integrate with Event Espresso or participate in building code, then you are in the right place. The following resources can help you get started.', 'event_espresso'); ?>
3
+	<h2><?php esc_html_e('Developer Resources', 'event_espresso'); ?></h2>
4 4
 	<ul>
5
-		<li><?php printf( esc_html__( '%1$sEvent Espresso 4 Developer Documentation%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/tree/master/docs#getting-started-with-the-ee-developer-docs" target="_blank">','</a>' ); ?></li>
6
-		<li><?php printf( esc_html__( '%1$sEvent Espresso 4 Developer News%2$s', 'event_espresso' ), '<a href="http://developer.eventespresso.com/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
7
-		<li><?php printf( esc_html__( '%1$sApply%2$s to be listed as an %3$sEvent Espresso Professional%2$s', 'event_espresso' ), '<a href="https://eventespresso.com/developers/event-espresso-pros-application/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>','<a href="https://eventespresso.com/developers/event-espresso-pros/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">' ); ?></li>
5
+		<li><?php printf(esc_html__('%1$sEvent Espresso 4 Developer Documentation%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/tree/master/docs#getting-started-with-the-ee-developer-docs" target="_blank">', '</a>'); ?></li>
6
+		<li><?php printf(esc_html__('%1$sEvent Espresso 4 Developer News%2$s', 'event_espresso'), '<a href="http://developer.eventespresso.com/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
7
+		<li><?php printf(esc_html__('%1$sApply%2$s to be listed as an %3$sEvent Espresso Professional%2$s', 'event_espresso'), '<a href="https://eventespresso.com/developers/event-espresso-pros-application/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>', '<a href="https://eventespresso.com/developers/event-espresso-pros/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">'); ?></li>
8 8
 	</ul>
9 9
 
10
-	<h2><?php esc_html_e( 'Event Espresso 4 Articles for Developers', 'event_espresso' ); ?></h2>
10
+	<h2><?php esc_html_e('Event Espresso 4 Articles for Developers', 'event_espresso'); ?></h2>
11 11
 	<ul>
12
-		<li><?php printf( esc_html__( '%1$sCustom Post Types Usage%2$s', 'event_espresso' ), '<a href="https://eventespresso.com/2014/02/epsresso-brewery-custom-post-types-event-espresso/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
13
-		<li><?php printf( esc_html__( '%1$sTheme Development%2$s', 'event_espresso' ), '<a href="https://eventespresso.com/2014/02/developers-corner-theming-event-espresso-4/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
14
-		<li><?php printf( esc_html__( '%1$sCapability System%2$s', 'event_espresso' ), '<a href="http://developer.eventespresso.com/docs/ee-capability-system-overview/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
15
-		<li><?php printf( esc_html__( '%1$sPayment Method Development%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/L--Payment-Methods-and-Gateways/creating-a-payment-method.md" target="_blank">','</a>' ); ?></li>
16
-		<li><?php printf( esc_html__( '%1$sMessages System in Event Espresso 4%2$s', 'event_espresso' ), '<a href="https://eventespresso.com/2014/03/messages-systemyour-tool-getting-word/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
17
-		<li><?php printf( esc_html__( '%1$sDatabase Model System%2$s (used for interfacing with EE4 data via WordPress plugins and server side querying)', 'event_espresso' ), '<a href="http://developer.eventespresso.com/docs/using-ee4-model-objects/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
12
+		<li><?php printf(esc_html__('%1$sCustom Post Types Usage%2$s', 'event_espresso'), '<a href="https://eventespresso.com/2014/02/epsresso-brewery-custom-post-types-event-espresso/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
13
+		<li><?php printf(esc_html__('%1$sTheme Development%2$s', 'event_espresso'), '<a href="https://eventespresso.com/2014/02/developers-corner-theming-event-espresso-4/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
14
+		<li><?php printf(esc_html__('%1$sCapability System%2$s', 'event_espresso'), '<a href="http://developer.eventespresso.com/docs/ee-capability-system-overview/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
15
+		<li><?php printf(esc_html__('%1$sPayment Method Development%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/L--Payment-Methods-and-Gateways/creating-a-payment-method.md" target="_blank">', '</a>'); ?></li>
16
+		<li><?php printf(esc_html__('%1$sMessages System in Event Espresso 4%2$s', 'event_espresso'), '<a href="https://eventespresso.com/2014/03/messages-systemyour-tool-getting-word/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
17
+		<li><?php printf(esc_html__('%1$sDatabase Model System%2$s (used for interfacing with EE4 data via WordPress plugins and server side querying)', 'event_espresso'), '<a href="http://developer.eventespresso.com/docs/using-ee4-model-objects/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
18 18
 	</ul>
19 19
 	
20
-	<h2><?php esc_html_e( 'REST API Resources', 'event_espresso' ); ?></h2>
20
+	<h2><?php esc_html_e('REST API Resources', 'event_espresso'); ?></h2>
21 21
 	<ul>
22
-		<li><?php printf( esc_html__( '%1$sREST API: Introduction%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/C--REST-API/ee4-rest-api-introduction.md" target="_blank">','</a>' ); ?></li>
23
-		<li><?php printf( esc_html__( '%1$sREST API: Reading Data%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/C--REST-API/ee4-rest-api-reading-data.md" target="_blank">','</a>' ); ?></li>
24
-		<li><?php printf( esc_html__( '%1$sBuilding an EE4 Add-on Using the REST API%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/T--Tutorials/building-an-ee4-addon-that-uses-angular-js-and-the-ee4-json-rest-api.md" target="_blank">','</a>' ); ?></li>
22
+		<li><?php printf(esc_html__('%1$sREST API: Introduction%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/C--REST-API/ee4-rest-api-introduction.md" target="_blank">', '</a>'); ?></li>
23
+		<li><?php printf(esc_html__('%1$sREST API: Reading Data%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/C--REST-API/ee4-rest-api-reading-data.md" target="_blank">', '</a>'); ?></li>
24
+		<li><?php printf(esc_html__('%1$sBuilding an EE4 Add-on Using the REST API%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/T--Tutorials/building-an-ee4-addon-that-uses-angular-js-and-the-ee4-json-rest-api.md" target="_blank">', '</a>'); ?></li>
25 25
 	</ul>
26 26
 </div>
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
core/libraries/plugin_api/EE_Register_Addon.lib.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 		// if plugin_action_slug is NOT set, but an admin page path IS set,
382 382
 		// then let's just use the plugin_slug since that will be used for linking to the admin page
383 383
 		$addon_settings['plugin_action_slug'] = empty( $addon_settings['plugin_action_slug'] )
384
-		                                        && ! empty( $addon_settings['admin_path'] )
384
+												&& ! empty( $addon_settings['admin_path'] )
385 385
 			? $addon_settings['plugin_slug']
386 386
 			: $addon_settings['plugin_action_slug'];
387 387
 		// full server path to main file (file loaded directly by WP)
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
 				EE_Register_Widget::deregister( $addon_name );
767 767
 			}
768 768
 			if ( ! empty( self::$_settings[ $addon_name ]['model_paths'] )
769
-			     ||
770
-			     ! empty( self::$_settings[ $addon_name ]['class_paths'] )
769
+				 ||
770
+				 ! empty( self::$_settings[ $addon_name ]['class_paths'] )
771 771
 			) {
772 772
 				// add to list of shortcodes to be registered
773 773
 				EE_Register_Model::deregister( $addon_name );
774 774
 			}
775 775
 			if ( ! empty( self::$_settings[ $addon_name ]['model_extension_paths'] )
776
-			     ||
777
-			     ! empty( self::$_settings[ $addon_name ]['class_extension_paths'] )
776
+				 ||
777
+				 ! empty( self::$_settings[ $addon_name ]['class_extension_paths'] )
778 778
 			) {
779 779
 				// add to list of shortcodes to be registered
780 780
 				EE_Register_Model_Extensions::deregister( $addon_name );
Please login to merge, or discard this patch.
Spacing   +182 added lines, -182 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 
@@ -60,23 +60,23 @@  discard block
 block discarded – undo
60 60
 	 * @param string $min_core_version
61 61
 	 * @return string always like '4.3.0.rc.000'
62 62
 	 */
63
-	protected static function _effective_version( $min_core_version ) {
63
+	protected static function _effective_version($min_core_version) {
64 64
 		// versions: 4 . 3 . 1 . p . 123
65 65
 		// offsets:    0 . 1 . 2 . 3 . 4
66
-		$version_parts = explode( '.', $min_core_version );
66
+		$version_parts = explode('.', $min_core_version);
67 67
 		//check they specified the micro version (after 2nd period)
68
-		if ( ! isset( $version_parts[2] ) ) {
68
+		if ( ! isset($version_parts[2])) {
69 69
 			$version_parts[2] = '0';
70 70
 		}
71 71
 		//if they didn't specify the 'p', or 'rc' part. Just assume the lowest possible
72 72
 		//soon we can assume that's 'rc', but this current version is 'alpha'
73
-		if ( ! isset( $version_parts[3] ) ) {
73
+		if ( ! isset($version_parts[3])) {
74 74
 			$version_parts[3] = 'dev';
75 75
 		}
76
-		if ( ! isset( $version_parts[4] ) ) {
76
+		if ( ! isset($version_parts[4])) {
77 77
 			$version_parts[4] = '000';
78 78
 		}
79
-		return implode( '.', $version_parts );
79
+		return implode('.', $version_parts);
80 80
 	}
81 81
 
82 82
 
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 		$actual_core_version = EVENT_ESPRESSO_VERSION
94 94
 	) {
95 95
 		return version_compare(
96
-			self::_effective_version( $actual_core_version ),
97
-			self::_effective_version( $min_core_version ),
96
+			self::_effective_version($actual_core_version),
97
+			self::_effective_version($min_core_version),
98 98
 			'>='
99 99
 		);
100 100
 	}
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 	 * @throws EE_Error
217 217
 	 * @return void
218 218
 	 */
219
-	public static function register( $addon_name = '', $setup_args = array() ) {
219
+	public static function register($addon_name = '', $setup_args = array()) {
220 220
 		// required fields MUST be present, so let's make sure they are.
221
-		if ( empty( $addon_name ) || ! is_array( $setup_args ) ) {
221
+		if (empty($addon_name) || ! is_array($setup_args)) {
222 222
 			throw new EE_Error(
223 223
 				__(
224 224
 					'In order to register an EE_Addon with EE_Register_Addon::register(), you must include the "addon_name" (the name of the addon), and an array of arguments.',
@@ -226,19 +226,19 @@  discard block
 block discarded – undo
226 226
 				)
227 227
 			);
228 228
 		}
229
-		if ( ! isset( $setup_args['main_file_path'] ) || empty( $setup_args['main_file_path'] ) ) {
229
+		if ( ! isset($setup_args['main_file_path']) || empty($setup_args['main_file_path'])) {
230 230
 			throw new EE_Error(
231 231
 				sprintf(
232 232
 					__(
233 233
 						'When registering an addon, you didn\'t provide the "main_file_path", which is the full path to the main file loaded directly by Wordpress. You only provided %s',
234 234
 						'event_espresso'
235 235
 					),
236
-					implode( ",", array_keys( $setup_args ) )
236
+					implode(",", array_keys($setup_args))
237 237
 				)
238 238
 			);
239 239
 		}
240 240
 		// check that addon has not already been registered with that name
241
-		if ( isset( self::$_settings[ $addon_name ] ) && ! did_action( 'activate_plugin' ) ) {
241
+		if (isset(self::$_settings[$addon_name]) && ! did_action('activate_plugin')) {
242 242
 			throw new EE_Error(
243 243
 				sprintf(
244 244
 					__(
@@ -250,124 +250,124 @@  discard block
 block discarded – undo
250 250
 			);
251 251
 		}
252 252
 		// no class name for addon?
253
-		if ( empty( $setup_args['class_name'] ) ) {
253
+		if (empty($setup_args['class_name'])) {
254 254
 			// generate one by first separating name with spaces
255
-			$class_name = str_replace( array( '-', '_' ), ' ', trim( $addon_name ) );
255
+			$class_name = str_replace(array('-', '_'), ' ', trim($addon_name));
256 256
 			//capitalize, then replace spaces with underscores
257
-			$class_name = str_replace( ' ', '_', ucwords( $class_name ) );
257
+			$class_name = str_replace(' ', '_', ucwords($class_name));
258 258
 		} else {
259 259
 			$class_name = $setup_args['class_name'];
260 260
 		}
261
-		$class_name = strpos( $class_name, 'EE_' ) === 0 ? $class_name : 'EE_' . $class_name;
261
+		$class_name = strpos($class_name, 'EE_') === 0 ? $class_name : 'EE_'.$class_name;
262 262
 		//setup $_settings array from incoming values.
263 263
 		$addon_settings = array(
264 264
 			// generated from the addon name, changes something like "calendar" to "EE_Calendar"
265 265
 			'class_name'            => $class_name,
266 266
 			// the addon slug for use in URLs, etc
267
-			'plugin_slug'           => isset( $setup_args['plugin_slug'] )
267
+			'plugin_slug'           => isset($setup_args['plugin_slug'])
268 268
 				? (string) $setup_args['plugin_slug']
269 269
 				: '',
270 270
 			// page slug to be used when generating the "Settings" link on the WP plugin page
271
-			'plugin_action_slug'    => isset( $setup_args['plugin_action_slug'] )
271
+			'plugin_action_slug'    => isset($setup_args['plugin_action_slug'])
272 272
 				? (string) $setup_args['plugin_action_slug']
273 273
 				: '',
274 274
 			// the "software" version for the addon
275
-			'version'               => isset( $setup_args['version'] )
275
+			'version'               => isset($setup_args['version'])
276 276
 				? (string) $setup_args['version']
277 277
 				: '',
278 278
 			// the minimum version of EE Core that the addon will work with
279
-			'min_core_version'      => isset( $setup_args['min_core_version'] )
279
+			'min_core_version'      => isset($setup_args['min_core_version'])
280 280
 				? (string) $setup_args['min_core_version']
281 281
 				: '',
282 282
 			// the minimum version of WordPress that the addon will work with
283
-			'min_wp_version'        => isset( $setup_args['min_wp_version'] )
283
+			'min_wp_version'        => isset($setup_args['min_wp_version'])
284 284
 				? (string) $setup_args['min_wp_version']
285 285
 				: EE_MIN_WP_VER_REQUIRED,
286 286
 			// full server path to main file (file loaded directly by WP)
287
-			'main_file_path'        => isset( $setup_args['main_file_path'] )
287
+			'main_file_path'        => isset($setup_args['main_file_path'])
288 288
 				? (string) $setup_args['main_file_path']
289 289
 				: '',
290 290
 			// path to folder containing files for integrating with the EE core admin and/or setting up EE admin pages
291
-			'admin_path'            => isset( $setup_args['admin_path'] )
291
+			'admin_path'            => isset($setup_args['admin_path'])
292 292
 				? (string) $setup_args['admin_path'] : '',
293 293
 			// a method to be called when the EE Admin is first invoked, can be used for hooking into any admin page
294
-			'admin_callback'        => isset( $setup_args['admin_callback'] )
294
+			'admin_callback'        => isset($setup_args['admin_callback'])
295 295
 				? (string) $setup_args['admin_callback']
296 296
 				: '',
297 297
 			// the section name for this addon's configuration settings section (defaults to "addons")
298
-			'config_section'        => isset( $setup_args['config_section'] )
298
+			'config_section'        => isset($setup_args['config_section'])
299 299
 				? (string) $setup_args['config_section']
300 300
 				: 'addons',
301 301
 			// the class name for this addon's configuration settings object
302
-			'config_class'          => isset( $setup_args['config_class'] )
302
+			'config_class'          => isset($setup_args['config_class'])
303 303
 				? (string) $setup_args['config_class'] : '',
304 304
 			//the name given to the config for this addons' configuration settings object (optional)
305
-			'config_name'           => isset( $setup_args['config_name'] )
305
+			'config_name'           => isset($setup_args['config_name'])
306 306
 				? (string) $setup_args['config_name'] : '',
307 307
 			// an array of "class names" => "full server paths" for any classes that might be invoked by the addon
308
-			'autoloader_paths'      => isset( $setup_args['autoloader_paths'] )
308
+			'autoloader_paths'      => isset($setup_args['autoloader_paths'])
309 309
 				? (array) $setup_args['autoloader_paths']
310 310
 				: array(),
311 311
 			// an array of  "full server paths" for any folders containing classes that might be invoked by the addon
312
-			'autoloader_folders'    => isset( $setup_args['autoloader_folders'] )
312
+			'autoloader_folders'    => isset($setup_args['autoloader_folders'])
313 313
 				? (array) $setup_args['autoloader_folders']
314 314
 				: array(),
315 315
 			// array of full server paths to any EE_DMS data migration scripts used by the addon
316
-			'dms_paths'             => isset( $setup_args['dms_paths'] )
316
+			'dms_paths'             => isset($setup_args['dms_paths'])
317 317
 				? (array) $setup_args['dms_paths']
318 318
 				: array(),
319 319
 			// array of full server paths to any EED_Modules used by the addon
320
-			'module_paths'          => isset( $setup_args['module_paths'] )
320
+			'module_paths'          => isset($setup_args['module_paths'])
321 321
 				? (array) $setup_args['module_paths']
322 322
 				: array(),
323 323
 			// array of full server paths to any EES_Shortcodes used by the addon
324
-			'shortcode_paths'       => isset( $setup_args['shortcode_paths'] )
324
+			'shortcode_paths'       => isset($setup_args['shortcode_paths'])
325 325
 				? (array) $setup_args['shortcode_paths']
326 326
 				: array(),
327 327
 			// array of full server paths to any WP_Widgets used by the addon
328
-			'widget_paths'          => isset( $setup_args['widget_paths'] )
328
+			'widget_paths'          => isset($setup_args['widget_paths'])
329 329
 				? (array) $setup_args['widget_paths']
330 330
 				: array(),
331 331
 			// array of PUE options used by the addon
332
-			'pue_options'           => isset( $setup_args['pue_options'] )
332
+			'pue_options'           => isset($setup_args['pue_options'])
333 333
 				? (array) $setup_args['pue_options']
334 334
 				: array(),
335
-			'message_types'         => isset( $setup_args['message_types'] )
335
+			'message_types'         => isset($setup_args['message_types'])
336 336
 				? (array) $setup_args['message_types']
337 337
 				: array(),
338
-			'capabilities'          => isset( $setup_args['capabilities'] )
338
+			'capabilities'          => isset($setup_args['capabilities'])
339 339
 				? (array) $setup_args['capabilities']
340 340
 				: array(),
341
-			'capability_maps'       => isset( $setup_args['capability_maps'] )
341
+			'capability_maps'       => isset($setup_args['capability_maps'])
342 342
 				? (array) $setup_args['capability_maps']
343 343
 				: array(),
344
-			'model_paths'           => isset( $setup_args['model_paths'] )
344
+			'model_paths'           => isset($setup_args['model_paths'])
345 345
 				? (array) $setup_args['model_paths']
346 346
 				: array(),
347
-			'class_paths'           => isset( $setup_args['class_paths'] )
347
+			'class_paths'           => isset($setup_args['class_paths'])
348 348
 				? (array) $setup_args['class_paths']
349 349
 				: array(),
350
-			'model_extension_paths' => isset( $setup_args['model_extension_paths'] )
350
+			'model_extension_paths' => isset($setup_args['model_extension_paths'])
351 351
 				? (array) $setup_args['model_extension_paths']
352 352
 				: array(),
353
-			'class_extension_paths' => isset( $setup_args['class_extension_paths'] )
353
+			'class_extension_paths' => isset($setup_args['class_extension_paths'])
354 354
 				? (array) $setup_args['class_extension_paths']
355 355
 				: array(),
356
-			'custom_post_types'     => isset( $setup_args['custom_post_types'] )
356
+			'custom_post_types'     => isset($setup_args['custom_post_types'])
357 357
 				? (array) $setup_args['custom_post_types']
358 358
 				: array(),
359
-			'custom_taxonomies'     => isset( $setup_args['custom_taxonomies'] )
359
+			'custom_taxonomies'     => isset($setup_args['custom_taxonomies'])
360 360
 				? (array) $setup_args['custom_taxonomies']
361 361
 				: array(),
362
-			'payment_method_paths'  => isset( $setup_args['payment_method_paths'] )
362
+			'payment_method_paths'  => isset($setup_args['payment_method_paths'])
363 363
 				? (array) $setup_args['payment_method_paths']
364 364
 				: array(),
365
-			'default_terms'         => isset( $setup_args['default_terms'] )
365
+			'default_terms'         => isset($setup_args['default_terms'])
366 366
 				? (array) $setup_args['default_terms']
367 367
 				: array(),
368 368
 			// if not empty, inserts a new table row after this plugin's row on the WP Plugins page
369 369
 			// that can be used for adding upgrading/marketing info
370
-			'plugins_page_row'      => isset( $setup_args['plugins_page_row'] )
370
+			'plugins_page_row'      => isset($setup_args['plugins_page_row'])
371 371
 				? $setup_args['plugins_page_row']
372 372
 				: '',
373 373
 			'namespace'             => isset(
@@ -380,19 +380,19 @@  discard block
 block discarded – undo
380 380
 		);
381 381
 		// if plugin_action_slug is NOT set, but an admin page path IS set,
382 382
 		// then let's just use the plugin_slug since that will be used for linking to the admin page
383
-		$addon_settings['plugin_action_slug'] = empty( $addon_settings['plugin_action_slug'] )
384
-		                                        && ! empty( $addon_settings['admin_path'] )
383
+		$addon_settings['plugin_action_slug'] = empty($addon_settings['plugin_action_slug'])
384
+		                                        && ! empty($addon_settings['admin_path'])
385 385
 			? $addon_settings['plugin_slug']
386 386
 			: $addon_settings['plugin_action_slug'];
387 387
 		// full server path to main file (file loaded directly by WP)
388
-		$addon_settings['plugin_basename'] = plugin_basename( $addon_settings['main_file_path'] );
388
+		$addon_settings['plugin_basename'] = plugin_basename($addon_settings['main_file_path']);
389 389
 		global $wp_version;
390 390
 		$incompatibility_message = '';
391 391
 		//check whether this addon version is compatible with EE core
392 392
 		if (
393
-			isset( EE_Register_Addon::$_incompatible_addons[ $addon_name ] )
393
+			isset(EE_Register_Addon::$_incompatible_addons[$addon_name])
394 394
 			&& ! self::_meets_min_core_version_requirement(
395
-				EE_Register_Addon::$_incompatible_addons[ $addon_name ],
395
+				EE_Register_Addon::$_incompatible_addons[$addon_name],
396 396
 				$addon_settings['version']
397 397
 			)
398 398
 		) {
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
 				),
404 404
 				$addon_name,
405 405
 				'<br />',
406
-				EE_Register_Addon::$_incompatible_addons[ $addon_name ]
406
+				EE_Register_Addon::$_incompatible_addons[$addon_name]
407 407
 			);
408 408
 		} else if (
409
-		! self::_meets_min_core_version_requirement( $addon_settings['min_core_version'], espresso_version() )
409
+		! self::_meets_min_core_version_requirement($addon_settings['min_core_version'], espresso_version())
410 410
 		) {
411 411
 			$incompatibility_message = sprintf(
412 412
 				__(
@@ -414,11 +414,11 @@  discard block
 block discarded – undo
414 414
 					'event_espresso'
415 415
 				),
416 416
 				$addon_name,
417
-				self::_effective_version( $addon_settings['min_core_version'] ),
418
-				self::_effective_version( espresso_version() ),
417
+				self::_effective_version($addon_settings['min_core_version']),
418
+				self::_effective_version(espresso_version()),
419 419
 				'<br />'
420 420
 			);
421
-		} else if ( version_compare( $wp_version, $addon_settings['min_wp_version'], '<' ) ) {
421
+		} else if (version_compare($wp_version, $addon_settings['min_wp_version'], '<')) {
422 422
 			$incompatibility_message = sprintf(
423 423
 				__(
424 424
 					'The Event Espresso "%1$s" addon could not be activated because it requires WordPress version "%2$s" or greater.%3$sPlease update your version of WordPress to use the "%1$s" addon and to keep your site secure.',
@@ -429,20 +429,20 @@  discard block
 block discarded – undo
429 429
 				'<br />'
430 430
 			);
431 431
 		}
432
-		if ( ! empty( $incompatibility_message ) ) {
432
+		if ( ! empty($incompatibility_message)) {
433 433
 			//remove 'activate' from the REQUEST so WP doesn't erroneously tell the user the
434 434
 			//plugin activated fine when it didn't
435
-			if ( isset( $_GET['activate'] ) ) {
436
-				unset( $_GET['activate'] );
435
+			if (isset($_GET['activate'])) {
436
+				unset($_GET['activate']);
437 437
 			}
438
-			if ( isset( $_REQUEST['activate'] ) ) {
439
-				unset( $_REQUEST['activate'] );
438
+			if (isset($_REQUEST['activate'])) {
439
+				unset($_REQUEST['activate']);
440 440
 			}
441 441
 			//and show an error message indicating the plugin didn't activate properly
442
-			EE_Error::add_error( $incompatibility_message, __FILE__, __FUNCTION__, __LINE__ );
443
-			if ( current_user_can( 'activate_plugins' ) ) {
444
-				require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
445
-				deactivate_plugins( plugin_basename( $addon_settings['main_file_path'] ), true );
442
+			EE_Error::add_error($incompatibility_message, __FILE__, __FUNCTION__, __LINE__);
443
+			if (current_user_can('activate_plugins')) {
444
+				require_once(ABSPATH.'wp-admin/includes/plugin.php');
445
+				deactivate_plugins(plugin_basename($addon_settings['main_file_path']), true);
446 446
 			}
447 447
 			return;
448 448
 		}
@@ -460,13 +460,13 @@  discard block
 block discarded – undo
460 460
 			);
461 461
 		}
462 462
 		//this is an activation request
463
-		if ( did_action( 'activate_plugin' ) ) {
463
+		if (did_action('activate_plugin')) {
464 464
 			//to find if THIS is the addon that was activated,
465 465
 			//just check if we have already registered it or not
466 466
 			//(as the newly-activated addon wasn't around the first time addons were registered)
467
-			if ( ! isset( self::$_settings[ $addon_name ] ) ) {
468
-				self::$_settings[ $addon_name ] = $addon_settings;
469
-				$addon = self::_load_and_init_addon_class( $addon_name );
467
+			if ( ! isset(self::$_settings[$addon_name])) {
468
+				self::$_settings[$addon_name] = $addon_settings;
469
+				$addon = self::_load_and_init_addon_class($addon_name);
470 470
 				$addon->set_activation_indicator_option();
471 471
 				//dont bother setting up the rest of the addon.
472 472
 				//we know it was just activated and the request will end soon
@@ -475,8 +475,8 @@  discard block
 block discarded – undo
475 475
 		} else {
476 476
 			// make sure this was called in the right place!
477 477
 			if (
478
-				! did_action( 'AHEE__EE_System__load_espresso_addons' )
479
-				|| did_action( 'AHEE__EE_System___detect_if_activation_or_upgrade__begin' )
478
+				! did_action('AHEE__EE_System__load_espresso_addons')
479
+				|| did_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin')
480 480
 			) {
481 481
 				EE_Error::doing_it_wrong(
482 482
 					__METHOD__,
@@ -490,155 +490,155 @@  discard block
 block discarded – undo
490 490
 					'4.3.0'
491 491
 				);
492 492
 			}
493
-			self::$_settings[ $addon_name ] = $addon_settings;
493
+			self::$_settings[$addon_name] = $addon_settings;
494 494
 		}
495 495
 		// we need cars
496
-		if ( ! empty( self::$_settings[ $addon_name ]['autoloader_paths'] ) ) {
496
+		if ( ! empty(self::$_settings[$addon_name]['autoloader_paths'])) {
497 497
 			// setup autoloader for single file
498
-			EEH_Autoloader::instance()->register_autoloader( self::$_settings[ $addon_name ]['autoloader_paths'] );
498
+			EEH_Autoloader::instance()->register_autoloader(self::$_settings[$addon_name]['autoloader_paths']);
499 499
 		}
500 500
 		// setup autoloaders for folders
501
-		if ( ! empty( self::$_settings[ $addon_name ]['autoloader_folders'] ) ) {
502
-			foreach ( self::$_settings[ $addon_name ]['autoloader_folders'] as $autoloader_folder ) {
503
-				EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $autoloader_folder );
501
+		if ( ! empty(self::$_settings[$addon_name]['autoloader_folders'])) {
502
+			foreach (self::$_settings[$addon_name]['autoloader_folders'] as $autoloader_folder) {
503
+				EEH_Autoloader::register_autoloaders_for_each_file_in_folder($autoloader_folder);
504 504
 			}
505 505
 		}
506 506
 		// register new models
507 507
 		if (
508
-			! empty( self::$_settings[ $addon_name ]['model_paths'] )
509
-			|| ! empty( self::$_settings[ $addon_name ]['class_paths'] )
508
+			! empty(self::$_settings[$addon_name]['model_paths'])
509
+			|| ! empty(self::$_settings[$addon_name]['class_paths'])
510 510
 		) {
511 511
 			EE_Register_Model::register(
512 512
 				$addon_name,
513 513
 				array(
514
-					'model_paths' => self::$_settings[ $addon_name ]['model_paths'],
515
-					'class_paths' => self::$_settings[ $addon_name ]['class_paths'],
514
+					'model_paths' => self::$_settings[$addon_name]['model_paths'],
515
+					'class_paths' => self::$_settings[$addon_name]['class_paths'],
516 516
 				)
517 517
 			);
518 518
 		}
519 519
 		// register model extensions
520 520
 		if (
521
-			! empty( self::$_settings[ $addon_name ]['model_extension_paths'] )
522
-			|| ! empty( self::$_settings[ $addon_name ]['class_extension_paths'] )
521
+			! empty(self::$_settings[$addon_name]['model_extension_paths'])
522
+			|| ! empty(self::$_settings[$addon_name]['class_extension_paths'])
523 523
 		) {
524 524
 			EE_Register_Model_Extensions::register(
525 525
 				$addon_name,
526 526
 				array(
527
-					'model_extension_paths' => self::$_settings[ $addon_name ]['model_extension_paths'],
528
-					'class_extension_paths' => self::$_settings[ $addon_name ]['class_extension_paths'],
527
+					'model_extension_paths' => self::$_settings[$addon_name]['model_extension_paths'],
528
+					'class_extension_paths' => self::$_settings[$addon_name]['class_extension_paths'],
529 529
 				)
530 530
 			);
531 531
 		}
532 532
 		// setup DMS
533
-		if ( ! empty( self::$_settings[ $addon_name ]['dms_paths'] ) ) {
533
+		if ( ! empty(self::$_settings[$addon_name]['dms_paths'])) {
534 534
 			EE_Register_Data_Migration_Scripts::register(
535 535
 				$addon_name,
536
-				array( 'dms_paths' => self::$_settings[ $addon_name ]['dms_paths'] )
536
+				array('dms_paths' => self::$_settings[$addon_name]['dms_paths'])
537 537
 			);
538 538
 		}
539 539
 		// if config_class is present let's register config.
540
-		if ( ! empty( self::$_settings[ $addon_name ]['config_class'] ) ) {
540
+		if ( ! empty(self::$_settings[$addon_name]['config_class'])) {
541 541
 			EE_Register_Config::register(
542
-				self::$_settings[ $addon_name ]['config_class'],
542
+				self::$_settings[$addon_name]['config_class'],
543 543
 				array(
544
-					'config_section' => self::$_settings[ $addon_name ]['config_section'],
545
-					'config_name'    => self::$_settings[ $addon_name ]['config_name'],
544
+					'config_section' => self::$_settings[$addon_name]['config_section'],
545
+					'config_name'    => self::$_settings[$addon_name]['config_name'],
546 546
 				)
547 547
 			);
548 548
 		}
549 549
 		// register admin page
550
-		if ( ! empty( self::$_settings[ $addon_name ]['admin_path'] ) ) {
550
+		if ( ! empty(self::$_settings[$addon_name]['admin_path'])) {
551 551
 			EE_Register_Admin_Page::register(
552 552
 				$addon_name,
553
-				array( 'page_path' => self::$_settings[ $addon_name ]['admin_path'] )
553
+				array('page_path' => self::$_settings[$addon_name]['admin_path'])
554 554
 			);
555 555
 		}
556 556
 		// add to list of modules to be registered
557
-		if ( ! empty( self::$_settings[ $addon_name ]['module_paths'] ) ) {
557
+		if ( ! empty(self::$_settings[$addon_name]['module_paths'])) {
558 558
 			EE_Register_Module::register(
559 559
 				$addon_name,
560
-				array( 'module_paths' => self::$_settings[ $addon_name ]['module_paths'] )
560
+				array('module_paths' => self::$_settings[$addon_name]['module_paths'])
561 561
 			);
562 562
 		}
563 563
 		// add to list of shortcodes to be registered
564
-		if ( ! empty( self::$_settings[ $addon_name ]['shortcode_paths'] ) ) {
564
+		if ( ! empty(self::$_settings[$addon_name]['shortcode_paths'])) {
565 565
 			EE_Register_Shortcode::register(
566 566
 				$addon_name,
567
-				array( 'shortcode_paths' => self::$_settings[ $addon_name ]['shortcode_paths'] )
567
+				array('shortcode_paths' => self::$_settings[$addon_name]['shortcode_paths'])
568 568
 			);
569 569
 		}
570 570
 		// add to list of widgets to be registered
571
-		if ( ! empty( self::$_settings[ $addon_name ]['widget_paths'] ) ) {
571
+		if ( ! empty(self::$_settings[$addon_name]['widget_paths'])) {
572 572
 			EE_Register_Widget::register(
573 573
 				$addon_name,
574
-				array( 'widget_paths' => self::$_settings[ $addon_name ]['widget_paths'] )
574
+				array('widget_paths' => self::$_settings[$addon_name]['widget_paths'])
575 575
 			);
576 576
 		}
577 577
 		//register capability related stuff.
578
-		if ( ! empty( self::$_settings[ $addon_name ]['capabilities'] ) ) {
578
+		if ( ! empty(self::$_settings[$addon_name]['capabilities'])) {
579 579
 			EE_Register_Capabilities::register(
580 580
 				$addon_name,
581 581
 				array(
582
-					'capabilities'    => self::$_settings[ $addon_name ]['capabilities'],
583
-					'capability_maps' => self::$_settings[ $addon_name ]['capability_maps'],
582
+					'capabilities'    => self::$_settings[$addon_name]['capabilities'],
583
+					'capability_maps' => self::$_settings[$addon_name]['capability_maps'],
584 584
 				)
585 585
 			);
586 586
 		}
587 587
 		//any message type to register?
588
-		if ( ! empty( self::$_settings[ $addon_name ]['message_types'] ) ) {
588
+		if ( ! empty(self::$_settings[$addon_name]['message_types'])) {
589 589
 			add_action(
590 590
 				'EE_Brewing_Regular___messages_caf',
591
-				array( 'EE_Register_Addon', 'register_message_types' )
591
+				array('EE_Register_Addon', 'register_message_types')
592 592
 			);
593 593
 		}
594 594
 		// if plugin update engine is being used for auto-updates (not needed if PUE is not being used)
595
-		if ( ! empty( $setup_args['pue_options'] ) ) {
596
-			self::$_settings[ $addon_name ]['pue_options'] = array(
597
-				'pue_plugin_slug' => isset( $setup_args['pue_options']['pue_plugin_slug'] )
595
+		if ( ! empty($setup_args['pue_options'])) {
596
+			self::$_settings[$addon_name]['pue_options'] = array(
597
+				'pue_plugin_slug' => isset($setup_args['pue_options']['pue_plugin_slug'])
598 598
 					? (string) $setup_args['pue_options']['pue_plugin_slug']
599
-					: 'espresso_' . strtolower( $class_name ),
600
-				'plugin_basename' => isset( $setup_args['pue_options']['plugin_basename'] )
599
+					: 'espresso_'.strtolower($class_name),
600
+				'plugin_basename' => isset($setup_args['pue_options']['plugin_basename'])
601 601
 					? (string) $setup_args['pue_options']['plugin_basename']
602
-					: plugin_basename( self::$_settings[ $addon_name ]['main_file_path'] ),
603
-				'checkPeriod'     => isset( $setup_args['pue_options']['checkPeriod'] )
602
+					: plugin_basename(self::$_settings[$addon_name]['main_file_path']),
603
+				'checkPeriod'     => isset($setup_args['pue_options']['checkPeriod'])
604 604
 					? (string) $setup_args['pue_options']['checkPeriod']
605 605
 					: '24',
606
-				'use_wp_update'   => isset( $setup_args['pue_options']['use_wp_update'] )
606
+				'use_wp_update'   => isset($setup_args['pue_options']['use_wp_update'])
607 607
 					? (string) $setup_args['pue_options']['use_wp_update']
608 608
 					: false,
609 609
 			);
610 610
 			add_action(
611 611
 				'AHEE__EE_System__brew_espresso__after_pue_init',
612
-				array( 'EE_Register_Addon', 'load_pue_update' )
612
+				array('EE_Register_Addon', 'load_pue_update')
613 613
 			);
614 614
 		}
615 615
 		//any custom post type/ custom capabilities or default terms to register
616 616
 		if (
617
-			! empty( self::$_settings[ $addon_name ]['custom_post_types'] )
618
-			|| ! empty( self::$_settings[ $addon_name ]['custom_taxonomies'] )
617
+			! empty(self::$_settings[$addon_name]['custom_post_types'])
618
+			|| ! empty(self::$_settings[$addon_name]['custom_taxonomies'])
619 619
 		) {
620 620
 			EE_Register_CPT::register(
621 621
 				$addon_name,
622 622
 				array(
623
-					'cpts'          => self::$_settings[ $addon_name ]['custom_post_types'],
624
-					'cts'           => self::$_settings[ $addon_name ]['custom_taxonomies'],
625
-					'default_terms' => self::$_settings[ $addon_name ]['default_terms'],
623
+					'cpts'          => self::$_settings[$addon_name]['custom_post_types'],
624
+					'cts'           => self::$_settings[$addon_name]['custom_taxonomies'],
625
+					'default_terms' => self::$_settings[$addon_name]['default_terms'],
626 626
 				)
627 627
 			);
628 628
 		}
629
-		if ( ! empty( self::$_settings[ $addon_name ]['payment_method_paths'] ) ) {
629
+		if ( ! empty(self::$_settings[$addon_name]['payment_method_paths'])) {
630 630
 			EE_Register_Payment_Method::register(
631 631
 				$addon_name,
632
-				array( 'payment_method_paths' => self::$_settings[ $addon_name ]['payment_method_paths'] )
632
+				array('payment_method_paths' => self::$_settings[$addon_name]['payment_method_paths'])
633 633
 			);
634 634
 		}
635 635
 		// load and instantiate main addon class
636
-		$addon = self::_load_and_init_addon_class( $addon_name );
636
+		$addon = self::_load_and_init_addon_class($addon_name);
637 637
 		// call any additional admin_callback functions during load_admin_controller hook
638
-		if ( ! empty( self::$_settings[ $addon_name ]['admin_callback'] ) ) {
638
+		if ( ! empty(self::$_settings[$addon_name]['admin_callback'])) {
639 639
 			add_action(
640 640
 				'AHEE__EE_System__load_controllers__load_admin_controllers',
641
-				array( $addon, self::$_settings[ $addon_name ]['admin_callback'] )
641
+				array($addon, self::$_settings[$addon_name]['admin_callback'])
642 642
 			);
643 643
 		}
644 644
 	}
@@ -651,25 +651,25 @@  discard block
 block discarded – undo
651 651
 	 * @param string $addon_name
652 652
 	 * @return EE_Addon
653 653
 	 */
654
-	private static function _load_and_init_addon_class( $addon_name ) {
654
+	private static function _load_and_init_addon_class($addon_name) {
655 655
 		$addon = EE_Registry::instance()->load_addon(
656
-			dirname( self::$_settings[ $addon_name ]['main_file_path'] ),
657
-			self::$_settings[ $addon_name ]['class_name']
656
+			dirname(self::$_settings[$addon_name]['main_file_path']),
657
+			self::$_settings[$addon_name]['class_name']
658 658
 		);
659
-		$addon->set_name( $addon_name );
660
-		$addon->set_plugin_slug( self::$_settings[ $addon_name ]['plugin_slug'] );
661
-		$addon->set_plugin_basename( self::$_settings[ $addon_name ]['plugin_basename'] );
662
-		$addon->set_main_plugin_file( self::$_settings[ $addon_name ]['main_file_path'] );
663
-		$addon->set_plugin_action_slug( self::$_settings[ $addon_name ]['plugin_action_slug'] );
664
-		$addon->set_plugins_page_row( self::$_settings[ $addon_name ]['plugins_page_row'] );
665
-		$addon->set_version( self::$_settings[ $addon_name ]['version'] );
666
-		$addon->set_min_core_version( self::_effective_version( self::$_settings[ $addon_name ]['min_core_version'] ) );
667
-		$addon->set_config_section( self::$_settings[ $addon_name ]['config_section'] );
668
-		$addon->set_config_class( self::$_settings[ $addon_name ]['config_class'] );
669
-		$addon->set_config_name( self::$_settings[ $addon_name ]['config_name'] );
659
+		$addon->set_name($addon_name);
660
+		$addon->set_plugin_slug(self::$_settings[$addon_name]['plugin_slug']);
661
+		$addon->set_plugin_basename(self::$_settings[$addon_name]['plugin_basename']);
662
+		$addon->set_main_plugin_file(self::$_settings[$addon_name]['main_file_path']);
663
+		$addon->set_plugin_action_slug(self::$_settings[$addon_name]['plugin_action_slug']);
664
+		$addon->set_plugins_page_row(self::$_settings[$addon_name]['plugins_page_row']);
665
+		$addon->set_version(self::$_settings[$addon_name]['version']);
666
+		$addon->set_min_core_version(self::_effective_version(self::$_settings[$addon_name]['min_core_version']));
667
+		$addon->set_config_section(self::$_settings[$addon_name]['config_section']);
668
+		$addon->set_config_class(self::$_settings[$addon_name]['config_class']);
669
+		$addon->set_config_name(self::$_settings[$addon_name]['config_name']);
670 670
 		//unfortunately this can't be hooked in upon construction, because we don't have
671 671
 		//the plugin mainfile's path upon construction.
672
-		register_deactivation_hook( $addon->get_main_plugin_file(), array( $addon, 'deactivation' ) );
672
+		register_deactivation_hook($addon->get_main_plugin_file(), array($addon, 'deactivation'));
673 673
 		return $addon;
674 674
 	}
675 675
 
@@ -682,18 +682,18 @@  discard block
 block discarded – undo
682 682
 	 */
683 683
 	public static function load_pue_update() {
684 684
 		// load PUE client
685
-		require_once EE_THIRD_PARTY . 'pue' . DS . 'pue-client.php';
685
+		require_once EE_THIRD_PARTY.'pue'.DS.'pue-client.php';
686 686
 		// cycle thru settings
687
-		foreach ( self::$_settings as $settings ) {
688
-			if ( ! empty( $settings['pue_options'] ) ) {
687
+		foreach (self::$_settings as $settings) {
688
+			if ( ! empty($settings['pue_options'])) {
689 689
 				// initiate the class and start the plugin update engine!
690 690
 				new PluginUpdateEngineChecker(
691 691
 				// host file URL
692 692
 					'https://eventespresso.com',
693 693
 					// plugin slug(s)
694 694
 					array(
695
-						'premium'    => array( 'p' => $settings['pue_options']['pue_plugin_slug'] ),
696
-						'prerelease' => array( 'beta' => $settings['pue_options']['pue_plugin_slug'] . '-pr' ),
695
+						'premium'    => array('p' => $settings['pue_options']['pue_plugin_slug']),
696
+						'prerelease' => array('beta' => $settings['pue_options']['pue_plugin_slug'].'-pr'),
697 697
 					),
698 698
 					// options
699 699
 					array(
@@ -721,9 +721,9 @@  discard block
 block discarded – undo
721 721
 	 * @throws \EE_Error
722 722
 	 */
723 723
 	public static function register_message_types() {
724
-		foreach ( self::$_settings as $settings ) {
725
-			foreach ( $settings['message_types'] as $message_type => $message_type_settings ) {
726
-				EE_Register_Message_Type::register( $message_type, $message_type_settings );
724
+		foreach (self::$_settings as $settings) {
725
+			foreach ($settings['message_types'] as $message_type => $message_type_settings) {
726
+				EE_Register_Message_Type::register($message_type, $message_type_settings);
727 727
 			}
728 728
 		}
729 729
 	}
@@ -738,73 +738,73 @@  discard block
 block discarded – undo
738 738
 	 * @throws EE_Error
739 739
 	 * @return void
740 740
 	 */
741
-	public static function deregister( $addon_name = null ) {
742
-		if ( isset( self::$_settings[ $addon_name ] ) ) {
743
-			$class_name = self::$_settings[ $addon_name ]['class_name'];
744
-			if ( ! empty( self::$_settings[ $addon_name ]['dms_paths'] ) ) {
741
+	public static function deregister($addon_name = null) {
742
+		if (isset(self::$_settings[$addon_name])) {
743
+			$class_name = self::$_settings[$addon_name]['class_name'];
744
+			if ( ! empty(self::$_settings[$addon_name]['dms_paths'])) {
745 745
 				// setup DMS
746
-				EE_Register_Data_Migration_Scripts::deregister( $addon_name );
746
+				EE_Register_Data_Migration_Scripts::deregister($addon_name);
747 747
 			}
748
-			if ( ! empty( self::$_settings[ $addon_name ]['admin_path'] ) ) {
748
+			if ( ! empty(self::$_settings[$addon_name]['admin_path'])) {
749 749
 				// register admin page
750
-				EE_Register_Admin_Page::deregister( $addon_name );
750
+				EE_Register_Admin_Page::deregister($addon_name);
751 751
 			}
752
-			if ( ! empty( self::$_settings[ $addon_name ]['module_paths'] ) ) {
752
+			if ( ! empty(self::$_settings[$addon_name]['module_paths'])) {
753 753
 				// add to list of modules to be registered
754
-				EE_Register_Module::deregister( $addon_name );
754
+				EE_Register_Module::deregister($addon_name);
755 755
 			}
756
-			if ( ! empty( self::$_settings[ $addon_name ]['shortcode_paths'] ) ) {
756
+			if ( ! empty(self::$_settings[$addon_name]['shortcode_paths'])) {
757 757
 				// add to list of shortcodes to be registered
758
-				EE_Register_Shortcode::deregister( $addon_name );
758
+				EE_Register_Shortcode::deregister($addon_name);
759 759
 			}
760
-			if ( ! empty( self::$_settings[ $addon_name ]['config_class'] ) ) {
760
+			if ( ! empty(self::$_settings[$addon_name]['config_class'])) {
761 761
 				// if config_class present let's register config.
762
-				EE_Register_Config::deregister( self::$_settings[ $addon_name ]['config_class'] );
762
+				EE_Register_Config::deregister(self::$_settings[$addon_name]['config_class']);
763 763
 			}
764
-			if ( ! empty( self::$_settings[ $addon_name ]['widget_paths'] ) ) {
764
+			if ( ! empty(self::$_settings[$addon_name]['widget_paths'])) {
765 765
 				// add to list of widgets to be registered
766
-				EE_Register_Widget::deregister( $addon_name );
766
+				EE_Register_Widget::deregister($addon_name);
767 767
 			}
768
-			if ( ! empty( self::$_settings[ $addon_name ]['model_paths'] )
768
+			if ( ! empty(self::$_settings[$addon_name]['model_paths'])
769 769
 			     ||
770
-			     ! empty( self::$_settings[ $addon_name ]['class_paths'] )
770
+			     ! empty(self::$_settings[$addon_name]['class_paths'])
771 771
 			) {
772 772
 				// add to list of shortcodes to be registered
773
-				EE_Register_Model::deregister( $addon_name );
773
+				EE_Register_Model::deregister($addon_name);
774 774
 			}
775
-			if ( ! empty( self::$_settings[ $addon_name ]['model_extension_paths'] )
775
+			if ( ! empty(self::$_settings[$addon_name]['model_extension_paths'])
776 776
 			     ||
777
-			     ! empty( self::$_settings[ $addon_name ]['class_extension_paths'] )
777
+			     ! empty(self::$_settings[$addon_name]['class_extension_paths'])
778 778
 			) {
779 779
 				// add to list of shortcodes to be registered
780
-				EE_Register_Model_Extensions::deregister( $addon_name );
780
+				EE_Register_Model_Extensions::deregister($addon_name);
781 781
 			}
782
-			if ( ! empty( self::$_settings[ $addon_name ]['message_types'] ) ) {
783
-				foreach ( self::$_settings[ $addon_name ]['message_types'] as $message_type => $message_type_settings )
782
+			if ( ! empty(self::$_settings[$addon_name]['message_types'])) {
783
+				foreach (self::$_settings[$addon_name]['message_types'] as $message_type => $message_type_settings)
784 784
 				{
785
-					EE_Register_Message_Type::deregister( $message_type );
785
+					EE_Register_Message_Type::deregister($message_type);
786 786
 				}
787 787
 			}
788 788
 			//deregister capabilities for addon
789 789
 			if (
790
-				! empty( self::$_settings[ $addon_name ]['capabilities'] )
791
-				|| ! empty( self::$_settings[ $addon_name ]['capability_maps'] )
790
+				! empty(self::$_settings[$addon_name]['capabilities'])
791
+				|| ! empty(self::$_settings[$addon_name]['capability_maps'])
792 792
 			) {
793
-				EE_Register_Capabilities::deregister( $addon_name );
793
+				EE_Register_Capabilities::deregister($addon_name);
794 794
 			}
795 795
 			//deregister custom_post_types for addon
796
-			if ( ! empty( self::$_settings[ $addon_name ]['custom_post_types'] ) ) {
797
-				EE_Register_CPT::deregister( $addon_name );
796
+			if ( ! empty(self::$_settings[$addon_name]['custom_post_types'])) {
797
+				EE_Register_CPT::deregister($addon_name);
798 798
 			}
799 799
 			remove_action(
800
-				'deactivate_' . EE_Registry::instance()->addons->{$class_name}->get_main_plugin_file_basename(),
801
-				array( EE_Registry::instance()->addons->{$class_name}, 'deactivation' )
800
+				'deactivate_'.EE_Registry::instance()->addons->{$class_name}->get_main_plugin_file_basename(),
801
+				array(EE_Registry::instance()->addons->{$class_name}, 'deactivation')
802 802
 			);
803 803
 			remove_action(
804 804
 				'AHEE__EE_System__perform_activations_upgrades_and_migrations',
805
-				array( EE_Registry::instance()->addons->{$class_name}, 'initialize_db_if_no_migrations_required' )
805
+				array(EE_Registry::instance()->addons->{$class_name}, 'initialize_db_if_no_migrations_required')
806 806
 			);
807
-			unset( EE_Registry::instance()->addons->{$class_name}, self::$_settings[ $addon_name ] );
807
+			unset(EE_Registry::instance()->addons->{$class_name}, self::$_settings[$addon_name]);
808 808
 		}
809 809
 	}
810 810
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Recipient_Details_Shortcodes.lib.php 1 patch
Spacing   +66 added lines, -67 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 /**
@@ -37,24 +37,24 @@  discard block
 block discarded – undo
37 37
 
38 38
 
39 39
 	protected function _init_props() {
40
-		$this->label = esc_html__( 'Recipient Details Shortcodes', 'event_espresso' );
41
-		$this->description = esc_html__( 'All shortcodes specific to recipient registration data', 'event_espresso' );
40
+		$this->label = esc_html__('Recipient Details Shortcodes', 'event_espresso');
41
+		$this->description = esc_html__('All shortcodes specific to recipient registration data', 'event_espresso');
42 42
 		$this->_shortcodes = array(
43
-			'[RECIPIENT_FNAME]' => esc_html__( 'Parses to the first name of the recipient for the message.', 'event_espresso' ),
44
-			'[RECIPIENT_LNAME]' => esc_html__( 'Parses to the last name of the recipient for the message.', 'event_espresso' ),
45
-			'[RECIPIENT_EMAIL]' => esc_html__( 'Parses to the email address of the recipient for the message.', 'event_espresso' ),
46
-			'[RECIPIENT_REGISTRATION_ID]' => esc_html__( 'Parses to the registration ID of the recipient for the message.', 'event_espresso' ),
47
-			'[RECIPIENT_REGISTRATION_CODE]' => esc_html__( 'Parses to the registration code of the recipient for the message.', 'event_espresso' ),
48
-			'[RECIPIENT_EDIT_REGISTRATION_LINK]' => esc_html__( 'Parses to a link for frontend editing of the registration for the recipient.', 'event_espresso' ),
49
-			'[RECIPIENT_PHONE_NUMBER]' => esc_html__( 'The Phone Number for the recipient of the message.', 'event_espresso' ),
50
-			'[RECIPIENT_ADDRESS]' => esc_html__( 'The Address for the recipient of the message.', 'event_espresso' ),
51
-			'[RECIPIENT_ADDRESS2]' => esc_html__( 'Whatever was in the address 2 field for the recipient of the message.', 'event_espresso' ),
52
-			'[RECIPIENT_CITY]' => esc_html__( 'The city for the recipient of the message.', 'event_espresso' ),
53
-			'[RECIPIENT_ZIP_PC]' => esc_html__( 'The ZIP (or Postal) Code for the recipient of the message.', 'event_espresso' ),
54
-			'[RECIPIENT_ADDRESS_STATE]' => esc_html__( 'The state/province for the recipient of the message.', 'event_espresso' ),
55
-			'[RECIPIENT_COUNTRY]' => esc_html__( 'The country for the recipient of the message.', 'event_espresso' ),
56
-			'[RECIPIENT_ANSWER_*]' => esc_html__( 'This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this recipient, then it will be output in place of this shortcode.', 'event_espresso' ),
57
-			'[RECIPIENT_TOTAL_AMOUNT_PAID]' => esc_html__( 'If a single registration related to the recipient is available, that is used to retrieve the total amount that has been paid for this recipient.  Otherwise the value of 0 is printed.', 'event_espresso' )
43
+			'[RECIPIENT_FNAME]' => esc_html__('Parses to the first name of the recipient for the message.', 'event_espresso'),
44
+			'[RECIPIENT_LNAME]' => esc_html__('Parses to the last name of the recipient for the message.', 'event_espresso'),
45
+			'[RECIPIENT_EMAIL]' => esc_html__('Parses to the email address of the recipient for the message.', 'event_espresso'),
46
+			'[RECIPIENT_REGISTRATION_ID]' => esc_html__('Parses to the registration ID of the recipient for the message.', 'event_espresso'),
47
+			'[RECIPIENT_REGISTRATION_CODE]' => esc_html__('Parses to the registration code of the recipient for the message.', 'event_espresso'),
48
+			'[RECIPIENT_EDIT_REGISTRATION_LINK]' => esc_html__('Parses to a link for frontend editing of the registration for the recipient.', 'event_espresso'),
49
+			'[RECIPIENT_PHONE_NUMBER]' => esc_html__('The Phone Number for the recipient of the message.', 'event_espresso'),
50
+			'[RECIPIENT_ADDRESS]' => esc_html__('The Address for the recipient of the message.', 'event_espresso'),
51
+			'[RECIPIENT_ADDRESS2]' => esc_html__('Whatever was in the address 2 field for the recipient of the message.', 'event_espresso'),
52
+			'[RECIPIENT_CITY]' => esc_html__('The city for the recipient of the message.', 'event_espresso'),
53
+			'[RECIPIENT_ZIP_PC]' => esc_html__('The ZIP (or Postal) Code for the recipient of the message.', 'event_espresso'),
54
+			'[RECIPIENT_ADDRESS_STATE]' => esc_html__('The state/province for the recipient of the message.', 'event_espresso'),
55
+			'[RECIPIENT_COUNTRY]' => esc_html__('The country for the recipient of the message.', 'event_espresso'),
56
+			'[RECIPIENT_ANSWER_*]' => esc_html__('This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this recipient, then it will be output in place of this shortcode.', 'event_espresso'),
57
+			'[RECIPIENT_TOTAL_AMOUNT_PAID]' => esc_html__('If a single registration related to the recipient is available, that is used to retrieve the total amount that has been paid for this recipient.  Otherwise the value of 0 is printed.', 'event_espresso')
58 58
 			);
59 59
 	}
60 60
 
@@ -65,36 +65,35 @@  discard block
 block discarded – undo
65 65
 	 * @param  string $shortcode the shortcode to be parsed.
66 66
 	 * @return string parsed shortcode
67 67
 	 */
68
-	protected function _parser( $shortcode ) {
68
+	protected function _parser($shortcode) {
69 69
 
70 70
 		//make sure we end up with a copy of the EE_Messages_Addressee object
71 71
 		$this->_recipient = $this->_data instanceof EE_Messages_Addressee ? $this->_data : null;
72 72
 		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee
73
-		                    && is_array( $this->_data )
74
-		                    && isset( $this->_data['data'] )
73
+		                    && is_array($this->_data)
74
+		                    && isset($this->_data['data'])
75 75
 		                    && $this->_data['data'] instanceof EE_Messages_Addressee
76
-			? $this->_data['data'] :
77
-			$this->_recipient;
76
+			? $this->_data['data'] : $this->_recipient;
78 77
 		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee
79
-		                    && ! empty( $this->_extra_data['data'] )
78
+		                    && ! empty($this->_extra_data['data'])
80 79
 		                    && $this->_extra_data['data'] instanceof EE_Messages_Addressee
81 80
 			? $this->_extra_data['data']
82 81
 			: $this->_recipient;
83 82
 
84
-		if ( ! $this->_recipient instanceof EE_Messages_Addressee ) {
83
+		if ( ! $this->_recipient instanceof EE_Messages_Addressee) {
85 84
 			return '';
86 85
 		}
87 86
 
88 87
 		$attendee = $this->_recipient->att_obj;
89
-		if ( ! $attendee instanceof EE_Attendee ) {
88
+		if ( ! $attendee instanceof EE_Attendee) {
90 89
 			return '';
91 90
 		}
92 91
 
93
-		$this->_registrations_for_recipient = isset( $this->_recipient->attendees[ $attendee->ID() ]['reg_objs'] )
94
-			? $this->_recipient->attendees[ $attendee->ID() ]['reg_objs']
92
+		$this->_registrations_for_recipient = isset($this->_recipient->attendees[$attendee->ID()]['reg_objs'])
93
+			? $this->_recipient->attendees[$attendee->ID()]['reg_objs']
95 94
 			: array();
96 95
 
97
-		switch ( $shortcode ) {
96
+		switch ($shortcode) {
98 97
 			case '[RECIPIENT_FNAME]' :
99 98
 				return $attendee->fname();
100 99
 				break;
@@ -108,21 +107,21 @@  discard block
 block discarded – undo
108 107
 				break;
109 108
 
110 109
 			case '[RECIPIENT_REGISTRATION_ID]' :
111
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration ) {
110
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration) {
112 111
 					return '';
113 112
 				}
114 113
 				return $this->_get_reg_id();
115 114
 				break;
116 115
 
117 116
 			case '[RECIPIENT_REGISTRATION_CODE]' :
118
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration ) {
117
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration) {
119 118
 					return '';
120 119
 				}
121 120
 				return $this->_get_reg_code();
122 121
 				break;
123 122
 
124 123
 			case '[RECIPIENT_EDIT_REGISTRATION_LINK]' :
125
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration ) {
124
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration) {
126 125
 					return '';
127 126
 				}
128 127
 				return $this->_recipient->reg_obj->edit_attendee_information_url();
@@ -164,23 +163,23 @@  discard block
 block discarded – undo
164 163
 				break;
165 164
 		}
166 165
 
167
-		if ( strpos( $shortcode, '[RECIPIENT_ANSWER_*' ) !== false ) {
168
-			$shortcode = str_replace( '[RECIPIENT_ANSWER_*', '', $shortcode );
169
-			$shortcode = trim( str_replace( ']', '', $shortcode ) );
166
+		if (strpos($shortcode, '[RECIPIENT_ANSWER_*') !== false) {
167
+			$shortcode = str_replace('[RECIPIENT_ANSWER_*', '', $shortcode);
168
+			$shortcode = trim(str_replace(']', '', $shortcode));
170 169
 
171 170
 
172 171
 			//now let's figure out what question has this text
173
-			if ( empty( $this->_recipient->questions ) || ! $this->_recipient->reg_obj instanceof EE_Registration ) {
172
+			if (empty($this->_recipient->questions) || ! $this->_recipient->reg_obj instanceof EE_Registration) {
174 173
 				return '';
175 174
 			}
176 175
 
177
-			foreach ( $this->_recipient->questions as $ansid => $question ) {
176
+			foreach ($this->_recipient->questions as $ansid => $question) {
178 177
 				if (
179 178
 					$question instanceof EE_Question
180
-					&& trim( $question->display_text() ) == trim( $shortcode )
181
-					&& isset( $this->_recipient->registrations[ $this->_recipient->reg_obj->ID() ]['ans_objs'][ $ansid ] )
179
+					&& trim($question->display_text()) == trim($shortcode)
180
+					&& isset($this->_recipient->registrations[$this->_recipient->reg_obj->ID()]['ans_objs'][$ansid])
182 181
 				) {
183
-					return $this->_recipient->registrations[ $this->_recipient->reg_obj->ID() ]['ans_objs'][ $ansid ]->get_pretty( 'ANS_value', 'no_wpautop' );
182
+					return $this->_recipient->registrations[$this->_recipient->reg_obj->ID()]['ans_objs'][$ansid]->get_pretty('ANS_value', 'no_wpautop');
184 183
 				}
185 184
 			}
186 185
 		}
@@ -211,53 +210,53 @@  discard block
 block discarded – undo
211 210
 	protected function _get_reg_code() {
212 211
 
213 212
 		//if only one related registration for the recipient then just return that reg code.
214
-		if ( count( $this->_registrations_for_recipient ) <= 1 )  {
213
+		if (count($this->_registrations_for_recipient) <= 1) {
215 214
 			return $this->_recipient->reg_obj->reg_code();
216 215
 		}
217 216
 
218 217
 		//k more than one registration so let's see if we can get specific to context
219 218
 		//are we parsing event_list?
220
-		if ( $this->_data instanceof EE_Event ) {
219
+		if ($this->_data instanceof EE_Event) {
221 220
 			$reg_code = array();
222 221
 			//loop through registrations for recipient and see if there is a match for this event
223
-			foreach ( $this->_registrations_for_recipient as $reg ) {
224
-				if ( $reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID() ) {
222
+			foreach ($this->_registrations_for_recipient as $reg) {
223
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID()) {
225 224
 					$reg_code[] = $reg->reg_code();
226 225
 				}
227 226
 			}
228
-			return implode( ', ', $reg_code );
227
+			return implode(', ', $reg_code);
229 228
 		}
230 229
 
231 230
 		//are we parsing ticket list?
232
-		if ( $this->_data instanceof EE_Ticket ) {
231
+		if ($this->_data instanceof EE_Ticket) {
233 232
 			$reg_code = array();
234 233
 			//loop through each registration for recipient and see if there is a match for this ticket
235
-			foreach ( $this->_registrations_for_recipient as $reg ) {
236
-				if ( $reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID() ) {
234
+			foreach ($this->_registrations_for_recipient as $reg) {
235
+				if ($reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID()) {
237 236
 					$reg_code = $reg->reg_code();
238 237
 				}
239 238
 			}
240
-			return implode( ', ', $reg_code );
239
+			return implode(', ', $reg_code);
241 240
 		}
242 241
 
243 242
 		//do we have a specific reg_obj?  Let's use it
244
-		if ( $this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration ) {
243
+		if ($this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration) {
245 244
 			return $this->_data->reg_obj->reg_code();
246 245
 		}
247 246
 
248 247
 		//do we have a specific reg_obj?  Let's use it
249
-		if ( $this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration ) {
248
+		if ($this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration) {
250 249
 			return $this->_data->reg_obj->reg_code();
251 250
 		}
252 251
 
253 252
 		//not able to determine the single reg code so let's return a comma delimited list of reg codes.
254 253
 		$reg_code = array();
255
-		foreach ( $this->_registrations_for_recipient as $reg ) {
256
-			if ( $reg instanceof EE_Registration ) {
254
+		foreach ($this->_registrations_for_recipient as $reg) {
255
+			if ($reg instanceof EE_Registration) {
257 256
 				$reg_code[] = $reg->reg_code();
258 257
 			}
259 258
 		}
260
-		return implode( ', ', $reg_code );
259
+		return implode(', ', $reg_code);
261 260
 	}
262 261
 
263 262
 
@@ -270,48 +269,48 @@  discard block
 block discarded – undo
270 269
 	protected function _get_reg_id() {
271 270
 
272 271
 		//if only one related registration for the recipient then just return that reg code.
273
-		if ( count( $this->_registrations_for_recipient ) <= 1 )  {
272
+		if (count($this->_registrations_for_recipient) <= 1) {
274 273
 			return $this->_recipient->reg_obj->ID();
275 274
 		}
276 275
 
277 276
 		//k more than one registration so let's see if we can get specific to context
278 277
 		//are we parsing event_list?
279
-		if ( $this->_data instanceof EE_Event ) {
278
+		if ($this->_data instanceof EE_Event) {
280 279
 			$registration_ids = array();
281 280
 			//loop through registrations for recipient and see if there is a match for this event
282
-			foreach ( $this->_registrations_for_recipient as $reg ) {
283
-				if ( $reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID() ) {
281
+			foreach ($this->_registrations_for_recipient as $reg) {
282
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID()) {
284 283
 					$registration_ids[] = $reg->ID();
285 284
 				}
286 285
 			}
287
-			return implode( ', ', $registration_ids );
286
+			return implode(', ', $registration_ids);
288 287
 		}
289 288
 
290 289
 		//are we parsing ticket list?
291
-		if ( $this->_data instanceof EE_Ticket ) {
290
+		if ($this->_data instanceof EE_Ticket) {
292 291
 			$registration_ids = array();
293 292
 			//loop through each registration for recipient and see if there is a match for this ticket
294
-			foreach ( $this->_registrations_for_recipient as $reg ) {
295
-				if ( $reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID() ) {
293
+			foreach ($this->_registrations_for_recipient as $reg) {
294
+				if ($reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID()) {
296 295
 					$registration_ids = $reg->ID();
297 296
 				}
298 297
 			}
299
-			return implode( ', ', $registration_ids );
298
+			return implode(', ', $registration_ids);
300 299
 		}
301 300
 
302 301
 		//do we have a specific reg_obj?  Let's use it
303
-		if ( $this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration ) {
302
+		if ($this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration) {
304 303
 			return $this->_data->reg_obj->ID();
305 304
 		}
306 305
 
307 306
 		//not able to determine the single reg code so let's return a comma delimited list of reg codes.
308 307
 		$registration_ids = array();
309
-		foreach ( $this->_registrations_for_recipient as $reg ) {
310
-			if ( $reg instanceof EE_Registration ) {
308
+		foreach ($this->_registrations_for_recipient as $reg) {
309
+			if ($reg instanceof EE_Registration) {
311 310
 				$registration_ids[] = $reg->ID();
312 311
 			}
313 312
 		}
314
-		return implode( ', ', $registration_ids );
313
+		return implode(', ', $registration_ids);
315 314
 	}
316 315
 
317 316
 
Please login to merge, or discard this patch.