Completed
Branch BETA-4.9-message-activity (f74763)
by
unknown
31:09 queued 14:23
created
public/template_tags.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
  * can_use_espresso_conditionals
148 148
  * tests whether the Espresso Conditional tags like is_espresso_event_single() can be called
149 149
  *
150
- * @param $conditional_tag
150
+ * @param string $conditional_tag
151 151
  * @return bool
152 152
  */
153 153
 function can_use_espresso_conditionals( $conditional_tag ) {
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 	/**
878 878
 	 * espresso_event_venues
879 879
 	 *
880
-	 * @return array  all venues related to an event
880
+	 * @return EE_Venue[]  all venues related to an event
881 881
 	 */
882 882
 	function espresso_event_venues() {
883 883
 		EE_Registry::instance()->load_helper( 'Venue_View' );
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 	 *
913 913
 	 * @param int     $VNU_ID optional, the venue id to check.
914 914
 	 *
915
-	 * @return bool | null
915
+	 * @return null|boolean | null
916 916
 	 */
917 917
 	function espresso_is_venue_private( $VNU_ID = 0 ) {
918 918
 		EE_Registry::instance()->load_helper( 'Venue_View' );
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 	 * returns true or false if a venue is password protected or not
928 928
 	 *
929 929
 	 * @param int     $VNU_ID optional, the venue id to check.
930
-	 * @return string
930
+	 * @return boolean
931 931
 	 */
932 932
 	function espresso_venue_is_password_protected( $VNU_ID = 0 ) {
933 933
 		EE_Registry::instance()->load_helper( 'Venue_View' );
Please login to merge, or discard this patch.
Spacing   +276 added lines, -276 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
  * @param int | \EE_Event $event
28 28
  * @return bool
29 29
  */
30
-function is_espresso_event( $event = NULL ) {
31
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
30
+function is_espresso_event($event = NULL) {
31
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
32 32
 		// extract EE_Event object from passed param regardless of what it is (within reason of course)
33
-		$event = EEH_Event_View::get_event( $event );
33
+		$event = EEH_Event_View::get_event($event);
34 34
 		// do we have a valid event ?
35
-		return $event instanceof EE_Event  ? TRUE : FALSE;
35
+		return $event instanceof EE_Event ? TRUE : FALSE;
36 36
 	}
37 37
 	return FALSE;
38 38
 }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
  * @return bool
45 45
  */
46 46
 function is_espresso_event_single() {
47
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
47
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
48 48
 		global $wp_query;
49 49
 		// return conditionals set by CPTs
50 50
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_single : FALSE;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
  * @return bool
60 60
  */
61 61
 function is_espresso_event_archive() {
62
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
62
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
63 63
 		global $wp_query;
64 64
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_archive : FALSE;
65 65
 	}
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
  * @return bool
74 74
  */
75 75
 function is_espresso_event_taxonomy() {
76
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
76
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
77 77
 		global $wp_query;
78 78
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_taxonomy : FALSE;
79 79
 	}
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
  * @param int | \EE_Venue $venue
88 88
  * @return bool
89 89
  */
90
-function is_espresso_venue( $venue = NULL ) {
91
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
90
+function is_espresso_venue($venue = NULL) {
91
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
92 92
 		// extract EE_Venue object from passed param regardless of what it is (within reason of course)
93
-		$venue = EEH_Venue_View::get_venue( $venue, FALSE );
93
+		$venue = EEH_Venue_View::get_venue($venue, FALSE);
94 94
 		// do we have a valid event ?
95 95
 		return $venue instanceof EE_Venue ? TRUE : FALSE;
96 96
 	}
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
  * @return bool
105 105
  */
106 106
 function is_espresso_venue_single() {
107
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
107
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
108 108
 		global $wp_query;
109 109
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_single : FALSE;
110 110
 	}
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
  * @return bool
119 119
  */
120 120
 function is_espresso_venue_archive() {
121
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
121
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
122 122
 		global $wp_query;
123 123
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_archive : FALSE;
124 124
 	}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
  * @return bool
133 133
  */
134 134
 function is_espresso_venue_taxonomy() {
135
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
135
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
136 136
 		global $wp_query;
137 137
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_taxonomy : FALSE;
138 138
 	}
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
  * @param $conditional_tag
147 147
  * @return bool
148 148
  */
149
-function can_use_espresso_conditionals( $conditional_tag ) {
150
-	if ( ! did_action( 'AHEE__EE_System__initialize' )) {
149
+function can_use_espresso_conditionals($conditional_tag) {
150
+	if ( ! did_action('AHEE__EE_System__initialize')) {
151 151
 		EE_Error::doing_it_wrong(
152 152
 			__FUNCTION__,
153 153
 			sprintf(
154
-				__( 'The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.','event_espresso'),
154
+				__('The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.', 'event_espresso'),
155 155
 				$conditional_tag
156 156
 			),
157 157
 			'4.4.0'
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
 
167 167
 /*************************** Event Queries ***************************/
168 168
 
169
-if ( ! function_exists( 'espresso_get_events' )) {
169
+if ( ! function_exists('espresso_get_events')) {
170 170
 	/**
171 171
 	 * 	espresso_get_events
172 172
 	 * @param array $params
173 173
 	 * @return array
174 174
 	 */
175
-	function espresso_get_events( $params = array() ) {
175
+	function espresso_get_events($params = array()) {
176 176
 		//set default params
177 177
 		$default_espresso_events_params = array(
178 178
 			'limit' => 10,
@@ -183,18 +183,18 @@  discard block
 block discarded – undo
183 183
 			'sort' => 'ASC'
184 184
 		);
185 185
 		// allow the defaults to be filtered
186
-		$default_espresso_events_params = apply_filters( 'espresso_get_events__default_espresso_events_params', $default_espresso_events_params );
186
+		$default_espresso_events_params = apply_filters('espresso_get_events__default_espresso_events_params', $default_espresso_events_params);
187 187
 		// grab params and merge with defaults, then extract
188
-		$params = array_merge( $default_espresso_events_params, $params );
188
+		$params = array_merge($default_espresso_events_params, $params);
189 189
 		// run the query
190
-		$events_query = new EE_Event_List_Query( $params );
190
+		$events_query = new EE_Event_List_Query($params);
191 191
 		// assign results to a variable so we can return it
192 192
 		$events = $events_query->have_posts() ? $events_query->posts : array();
193 193
 		// but first reset the query and postdata
194 194
 		wp_reset_query();
195 195
 		wp_reset_postdata();
196 196
 		EED_Events_Archive::remove_all_events_archive_filters();
197
-		unset( $events_query );
197
+		unset($events_query);
198 198
 		return $events;
199 199
 	}
200 200
 }
@@ -208,32 +208,32 @@  discard block
 block discarded – undo
208 208
  * espresso_load_ticket_selector
209 209
  */
210 210
 function espresso_load_ticket_selector() {
211
-	EE_Registry::instance()->load_file( EE_MODULES . 'ticket_selector', 'EED_Ticket_Selector', 'module' );
211
+	EE_Registry::instance()->load_file(EE_MODULES.'ticket_selector', 'EED_Ticket_Selector', 'module');
212 212
 }
213 213
 
214
-if ( ! function_exists( 'espresso_ticket_selector' )) {
214
+if ( ! function_exists('espresso_ticket_selector')) {
215 215
 	/**
216 216
 	 * espresso_ticket_selector
217 217
 	 * @param null $event
218 218
 	 */
219
-	function espresso_ticket_selector( $event = NULL ) {
220
-		if (  ! apply_filters( 'FHEE_disable_espresso_ticket_selector', FALSE ) ) {
219
+	function espresso_ticket_selector($event = NULL) {
220
+		if ( ! apply_filters('FHEE_disable_espresso_ticket_selector', FALSE)) {
221 221
 			espresso_load_ticket_selector();
222
-			echo EED_Ticket_Selector::display_ticket_selector( $event );
222
+			echo EED_Ticket_Selector::display_ticket_selector($event);
223 223
 		}
224 224
 	}
225 225
 }
226 226
 
227 227
 
228
-	if ( ! function_exists( 'espresso_view_details_btn' )) {
228
+	if ( ! function_exists('espresso_view_details_btn')) {
229 229
 	/**
230 230
 	 * espresso_view_details_btn
231 231
 	 * @param null $event
232 232
 	 */
233
-	function espresso_view_details_btn( $event = NULL ) {
234
-		if (  ! apply_filters( 'FHEE_disable_espresso_view_details_btn', FALSE ) ) {
233
+	function espresso_view_details_btn($event = NULL) {
234
+		if ( ! apply_filters('FHEE_disable_espresso_view_details_btn', FALSE)) {
235 235
 			espresso_load_ticket_selector();
236
-			echo EED_Ticket_Selector::display_ticket_selector( $event, TRUE );
236
+			echo EED_Ticket_Selector::display_ticket_selector($event, TRUE);
237 237
 		}
238 238
 	}
239 239
 }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
 /*************************** EEH_Event_View ***************************/
245 245
 
246
-if ( ! function_exists( 'espresso_load_event_list_assets' )) {
246
+if ( ! function_exists('espresso_load_event_list_assets')) {
247 247
 	/**
248 248
 	 * espresso_load_event_list_assets
249 249
 	 * ensures that event list styles and scripts are loaded
@@ -252,13 +252,13 @@  discard block
 block discarded – undo
252 252
 	 */
253 253
 	function espresso_load_event_list_assets() {
254 254
 		$event_list = EED_Events_Archive::instance();
255
-		add_action( 'AHEE__EE_System__initialize_last', array( $event_list, 'load_event_list_assets' ), 10 );
256
-		add_filter( 'FHEE_enable_default_espresso_css', '__return_true' );
255
+		add_action('AHEE__EE_System__initialize_last', array($event_list, 'load_event_list_assets'), 10);
256
+		add_filter('FHEE_enable_default_espresso_css', '__return_true');
257 257
 	}
258 258
 }
259 259
 
260 260
 
261
-if ( ! function_exists( 'espresso_event_reg_button' )) {
261
+if ( ! function_exists('espresso_event_reg_button')) {
262 262
 	/**
263 263
 	 * espresso_event_reg_button
264 264
 	 * returns the "Register Now" button if event is active,
@@ -270,9 +270,9 @@  discard block
 block discarded – undo
270 270
 	 * @param bool $EVT_ID
271 271
 	 * @return string
272 272
 	 */
273
-	function espresso_event_reg_button( $btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE ) {
274
-		$event_status = EEH_Event_View::event_active_status( $EVT_ID );
275
-		switch ( $event_status ) {
273
+	function espresso_event_reg_button($btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE) {
274
+		$event_status = EEH_Event_View::event_active_status($EVT_ID);
275
+		switch ($event_status) {
276 276
 			case EE_Datetime::sold_out :
277 277
 				$btn_text = __('Sold Out', 'event_espresso');
278 278
 				$class = 'ee-pink';
@@ -288,10 +288,10 @@  discard block
 block discarded – undo
288 288
 			case EE_Datetime::upcoming :
289 289
 			case EE_Datetime::active :
290 290
 			default :
291
-				$btn_text =! empty( $btn_text_if_active ) ? $btn_text_if_active : __( 'Register Now', 'event_espresso' );
291
+				$btn_text = ! empty($btn_text_if_active) ? $btn_text_if_active : __('Register Now', 'event_espresso');
292 292
 				$class = 'ee-green';
293 293
 		}
294
-		if ( $event_status < 1 && ! empty( $btn_text_if_inactive )) {
294
+		if ($event_status < 1 && ! empty($btn_text_if_inactive)) {
295 295
 			$btn_text = $btn_text_if_inactive;
296 296
 			$class = 'ee-grey';
297 297
 		}
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 
306 306
 
307 307
 
308
-if ( ! function_exists( 'espresso_display_ticket_selector' )) {
308
+if ( ! function_exists('espresso_display_ticket_selector')) {
309 309
 	/**
310 310
 	 * espresso_display_ticket_selector
311 311
 	 * whether or not to display the Ticket Selector for an event
@@ -313,14 +313,14 @@  discard block
 block discarded – undo
313 313
 	 * @param bool $EVT_ID
314 314
 	 * @return boolean
315 315
 	 */
316
-	function espresso_display_ticket_selector( $EVT_ID = FALSE ) {
317
-		return EEH_Event_View::display_ticket_selector( $EVT_ID );
316
+	function espresso_display_ticket_selector($EVT_ID = FALSE) {
317
+		return EEH_Event_View::display_ticket_selector($EVT_ID);
318 318
 	}
319 319
 }
320 320
 
321 321
 
322 322
 
323
-if ( ! function_exists( 'espresso_event_status_banner' )) {
323
+if ( ! function_exists('espresso_event_status_banner')) {
324 324
 	/**
325 325
 	 * espresso_event_status
326 326
 	 * returns a banner showing the event status if it is sold out, expired, or inactive
@@ -328,13 +328,13 @@  discard block
 block discarded – undo
328 328
 	 * @param bool $EVT_ID
329 329
 	 * @return string
330 330
 	 */
331
-	function espresso_event_status_banner( $EVT_ID = FALSE ) {
332
-		return EEH_Event_View::event_status( $EVT_ID );
331
+	function espresso_event_status_banner($EVT_ID = FALSE) {
332
+		return EEH_Event_View::event_status($EVT_ID);
333 333
 	}
334 334
 }
335 335
 
336 336
 
337
-if ( ! function_exists( 'espresso_event_status' )) {
337
+if ( ! function_exists('espresso_event_status')) {
338 338
 	/**
339 339
 	 * espresso_event_status
340 340
 	 * returns the event status if it is sold out, expired, or inactive
@@ -343,17 +343,17 @@  discard block
 block discarded – undo
343 343
 	 * @param bool $echo
344 344
 	 * @return string
345 345
 	 */
346
-	function espresso_event_status( $EVT_ID = 0, $echo = TRUE ) {
347
-		if ( $echo ) {
348
-			echo EEH_Event_View::event_active_status( $EVT_ID );
346
+	function espresso_event_status($EVT_ID = 0, $echo = TRUE) {
347
+		if ($echo) {
348
+			echo EEH_Event_View::event_active_status($EVT_ID);
349 349
 			return '';
350 350
 		}
351
-		return EEH_Event_View::event_active_status( $EVT_ID );
351
+		return EEH_Event_View::event_active_status($EVT_ID);
352 352
 	}
353 353
 }
354 354
 
355 355
 
356
-if ( ! function_exists( 'espresso_event_categories' )) {
356
+if ( ! function_exists('espresso_event_categories')) {
357 357
 	/**
358 358
 	 * espresso_event_categories
359 359
 	 * returns the terms associated with an event
@@ -363,17 +363,17 @@  discard block
 block discarded – undo
363 363
 	 * @param bool $echo
364 364
 	 * @return string
365 365
 	 */
366
-	function espresso_event_categories( $EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE ) {
367
-		if ( $echo ) {
368
-			echo EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized );
366
+	function espresso_event_categories($EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) {
367
+		if ($echo) {
368
+			echo EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized);
369 369
 			return '';
370 370
 		}
371
-		return EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized );
371
+		return EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized);
372 372
 	}
373 373
 }
374 374
 
375 375
 
376
-if ( ! function_exists( 'espresso_event_tickets_available' )) {
376
+if ( ! function_exists('espresso_event_tickets_available')) {
377 377
 	/**
378 378
 	 * espresso_event_tickets_available
379 379
 	 * returns the ticket types available for purchase for an event
@@ -383,26 +383,26 @@  discard block
 block discarded – undo
383 383
 	 * @param bool $format
384 384
 	 * @return string
385 385
 	 */
386
-	function espresso_event_tickets_available( $EVT_ID = 0, $echo = TRUE, $format = TRUE ) {
387
-		$tickets = EEH_Event_View::event_tickets_available( $EVT_ID );
388
-		if ( is_array( $tickets ) && ! empty( $tickets )) {
386
+	function espresso_event_tickets_available($EVT_ID = 0, $echo = TRUE, $format = TRUE) {
387
+		$tickets = EEH_Event_View::event_tickets_available($EVT_ID);
388
+		if (is_array($tickets) && ! empty($tickets)) {
389 389
 			// if formatting then $html will be a string, else it will be an array of ticket objects
390
-			$html = $format ? '<ul id="ee-event-tickets-ul-' . $EVT_ID . '" class="ee-event-tickets-ul">' : array();
391
-			foreach ( $tickets as $ticket ) {
392
-				if ( $ticket instanceof EE_Ticket ) {
393
-					if ( $format ) {
394
-						$html .= '<li id="ee-event-tickets-li-' . $ticket->ID() . '" class="ee-event-tickets-li">';
395
-						$html .= $ticket->name() . ' ' . EEH_Template::format_currency( $ticket->get_ticket_total_with_taxes() );
390
+			$html = $format ? '<ul id="ee-event-tickets-ul-'.$EVT_ID.'" class="ee-event-tickets-ul">' : array();
391
+			foreach ($tickets as $ticket) {
392
+				if ($ticket instanceof EE_Ticket) {
393
+					if ($format) {
394
+						$html .= '<li id="ee-event-tickets-li-'.$ticket->ID().'" class="ee-event-tickets-li">';
395
+						$html .= $ticket->name().' '.EEH_Template::format_currency($ticket->get_ticket_total_with_taxes());
396 396
 						$html .= '</li>';
397 397
 					} else {
398 398
 						$html[] = $ticket;
399 399
 					}
400 400
 				}
401 401
 			}
402
-			if ( $format ) {
402
+			if ($format) {
403 403
 				$html .= '</ul>';
404 404
 			}
405
-			if ( $echo && ! $format ) {
405
+			if ($echo && ! $format) {
406 406
 				echo $html;
407 407
 				return '';
408 408
 			}
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	}
413 413
 }
414 414
 
415
-if ( ! function_exists( 'espresso_event_date_obj' )) {
415
+if ( ! function_exists('espresso_event_date_obj')) {
416 416
 	/**
417 417
 	 * espresso_event_date_obj
418 418
 	 * returns the primary date object for an event
@@ -420,13 +420,13 @@  discard block
 block discarded – undo
420 420
 	 * @param bool $EVT_ID
421 421
 	 * @return object
422 422
 	 */
423
-	function espresso_event_date_obj( $EVT_ID = FALSE ) {
424
-		return EEH_Event_View::get_primary_date_obj( $EVT_ID );
423
+	function espresso_event_date_obj($EVT_ID = FALSE) {
424
+		return EEH_Event_View::get_primary_date_obj($EVT_ID);
425 425
 	}
426 426
 }
427 427
 
428 428
 
429
-if ( ! function_exists( 'espresso_event_date' )) {
429
+if ( ! function_exists('espresso_event_date')) {
430 430
 	/**
431 431
 	 * espresso_event_date
432 432
 	 * returns the primary date for an event
@@ -437,22 +437,22 @@  discard block
 block discarded – undo
437 437
 	 * @param bool $echo
438 438
 	 * @return string
439 439
 	 */
440
-	function espresso_event_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) {
441
-		$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
442
-		$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
443
-		$date_format = apply_filters( 'FHEE__espresso_event_date__date_format', $date_format );
444
-		$time_format = apply_filters( 'FHEE__espresso_event_date__time_format', $time_format );
445
-		if($echo){
446
-			echo EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID );
440
+	function espresso_event_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) {
441
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
442
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
443
+		$date_format = apply_filters('FHEE__espresso_event_date__date_format', $date_format);
444
+		$time_format = apply_filters('FHEE__espresso_event_date__time_format', $time_format);
445
+		if ($echo) {
446
+			echo EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID);
447 447
 			return '';
448 448
 		}
449
-		return EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID );
449
+		return EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID);
450 450
 
451 451
 	}
452 452
 }
453 453
 
454 454
 
455
-if ( ! function_exists( 'espresso_list_of_event_dates' )) {
455
+if ( ! function_exists('espresso_list_of_event_dates')) {
456 456
 	/**
457 457
 	 * espresso_list_of_event_dates
458 458
 	 * returns a unordered list of dates for an event
@@ -467,40 +467,40 @@  discard block
 block discarded – undo
467 467
 	 * @param null   $limit
468 468
 	 * @return string
469 469
 	 */
470
-	function espresso_list_of_event_dates( $EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL ) {
471
-		$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
472
-		$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
473
-		$date_format = apply_filters( 'FHEE__espresso_list_of_event_dates__date_format', $date_format );
474
-		$time_format = apply_filters( 'FHEE__espresso_list_of_event_dates__time_format', $time_format );
475
-		$datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired, FALSE, $limit );
476
-		if ( ! $format ) {
477
-			return apply_filters( 'FHEE__espresso_list_of_event_dates__datetimes', $datetimes );
470
+	function espresso_list_of_event_dates($EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL) {
471
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
472
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
473
+		$date_format = apply_filters('FHEE__espresso_list_of_event_dates__date_format', $date_format);
474
+		$time_format = apply_filters('FHEE__espresso_list_of_event_dates__time_format', $time_format);
475
+		$datetimes = EEH_Event_View::get_all_date_obj($EVT_ID, $show_expired, FALSE, $limit);
476
+		if ( ! $format) {
477
+			return apply_filters('FHEE__espresso_list_of_event_dates__datetimes', $datetimes);
478 478
 		}
479 479
 		//d( $datetimes );
480
-		if ( is_array( $datetimes ) && ! empty( $datetimes )) {
480
+		if (is_array($datetimes) && ! empty($datetimes)) {
481 481
 			global $post;
482
-			$html = $format ? '<ul id="ee-event-datetimes-ul-' . $post->ID . '" class="ee-event-datetimes-ul ee-clearfix">' : '';
483
-			foreach ( $datetimes as $datetime ) {
484
-				if ( $datetime instanceof EE_Datetime ) {
485
-					$html .= '<li id="ee-event-datetimes-li-' . $datetime->ID();
486
-					$html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-' . $datetime->get_active_status() . '">';
482
+			$html = $format ? '<ul id="ee-event-datetimes-ul-'.$post->ID.'" class="ee-event-datetimes-ul ee-clearfix">' : '';
483
+			foreach ($datetimes as $datetime) {
484
+				if ($datetime instanceof EE_Datetime) {
485
+					$html .= '<li id="ee-event-datetimes-li-'.$datetime->ID();
486
+					$html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-'.$datetime->get_active_status().'">';
487 487
 					$datetime_name = $datetime->name();
488
-					$html .= ! empty( $datetime_name ) ? '<strong>' . $datetime_name . '</strong>' : '';
489
-					$html .= ! empty( $datetime_name )  && $add_breaks ? '<br />' : '';
490
-					$html .= '<span class="dashicons dashicons-calendar"></span>' . $datetime->date_range( $date_format ) . '<br/>';
491
-					$html .= '<span class="dashicons dashicons-clock"></span>' . $datetime->time_range( $time_format );
488
+					$html .= ! empty($datetime_name) ? '<strong>'.$datetime_name.'</strong>' : '';
489
+					$html .= ! empty($datetime_name) && $add_breaks ? '<br />' : '';
490
+					$html .= '<span class="dashicons dashicons-calendar"></span>'.$datetime->date_range($date_format).'<br/>';
491
+					$html .= '<span class="dashicons dashicons-clock"></span>'.$datetime->time_range($time_format);
492 492
 					$datetime_description = $datetime->description();
493
-					$html .= ! empty( $datetime_description )  && $add_breaks ? '<br />' : '';
494
-					$html .= ! empty( $datetime_description ) ? ' - ' . $datetime_description : '';
495
-					$html = apply_filters( 'FHEE__espresso_list_of_event_dates__datetime_html', $html, $datetime );
493
+					$html .= ! empty($datetime_description) && $add_breaks ? '<br />' : '';
494
+					$html .= ! empty($datetime_description) ? ' - '.$datetime_description : '';
495
+					$html = apply_filters('FHEE__espresso_list_of_event_dates__datetime_html', $html, $datetime);
496 496
 					$html .= '</li>';
497 497
 				}
498 498
 			}
499 499
 			$html .= $format ? '</ul>' : '';
500 500
 		} else {
501
-			$html = $format ?  '<p><span class="dashicons dashicons-marker pink-text"></span>' . __( 'There are no upcoming dates for this event.', 'event_espresso' ) . '</p><br/>' : '';
501
+			$html = $format ? '<p><span class="dashicons dashicons-marker pink-text"></span>'.__('There are no upcoming dates for this event.', 'event_espresso').'</p><br/>' : '';
502 502
 		}
503
-		if ( $echo ) {
503
+		if ($echo) {
504 504
 			echo $html;
505 505
 			return '';
506 506
 		}
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 }
510 510
 
511 511
 
512
-if ( ! function_exists( 'espresso_event_end_date' )) {
512
+if ( ! function_exists('espresso_event_end_date')) {
513 513
 	/**
514 514
 	 * espresso_event_end_date
515 515
 	 * returns the last date for an event
@@ -520,20 +520,20 @@  discard block
 block discarded – undo
520 520
 	 * @param bool   $echo
521 521
 	 * @return string
522 522
 	 */
523
-	function espresso_event_end_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) {
524
-		$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
525
-		$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
526
-		$date_format = apply_filters( 'FHEE__espresso_event_end_date__date_format', $date_format );
527
-		$time_format = apply_filters( 'FHEE__espresso_event_end_date__time_format', $time_format );
528
-		if($echo){
529
-			echo EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID );
523
+	function espresso_event_end_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) {
524
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
525
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
526
+		$date_format = apply_filters('FHEE__espresso_event_end_date__date_format', $date_format);
527
+		$time_format = apply_filters('FHEE__espresso_event_end_date__time_format', $time_format);
528
+		if ($echo) {
529
+			echo EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID);
530 530
 			return '';
531 531
 		}
532
-		return EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID );
532
+		return EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID);
533 533
 	}
534 534
 }
535 535
 
536
-if ( ! function_exists( 'espresso_event_date_range' )) {
536
+if ( ! function_exists('espresso_event_date_range')) {
537 537
 	/**
538 538
 	 * espresso_event_date_range
539 539
 	 * returns the first and last chronologically ordered dates for an event (if different)
@@ -546,31 +546,31 @@  discard block
 block discarded – undo
546 546
 	 * @param bool   $echo
547 547
 	 * @return string
548 548
 	 */
549
-	function espresso_event_date_range( $date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE ) {
549
+	function espresso_event_date_range($date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE) {
550 550
 		// set and filter date and time formats when a range is returned
551
-		$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
552
-		$date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', $date_format );
551
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
552
+		$date_format = apply_filters('FHEE__espresso_event_date_range__date_format', $date_format);
553 553
 		// get the start and end date with NO time portion
554
-		$the_event_date = EEH_Event_View::the_earliest_event_date( $date_format, '', $EVT_ID );
555
-		$the_event_end_date = EEH_Event_View::the_latest_event_date( $date_format, '', $EVT_ID );
554
+		$the_event_date = EEH_Event_View::the_earliest_event_date($date_format, '', $EVT_ID);
555
+		$the_event_end_date = EEH_Event_View::the_latest_event_date($date_format, '', $EVT_ID);
556 556
 		// now we can determine if date range spans more than one day
557
-		if ( $the_event_date != $the_event_end_date ) {
558
-			$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
559
-			$time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', $time_format );
557
+		if ($the_event_date != $the_event_end_date) {
558
+			$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
559
+			$time_format = apply_filters('FHEE__espresso_event_date_range__time_format', $time_format);
560 560
 			$html = sprintf(
561
-				__( '%1$s - %2$s', 'event_espresso' ),
562
-				EEH_Event_View::the_earliest_event_date( $date_format, $time_format, $EVT_ID ),
563
-				EEH_Event_View::the_latest_event_date( $date_format, $time_format, $EVT_ID )
561
+				__('%1$s - %2$s', 'event_espresso'),
562
+				EEH_Event_View::the_earliest_event_date($date_format, $time_format, $EVT_ID),
563
+				EEH_Event_View::the_latest_event_date($date_format, $time_format, $EVT_ID)
564 564
 			);
565 565
 		} else {
566 566
 			// set and filter date and time formats when only a single datetime is returned
567
-			$single_date_format = ! empty( $single_date_format ) ? $single_date_format : get_option( 'date_format' );
568
-			$single_time_format = ! empty( $single_time_format ) ? $single_time_format : get_option( 'time_format' );
569
-			$single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', $single_date_format );
570
-			$single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', $single_time_format );
571
-			$html = EEH_Event_View::the_earliest_event_date( $single_date_format, $single_time_format, $EVT_ID );
567
+			$single_date_format = ! empty($single_date_format) ? $single_date_format : get_option('date_format');
568
+			$single_time_format = ! empty($single_time_format) ? $single_time_format : get_option('time_format');
569
+			$single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', $single_date_format);
570
+			$single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', $single_time_format);
571
+			$html = EEH_Event_View::the_earliest_event_date($single_date_format, $single_time_format, $EVT_ID);
572 572
 		}
573
-		if ( $echo ) {
573
+		if ($echo) {
574 574
 			echo $html;
575 575
 			return '';
576 576
 		}
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 }
580 580
 
581 581
 
582
-if ( ! function_exists( 'espresso_event_date_as_calendar_page' )) {
582
+if ( ! function_exists('espresso_event_date_as_calendar_page')) {
583 583
 	/**
584 584
 	 * espresso_event_date_as_calendar_page
585 585
 	 * returns the primary date for an event, stylized to appear as the page of a calendar
@@ -587,15 +587,15 @@  discard block
 block discarded – undo
587 587
 	 * @param bool $EVT_ID
588 588
 	 * @return string
589 589
 	 */
590
-	function espresso_event_date_as_calendar_page( $EVT_ID = FALSE ) {
591
-		EEH_Event_View::event_date_as_calendar_page( $EVT_ID );
590
+	function espresso_event_date_as_calendar_page($EVT_ID = FALSE) {
591
+		EEH_Event_View::event_date_as_calendar_page($EVT_ID);
592 592
 	}
593 593
 }
594 594
 
595 595
 
596 596
 
597 597
 
598
-if ( ! function_exists( 'espresso_event_link_url' )) {
598
+if ( ! function_exists('espresso_event_link_url')) {
599 599
 	/**
600 600
 	 * espresso_event_link_url
601 601
 	 *
@@ -603,18 +603,18 @@  discard block
 block discarded – undo
603 603
 	 * @param bool $echo
604 604
 	 * @return string
605 605
 	 */
606
-	function espresso_event_link_url( $EVT_ID = 0, $echo = TRUE ) {
607
-		if ( $echo ) {
608
-			echo EEH_Event_View::event_link_url( $EVT_ID );
606
+	function espresso_event_link_url($EVT_ID = 0, $echo = TRUE) {
607
+		if ($echo) {
608
+			echo EEH_Event_View::event_link_url($EVT_ID);
609 609
 			return '';
610 610
 		}
611
-		return EEH_Event_View::event_link_url( $EVT_ID );
611
+		return EEH_Event_View::event_link_url($EVT_ID);
612 612
 	}
613 613
 }
614 614
 
615 615
 
616 616
 
617
-if ( ! function_exists( 'espresso_event_has_content_or_excerpt' )) {
617
+if ( ! function_exists('espresso_event_has_content_or_excerpt')) {
618 618
 	/**
619 619
 	 *    espresso_event_has_content_or_excerpt
620 620
 	 *
@@ -622,15 +622,15 @@  discard block
 block discarded – undo
622 622
 	 * @param bool $EVT_ID
623 623
 	 * @return    boolean
624 624
 	 */
625
-	function espresso_event_has_content_or_excerpt( $EVT_ID = FALSE ) {
626
-		return EEH_Event_View::event_has_content_or_excerpt( $EVT_ID );
625
+	function espresso_event_has_content_or_excerpt($EVT_ID = FALSE) {
626
+		return EEH_Event_View::event_has_content_or_excerpt($EVT_ID);
627 627
 	}
628 628
 }
629 629
 
630 630
 
631 631
 
632 632
 
633
-if ( ! function_exists( 'espresso_event_content_or_excerpt' )) {
633
+if ( ! function_exists('espresso_event_content_or_excerpt')) {
634 634
 	/**
635 635
 	 * espresso_event_content_or_excerpt
636 636
 	 *
@@ -639,18 +639,18 @@  discard block
 block discarded – undo
639 639
 	 * @param bool $echo
640 640
 	 * @return string
641 641
 	 */
642
-	function espresso_event_content_or_excerpt( $num_words = 55, $more = NULL, $echo = TRUE ) {
643
-		if ( $echo ) {
644
-			echo EEH_Event_View::event_content_or_excerpt( $num_words, $more );
642
+	function espresso_event_content_or_excerpt($num_words = 55, $more = NULL, $echo = TRUE) {
643
+		if ($echo) {
644
+			echo EEH_Event_View::event_content_or_excerpt($num_words, $more);
645 645
 			return '';
646 646
 		}
647
-		return EEH_Event_View::event_content_or_excerpt( $num_words, $more );
647
+		return EEH_Event_View::event_content_or_excerpt($num_words, $more);
648 648
 	}
649 649
 }
650 650
 
651 651
 
652 652
 
653
-if ( ! function_exists( 'espresso_event_phone' )) {
653
+if ( ! function_exists('espresso_event_phone')) {
654 654
 	/**
655 655
 	 * espresso_event_phone
656 656
 	 *
@@ -658,18 +658,18 @@  discard block
 block discarded – undo
658 658
 	 * @param bool $echo
659 659
 	 * @return string
660 660
 	 */
661
-	function espresso_event_phone( $EVT_ID = 0, $echo = TRUE ) {
662
-		if ( $echo ) {
663
-			echo EEH_Event_View::event_phone( $EVT_ID );
661
+	function espresso_event_phone($EVT_ID = 0, $echo = TRUE) {
662
+		if ($echo) {
663
+			echo EEH_Event_View::event_phone($EVT_ID);
664 664
 			return '';
665 665
 		}
666
-		return EEH_Event_View::event_phone( $EVT_ID );
666
+		return EEH_Event_View::event_phone($EVT_ID);
667 667
 	}
668 668
 }
669 669
 
670 670
 
671 671
 
672
-if ( ! function_exists( 'espresso_edit_event_link' )) {
672
+if ( ! function_exists('espresso_edit_event_link')) {
673 673
 	/**
674 674
 	 * espresso_edit_event_link
675 675
 	 * returns a link to edit an event
@@ -678,39 +678,39 @@  discard block
 block discarded – undo
678 678
 	 * @param bool $echo
679 679
 	 * @return string
680 680
 	 */
681
-	function espresso_edit_event_link( $EVT_ID = 0, $echo = TRUE ) {
682
-		if ( $echo ) {
683
-			echo EEH_Event_View::edit_event_link( $EVT_ID );
681
+	function espresso_edit_event_link($EVT_ID = 0, $echo = TRUE) {
682
+		if ($echo) {
683
+			echo EEH_Event_View::edit_event_link($EVT_ID);
684 684
 			return '';
685 685
 		}
686
-		return EEH_Event_View::edit_event_link( $EVT_ID );
686
+		return EEH_Event_View::edit_event_link($EVT_ID);
687 687
 	}
688 688
 }
689 689
 
690 690
 
691
-if ( ! function_exists( 'espresso_organization_name' )) {
691
+if ( ! function_exists('espresso_organization_name')) {
692 692
 	/**
693 693
 	 * espresso_organization_name
694 694
 	 * @param bool $echo
695 695
 	 * @return string
696 696
 	 */
697 697
 	function espresso_organization_name($echo = TRUE) {
698
-		if($echo){
699
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'name' );
698
+		if ($echo) {
699
+			echo EE_Registry::instance()->CFG->organization->get_pretty('name');
700 700
 			return '';
701 701
 		}
702
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'name' );
702
+		return EE_Registry::instance()->CFG->organization->get_pretty('name');
703 703
 	}
704 704
 }
705 705
 
706
-if ( ! function_exists( 'espresso_organization_address' )) {
706
+if ( ! function_exists('espresso_organization_address')) {
707 707
 	/**
708 708
 	 * espresso_organization_address
709 709
 	 * @param string $type
710 710
 	 * @return string
711 711
 	 */
712
-	function espresso_organization_address( $type = 'inline' ) {
713
-		if ( EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ) {
712
+	function espresso_organization_address($type = 'inline') {
713
+		if (EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config) {
714 714
 			$address = new EventEspresso\core\entities\GenericAddress(
715 715
 				EE_Registry::instance()->CFG->organization->address_1,
716 716
 				EE_Registry::instance()->CFG->organization->address_2,
@@ -719,129 +719,129 @@  discard block
 block discarded – undo
719 719
 				EE_Registry::instance()->CFG->organization->zip,
720 720
 				EE_Registry::instance()->CFG->organization->CNT_ISO
721 721
 			);
722
-			return EEH_Address::format( $address, $type );
722
+			return EEH_Address::format($address, $type);
723 723
 		}
724 724
 		return '';
725 725
 	}
726 726
 }
727 727
 
728
-if ( ! function_exists( 'espresso_organization_email' )) {
728
+if ( ! function_exists('espresso_organization_email')) {
729 729
 	/**
730 730
 	 * espresso_organization_email
731 731
 	 * @param bool $echo
732 732
 	 * @return string
733 733
 	 */
734
-	function espresso_organization_email( $echo = TRUE ) {
735
-		if($echo){
736
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'email' );
734
+	function espresso_organization_email($echo = TRUE) {
735
+		if ($echo) {
736
+			echo EE_Registry::instance()->CFG->organization->get_pretty('email');
737 737
 			return '';
738 738
 		}
739
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'email' );
739
+		return EE_Registry::instance()->CFG->organization->get_pretty('email');
740 740
 	}
741 741
 }
742 742
 
743
-if ( ! function_exists( 'espresso_organization_logo_url' )) {
743
+if ( ! function_exists('espresso_organization_logo_url')) {
744 744
 	/**
745 745
 	 * espresso_organization_logo_url
746 746
 	 * @param bool $echo
747 747
 	 * @return string
748 748
 	 */
749
-	function espresso_organization_logo_url( $echo = TRUE ) {
750
-		if($echo){
751
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' );
749
+	function espresso_organization_logo_url($echo = TRUE) {
750
+		if ($echo) {
751
+			echo EE_Registry::instance()->CFG->organization->get_pretty('logo_url');
752 752
 			return '';
753 753
 		}
754
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' );
754
+		return EE_Registry::instance()->CFG->organization->get_pretty('logo_url');
755 755
 	}
756 756
 }
757 757
 
758
-if ( ! function_exists( 'espresso_organization_facebook' )) {
758
+if ( ! function_exists('espresso_organization_facebook')) {
759 759
 	/**
760 760
 	 * espresso_organization_facebook
761 761
 	 * @param bool $echo
762 762
 	 * @return string
763 763
 	 */
764
-	function espresso_organization_facebook( $echo = TRUE ) {
765
-		if($echo){
766
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' );
764
+	function espresso_organization_facebook($echo = TRUE) {
765
+		if ($echo) {
766
+			echo EE_Registry::instance()->CFG->organization->get_pretty('facebook');
767 767
 			return '';
768 768
 		}
769
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' );
769
+		return EE_Registry::instance()->CFG->organization->get_pretty('facebook');
770 770
 	}
771 771
 }
772 772
 
773
-if ( ! function_exists( 'espresso_organization_twitter' )) {
773
+if ( ! function_exists('espresso_organization_twitter')) {
774 774
 	/**
775 775
 	 * espresso_organization_twitter
776 776
 	 * @param bool $echo
777 777
 	 * @return string
778 778
 	 */
779
-	function espresso_organization_twitter( $echo = TRUE ) {
780
-		if($echo){
781
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' );
779
+	function espresso_organization_twitter($echo = TRUE) {
780
+		if ($echo) {
781
+			echo EE_Registry::instance()->CFG->organization->get_pretty('twitter');
782 782
 			return '';
783 783
 		}
784
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' );
784
+		return EE_Registry::instance()->CFG->organization->get_pretty('twitter');
785 785
 	}
786 786
 }
787 787
 
788
-if ( ! function_exists( 'espresso_organization_linkedin' )) {
788
+if ( ! function_exists('espresso_organization_linkedin')) {
789 789
 	/**
790 790
 	 * espresso_organization_linkedin
791 791
 	 * @param bool $echo
792 792
 	 * @return string
793 793
 	 */
794
-	function espresso_organization_linkedin( $echo = TRUE ) {
795
-		if($echo){
796
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' );
794
+	function espresso_organization_linkedin($echo = TRUE) {
795
+		if ($echo) {
796
+			echo EE_Registry::instance()->CFG->organization->get_pretty('linkedin');
797 797
 			return '';
798 798
 		}
799
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' );
799
+		return EE_Registry::instance()->CFG->organization->get_pretty('linkedin');
800 800
 	}
801 801
 }
802 802
 
803
-if ( ! function_exists( 'espresso_organization_pinterest' )) {
803
+if ( ! function_exists('espresso_organization_pinterest')) {
804 804
 	/**
805 805
 	 * espresso_organization_pinterest
806 806
 	 * @param bool $echo
807 807
 	 * @return string
808 808
 	 */
809
-	function espresso_organization_pinterest( $echo = TRUE ) {
810
-		if($echo){
811
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' );
809
+	function espresso_organization_pinterest($echo = TRUE) {
810
+		if ($echo) {
811
+			echo EE_Registry::instance()->CFG->organization->get_pretty('pinterest');
812 812
 			return '';
813 813
 		}
814
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' );
814
+		return EE_Registry::instance()->CFG->organization->get_pretty('pinterest');
815 815
 	}
816 816
 }
817 817
 
818
-if ( ! function_exists( 'espresso_organization_google' )) {
818
+if ( ! function_exists('espresso_organization_google')) {
819 819
 	/**
820 820
 	 * espresso_organization_google
821 821
 	 * @param bool $echo
822 822
 	 * @return string
823 823
 	 */
824
-	function espresso_organization_google( $echo = TRUE ) {
825
-		if($echo){
826
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'google' );
824
+	function espresso_organization_google($echo = TRUE) {
825
+		if ($echo) {
826
+			echo EE_Registry::instance()->CFG->organization->get_pretty('google');
827 827
 			return '';
828 828
 		}
829
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'google' );
829
+		return EE_Registry::instance()->CFG->organization->get_pretty('google');
830 830
 	}
831 831
 }
832 832
 
833
-if ( ! function_exists( 'espresso_organization_instagram' )) {
833
+if ( ! function_exists('espresso_organization_instagram')) {
834 834
 	/**
835 835
 	 * espresso_organization_instagram
836 836
 	 * @param bool $echo
837 837
 	 * @return string
838 838
 	 */
839
-	function espresso_organization_instagram( $echo = TRUE ) {
840
-		if($echo){
841
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' );
839
+	function espresso_organization_instagram($echo = TRUE) {
840
+		if ($echo) {
841
+			echo EE_Registry::instance()->CFG->organization->get_pretty('instagram');
842 842
 			return '';
843 843
 		}
844
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' );
844
+		return EE_Registry::instance()->CFG->organization->get_pretty('instagram');
845 845
 	}
846 846
 }
847 847
 
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 
852 852
 
853 853
 
854
-if ( ! function_exists( 'espresso_event_venues' )) {
854
+if ( ! function_exists('espresso_event_venues')) {
855 855
 	/**
856 856
 	 * espresso_event_venues
857 857
 	 *
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 
866 866
 
867 867
 
868
-if ( ! function_exists( 'espresso_venue_id' )) {
868
+if ( ! function_exists('espresso_venue_id')) {
869 869
 	/**
870 870
 	 *    espresso_venue_name
871 871
 	 *
@@ -873,15 +873,15 @@  discard block
 block discarded – undo
873 873
 	 * @param     int $EVT_ID
874 874
 	 * @return    string
875 875
 	 */
876
-	function espresso_venue_id( $EVT_ID = 0 ) {
877
-		$venue = EEH_Venue_View::get_venue( $EVT_ID );
876
+	function espresso_venue_id($EVT_ID = 0) {
877
+		$venue = EEH_Venue_View::get_venue($EVT_ID);
878 878
 		return $venue instanceof EE_Venue ? $venue->ID() : 0;
879 879
 	}
880 880
 }
881 881
 
882 882
 
883 883
 
884
-if ( ! function_exists( 'espresso_is_venue_private' ) ) {
884
+if ( ! function_exists('espresso_is_venue_private')) {
885 885
 	/**
886 886
 	 * Return whether a venue is private or not.
887 887
 	 * @see EEH_Venue_View::get_venue() for more info on expected return results.
@@ -890,45 +890,45 @@  discard block
 block discarded – undo
890 890
 	 *
891 891
 	 * @return bool | null
892 892
 	 */
893
-	function espresso_is_venue_private( $VNU_ID = 0 ) {
894
-		return EEH_Venue_View::is_venue_private( $VNU_ID );
893
+	function espresso_is_venue_private($VNU_ID = 0) {
894
+		return EEH_Venue_View::is_venue_private($VNU_ID);
895 895
 	}
896 896
 }
897 897
 
898 898
 
899 899
 
900
-if ( ! function_exists( 'espresso_venue_is_password_protected' ) ) {
900
+if ( ! function_exists('espresso_venue_is_password_protected')) {
901 901
 	/**
902 902
 	 * returns true or false if a venue is password protected or not
903 903
 	 *
904 904
 	 * @param int     $VNU_ID optional, the venue id to check.
905 905
 	 * @return string
906 906
 	 */
907
-	function espresso_venue_is_password_protected( $VNU_ID = 0 ) {
908
-		EE_Registry::instance()->load_helper( 'Venue_View' );
909
-		return EEH_Venue_View::is_venue_password_protected( $VNU_ID );
907
+	function espresso_venue_is_password_protected($VNU_ID = 0) {
908
+		EE_Registry::instance()->load_helper('Venue_View');
909
+		return EEH_Venue_View::is_venue_password_protected($VNU_ID);
910 910
 	}
911 911
 }
912 912
 
913 913
 
914 914
 
915
-if ( ! function_exists( 'espresso_password_protected_venue_form' ) ) {
915
+if ( ! function_exists('espresso_password_protected_venue_form')) {
916 916
 	/**
917 917
 	 * Returns a password form if venue is password protected.
918 918
 	 *
919 919
 	 * @param int     $VNU_ID optional, the venue id to check.
920 920
 	 * @return string
921 921
 	 */
922
-	function espresso_password_protected_venue_form( $VNU_ID = 0 ) {
923
-		EE_Registry::instance()->load_helper( 'Venue_View' );
924
-		return EEH_Venue_View::password_protected_venue_form( $VNU_ID );
922
+	function espresso_password_protected_venue_form($VNU_ID = 0) {
923
+		EE_Registry::instance()->load_helper('Venue_View');
924
+		return EEH_Venue_View::password_protected_venue_form($VNU_ID);
925 925
 	}
926 926
 }
927 927
 
928 928
 
929 929
 
930 930
 
931
-if ( ! function_exists( 'espresso_venue_name' )) {
931
+if ( ! function_exists('espresso_venue_name')) {
932 932
 	/**
933 933
 	 *    espresso_venue_name
934 934
 	 *
@@ -938,19 +938,19 @@  discard block
 block discarded – undo
938 938
 	 * @param bool   $echo
939 939
 	 * @return    string
940 940
 	 */
941
-	function espresso_venue_name( $VNU_ID = 0, $link_to = 'details', $echo = TRUE ) {
942
-		if($echo){
943
-			echo EEH_Venue_View::venue_name( $link_to, $VNU_ID );
941
+	function espresso_venue_name($VNU_ID = 0, $link_to = 'details', $echo = TRUE) {
942
+		if ($echo) {
943
+			echo EEH_Venue_View::venue_name($link_to, $VNU_ID);
944 944
 			return '';
945 945
 		}
946
-		return EEH_Venue_View::venue_name( $link_to, $VNU_ID );
946
+		return EEH_Venue_View::venue_name($link_to, $VNU_ID);
947 947
 	}
948 948
 }
949 949
 
950 950
 
951 951
 
952 952
 
953
-if ( ! function_exists( 'espresso_venue_link' )) {
953
+if ( ! function_exists('espresso_venue_link')) {
954 954
 	/**
955 955
 	 * 	espresso_venue_link
956 956
 	 *
@@ -959,14 +959,14 @@  discard block
 block discarded – undo
959 959
 	 *  @param 	string 	$text
960 960
 	 *  @return 	string
961 961
 	 */
962
-	function espresso_venue_link( $VNU_ID = 0, $text = '' ) {
963
-		return EEH_Venue_View::venue_details_link( $VNU_ID, $text );
962
+	function espresso_venue_link($VNU_ID = 0, $text = '') {
963
+		return EEH_Venue_View::venue_details_link($VNU_ID, $text);
964 964
 	}
965 965
 }
966 966
 
967 967
 
968 968
 
969
-if ( ! function_exists( 'espresso_venue_description' )) {
969
+if ( ! function_exists('espresso_venue_description')) {
970 970
 	/**
971 971
 	 *    espresso_venue_description
972 972
 	 *
@@ -975,17 +975,17 @@  discard block
 block discarded – undo
975 975
 	 * @param bool $echo
976 976
 	 * @return    string
977 977
 	 */
978
-	function espresso_venue_description( $VNU_ID = FALSE, $echo = TRUE ) {
979
-		if($echo){
980
-			echo EEH_Venue_View::venue_description( $VNU_ID );
978
+	function espresso_venue_description($VNU_ID = FALSE, $echo = TRUE) {
979
+		if ($echo) {
980
+			echo EEH_Venue_View::venue_description($VNU_ID);
981 981
 			return '';
982 982
 		}
983
-		return EEH_Venue_View::venue_description( $VNU_ID );
983
+		return EEH_Venue_View::venue_description($VNU_ID);
984 984
 	}
985 985
 }
986 986
 
987 987
 
988
-if ( ! function_exists( 'espresso_venue_excerpt' )) {
988
+if ( ! function_exists('espresso_venue_excerpt')) {
989 989
 	/**
990 990
 	 *    espresso_venue_excerpt
991 991
 	 *
@@ -994,18 +994,18 @@  discard block
 block discarded – undo
994 994
 	 * @param bool $echo
995 995
 	 * @return    string
996 996
 	 */
997
-	function espresso_venue_excerpt( $VNU_ID = 0,  $echo = TRUE ) {
998
-		if ( $echo ) {
999
-			echo EEH_Venue_View::venue_excerpt( $VNU_ID );
997
+	function espresso_venue_excerpt($VNU_ID = 0, $echo = TRUE) {
998
+		if ($echo) {
999
+			echo EEH_Venue_View::venue_excerpt($VNU_ID);
1000 1000
 			return '';
1001 1001
 		}
1002
-		return EEH_Venue_View::venue_excerpt( $VNU_ID );
1002
+		return EEH_Venue_View::venue_excerpt($VNU_ID);
1003 1003
 	}
1004 1004
 }
1005 1005
 
1006 1006
 
1007 1007
 
1008
-if ( ! function_exists( 'espresso_venue_categories' )) {
1008
+if ( ! function_exists('espresso_venue_categories')) {
1009 1009
 	/**
1010 1010
 	 * espresso_venue_categories
1011 1011
 	 * returns the terms associated with a venue
@@ -1015,17 +1015,17 @@  discard block
 block discarded – undo
1015 1015
 	 * @param bool $echo
1016 1016
 	 * @return string
1017 1017
 	 */
1018
-	function espresso_venue_categories( $VNU_ID = 0, $hide_uncategorized = TRUE,  $echo = TRUE ) {
1019
-		if ( $echo ) {
1020
-			echo EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized );
1018
+	function espresso_venue_categories($VNU_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) {
1019
+		if ($echo) {
1020
+			echo EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized);
1021 1021
 			return '';
1022 1022
 		}
1023
-		return EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized );
1023
+		return EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized);
1024 1024
 	}
1025 1025
 }
1026 1026
 
1027 1027
 
1028
-if ( ! function_exists( 'espresso_venue_address' )) {
1028
+if ( ! function_exists('espresso_venue_address')) {
1029 1029
 	/**
1030 1030
 	 * espresso_venue_address
1031 1031
 	 * returns a formatted block of html  for displaying a venue's address
@@ -1035,17 +1035,17 @@  discard block
 block discarded – undo
1035 1035
 	 * @param bool   $echo
1036 1036
 	 * @return string
1037 1037
 	 */
1038
-	function espresso_venue_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) {
1039
-		if ( $echo ) {
1040
-			echo EEH_Venue_View::venue_address( $type, $VNU_ID );
1038
+	function espresso_venue_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) {
1039
+		if ($echo) {
1040
+			echo EEH_Venue_View::venue_address($type, $VNU_ID);
1041 1041
 			return '';
1042 1042
 		}
1043
-		return EEH_Venue_View::venue_address( $type, $VNU_ID );
1043
+		return EEH_Venue_View::venue_address($type, $VNU_ID);
1044 1044
 	}
1045 1045
 }
1046 1046
 
1047 1047
 
1048
-if ( ! function_exists( 'espresso_venue_raw_address' )) {
1048
+if ( ! function_exists('espresso_venue_raw_address')) {
1049 1049
 	/**
1050 1050
 	 * espresso_venue_address
1051 1051
 	 * returns an UN-formatted string containing a venue's address
@@ -1055,17 +1055,17 @@  discard block
 block discarded – undo
1055 1055
 	 * @param bool     $echo
1056 1056
 	 * @return string
1057 1057
 	 */
1058
-	function espresso_venue_raw_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) {
1059
-		if ( $echo ) {
1060
-			echo EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE );
1058
+	function espresso_venue_raw_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) {
1059
+		if ($echo) {
1060
+			echo EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE);
1061 1061
 			return '';
1062 1062
 		}
1063
-		return EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE );
1063
+		return EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE);
1064 1064
 	}
1065 1065
 }
1066 1066
 
1067 1067
 
1068
-if ( ! function_exists( 'espresso_venue_has_address' )) {
1068
+if ( ! function_exists('espresso_venue_has_address')) {
1069 1069
 	/**
1070 1070
 	 * espresso_venue_has_address
1071 1071
 	 * returns TRUE or FALSE if a Venue has address information
@@ -1073,13 +1073,13 @@  discard block
 block discarded – undo
1073 1073
 	 * @param int $VNU_ID
1074 1074
 	 * @return bool
1075 1075
 	 */
1076
-	function espresso_venue_has_address( $VNU_ID = 0 ) {
1077
-		return EEH_Venue_View::venue_has_address( $VNU_ID );
1076
+	function espresso_venue_has_address($VNU_ID = 0) {
1077
+		return EEH_Venue_View::venue_has_address($VNU_ID);
1078 1078
 	}
1079 1079
 }
1080 1080
 
1081 1081
 
1082
-if ( ! function_exists( 'espresso_venue_gmap' )) {
1082
+if ( ! function_exists('espresso_venue_gmap')) {
1083 1083
 	/**
1084 1084
 	 * espresso_venue_gmap
1085 1085
 	 * returns a google map for the venue address
@@ -1090,17 +1090,17 @@  discard block
 block discarded – undo
1090 1090
 	 * @param bool     $echo
1091 1091
 	 * @return string
1092 1092
 	 */
1093
-	function espresso_venue_gmap( $VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE  ) {
1094
-		if ( $echo ) {
1095
-			echo EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap );
1093
+	function espresso_venue_gmap($VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE) {
1094
+		if ($echo) {
1095
+			echo EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap);
1096 1096
 			return '';
1097 1097
 		}
1098
-		return EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap );
1098
+		return EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap);
1099 1099
 	}
1100 1100
 }
1101 1101
 
1102 1102
 
1103
-if ( ! function_exists( 'espresso_venue_phone' )) {
1103
+if ( ! function_exists('espresso_venue_phone')) {
1104 1104
 	/**
1105 1105
 	 * espresso_venue_phone
1106 1106
 	 *
@@ -1108,18 +1108,18 @@  discard block
 block discarded – undo
1108 1108
 	 * @param bool $echo
1109 1109
 	 * @return string
1110 1110
 	 */
1111
-	function espresso_venue_phone( $VNU_ID = 0, $echo = TRUE ) {
1112
-		if ( $echo ) {
1113
-			echo EEH_Venue_View::venue_phone( $VNU_ID );
1111
+	function espresso_venue_phone($VNU_ID = 0, $echo = TRUE) {
1112
+		if ($echo) {
1113
+			echo EEH_Venue_View::venue_phone($VNU_ID);
1114 1114
 			return '';
1115 1115
 		}
1116
-		return EEH_Venue_View::venue_phone( $VNU_ID );
1116
+		return EEH_Venue_View::venue_phone($VNU_ID);
1117 1117
 	}
1118 1118
 }
1119 1119
 
1120 1120
 
1121 1121
 
1122
-if ( ! function_exists( 'espresso_venue_website' )) {
1122
+if ( ! function_exists('espresso_venue_website')) {
1123 1123
 	/**
1124 1124
 	 * espresso_venue_website
1125 1125
 	 *
@@ -1127,18 +1127,18 @@  discard block
 block discarded – undo
1127 1127
 	 * @param bool $echo
1128 1128
 	 * @return string
1129 1129
 	 */
1130
-	function espresso_venue_website( $VNU_ID = 0, $echo = TRUE ) {
1131
-		if ( $echo ) {
1132
-			echo EEH_Venue_View::venue_website_link( $VNU_ID );
1130
+	function espresso_venue_website($VNU_ID = 0, $echo = TRUE) {
1131
+		if ($echo) {
1132
+			echo EEH_Venue_View::venue_website_link($VNU_ID);
1133 1133
 			return '';
1134 1134
 		}
1135
-		return EEH_Venue_View::venue_website_link( $VNU_ID );
1135
+		return EEH_Venue_View::venue_website_link($VNU_ID);
1136 1136
 	}
1137 1137
 }
1138 1138
 
1139 1139
 
1140 1140
 
1141
-if ( ! function_exists( 'espresso_edit_venue_link' )) {
1141
+if ( ! function_exists('espresso_edit_venue_link')) {
1142 1142
 	/**
1143 1143
 	 * espresso_edit_venue_link
1144 1144
 	 *
@@ -1146,12 +1146,12 @@  discard block
 block discarded – undo
1146 1146
 	 * @param bool $echo
1147 1147
 	 * @return string
1148 1148
 	 */
1149
-	function espresso_edit_venue_link( $VNU_ID = 0, $echo = TRUE ) {
1150
-		if($echo){
1151
-			echo EEH_Venue_View::edit_venue_link( $VNU_ID );
1149
+	function espresso_edit_venue_link($VNU_ID = 0, $echo = TRUE) {
1150
+		if ($echo) {
1151
+			echo EEH_Venue_View::edit_venue_link($VNU_ID);
1152 1152
 			return '';
1153 1153
 		}
1154
-		return EEH_Venue_View::edit_venue_link( $VNU_ID );
1154
+		return EEH_Venue_View::edit_venue_link($VNU_ID);
1155 1155
 	}
1156 1156
 }
1157 1157
 
Please login to merge, or discard this patch.
public/Espresso_Arabica_2014/content-espresso_events-venues.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,64 +1,64 @@
 block discarded – undo
1 1
 <?php
2 2
 //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' &nbsp; <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>';
3 3
 if (
4
-	( is_single() && espresso_display_venue_in_event_details() )
5
-	|| ( is_archive() && espresso_display_venue_in_event_list() )
4
+	(is_single() && espresso_display_venue_in_event_details())
5
+	|| (is_archive() && espresso_display_venue_in_event_list())
6 6
 ) :
7 7
 	global $post;
8
-	do_action( 'AHEE_event_details_before_venue_details', $post );
9
-	$venue_name = espresso_venue_name( 0, 'details', FALSE );
10
-	if ( empty( $venue_name ) && espresso_is_venue_private() ) {
11
-		do_action( 'AHEE_event_details_after_venue_details', $post );
8
+	do_action('AHEE_event_details_before_venue_details', $post);
9
+	$venue_name = espresso_venue_name(0, 'details', FALSE);
10
+	if (empty($venue_name) && espresso_is_venue_private()) {
11
+		do_action('AHEE_event_details_after_venue_details', $post);
12 12
 		return '';
13 13
 	}
14 14
 ?>
15 15
 
16 16
 <div class="espresso-venue-dv<?php echo espresso_is_venue_private() ? ' espresso-private-venue-dv' : ''; ?>">
17 17
 	<h3 class="event-venues-h3 ee-event-h3">
18
-		<?php _e( 'Location', 'event_espresso' ); ?>
18
+		<?php _e('Location', 'event_espresso'); ?>
19 19
 	</h3>
20
-	<h4><strong><?php _e( 'Venue:', 'event_espresso' ); ?></strong>&nbsp;&nbsp; <strong> <?php echo $venue_name; ?></strong></h4>
20
+	<h4><strong><?php _e('Venue:', 'event_espresso'); ?></strong>&nbsp;&nbsp; <strong> <?php echo $venue_name; ?></strong></h4>
21 21
 	<p><span class="smaller-text tags-links"><?php echo espresso_venue_categories(); ?></span></p>
22
-<?php  if ( $venue_phone = espresso_venue_phone( $post->ID, FALSE )) : ?>
22
+<?php  if ($venue_phone = espresso_venue_phone($post->ID, FALSE)) : ?>
23 23
 	<p>
24
-		<span class="small-text"><strong><?php _e( 'Venue Phone:', 'event_espresso' ); ?></strong></span> <?php echo $venue_phone; ?>
24
+		<span class="small-text"><strong><?php _e('Venue Phone:', 'event_espresso'); ?></strong></span> <?php echo $venue_phone; ?>
25 25
 	</p>
26
-<?php endif;  ?>
27
-<?php  if ( espresso_venue_has_address( $post->ID )) : ?>
28
-	<strong><span class="dashicons dashicons-location-alt"></span><?php _e( 'Address:', 'event_espresso' ); ?></strong>
29
-	<?php espresso_venue_address( 'inline' ); ?>
30
-	<?php espresso_venue_gmap( $post->ID ); ?>
26
+<?php endif; ?>
27
+<?php  if (espresso_venue_has_address($post->ID)) : ?>
28
+	<strong><span class="dashicons dashicons-location-alt"></span><?php _e('Address:', 'event_espresso'); ?></strong>
29
+	<?php espresso_venue_address('inline'); ?>
30
+	<?php espresso_venue_gmap($post->ID); ?>
31 31
 	<div class="clear"><br/></div>
32
-<?php endif;  ?>
32
+<?php endif; ?>
33 33
 
34
-	<?php $VNU_ID = espresso_venue_id( $post->ID ); ?>
35
-	<?php if ( is_single() ) : ?>
36
-		<?php $venue_description = espresso_venue_description( $VNU_ID, FALSE ); ?>
37
-		<?php if ( $venue_description ) : ?>
34
+	<?php $VNU_ID = espresso_venue_id($post->ID); ?>
35
+	<?php if (is_single()) : ?>
36
+		<?php $venue_description = espresso_venue_description($VNU_ID, FALSE); ?>
37
+		<?php if ($venue_description) : ?>
38 38
 	<p>
39
-		<strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/>
40
-		<?php echo do_shortcode( $venue_description ); ?>
39
+		<strong><?php _e('Description:', 'event_espresso'); ?></strong><br/>
40
+		<?php echo do_shortcode($venue_description); ?>
41 41
 	</p>
42
-		<?php endif;  ?>
42
+		<?php endif; ?>
43 43
 	<?php else : ?>
44
-		<?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?>
45
-		<?php if ( $venue_excerpt ) : ?>
44
+		<?php $venue_excerpt = espresso_venue_excerpt($VNU_ID, FALSE); ?>
45
+		<?php if ($venue_excerpt) : ?>
46 46
 	<p>
47
-		<strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/>
47
+		<strong><?php _e('Description:', 'event_espresso'); ?></strong><br/>
48 48
 		<?php echo $venue_excerpt; ?>
49 49
 	</p>
50
-			<?php endif;  ?>
51
-		<?php endif;  ?>
50
+			<?php endif; ?>
51
+		<?php endif; ?>
52 52
 </div>
53 53
 <!-- .espresso-venue-dv -->
54 54
 <?php
55
-do_action( 'AHEE_event_details_after_venue_details', $post );
55
+do_action('AHEE_event_details_after_venue_details', $post);
56 56
 else :
57
-	if ( espresso_venue_is_password_protected() ) :
57
+	if (espresso_venue_is_password_protected()) :
58 58
 ?>
59 59
 	<div class="espresso-venue-dv  espresso-password-protected-venue-dv" >
60 60
 		<h3 class="event-venues-h3 ee-event-h3">
61
-			<?php _e( 'Location', 'event_espresso' );?>
61
+			<?php _e('Location', 'event_espresso'); ?>
62 62
 		</h3>
63 63
 		<?php echo espresso_password_protected_venue_form(); ?>
64 64
 	</div>
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,8 +40,11 @@  discard block
 block discarded – undo
40 40
 		<?php echo do_shortcode( $venue_description ); ?>
41 41
 	</p>
42 42
 		<?php endif;  ?>
43
-	<?php else : ?>
44
-		<?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?>
43
+	<?php else {
44
+	: ?>
45
+		<?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE );
46
+}
47
+?>
45 48
 		<?php if ( $venue_excerpt ) : ?>
46 49
 	<p>
47 50
 		<strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/>
@@ -53,12 +56,15 @@  discard block
 block discarded – undo
53 56
 <!-- .espresso-venue-dv -->
54 57
 <?php
55 58
 do_action( 'AHEE_event_details_after_venue_details', $post );
56
-else :
59
+else {
60
+	:
57 61
 	if ( espresso_venue_is_password_protected() ) :
58 62
 ?>
59 63
 	<div class="espresso-venue-dv  espresso-password-protected-venue-dv" >
60 64
 		<h3 class="event-venues-h3 ee-event-h3">
61
-			<?php _e( 'Location', 'event_espresso' );?>
65
+			<?php _e( 'Location', 'event_espresso' );
66
+}
67
+?>
62 68
 		</h3>
63 69
 		<?php echo espresso_password_protected_venue_form(); ?>
64 70
 	</div>
Please login to merge, or discard this patch.
core/helpers/EEH_Venue_View.helper.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -799,7 +799,6 @@
 block discarded – undo
799 799
 
800 800
 
801 801
 	/**
802
-
803 802
 	 *
804 803
 	 * 	 If the the first date starts at midnight on one day, and the next date ends at midnight on the
805 804
 	 * 	 very next day then this method will return true.
Please login to merge, or discard this patch.
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -45,16 +45,16 @@  discard block
 block discarded – undo
45 45
 	 * @param bool $password_check
46 46
 	 * @return \EE_Venue|null
47 47
 	 */
48
-	public static function get_venue( $VNU_ID = 0, $look_in_event = TRUE, $privacy_check = true, $password_check = true ) {
49
-		$VNU_ID = absint( $VNU_ID );
48
+	public static function get_venue($VNU_ID = 0, $look_in_event = TRUE, $privacy_check = true, $password_check = true) {
49
+		$VNU_ID = absint($VNU_ID);
50 50
 		// do we already have the Venue you are looking for?
51
-		if ( EEH_Venue_View::$_venue instanceof EE_Venue && EEH_Venue_View::$_venue->ID() == $VNU_ID ) {
52
-			return EEH_Venue_View::_get_venue( $privacy_check );
51
+		if (EEH_Venue_View::$_venue instanceof EE_Venue && EEH_Venue_View::$_venue->ID() == $VNU_ID) {
52
+			return EEH_Venue_View::_get_venue($privacy_check);
53 53
 		}
54 54
 		// international newspaper?
55 55
 		global $post;
56
-		if ( $post instanceof WP_Post ) {
57
-			switch ( $post->post_type ) {
56
+		if ($post instanceof WP_Post) {
57
+			switch ($post->post_type) {
58 58
 				// if this is being called from an EE_Venue post,
59 59
 				// and the EE_Venue post corresponds to the EE_Venue that is being asked for,
60 60
 				// then we can try to just grab the attached EE_Venue object
@@ -62,31 +62,31 @@  discard block
 block discarded – undo
62 62
 					// the post already contains the related EE_Venue object AND one of the following is TRUE:
63 63
 					// the requested Venue ID matches the post ID OR...
64 64
 					// there was no specific Venue ID requested
65
-					if ( isset( $post->EE_Venue ) && ( $VNU_ID == $post->ID || ! $VNU_ID )) {
65
+					if (isset($post->EE_Venue) && ($VNU_ID == $post->ID || ! $VNU_ID)) {
66 66
 						// use existing related EE_Venue object
67
-						EEH_Venue_View::$_venue =  $post->EE_Venue;
68
-					} else if ( $VNU_ID ) {
67
+						EEH_Venue_View::$_venue = $post->EE_Venue;
68
+					} else if ($VNU_ID) {
69 69
 						// there WAS a specific Venue ID requested, but it's NOT the current post object
70
-						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID( $VNU_ID );
70
+						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID($VNU_ID);
71 71
 					} else {
72 72
 						// no specific Venue ID requested, so use post ID to generate EE_Venue object
73
-						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID( $post->ID );
73
+						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID($post->ID);
74 74
 					}
75 75
 				break;
76 76
 
77 77
 				case 'espresso_events':
78
-					if ( $look_in_event ) {
78
+					if ($look_in_event) {
79 79
 						// grab the events related venues
80 80
 						$venues = EEH_Venue_View::get_event_venues();
81 81
 						// make sure the result is an array
82
-						$venues = is_array( $venues ) ? $venues : array();
82
+						$venues = is_array($venues) ? $venues : array();
83 83
 						// do we have an ID for a specific venue?
84
-						if ( $VNU_ID ) {
84
+						if ($VNU_ID) {
85 85
 							// loop thru the related venues
86
-							foreach( $venues as $venue ) {
87
-								if ( $venue instanceof EE_Venue ) {
86
+							foreach ($venues as $venue) {
87
+								if ($venue instanceof EE_Venue) {
88 88
 									// until we find the venue we're looking for
89
-									if ( $venue->ID() == $VNU_ID ) {
89
+									if ($venue->ID() == $VNU_ID) {
90 90
 										EEH_Venue_View::$_venue = $venue;
91 91
 										break;
92 92
 									}
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 							// then the global post is an events post and this function was called with no argument
99 99
 						} else {
100 100
 							// just grab the first related event venue
101
-							EEH_Venue_View::$_venue = reset( $venues );
101
+							EEH_Venue_View::$_venue = reset($venues);
102 102
 						}
103 103
 					}
104 104
 				break;
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 			}
107 107
 		}
108 108
 		// now if we STILL do NOT have an EE_Venue model object, BUT we have a Venue ID...
109
-		if ( ! EEH_Venue_View::$_venue instanceof EE_Venue && $VNU_ID ) {
109
+		if ( ! EEH_Venue_View::$_venue instanceof EE_Venue && $VNU_ID) {
110 110
 			// sigh... pull it from the db
111
-			EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID( $VNU_ID );
111
+			EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID($VNU_ID);
112 112
 		}
113
-		return EEH_Venue_View::_get_venue( $privacy_check, $password_check );
113
+		return EEH_Venue_View::_get_venue($privacy_check, $password_check);
114 114
 	}
115 115
 
116 116
 
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
 	 * @param bool $password_check
124 124
 	 * @return 	EE_Venue
125 125
 	 */
126
-	protected static function _get_venue( $privacy_check = true, $password_check = true ) {
126
+	protected static function _get_venue($privacy_check = true, $password_check = true) {
127 127
 		// check for private venues.
128 128
 		if (
129 129
 			EEH_Venue_View::$_venue instanceof EE_Venue
130 130
 			&& EEH_Venue_View::$_venue->status() == 'private'
131 131
 			&& $privacy_check
132
-			&& ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_venues', 'get_venues' )
132
+			&& ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_venues', 'get_venues')
133 133
 		) {
134 134
 			return null;
135 135
 		}
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		if (
138 138
 			EEH_Venue_View::$_venue instanceof EE_Venue
139 139
 			&& $password_check
140
-			&& post_password_required( EEH_Venue_View::$_venue->ID() )
140
+			&& post_password_required(EEH_Venue_View::$_venue->ID())
141 141
 		) {
142 142
 			return null;
143 143
 		}
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	public static function get_event_venues() {
156 156
 		global $post;
157
-		if ( $post->post_type == 'espresso_events' ) {
158
-			if ( isset( $post->EE_Event ) && $post->EE_Event instanceof EE_Event ) {
157
+		if ($post->post_type == 'espresso_events') {
158
+			if (isset($post->EE_Event) && $post->EE_Event instanceof EE_Event) {
159 159
 				return $post->EE_Event->venues();
160 160
 			}
161 161
 		}
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
 	 *
176 176
 	 * @return bool|null
177 177
 	 */
178
-	public static function is_venue_private( $VNU_ID = false ) {
179
-		$venue = EEH_Venue_View::get_venue( $VNU_ID, true, true );
180
-		if ( ! $venue instanceof EE_Venue ) {
178
+	public static function is_venue_private($VNU_ID = false) {
179
+		$venue = EEH_Venue_View::get_venue($VNU_ID, true, true);
180
+		if ( ! $venue instanceof EE_Venue) {
181 181
 			return null;
182 182
 		}
183 183
 
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
 	 * @param bool $VNU_ID venue to check (optional). If not included will use internally derived venue object.
193 193
 	 * @return bool
194 194
 	 */
195
-	public static function is_venue_password_protected( $VNU_ID = false ) {
196
-		$venue = EEH_Venue_View::get_venue( $VNU_ID, true, true, false );
195
+	public static function is_venue_password_protected($VNU_ID = false) {
196
+		$venue = EEH_Venue_View::get_venue($VNU_ID, true, true, false);
197 197
 		if (
198 198
 			$venue instanceof EE_Venue
199
-			&& post_password_required( $venue->ID() )
199
+			&& post_password_required($venue->ID())
200 200
 		) {
201 201
 			return true;
202 202
 		}
@@ -213,13 +213,13 @@  discard block
 block discarded – undo
213 213
 	 *
214 214
 	 * @return string
215 215
 	 */
216
-	public static function password_protected_venue_form( $VNU_ID = false ) {
217
-		$venue = EEH_Venue_View::get_venue( $VNU_ID, true, true, false );
216
+	public static function password_protected_venue_form($VNU_ID = false) {
217
+		$venue = EEH_Venue_View::get_venue($VNU_ID, true, true, false);
218 218
 		if (
219 219
 			$venue instanceof EE_Venue
220
-			&& post_password_required( $venue->ID() )
220
+			&& post_password_required($venue->ID())
221 221
 		) {
222
-			return get_the_password_form( $venue->ID() );
222
+			return get_the_password_form($venue->ID());
223 223
 		}
224 224
 		return '';
225 225
 	}
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
 	 * @param int $VNU_ID
234 234
 	 * @return string
235 235
 	 */
236
-	public static function venue_description( $VNU_ID = 0 ) {
237
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
238
-		if ( $venue instanceof EE_Venue ) {
236
+	public static function venue_description($VNU_ID = 0) {
237
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
238
+		if ($venue instanceof EE_Venue) {
239 239
 			return$venue->description();
240 240
 		}
241 241
 		return '';
@@ -250,12 +250,12 @@  discard block
 block discarded – undo
250 250
 	 * @param int $VNU_ID
251 251
 	 * @return string
252 252
 	 */
253
-	public static function venue_excerpt( $VNU_ID = 0 ) {
254
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
255
-		if ( $venue instanceof EE_Venue ) {
253
+	public static function venue_excerpt($VNU_ID = 0) {
254
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
255
+		if ($venue instanceof EE_Venue) {
256 256
 			$excerpt = $venue->excerpt() != NULL && $venue->excerpt() ? $venue->excerpt() : $venue->description();
257
-			$venue_link = ' ' . EEH_Venue_View::venue_details_link( $venue->ID(), __( 'more', 'event_espresso' ) . '&hellip;' );
258
-			return ! empty( $excerpt ) ? wp_trim_words( $excerpt, 25, '' ) . $venue_link : '';
257
+			$venue_link = ' '.EEH_Venue_View::venue_details_link($venue->ID(), __('more', 'event_espresso').'&hellip;');
258
+			return ! empty($excerpt) ? wp_trim_words($excerpt, 25, '').$venue_link : '';
259 259
 		}
260 260
 		return '';
261 261
 	}
@@ -270,22 +270,22 @@  discard block
 block discarded – undo
270 270
 	 * @param bool $hide_uncategorized
271 271
 	 * @return string
272 272
 	 */
273
-	public static function venue_categories( $VNU_ID = 0, $hide_uncategorized = TRUE ) {
273
+	public static function venue_categories($VNU_ID = 0, $hide_uncategorized = TRUE) {
274 274
 		$category_links = array();
275
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
276
-		if ( $venue instanceof EE_Venue ) {
275
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
276
+		if ($venue instanceof EE_Venue) {
277 277
 			// get category terms
278
-			if ( $venue_categories = get_the_terms( $venue->ID(), 'espresso_venue_categories' )) {
278
+			if ($venue_categories = get_the_terms($venue->ID(), 'espresso_venue_categories')) {
279 279
 				// loop thru terms and create links
280
-				foreach ( $venue_categories as $term ) {
281
-					$url = get_term_link( $term, 'espresso_venue_categories' );
282
-					if ( ! is_wp_error( $url ) && (( $hide_uncategorized && strtolower( $term->name ) != __( 'uncategorized', 'event_espresso' )) || ! $hide_uncategorized )) {
283
-						$category_links[] = '<a href="' . esc_url( $url ) . '" rel="tag">' . $term->name . '</a> ';
280
+				foreach ($venue_categories as $term) {
281
+					$url = get_term_link($term, 'espresso_venue_categories');
282
+					if ( ! is_wp_error($url) && (($hide_uncategorized && strtolower($term->name) != __('uncategorized', 'event_espresso')) || ! $hide_uncategorized)) {
283
+						$category_links[] = '<a href="'.esc_url($url).'" rel="tag">'.$term->name.'</a> ';
284 284
 					}
285 285
 				}
286 286
 			}
287 287
 		}
288
-		return implode( ', ', $category_links );
288
+		return implode(', ', $category_links);
289 289
 	}
290 290
 
291 291
 
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
 	 * @param bool $add_wrapper
301 301
 	 * @return string
302 302
 	 */
303
-	public static function venue_address( $type = 'multiline', $VNU_ID = 0, $use_schema = true, $add_wrapper = true ) {
304
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
305
-		if ( $venue instanceof EE_Venue ) {
306
-			return EEH_Address::format( $venue, $type, $use_schema, $add_wrapper );
303
+	public static function venue_address($type = 'multiline', $VNU_ID = 0, $use_schema = true, $add_wrapper = true) {
304
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
305
+		if ($venue instanceof EE_Venue) {
306
+			return EEH_Address::format($venue, $type, $use_schema, $add_wrapper);
307 307
 		}
308 308
 		return '';
309 309
 	}
@@ -317,10 +317,10 @@  discard block
 block discarded – undo
317 317
 	 * @param int $VNU_ID
318 318
 	 * @return bool|string
319 319
 	 */
320
-	public static function venue_has_address( $VNU_ID = 0 ) {
321
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
322
-		if ( $venue instanceof EE_Venue ) {
323
-			return EEH_Address::format( $venue, 'inline', FALSE, FALSE );
320
+	public static function venue_has_address($VNU_ID = 0) {
321
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
322
+		if ($venue instanceof EE_Venue) {
323
+			return EEH_Address::format($venue, 'inline', FALSE, FALSE);
324 324
 		}
325 325
 		return false;
326 326
 	}
@@ -335,30 +335,30 @@  discard block
 block discarded – undo
335 335
 	 * @param int $VNU_ID
336 336
 	 * @return string
337 337
 	 */
338
-	public static function venue_name( $link_to = 'details', $VNU_ID = 0 ) {
339
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
340
-		if ( $venue instanceof EE_Venue ) {
338
+	public static function venue_name($link_to = 'details', $VNU_ID = 0) {
339
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
340
+		if ($venue instanceof EE_Venue) {
341 341
 			$venue_name = apply_filters(
342 342
 				'FHEE__EEH_Venue__venue_name__append_private_venue_name',
343 343
 				EEH_Venue_View::is_venue_private()
344
-					? EEH_Venue_View::$_venue->name() . "&nbsp;" . __( '(Private)', 'event_espresso' )
344
+					? EEH_Venue_View::$_venue->name()."&nbsp;".__('(Private)', 'event_espresso')
345 345
 					: EEH_Venue_View::$_venue->name(),
346 346
 				EEH_Venue_View::$_venue
347 347
 			);
348
-			$venue_name = EEH_Schema::name( $venue_name );
348
+			$venue_name = EEH_Schema::name($venue_name);
349 349
 
350 350
 			//if venue is trashed then ignore the "link to" setting because the venue is trashed.
351
-			if ( $venue->get('status') == 'trash' ) {
351
+			if ($venue->get('status') == 'trash') {
352 352
 				$link_to = '';
353 353
 			}
354
-			switch( $link_to ) {
354
+			switch ($link_to) {
355 355
 
356 356
 				case 'details' :
357
-					return EEH_Venue_View::venue_details_link( $venue->ID(), $venue_name );
357
+					return EEH_Venue_View::venue_details_link($venue->ID(), $venue_name);
358 358
 				break;
359 359
 
360 360
 				case 'website' :
361
-					return EEH_Venue_View::venue_website_link( $venue->ID(), $venue_name );
361
+					return EEH_Venue_View::venue_website_link($venue->ID(), $venue_name);
362 362
 				break;
363 363
 
364 364
 				default :
@@ -378,10 +378,10 @@  discard block
 block discarded – undo
378 378
 	 * @param    string $text
379 379
 	 * @return string
380 380
 	 */
381
-	public static function venue_details_link( $VNU_ID = 0, $text = '' ) {
382
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
383
-		if ( $venue instanceof EE_Venue ) {
384
-			return EEH_Schema::url( get_permalink( $venue->ID() ), $text );
381
+	public static function venue_details_link($VNU_ID = 0, $text = '') {
382
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
383
+		if ($venue instanceof EE_Venue) {
384
+			return EEH_Schema::url(get_permalink($venue->ID()), $text);
385 385
 		}
386 386
 		return '';
387 387
 	}
@@ -396,12 +396,12 @@  discard block
 block discarded – undo
396 396
 	 * @param    string $text
397 397
 	 * @return string
398 398
 	 */
399
-	public static function venue_website_link( $VNU_ID = 0, $text = '' ) {
400
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
401
-		if ( $venue instanceof EE_Venue ) {
399
+	public static function venue_website_link($VNU_ID = 0, $text = '') {
400
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
401
+		if ($venue instanceof EE_Venue) {
402 402
 			$url = $venue->venue_url();
403
-			$text = ! empty( $text ) ? $text : $url;
404
-			return ! empty( $url ) ? EEH_Schema::url( $url, $text ) : '';
403
+			$text = ! empty($text) ? $text : $url;
404
+			return ! empty($url) ? EEH_Schema::url($url, $text) : '';
405 405
 		}
406 406
 		return '';
407 407
 	}
@@ -415,10 +415,10 @@  discard block
 block discarded – undo
415 415
 	 * @param int $VNU_ID
416 416
 	 * @return string
417 417
 	 */
418
-	public static function venue_phone( $VNU_ID = 0) {
419
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
420
-		if ( $venue instanceof EE_Venue ) {
421
-			return EEH_Schema::telephone( $venue->phone() );
418
+	public static function venue_phone($VNU_ID = 0) {
419
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
420
+		if ($venue instanceof EE_Venue) {
421
+			return EEH_Schema::telephone($venue->phone());
422 422
 		}
423 423
 		return '';
424 424
 	}
@@ -434,48 +434,48 @@  discard block
 block discarded – undo
434 434
 	 * @param    array $gmap map options
435 435
 	 * @return string
436 436
 	 */
437
-	public static function venue_gmap( $VNU_ID = 0, $map_ID = FALSE, $gmap = array() ) {
437
+	public static function venue_gmap($VNU_ID = 0, $map_ID = FALSE, $gmap = array()) {
438 438
 
439
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
440
-		if ( $venue instanceof EE_Venue ) {
439
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
440
+		if ($venue instanceof EE_Venue) {
441 441
 			// check for global espresso_events post and use it's ID if no map_ID is set
442 442
 			global $post;
443
-			$map_ID = empty( $map_ID ) && $post->post_type == 'espresso_events' ? $post->ID : $map_ID;
443
+			$map_ID = empty($map_ID) && $post->post_type == 'espresso_events' ? $post->ID : $map_ID;
444 444
 			// grab map settings
445 445
 			$map_cfg = EE_Registry::instance()->CFG->map_settings;
446 446
 			// are maps enabled ?
447
-			if ( $map_cfg->use_google_maps && $venue->enable_for_gmap() ) {
447
+			if ($map_cfg->use_google_maps && $venue->enable_for_gmap()) {
448 448
 
449 449
 				$details_page = is_single();
450 450
 				$options = array();
451
-				$options['map_ID'] = $map_ID && $map_ID != $venue->ID() ? $map_ID . '-' . $venue->ID()/* . '-' . $static_map_id*/ : $venue->ID()/* . '-' . $static_map_id*/;
451
+				$options['map_ID'] = $map_ID && $map_ID != $venue->ID() ? $map_ID.'-'.$venue->ID()/* . '-' . $static_map_id*/ : $venue->ID()/* . '-' . $static_map_id*/;
452 452
 
453
-				$options['location'] = EEH_Address::format( $venue, 'inline', FALSE, FALSE );
453
+				$options['location'] = EEH_Address::format($venue, 'inline', FALSE, FALSE);
454 454
 
455 455
 				$options['ee_map_width'] = $details_page ? $map_cfg->event_details_map_width : $map_cfg->event_list_map_width;
456
-				$options['ee_map_width'] = isset( $gmap['ee_map_width'] ) && ! empty( $gmap['ee_map_width'] ) ? $gmap['ee_map_width'] : $options['ee_map_width'];
456
+				$options['ee_map_width'] = isset($gmap['ee_map_width']) && ! empty($gmap['ee_map_width']) ? $gmap['ee_map_width'] : $options['ee_map_width'];
457 457
 
458 458
 				$options['ee_map_height'] = $details_page ? $map_cfg->event_details_map_height : $map_cfg->event_list_map_height;
459
-				$options['ee_map_height'] = isset( $gmap['ee_map_height'] ) && ! empty( $gmap['ee_map_height'] ) ? $gmap['ee_map_height'] : $options['ee_map_height'];
459
+				$options['ee_map_height'] = isset($gmap['ee_map_height']) && ! empty($gmap['ee_map_height']) ? $gmap['ee_map_height'] : $options['ee_map_height'];
460 460
 
461 461
 				$options['ee_map_zoom'] = $details_page ? $map_cfg->event_details_map_zoom : $map_cfg->event_list_map_zoom;
462
-				$options['ee_map_zoom'] = isset( $gmap['ee_map_zoom'] ) && ! empty( $gmap['ee_map_zoom'] ) ? $gmap['ee_map_zoom'] : $options['ee_map_zoom'];
462
+				$options['ee_map_zoom'] = isset($gmap['ee_map_zoom']) && ! empty($gmap['ee_map_zoom']) ? $gmap['ee_map_zoom'] : $options['ee_map_zoom'];
463 463
 
464 464
 				$options['ee_map_nav_display'] = $details_page ? $map_cfg->event_details_display_nav : $map_cfg->event_list_display_nav;
465
-				$options['ee_map_nav_display'] = isset( $gmap['ee_map_nav_display'] ) && ! empty( $gmap['ee_map_nav_display'] ) ? 'true' : $options['ee_map_nav_display'];;
465
+				$options['ee_map_nav_display'] = isset($gmap['ee_map_nav_display']) && ! empty($gmap['ee_map_nav_display']) ? 'true' : $options['ee_map_nav_display']; ;
466 466
 
467 467
 				$options['ee_map_nav_size'] = $details_page ? $map_cfg->event_details_nav_size : $map_cfg->event_list_nav_size;
468
-				$options['ee_map_nav_size'] =  isset( $gmap['ee_map_nav_size'] ) && ! empty( $gmap['ee_map_nav_size'] )? $gmap['ee_map_nav_size'] : $options['ee_map_nav_size'];
468
+				$options['ee_map_nav_size'] = isset($gmap['ee_map_nav_size']) && ! empty($gmap['ee_map_nav_size']) ? $gmap['ee_map_nav_size'] : $options['ee_map_nav_size'];
469 469
 
470 470
 				$options['ee_map_type_control'] = $details_page ? $map_cfg->event_details_control_type : $map_cfg->event_list_control_type;
471
-				$options['ee_map_type_control'] =  isset( $gmap['ee_map_type_control'] ) && ! empty( $gmap['ee_map_type_control'] )? $gmap['ee_map_type_control'] : $options['ee_map_type_control'];
471
+				$options['ee_map_type_control'] = isset($gmap['ee_map_type_control']) && ! empty($gmap['ee_map_type_control']) ? $gmap['ee_map_type_control'] : $options['ee_map_type_control'];
472 472
 
473 473
 				$options['ee_map_align'] = $details_page ? $map_cfg->event_details_map_align : $map_cfg->event_list_map_align;
474
-				$options['ee_map_align'] =  isset( $gmap['ee_map_align'] ) && ! empty( $gmap['ee_map_align'] )? $gmap['ee_map_align'] : $options['ee_map_align'];
474
+				$options['ee_map_align'] = isset($gmap['ee_map_align']) && ! empty($gmap['ee_map_align']) ? $gmap['ee_map_align'] : $options['ee_map_align'];
475 475
 
476
-				$options['ee_static_url'] =  isset( $gmap['ee_static_url'] ) && ! empty( $gmap['ee_static_url'] ) ? (bool)absint( $gmap['ee_static_url'] ) : $venue->google_map_link();
476
+				$options['ee_static_url'] = isset($gmap['ee_static_url']) && ! empty($gmap['ee_static_url']) ? (bool) absint($gmap['ee_static_url']) : $venue->google_map_link();
477 477
 
478
-				return EEH_Maps::google_map( $options );
478
+				return EEH_Maps::google_map($options);
479 479
 
480 480
 			}
481 481
 		}
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 	 * @param array $atts like EEH_Maps::google_map_link
491 491
 	 * @return string
492 492
 	 */
493
-	public static function espresso_google_static_map( EE_Venue $venue, $atts = array() ){
493
+	public static function espresso_google_static_map(EE_Venue $venue, $atts = array()) {
494 494
 		$state = $venue->state_obj();
495 495
 		$country = $venue->country_obj();
496 496
 		$atts = shortcode_atts(
@@ -521,23 +521,23 @@  discard block
 block discarded – undo
521 521
 	 * @param string $after
522 522
 	 * @return string
523 523
 	 */
524
-	public static function edit_venue_link( $VNU_ID = 0, $link = '', $before = '<p class="edit-venue-lnk small-txt">', $after = '</p>' ) {
525
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
526
-		if ( $venue instanceof EE_Venue ) {
524
+	public static function edit_venue_link($VNU_ID = 0, $link = '', $before = '<p class="edit-venue-lnk small-txt">', $after = '</p>') {
525
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
526
+		if ($venue instanceof EE_Venue) {
527 527
 			// can the user edit this post ?
528
-			if ( current_user_can( 'edit_post', $venue->ID() )) {
528
+			if (current_user_can('edit_post', $venue->ID())) {
529 529
 				// set link text
530
-				$link = ! empty( $link ) ? $link : __('edit this venue');
530
+				$link = ! empty($link) ? $link : __('edit this venue');
531 531
 				// generate nonce
532
-				$nonce = wp_create_nonce( 'edit_nonce' );
532
+				$nonce = wp_create_nonce('edit_nonce');
533 533
 				// generate url to venue editor for this venue
534
-				$url = add_query_arg( array( 'page' => 'espresso_venues', 'action' => 'edit', 'post' => $venue->ID(), 'edit_nonce' => $nonce ), admin_url( 'admin.php' ) );
534
+				$url = add_query_arg(array('page' => 'espresso_venues', 'action' => 'edit', 'post' => $venue->ID(), 'edit_nonce' => $nonce), admin_url('admin.php'));
535 535
 				// get edit CPT text
536
-				$post_type_obj = get_post_type_object( 'espresso_venues' );
536
+				$post_type_obj = get_post_type_object('espresso_venues');
537 537
 				// build final link html
538
-				$link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $link . '</a>';
538
+				$link = '<a class="post-edit-link" href="'.$url.'" title="'.esc_attr($post_type_obj->labels->edit_item).'">'.$link.'</a>';
539 539
 				// put it all together
540
-				return $before . apply_filters( 'edit_post_link', $link, $venue->ID() ) . $after;
540
+				return $before.apply_filters('edit_post_link', $link, $venue->ID()).$after;
541 541
 			}
542 542
 		}
543 543
 		return '';
Please login to merge, or discard this patch.
core/db_models/EEM_Question.model.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2 2
 	exit('No direct script access allowed');
3 3
 }
4
-require_once( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
5
-require_once( EE_CLASSES . 'EE_Question.class.php' );
4
+require_once(EE_MODELS.'EEM_Soft_Delete_Base.model.php');
5
+require_once(EE_CLASSES.'EE_Question.class.php');
6 6
 
7 7
 
8 8
 
@@ -101,52 +101,52 @@  discard block
 block discarded – undo
101 101
 	 *
102 102
 	 * @param null $timezone
103 103
 	 */
104
-	protected function __construct( $timezone = NULL ) {
105
-		$this->singular_item = __('Question','event_espresso');
106
-		$this->plural_item = __('Questions','event_espresso');
107
-		$this->_allowed_question_types=apply_filters(
104
+	protected function __construct($timezone = NULL) {
105
+		$this->singular_item = __('Question', 'event_espresso');
106
+		$this->plural_item = __('Questions', 'event_espresso');
107
+		$this->_allowed_question_types = apply_filters(
108 108
 			'FHEE__EEM_Question__construct__allowed_question_types',
109 109
 			array(
110
-				EEM_Question::QST_type_text =>__('Text','event_espresso'),
111
-				EEM_Question::QST_type_textarea =>__('Textarea','event_espresso'),
112
-				EEM_Question::QST_type_checkbox =>__('Checkboxes','event_espresso'),
113
-				EEM_Question::QST_type_radio =>__('Radio Buttons','event_espresso'),
114
-				EEM_Question::QST_type_dropdown =>__('Dropdown','event_espresso'),
115
-				EEM_Question::QST_type_state =>__('State/Province Dropdown','event_espresso'),
116
-				EEM_Question::QST_type_country =>__('Country Dropdown','event_espresso'),
117
-				EEM_Question::QST_type_date =>__('Date Picker','event_espresso'),
118
-				EEM_Question::QST_type_html_textarea => __( 'HTML Textarea', 'event_espresso' ),
119
-				EEM_Question::QST_type_email => __( 'Email', 'event_espresso' ),
120
-				EEM_Question::QST_type_us_phone => __( 'USA - Format Phone', 'event_espresso' ),
121
-				EEM_Question::QST_type_decimal => __( 'Number', 'event_espresso' ),
122
-				EEM_Question::QST_type_int => __( 'Whole Number', 'event_espresso' ),
123
-				EEM_Question::QST_type_url => __( 'URL', 'event_espresso' ),
124
-				EEM_Question::QST_type_year => __( 'Year', 'event_espresso' ),
125
-				EEM_Question::QST_type_multi_select => __( 'Multi Select', 'event_espresso' )
110
+				EEM_Question::QST_type_text =>__('Text', 'event_espresso'),
111
+				EEM_Question::QST_type_textarea =>__('Textarea', 'event_espresso'),
112
+				EEM_Question::QST_type_checkbox =>__('Checkboxes', 'event_espresso'),
113
+				EEM_Question::QST_type_radio =>__('Radio Buttons', 'event_espresso'),
114
+				EEM_Question::QST_type_dropdown =>__('Dropdown', 'event_espresso'),
115
+				EEM_Question::QST_type_state =>__('State/Province Dropdown', 'event_espresso'),
116
+				EEM_Question::QST_type_country =>__('Country Dropdown', 'event_espresso'),
117
+				EEM_Question::QST_type_date =>__('Date Picker', 'event_espresso'),
118
+				EEM_Question::QST_type_html_textarea => __('HTML Textarea', 'event_espresso'),
119
+				EEM_Question::QST_type_email => __('Email', 'event_espresso'),
120
+				EEM_Question::QST_type_us_phone => __('USA - Format Phone', 'event_espresso'),
121
+				EEM_Question::QST_type_decimal => __('Number', 'event_espresso'),
122
+				EEM_Question::QST_type_int => __('Whole Number', 'event_espresso'),
123
+				EEM_Question::QST_type_url => __('URL', 'event_espresso'),
124
+				EEM_Question::QST_type_year => __('Year', 'event_espresso'),
125
+				EEM_Question::QST_type_multi_select => __('Multi Select', 'event_espresso')
126 126
 			)
127 127
 		);
128 128
 		$this->_question_descriptions = apply_filters(
129 129
 			'FHEE__EEM_Question__construct__allowed_question_types',
130 130
 			array(
131
-				EEM_Question::QST_type_text          => __( 'A single line text input field', 'event_espresso' ),
132
-				EEM_Question::QST_type_textarea      => __( 'A multi line text input field', 'event_espresso' ),
133
-				EEM_Question::QST_type_checkbox      => __( 'Allows multiple preset options to be selected', 'event_espresso' ),
134
-				EEM_Question::QST_type_radio         => __( 'Allows a single preset option to be selected', 'event_espresso' ),
135
-				EEM_Question::QST_type_dropdown      => __( 'A dropdown that allows a single selection', 'event_espresso' ),
136
-				EEM_Question::QST_type_state         => __( 'A dropdown that lists states/provinces', 'event_espresso' ),
137
-				EEM_Question::QST_type_country       => __( 'A dropdown that lists countries', 'event_espresso' ),
138
-				EEM_Question::QST_type_date          => __( 'A popup calendar that allows date selections', 'event_espresso' ),
139
-				EEM_Question::QST_type_html_textarea => __( 'A multi line text input field that allows HTML', 'event_espresso' ),
140
-				EEM_Question::QST_type_email         => __( 'A text field that must contain a valid Email address', 'event_espresso' ),
141
-				EEM_Question::QST_type_us_phone      => __( 'A text field that must contain a valid US phone number', 'event_espresso' ),
142
-				EEM_Question::QST_type_decimal       => __( 'A text field that allows number values with decimals', 'event_espresso' ),
143
-				EEM_Question::QST_type_int           => __( 'A text field that only allows whole numbers (no decimals)', 'event_espresso' ),
144
-				EEM_Question::QST_type_url           => __( 'A text field that must contain a valid URL', 'event_espresso' ),
145
-				EEM_Question::QST_type_year          => __( 'A dropdown that lists the last 100 years', 'event_espresso' ),
146
-				EEM_Question::QST_type_multi_select  => __( 'A dropdown that allows multiple selections', 'event_espresso' )
131
+				EEM_Question::QST_type_text          => __('A single line text input field', 'event_espresso'),
132
+				EEM_Question::QST_type_textarea      => __('A multi line text input field', 'event_espresso'),
133
+				EEM_Question::QST_type_checkbox      => __('Allows multiple preset options to be selected', 'event_espresso'),
134
+				EEM_Question::QST_type_radio         => __('Allows a single preset option to be selected', 'event_espresso'),
135
+				EEM_Question::QST_type_dropdown      => __('A dropdown that allows a single selection', 'event_espresso'),
136
+				EEM_Question::QST_type_state         => __('A dropdown that lists states/provinces', 'event_espresso'),
137
+				EEM_Question::QST_type_country       => __('A dropdown that lists countries', 'event_espresso'),
138
+				EEM_Question::QST_type_date          => __('A popup calendar that allows date selections', 'event_espresso'),
139
+				EEM_Question::QST_type_html_textarea => __('A multi line text input field that allows HTML', 'event_espresso'),
140
+				EEM_Question::QST_type_email         => __('A text field that must contain a valid Email address', 'event_espresso'),
141
+				EEM_Question::QST_type_us_phone      => __('A text field that must contain a valid US phone number', 'event_espresso'),
142
+				EEM_Question::QST_type_decimal       => __('A text field that allows number values with decimals', 'event_espresso'),
143
+				EEM_Question::QST_type_int           => __('A text field that only allows whole numbers (no decimals)', 'event_espresso'),
144
+				EEM_Question::QST_type_url           => __('A text field that must contain a valid URL', 'event_espresso'),
145
+				EEM_Question::QST_type_year          => __('A dropdown that lists the last 100 years', 'event_espresso'),
146
+				EEM_Question::QST_type_multi_select  => __('A dropdown that allows multiple selections', 'event_espresso')
147 147
 			)
148 148
 		);
149
-		$this->_question_type_categories = (array)apply_filters(
149
+		$this->_question_type_categories = (array) apply_filters(
150 150
 				'FHEE__EEM_Question__construct__question_type_categories',
151 151
 				array(
152 152
 				'text' => array(
@@ -171,22 +171,22 @@  discard block
 block discarded – undo
171 171
 		);
172 172
 
173 173
 		$this->_tables = array(
174
-			'Question'=>new EE_Primary_Table('esp_question','QST_ID')
174
+			'Question'=>new EE_Primary_Table('esp_question', 'QST_ID')
175 175
 		);
176 176
 		$this->_fields = array(
177 177
 			'Question'=>array(
178
-				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID','event_espresso')),
179
-				'QST_display_text'=>new EE_Full_HTML_Field('QST_display_text', __('Question Text','event_espresso'), true, ''),
180
-				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)','event_espresso'), true, ''),
181
-				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question','event_espresso'), false, '' ),
182
-				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type','event_espresso'),false, 'TEXT',$this->_allowed_question_types),
183
-				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?','event_espresso'), false, false),
184
-				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided','event_espresso'), true, ''),
185
-				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order','event_espresso'), false, 0),
186
-				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?','event_espresso'), false, false),
187
-				'QST_max' => new EE_Infinite_Integer_Field( 'QST_max', __( 'Max Size', 'event_espresso'	), false, EE_INF ),
188
-				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID','event_espresso'), false ),
189
-				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted','event_espresso'), false, false)
178
+				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso')),
179
+				'QST_display_text'=>new EE_Full_HTML_Field('QST_display_text', __('Question Text', 'event_espresso'), true, ''),
180
+				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)', 'event_espresso'), true, ''),
181
+				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question', 'event_espresso'), false, ''),
182
+				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type', 'event_espresso'), false, 'TEXT', $this->_allowed_question_types),
183
+				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?', 'event_espresso'), false, false),
184
+				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided', 'event_espresso'), true, ''),
185
+				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order', 'event_espresso'), false, 0),
186
+				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?', 'event_espresso'), false, false),
187
+				'QST_max' => new EE_Infinite_Integer_Field('QST_max', __('Max Size', 'event_espresso'), false, EE_INF),
188
+				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID', 'event_espresso'), false),
189
+				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted', 'event_espresso'), false, false)
190 190
 			)
191 191
 		);
192 192
 		$this->_model_relations = array(
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 			'Question_Group_Question'=>new EE_Has_Many_Relation()
199 199
 		);
200 200
 		//this model is generally available for reading
201
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
202
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('QST_system');
203
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('QST_system');
204
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('QST_system');
205
-		parent::__construct( $timezone );
201
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
202
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('QST_system');
203
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('QST_system');
204
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('QST_system');
205
+		parent::__construct($timezone);
206 206
 	}
207 207
 
208 208
 	/**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 * but they can be extended
211 211
 	 * @return string[]
212 212
 	 */
213
-	public function allowed_question_types(){
213
+	public function allowed_question_types() {
214 214
 		return $this->_allowed_question_types;
215 215
 	}
216 216
 	/**
@@ -218,16 +218,16 @@  discard block
 block discarded – undo
218 218
 	 * @param string $question_type one of EEM_Question::allowed_question_types(
219 219
 	 * @return string[] like EEM_Question::allowed_question_types()
220 220
 	 */
221
-	public function question_types_in_same_category( $question_type ) {
222
-		$question_types = array( $question_type );
223
-		foreach( $this->_question_type_categories as $category => $question_types_in_category ) {
224
-			if( in_array( $question_type, $question_types_in_category ) ) {
221
+	public function question_types_in_same_category($question_type) {
222
+		$question_types = array($question_type);
223
+		foreach ($this->_question_type_categories as $category => $question_types_in_category) {
224
+			if (in_array($question_type, $question_types_in_category)) {
225 225
 				$question_types = $question_types_in_category;
226 226
 				break;
227 227
 			}
228 228
 		}
229 229
 
230
-		return array_intersect_key( $this->allowed_question_types(), array_flip( $question_types ) );
230
+		return array_intersect_key($this->allowed_question_types(), array_flip($question_types));
231 231
 	}
232 232
 
233 233
 	/**
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
 	 * @param string $category one of the top-level keys of EEM_Question::question_type_categories()
237 237
 	 * @return boolean
238 238
 	 */
239
-	public function question_type_is_in_category( $question_type, $category ) {
240
-		if( ! isset( $this->_question_type_categories[ $category ] ) ) {
239
+	public function question_type_is_in_category($question_type, $category) {
240
+		if ( ! isset($this->_question_type_categories[$category])) {
241 241
 			return false;
242 242
 		}
243
-		return in_array( $question_type, $this->_question_type_categories[ $category ] );
243
+		return in_array($question_type, $this->_question_type_categories[$category]);
244 244
 	}
245 245
 
246 246
 	/**
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
 	 * @param string $system_question_group_id QSG_system
258 258
 	 * @return array of system question names (QST_system)
259 259
 	 */
260
-	public function allowed_system_questions_in_system_question_group( $system_question_group_id ) {
260
+	public function allowed_system_questions_in_system_question_group($system_question_group_id) {
261 261
 		$question_system_ids = array();
262
-		switch( $system_question_group_id ) {
262
+		switch ($system_question_group_id) {
263 263
 			case EEM_Question_Group::system_personal:
264 264
 				$question_system_ids = array(
265 265
 					EEM_Attendee::system_question_fname,
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 				);
281 281
 				break;
282 282
 		}
283
-		return apply_filters( 'FHEE__EEM_Question__system_questions_allowed_in_system_question_group__return', $question_system_ids, $system_question_group_id );
283
+		return apply_filters('FHEE__EEM_Question__system_questions_allowed_in_system_question_group__return', $question_system_ids, $system_question_group_id);
284 284
 	}
285 285
 
286 286
 	/**
@@ -289,11 +289,11 @@  discard block
 block discarded – undo
289 289
 	 * @param string $system_question_group_id QSG_system
290 290
 	 * @return array of system question names (QST_system)
291 291
 	 */
292
-	public function required_system_questions_in_system_question_group( $system_question_group_id ) {
292
+	public function required_system_questions_in_system_question_group($system_question_group_id) {
293 293
 		$question_system_ids = null;
294
-		switch( $system_question_group_id ) {
294
+		switch ($system_question_group_id) {
295 295
 			case EEM_Question_Group::system_personal:
296
-				$question_system_ids =  array(
296
+				$question_system_ids = array(
297 297
 					EEM_Attendee::system_question_fname,
298 298
 					EEM_Attendee::system_question_email,
299 299
 				);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 			default:
302 302
 				$question_system_ids = array();
303 303
 		}
304
-		return apply_filters( 'FHEE__EEM_Question__system_questions_required_in_system_question_group', $question_system_ids, $system_question_group_id );
304
+		return apply_filters('FHEE__EEM_Question__system_questions_required_in_system_question_group', $question_system_ids, $system_question_group_id);
305 305
 	}
306 306
 
307 307
 
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
 	 * @param $QST_system
313 313
 	 * @return int of QST_ID for the question that corresponds to that QST_system
314 314
 	 */
315
-	public function get_Question_ID_from_system_string( $QST_system ){
316
-		 return $this->get_var( array( array( 'QST_system' => $QST_system ) ) );
315
+	public function get_Question_ID_from_system_string($QST_system) {
316
+		 return $this->get_var(array(array('QST_system' => $QST_system)));
317 317
 	}
318 318
 
319 319
 
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
 	 */
326 326
 	public function get_latest_question_order() {
327 327
 		$columns_to_select = array(
328
-			'max_order' => array("MAX(QST_order)","%d")
328
+			'max_order' => array("MAX(QST_order)", "%d")
329 329
 		);
330
-		$max = $this->_get_all_wpdb_results( array(), ARRAY_A, $columns_to_select );
331
-		return isset( $max[0], $max[0]['max_order'] ) ? $max[0]['max_order'] : 0;
330
+		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select);
331
+		return isset($max[0], $max[0]['max_order']) ? $max[0]['max_order'] : 0;
332 332
 	}
333 333
 
334 334
 	/**
@@ -357,10 +357,10 @@  discard block
 block discarded – undo
357 357
 	 * @param string $system_question_value
358 358
 	 * @return int|float
359 359
 	 */
360
-	public function absolute_max_for_system_question( $system_question_value ) {
360
+	public function absolute_max_for_system_question($system_question_value) {
361 361
 		$maxes = $this->system_question_maxes();
362
-		if( isset( $maxes[ $system_question_value ] ) ) {
363
-			return $maxes[ $system_question_value ];
362
+		if (isset($maxes[$system_question_value])) {
363
+			return $maxes[$system_question_value];
364 364
 		} else {
365 365
 			return EE_INF;
366 366
 		}
Please login to merge, or discard this patch.
modules/venue_single/EED_Venue_Single.module.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @return EED_Venue_Single
28 28
 	 */
29 29
 	public static function instance() {
30
-		return parent::get_instance( __CLASS__ );
30
+		return parent::get_instance(__CLASS__);
31 31
 	}
32 32
 
33 33
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *  @return 	void
38 38
 	 */
39 39
 	public static function set_hooks() {
40
-		EE_Config::register_route( 'venue', 'Venue_Single', 'run' );
40
+		EE_Config::register_route('venue', 'Venue_Single', 'run');
41 41
 //		EE_Config::register_view( 'venue', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'single-espresso_venues.php' );
42 42
 	}
43 43
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 * @access    public
59 59
 	 * @param \WP $WP
60 60
 	 */
61
-	public function run( $WP ) {
61
+	public function run($WP) {
62 62
 		// check what template is loaded
63
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
64
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
63
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
64
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
65 65
 	}
66 66
 
67 67
 
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 	 * @param  string $template
74 74
 	 * @return string
75 75
 	 */
76
-	public function template_include( $template ) {
76
+	public function template_include($template) {
77 77
 		// not a custom template?
78
-		if ( EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'single-espresso_venues.php' ) {
78
+		if (EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'single-espresso_venues.php') {
79 79
 			EEH_Template::load_espresso_theme_functions();
80 80
 			// then add extra event data via hooks
81
-			add_filter( 'the_title', array( $this, 'the_title' ), 100, 1 );
82
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
81
+			add_filter('the_title', array($this, 'the_title'), 100, 1);
82
+			add_filter('the_content', array($this, 'venue_details'), 100);
83 83
 			// don't display entry meta because the existing theme will take car of that
84
-			add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' );
84
+			add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false');
85 85
 		}
86 86
 		return $template;
87 87
 	}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 * @param  string $title
96 96
 	 * @return string
97 97
 	 */
98
-	public function the_title( $title = '' ) {
98
+	public function the_title($title = '') {
99 99
 		return $title;
100 100
 	}
101 101
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 * @param  string $content
108 108
 	 * @return string
109 109
 	 */
110
-	public function venue_details( $content ) {
110
+	public function venue_details($content) {
111 111
 		global $post;
112 112
 		if (
113 113
 			$post->post_type == 'espresso_venues'
@@ -117,16 +117,16 @@  discard block
 block discarded – undo
117 117
 			// it uses the_content() for displaying the $post->post_content
118 118
 			// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
119 119
 			// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
120
-			remove_filter( 'the_content', array( $this, 'venue_details' ), 100 );
120
+			remove_filter('the_content', array($this, 'venue_details'), 100);
121 121
 			// add filters we want
122
-			add_filter( 'the_content', array( $this, 'venue_location' ), 110 );
122
+			add_filter('the_content', array($this, 'venue_location'), 110);
123 123
 			// now load our template
124
-			$template = EEH_Template::locate_template( 'content-espresso_venues-details.php' );
124
+			$template = EEH_Template::locate_template('content-espresso_venues-details.php');
125 125
 			// remove other filters we added so they won't get applied to the next post
126
-			remove_filter( 'the_content', array( $this, 'venue_location' ), 110 );
126
+			remove_filter('the_content', array($this, 'venue_location'), 110);
127 127
 		}
128 128
 		// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
129
-		return ! empty( $template ) ? $template : $content;
129
+		return ! empty($template) ? $template : $content;
130 130
 	}
131 131
 
132 132
 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 	 * @param  string $content
139 139
 	 * @return string
140 140
 	 */
141
-	public function venue_location( $content ) {
142
-		return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' );
141
+	public function venue_location($content) {
142
+		return $content.EEH_Template::locate_template('content-espresso_venues-location.php');
143 143
 	}
144 144
 
145 145
 
@@ -152,16 +152,16 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public function wp_enqueue_scripts() {
154 154
 		// get some style
155
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_single() ) {
155
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_single()) {
156 156
 			// first check theme folder
157
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
158
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
159
-			} else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) {
160
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
157
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
158
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
159
+			} else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) {
160
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
161 161
 			}
162
-			wp_enqueue_style( $this->theme );
163
-			if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
164
-				add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 );
162
+			wp_enqueue_style($this->theme);
163
+			if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
164
+				add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
165 165
 			}
166 166
 		}
167 167
 	}
Please login to merge, or discard this patch.
modules/venues_archive/EED_Venues_Archive.module.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @return EED_Venues_Archive
28 28
 	 */
29 29
 	public static function instance() {
30
-		return parent::get_instance( __CLASS__ );
30
+		return parent::get_instance(__CLASS__);
31 31
 	}
32 32
 
33 33
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *  @return 	void
38 38
 	 */
39 39
 	public static function set_hooks() {
40
-		EE_Config::register_route( 'venues', 'Venues_Archive', 'run' );
40
+		EE_Config::register_route('venues', 'Venues_Archive', 'run');
41 41
 //		EE_Config::register_view( 'venues', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_venues.php' );
42 42
 	}
43 43
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 * @access    public
59 59
 	 * @param \WP $WP
60 60
 	 */
61
-	public function run( $WP ) {
61
+	public function run($WP) {
62 62
 		// check what template is loaded
63
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
64
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
63
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
64
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
65 65
 	}
66 66
 
67 67
 
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
 	 * @param  string $template
74 74
 	 * @return string
75 75
 	 */
76
-	public function template_include( $template ) {
76
+	public function template_include($template) {
77 77
 		// not a custom template?
78
-		if ( EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'archive-espresso_venues.php' ) {
78
+		if (EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'archive-espresso_venues.php') {
79 79
 			EEH_Template::load_espresso_theme_functions();
80 80
 			// then add extra event data via hooks
81
-			add_filter( 'the_title', array( $this, 'the_title' ), 100, 1 );
81
+			add_filter('the_title', array($this, 'the_title'), 100, 1);
82 82
 			// don't know if theme uses the_excerpt
83
-			add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
83
+			add_filter('the_excerpt', array($this, 'venue_details'), 100);
84 84
 			// or the_content
85
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
85
+			add_filter('the_content', array($this, 'venue_details'), 100);
86 86
 			// don't display entry meta because the existing theme will take care of that
87
-			add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' );
87
+			add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false');
88 88
 		}
89 89
 		return $template;
90 90
 	}
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * @param  string $title
99 99
 	 * @return string
100 100
 	 */
101
-	public function the_title( $title = '' ) {
101
+	public function the_title($title = '') {
102 102
 		return $title;
103 103
 	}
104 104
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * @param  string $content
111 111
 	 * @return string
112 112
 	 */
113
-	public function venue_details( $content ) {
113
+	public function venue_details($content) {
114 114
 		global $post;
115 115
 		if (
116 116
 			$post->post_type == 'espresso_venues'
@@ -120,22 +120,22 @@  discard block
 block discarded – undo
120 120
 			// it uses the_content() for displaying the $post->post_content
121 121
 			// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
122 122
 			// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
123
-			remove_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
124
-			remove_filter( 'the_content', array( $this, 'venue_details' ), 100 );
123
+			remove_filter('the_excerpt', array($this, 'venue_details'), 100);
124
+			remove_filter('the_content', array($this, 'venue_details'), 100);
125 125
 			// add filters we want
126
-			add_filter( 'the_content', array( $this, 'venue_location' ), 110 );
127
-			add_filter( 'the_excerpt', array( $this, 'venue_location' ), 110 );
126
+			add_filter('the_content', array($this, 'venue_location'), 110);
127
+			add_filter('the_excerpt', array($this, 'venue_location'), 110);
128 128
 			// now load our template
129
-			$template = EEH_Template::locate_template( 'content-espresso_venues-details.php' );
129
+			$template = EEH_Template::locate_template('content-espresso_venues-details.php');
130 130
 			//now add our filter back in, plus some others
131
-			add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
132
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
131
+			add_filter('the_excerpt', array($this, 'venue_details'), 100);
132
+			add_filter('the_content', array($this, 'venue_details'), 100);
133 133
 			// remove other filters we added so they won't get applied to the next post
134
-			remove_filter( 'the_content', array( $this, 'venue_location' ), 110 );
135
-			remove_filter( 'the_excerpt', array( $this, 'venue_location' ), 110 );
134
+			remove_filter('the_content', array($this, 'venue_location'), 110);
135
+			remove_filter('the_excerpt', array($this, 'venue_location'), 110);
136 136
 			// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
137 137
 		}
138
-		return ! empty( $template ) ? $template : $content;
138
+		return ! empty($template) ? $template : $content;
139 139
 	}
140 140
 
141 141
 
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 	 * @param  string $content
148 148
 	 * @return string
149 149
 	 */
150
-	public function venue_location( $content ) {
151
-		return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' );
150
+	public function venue_location($content) {
151
+		return $content.EEH_Template::locate_template('content-espresso_venues-location.php');
152 152
 	}
153 153
 
154 154
 
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	public function wp_enqueue_scripts() {
164 164
 		// get some style
165
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_archive() ) {
165
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_archive()) {
166 166
 			// first check theme folder
167
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
168
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
169
-			} else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) {
170
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
167
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
168
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
169
+			} else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) {
170
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
171 171
 			}
172
-			wp_enqueue_style( $this->theme );
172
+			wp_enqueue_style($this->theme);
173 173
 		}
174 174
 	}
175 175
 
Please login to merge, or discard this patch.
registrations/form_sections/EE_Registration_Custom_Questions_Form.form.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
  * @since		 	   4.8.30.rc.009
14 14
  *
15 15
  */
16
-if( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
17
-	exit( 'No direct script access allowed' );
16
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
17
+	exit('No direct script access allowed');
18 18
 }
19 19
 
20
-class EE_Registration_Custom_Questions_Form extends EE_Form_Section_Proper{
20
+class EE_Registration_Custom_Questions_Form extends EE_Form_Section_Proper {
21 21
 	/**
22 22
 	 *
23 23
 	 * @var EE_Registration
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
 	 * @param EE_Registration $reg
30 30
 	 * @param array $options
31 31
 	 */
32
-	public function __construct( EE_Registration $reg, $options = array() ) {
32
+	public function __construct(EE_Registration $reg, $options = array()) {
33 33
 		$this->_registration = $reg;
34
-		if( ! isset( $options[ 'layout_strategy' ] ) ) {
35
-			$options[ 'layout_strategy' ] = new EE_Admin_Two_Column_Layout();
34
+		if ( ! isset($options['layout_strategy'])) {
35
+			$options['layout_strategy'] = new EE_Admin_Two_Column_Layout();
36 36
 		}
37
-		if( ! isset( $options[ 'html_id' ] ) ) {
38
-			$options[ 'html_id' ] = 'reg-admin-attendee-questions-frm';
37
+		if ( ! isset($options['html_id'])) {
38
+			$options['html_id'] = 'reg-admin-attendee-questions-frm';
39 39
 		}
40 40
 		$this->build_form_from_registration();
41
-		parent::__construct( $options );
41
+		parent::__construct($options);
42 42
 	}
43 43
 
44 44
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 
53 53
 	public function build_form_from_registration() {
54 54
 		$reg = $this->get_registration();
55
-		if( ! $reg instanceof EE_Registration ) {
56
-			throw new EE_Error( __( 'We cannot build the registration custom questions form because there is no registration set on it yet', 'event_espresso') );
55
+		if ( ! $reg instanceof EE_Registration) {
56
+			throw new EE_Error(__('We cannot build the registration custom questions form because there is no registration set on it yet', 'event_espresso'));
57 57
 		}
58 58
 		//we want to get all their question groups
59 59
 		$question_groups = EEM_Question_Group::instance()->get_all(
@@ -63,16 +63,16 @@  discard block
 block discarded – undo
63 63
 					'Event_Question_Group.EQG_primary' => $reg->count() == 1 ? TRUE : FALSE,
64 64
 					'OR' => array(
65 65
 						'Question.QST_system*blank' =>  '',
66
-						'Question.QST_system*null' => array( 'IS_NULL' ) 
66
+						'Question.QST_system*null' => array('IS_NULL') 
67 67
 					)
68 68
 				),
69
-				'order_by' => array( 'QSG_order' => 'ASC' )
69
+				'order_by' => array('QSG_order' => 'ASC')
70 70
 			)
71 71
 		);
72 72
 		//get each question groups questions
73
-		foreach( $question_groups as $question_group ) {
74
-			if ( $question_group instanceof EE_Question_Group ) {
75
-				$this->_subsections[ $question_group->ID() ] = $this->build_subform_from_question_group(
73
+		foreach ($question_groups as $question_group) {
74
+			if ($question_group instanceof EE_Question_Group) {
75
+				$this->_subsections[$question_group->ID()] = $this->build_subform_from_question_group(
76 76
 					$question_group,
77 77
 					$reg
78 78
 				);
@@ -89,16 +89,16 @@  discard block
 block discarded – undo
89 89
 	 * @return \EE_Form_Section_Proper
90 90
 	 * @throws \EE_Error
91 91
 	 */
92
-	public function build_subform_from_question_group( $question_group, $registration ) {
93
-		if( ! $question_group instanceof EE_Question_Group ||
92
+	public function build_subform_from_question_group($question_group, $registration) {
93
+		if ( ! $question_group instanceof EE_Question_Group ||
94 94
 			! $registration instanceof EE_Registration) {
95
-			throw new EE_Error( __( 'A valid question group and registration must be passed to EE_Registration_Custom_Question_Form', 'event_espresso' ) );
95
+			throw new EE_Error(__('A valid question group and registration must be passed to EE_Registration_Custom_Question_Form', 'event_espresso'));
96 96
 		}
97 97
 		$parts_of_subsection = array(
98 98
 			'title' => new EE_Form_Section_HTML(
99
-					EEH_HTML::h5( $question_group->name(),
99
+					EEH_HTML::h5($question_group->name(),
100 100
 					$question_group->identifier(),
101
-					'espresso-question-group-title-h5 section-title' )
101
+					'espresso-question-group-title-h5 section-title')
102 102
 				)
103 103
 		);
104 104
 		$questions = $question_group->questions( 
@@ -106,17 +106,17 @@  discard block
 block discarded – undo
106 106
 				array( 
107 107
 					'OR' => array(
108 108
 						'QST_system*blank' => '',
109
-						'QST_system*null' => array( 'IS_NULL' )
109
+						'QST_system*null' => array('IS_NULL')
110 110
 					)
111 111
 				)
112 112
 			)
113 113
 		);
114
-		foreach( $questions as $question ) {
115
-			$parts_of_subsection[ $question->ID() ] = $question->generate_form_input( $registration );
114
+		foreach ($questions as $question) {
115
+			$parts_of_subsection[$question->ID()] = $question->generate_form_input($registration);
116 116
 		}
117
-		$parts_of_subsection[ 'edit_link' ] = new EE_Form_Section_HTML(
118
-				'<tr><th/><td class="reg-admin-edit-attendee-question-td"><a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '">
119
-					<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span>
117
+		$parts_of_subsection['edit_link'] = new EE_Form_Section_HTML(
118
+				'<tr><th/><td class="reg-admin-edit-attendee-question-td"><a class="reg-admin-edit-attendee-question-lnk" href="#" title="'.esc_attr__('click to edit question', 'event_espresso').'">
119
+					<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span>
120 120
 					<div class="dashicons dashicons-edit"></div>
121 121
 				</a></td></tr>'
122 122
 			);
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
 	protected function _normalize($req_data) {
137 137
 		$this->_received_submission = TRUE;
138 138
 		$this->_validation_errors = array();
139
-		foreach($this->get_validatable_subsections() as $subsection){
140
-			if( $subsection->form_data_present_in( $req_data ) ) {
141
-				try{
139
+		foreach ($this->get_validatable_subsections() as $subsection) {
140
+			if ($subsection->form_data_present_in($req_data)) {
141
+				try {
142 142
 					$subsection->_normalize($req_data);
143
-				}catch( EE_Validation_Error $e ){
144
-					$subsection->add_validation_error( $e );
143
+				} catch (EE_Validation_Error $e) {
144
+					$subsection->add_validation_error($e);
145 145
 				}
146 146
 			}
147 147
 		}
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
 	 * calling parent::_validate() first.
157 157
 	 */
158 158
 	protected function _validate() {
159
-		foreach($this->get_validatable_subsections() as $subsection_name => $subsection){
160
-			if( $subsection->form_data_present_in( array_merge( $_GET, $_POST ) ) ) {
161
-				if(method_exists($this,'_validate_'.$subsection_name)){
162
-					call_user_func_array(array($this,'_validate_'.$subsection_name), array($subsection));
159
+		foreach ($this->get_validatable_subsections() as $subsection_name => $subsection) {
160
+			if ($subsection->form_data_present_in(array_merge($_GET, $_POST))) {
161
+				if (method_exists($this, '_validate_'.$subsection_name)) {
162
+					call_user_func_array(array($this, '_validate_'.$subsection_name), array($subsection));
163 163
 				}
164 164
 				$subsection->_validate();
165
-			} elseif( $subsection instanceof EE_Form_Section_Proper ) {
165
+			} elseif ($subsection instanceof EE_Form_Section_Proper) {
166 166
 				$subsection->_received_submission = true;
167 167
 			}
168 168
 		}
Please login to merge, or discard this patch.
admin_pages/registrations/Registrations_Admin_Page.core.php 1 patch
Spacing   +544 added lines, -544 removed lines patch added patch discarded remove patch
@@ -56,26 +56,26 @@  discard block
 block discarded – undo
56 56
 	 * @param bool $routing
57 57
 	 * @return Registrations_Admin_Page
58 58
 	 */
59
-	public function __construct( $routing = TRUE ) {
60
-		parent::__construct( $routing );
61
-		add_action( 'wp_loaded', array( $this, 'wp_loaded' ));
59
+	public function __construct($routing = TRUE) {
60
+		parent::__construct($routing);
61
+		add_action('wp_loaded', array($this, 'wp_loaded'));
62 62
 	}
63 63
 
64 64
 
65 65
 
66 66
 	public function wp_loaded() {
67 67
 		// when adding a new registration...
68
-		if ( isset( $this->_req_data[ 'action' ] ) && $this->_req_data[ 'action' ] == 'new_registration' ) {
68
+		if (isset($this->_req_data['action']) && $this->_req_data['action'] == 'new_registration') {
69 69
 			EE_System::do_not_cache();
70 70
 			if (
71
-				! isset( $this->_req_data[ 'processing_registration' ] )
72
-				|| absint( $this->_req_data[ 'processing_registration' ] ) !== 1
71
+				! isset($this->_req_data['processing_registration'])
72
+				|| absint($this->_req_data['processing_registration']) !== 1
73 73
 			) {
74 74
 				// and it's NOT the attendee information reg step
75 75
 				// force cookie expiration by setting time to last week
76
-				setcookie( 'ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/' );
76
+				setcookie('ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/');
77 77
 				// and update the global
78
-				$_COOKIE[ 'ee_registration_added' ] = 0;
78
+				$_COOKIE['ee_registration_added'] = 0;
79 79
 			}
80 80
 		}
81 81
 	}
@@ -109,16 +109,16 @@  discard block
 block discarded – undo
109 109
 				'trash' => 'post.php'
110 110
 			);
111 111
 
112
-		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 );
112
+		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10);
113 113
 		//add filters so that the comment urls don't take users to a confusing 404 page
114
-		add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 );
114
+		add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3);
115 115
 	}
116 116
 
117 117
 
118
-	public function clear_comment_link( $link, $comment, $args ) {
118
+	public function clear_comment_link($link, $comment, $args) {
119 119
 		//gotta make sure this only happens on this route
120
-		$post_type = get_post_type( $comment->comment_post_ID);
121
-		if ( $post_type == 'espresso_attendees' )
120
+		$post_type = get_post_type($comment->comment_post_ID);
121
+		if ($post_type == 'espresso_attendees')
122 122
 			return '#commentsdiv';
123 123
 		return $link;
124 124
 	}
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
 	protected function _ajax_hooks() {
128 128
 		//todo: all hooks for registrations ajax goes in here
129
-		add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' ));
129
+		add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status'));
130 130
 	}
131 131
 
132 132
 
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
 				'add-attendee' => __('Add Contact', 'event_espresso'),
142 142
 				'edit' => __('Edit Contact', 'event_espresso'),
143 143
 				'report'=>  __("Event Registrations CSV Report", "event_espresso"),
144
-				'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ),
145
-				'contact_list_report' => __( 'Contact List Report', 'event_espresso' ),
144
+				'report_all' => __('All Registrations CSV Report', 'event_espresso'),
145
+				'contact_list_report' => __('Contact List Report', 'event_espresso'),
146 146
 				'contact_list_export'=>  __("Export Data", "event_espresso"),
147 147
 			),
148 148
 			'publishbox' => array(
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 
171 171
 		$this->_get_registration_status_array();
172 172
 
173
-		$reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0;
174
-		$att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0;
175
-		$att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id;
173
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0;
174
+		$att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0;
175
+		$att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id;
176 176
 
177 177
 		$this->_page_routes = array(
178 178
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
 				'restore_registrations' => array(
207 207
 					'func' => '_trash_or_restore_registrations',
208
-					'args' => array( 'trash' => FALSE ),
208
+					'args' => array('trash' => FALSE),
209 209
 					'noheader' => TRUE,
210 210
 					'capability' => 'ee_delete_registrations'
211 211
 					),
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 						'filename' => 'registrations_overview_other'
439 439
 					)
440 440
                 ),
441
-				'help_tour' => array( 'Registration_Overview_Help_Tour' ),
441
+				'help_tour' => array('Registration_Overview_Help_Tour'),
442 442
 				'qtips' => array('Registration_List_Table_Tips'),
443 443
 				'list_table' => 'EE_Registrations_List_Table',
444 444
 				'require_nonce' => FALSE
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 				'nav' => array(
449 449
 					'label' => __('REG Details', 'event_espresso'),
450 450
 					'order' => 15,
451
-					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
451
+					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID']), $this->_current_page_view_url) : $this->_admin_base_url,
452 452
 					'persistent' => FALSE
453 453
 				),
454 454
                 'help_tabs' => array(
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
 						'filename' => 'registrations_details_registrant_details'
470 470
 					)
471 471
 				),
472
-				'help_tour' => array( 'Registration_Details_Help_Tour' ),
473
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_registration_details_metaboxes' ) ),
472
+				'help_tour' => array('Registration_Details_Help_Tour'),
473
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_registration_details_metaboxes')),
474 474
 				'require_nonce' => FALSE
475 475
 			),
476 476
 
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 					'order' => 15,
495 495
 					'persistent' => FALSE
496 496
 				),
497
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes' ) ),
497
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes')),
498 498
 				'require_nonce' => FALSE
499 499
 			),
500 500
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 					'label' => __('Edit Contact', 'event_espresso'),
504 504
 					'order' => 15,
505 505
 					'persistent' => FALSE,
506
-					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url
506
+					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID']), $this->_current_page_view_url) : $this->_admin_base_url
507 507
 				),
508 508
 				'metaboxes' => array('attendee_editor_metaboxes'),
509 509
 				'require_nonce' => FALSE
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 						'filename' => 'registrations_contact_list_other'
534 534
 					)
535 535
                 ),
536
-				'help_tour' => array( 'Contact_List_Help_Tour' ),
536
+				'help_tour' => array('Contact_List_Help_Tour'),
537 537
 				'metaboxes' => array(),
538 538
 				'require_nonce' => FALSE
539 539
 			),
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 	protected function _add_screen_options() {}
553 553
 	protected function _add_feature_pointers() {}
554 554
 	public function admin_init() {
555
-		EE_Registry::$i18n_js_strings[ 'update_att_qstns' ] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' );
555
+		EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso');
556 556
 	}
557 557
 	public function admin_notices() {}
558 558
 	public function admin_footer_scripts() {}
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 	*		@return void
571 571
 	*/
572 572
 	private function _get_registration_status_array() {
573
-		self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE);
573
+		self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE);
574 574
 	}
575 575
 
576 576
 
@@ -593,11 +593,11 @@  discard block
 block discarded – undo
593 593
 	public function load_scripts_styles() {
594 594
 		//style
595 595
 		//wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION );
596
-		wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
596
+		wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
597 597
 		wp_enqueue_style('espresso_reg');
598 598
 
599 599
 		//script
600
-		wp_register_script('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
600
+		wp_register_script('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
601 601
 		wp_enqueue_script('espresso_reg');
602 602
 	}
603 603
 
@@ -606,9 +606,9 @@  discard block
 block discarded – undo
606 606
 	public function load_scripts_styles_edit_attendee() {
607 607
 		//stuff to only show up on our attendee edit details page.
608 608
 		$attendee_details_translations = array(
609
-			'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') )
609
+			'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created'))
610 610
 			);
611
-		wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations );
611
+		wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations);
612 612
 		wp_enqueue_script('jquery-validate');
613 613
 	}
614 614
 
@@ -617,8 +617,8 @@  discard block
 block discarded – undo
617 617
 		//styles
618 618
 		wp_enqueue_style('espresso-ui-theme');
619 619
 		//scripts
620
-		$this->_get_reg_custom_questions_form( $this->_registration->ID() );
621
-		$this->_reg_custom_questions_form->wp_enqueue_scripts( true );
620
+		$this->_get_reg_custom_questions_form($this->_registration->ID());
621
+		$this->_reg_custom_questions_form->wp_enqueue_scripts(true);
622 622
 	}
623 623
 
624 624
 
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 
629 629
 	public function load_scripts_styles_contact_list() {
630 630
 		wp_deregister_style('espresso_reg');
631
-		wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
631
+		wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
632 632
 		wp_enqueue_style('espresso_att');
633 633
 	}
634 634
 
@@ -637,9 +637,9 @@  discard block
 block discarded – undo
637 637
 
638 638
 
639 639
 	public function load_scripts_styles_new_registration() {
640
-		wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE );
640
+		wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE);
641 641
 		wp_enqueue_script('ee-spco-for-admin');
642
-		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
642
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
643 643
 		EE_Form_Section_Proper::wp_enqueue_scripts();
644 644
 		EED_Ticket_Selector::load_tckt_slctr_assets();
645 645
 		EE_Datepicker_Input::enqueue_styles_and_scripts();
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 		//for notification related bulk actions we need to make sure only active messengers have an option.
667 667
 		EED_Messages::set_autoloaders();
668 668
 		/** @type EE_Message_Resource_Manager $message_resource_manager */
669
-		$message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
669
+		$message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
670 670
 		$active_mts = $message_resource_manager->list_of_active_message_types();
671 671
 		//key= bulk_action_slug, value= message type.
672 672
 		$match_array = array(
@@ -679,23 +679,23 @@  discard block
 block discarded – undo
679 679
 
680 680
 		/** setup reg status bulk actions **/
681 681
 		$def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso');
682
-		if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
682
+		if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
683 683
 			$def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso');
684 684
 		}
685 685
 		$def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso');
686
-		if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
686
+		if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
687 687
 			$def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso');
688 688
 		}
689 689
 		$def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso');
690
-		if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
690
+		if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
691 691
 			$def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso');
692 692
 		}
693 693
 		$def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso');
694
-		if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
694
+		if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
695 695
 			$def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso');
696 696
 		}
697 697
 		$def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso');
698
-		if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
698
+		if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
699 699
 			$def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso');
700 700
 		}
701 701
 
@@ -704,29 +704,29 @@  discard block
 block discarded – undo
704 704
 				'slug' => 'all',
705 705
 				'label' => __('View All Registrations', 'event_espresso'),
706 706
 				'count' => 0,
707
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
707
+				'bulk_action' => array_merge($def_reg_status_actions, array(
708 708
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
709
-					) )
709
+					))
710 710
 				),
711 711
 			'month' => array(
712 712
 				'slug' => 'month',
713 713
 				'label' => __('This Month', 'event_espresso'),
714 714
 				'count' => 0,
715
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
715
+				'bulk_action' => array_merge($def_reg_status_actions, array(
716 716
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
717 717
 					))
718 718
 				),
719 719
 			'today' => array(
720 720
 				'slug' => 'today',
721
-				'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp' ) ) ),
721
+				'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp'))),
722 722
 				'count' => 0,
723
-				'bulk_action' => array_merge( $def_reg_status_actions,  array(
723
+				'bulk_action' => array_merge($def_reg_status_actions, array(
724 724
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
725 725
 					))
726 726
 				)
727 727
 			);
728 728
 
729
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) {
729
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) {
730 730
 			$this->_views['incomplete'] = array(
731 731
 				'slug' => 'incomplete',
732 732
 				'label' => __('Incomplete', 'event_espresso'),
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 				)
763 763
 			);
764 764
 
765
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) {
765
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) {
766 766
 			$this->_views['trash'] = array(
767 767
 				'slug' => 'trash',
768 768
 				'label' => __('Trash', 'event_espresso'),
@@ -801,18 +801,18 @@  discard block
 block discarded – undo
801 801
 				'desc' => __('View Transaction Invoice', 'event_espresso')
802 802
 				),
803 803
  			);
804
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
804
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
805 805
 			$fc_items['resend_registration'] = array(
806 806
 				'class' => 'dashicons dashicons-email-alt',
807 807
 				'desc' => __('Resend Registration Details', 'event_espresso')
808 808
 				);
809 809
 		} else {
810
-			$fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' );
810
+			$fc_items['blank'] = array('class' => 'blank', 'desc' => '');
811 811
 		}
812 812
 
813
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_messages', 'view_filtered_messages' ) ) {
814
-			$related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' );
815
-			if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) {
813
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_messages', 'view_filtered_messages')) {
814
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
815
+			if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) {
816 816
 				$fc_items['view_related_messages'] = array(
817 817
 					'class' => $related_for_icon['css_class'],
818 818
 					'desc' => $related_for_icon['label'],
@@ -822,31 +822,31 @@  discard block
 block discarded – undo
822 822
 
823 823
 		$sc_items = array(
824 824
 			'approved_status' => array(
825
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
826
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
825
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved,
826
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')
827 827
 				),
828 828
 			'pending_status' => array(
829
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
830
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' )
829
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment,
830
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence')
831 831
 				),
832 832
 			'incomplete_status' => array(
833
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete,
834
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' )
833
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete,
834
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence')
835 835
 			),
836 836
 			'not_approved' => array(
837
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
838
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' )
837
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved,
838
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')
839 839
 				),
840 840
 			'declined_status' => array(
841
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
842
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
841
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined,
842
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence')
843 843
 				),
844 844
 			'cancelled_status' => array(
845
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
846
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
845
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled,
846
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence')
847 847
 				)
848 848
 			);
849
-		return array_merge( $fc_items, $sc_items );
849
+		return array_merge($fc_items, $sc_items);
850 850
 	}
851 851
 
852 852
 
@@ -859,15 +859,15 @@  discard block
 block discarded – undo
859 859
 
860 860
 
861 861
 	protected function _registrations_overview_list_table() {
862
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
863
-		if ( $EVT_ID ) {
864
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID ) ) {
865
-				$this->_admin_page_title .= $this->get_action_link_or_button( 'new_registration', 'add-registrant', array( 'event_id' => $EVT_ID ), 'add-new-h2' );
862
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
863
+		if ($EVT_ID) {
864
+			if (EE_Registry::instance()->CAP->current_user_can('ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID)) {
865
+				$this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $EVT_ID), 'add-new-h2');
866 866
 			}
867
-			$event = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
868
-			$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( __('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce( array('action' => 'edit', 'post' => $event->ID() ), EVENTS_ADMIN_URL ) . '">' . $event->get('EVT_name') . '</a>', '</h2>' ) : '';
867
+			$event = EEM_Event::instance()->get_one_by_ID($EVT_ID);
868
+			$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(__('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'">'.$event->get('EVT_name').'</a>', '</h2>') : '';
869 869
 		}
870
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() );
870
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items());
871 871
 		$this->display_admin_list_table_page_with_no_sidebar();
872 872
 	}
873 873
 
@@ -882,19 +882,19 @@  discard block
 block discarded – undo
882 882
 	 */
883 883
 	private function _set_registration_object() {
884 884
 		//get out if we've already set the object
885
-		if ( is_object( $this->_registration )) {
885
+		if (is_object($this->_registration)) {
886 886
 			return TRUE;
887 887
 		}
888 888
 
889 889
 	    $REG = EEM_Registration::instance();
890 890
 
891
-		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
891
+		$REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE;
892 892
 
893
-		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID ))
893
+		if ($this->_registration = $REG->get_one_by_ID($REG_ID))
894 894
 			return TRUE;
895 895
 		else {
896
-			$error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID );
897
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
896
+			$error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID);
897
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
898 898
 			$this->_registration = NULL;
899 899
 			return FALSE;
900 900
 		}
@@ -912,24 +912,24 @@  discard block
 block discarded – undo
912 912
 	 * @throws \EE_Error
913 913
 	 * @return mixed (int|array)  int = count || array of registration objects
914 914
 	 */
915
-	public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) {
916
-		$EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE;
917
-		$CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE;
918
-		$reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE;
919
-		$month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april
920
-		$today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'today' ? TRUE : FALSE;
921
-		$this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'month' ? TRUE  : FALSE;
915
+	public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) {
916
+		$EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE;
917
+		$CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE;
918
+		$reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE;
919
+		$month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april
920
+		$today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'today' ? TRUE : FALSE;
921
+		$this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'month' ? TRUE : FALSE;
922 922
 		$start_date = FALSE;
923 923
 		$end_date = FALSE;
924 924
 		$_where = array();
925
-		$trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE;
926
-		$incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE;
925
+		$trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE;
926
+		$incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE;
927 927
 
928 928
 		//set orderby
929 929
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
930 930
 
931 931
 
932
-		switch ( $this->_req_data['orderby'] ) {
932
+		switch ($this->_req_data['orderby']) {
933 933
 			case '_REG_ID':
934 934
 				$orderby = 'REG_ID';
935 935
 				break;
@@ -949,26 +949,26 @@  discard block
 block discarded – undo
949 949
 				$orderby = 'REG_date';
950 950
 		}
951 951
 
952
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
953
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
954
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
952
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
953
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
954
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
955 955
 
956 956
 
957
-		$offset = ($current_page-1)*$per_page;
958
-		$limit = $count  ? NULL : array( $offset, $per_page );
957
+		$offset = ($current_page - 1) * $per_page;
958
+		$limit = $count ? NULL : array($offset, $per_page);
959 959
 
960
-		if($EVT_ID){
961
-			$_where['EVT_ID']=$EVT_ID;
960
+		if ($EVT_ID) {
961
+			$_where['EVT_ID'] = $EVT_ID;
962 962
 		}
963
-		if($CAT_ID){
963
+		if ($CAT_ID) {
964 964
 			$_where['Event.Term_Taxonomy.term_id'] = $CAT_ID;
965 965
 		}
966
-		if ( $incomplete ) {
966
+		if ($incomplete) {
967 967
 			$_where['STS_ID'] = EEM_Registration::status_id_incomplete;
968 968
 		} else if ( ! $trash) {
969
-			$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
969
+			$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
970 970
 		}
971
-		if($reg_status){
971
+		if ($reg_status) {
972 972
 			$_where['STS_ID'] = $reg_status;
973 973
 		}
974 974
 
@@ -980,105 +980,105 @@  discard block
 block discarded – undo
980 980
 		$time_start = ' 00:00:00';
981 981
 		$time_end = ' 23:59:59';
982 982
 
983
-		if($today_a || $today ){
983
+		if ($today_a || $today) {
984 984
 			$curdate = date('Y-m-d', current_time('timestamp'));
985
-			$_where['REG_date']= array('BETWEEN',
985
+			$_where['REG_date'] = array('BETWEEN',
986 986
 				array(
987
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ),
988
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ),
987
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_start, 'Y-m-d H:i:s'),
988
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_end, 'Y-m-d H:i:s'),
989 989
 			));
990
-		}elseif($this_month_a || $this_month){
990
+		}elseif ($this_month_a || $this_month) {
991 991
 			$this_month_r = date('m', current_time('timestamp'));
992
-			$days_this_month = date( 't', current_time('timestamp') );
993
-			$_where['REG_date']= array('BETWEEN',
992
+			$days_this_month = date('t', current_time('timestamp'));
993
+			$_where['REG_date'] = array('BETWEEN',
994 994
 				array(
995
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ),
996
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' )
995
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'),
996
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s')
997 997
 			));
998
-		}elseif($month_range){
998
+		}elseif ($month_range) {
999 999
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1000
-			$month_r = !empty($pieces[0]) ? date('m', strtotime( $month_range ) ) : '';
1001
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
1002
-			$days_in_month = date('t', strtotime($year_r .  '-' . $month_r . '-' . '01') );
1003
-			$_where['REG_date']= array('BETWEEN',
1004
-				array(  EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month .  ' 23:59:59', 'Y-m-d H:i:s' ) ) );
1005
-		}elseif($start_date && $end_date){
1000
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($month_range)) : '';
1001
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1002
+			$days_in_month = date('t', strtotime($year_r.'-'.$month_r.'-'.'01'));
1003
+			$_where['REG_date'] = array('BETWEEN',
1004
+				array(EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-'.$days_in_month.' 23:59:59', 'Y-m-d H:i:s')));
1005
+		}elseif ($start_date && $end_date) {
1006 1006
 			throw new EE_Error("not yet supported");
1007
-		}elseif($start_date){
1007
+		}elseif ($start_date) {
1008 1008
 			throw new EE_Error("not yet supported");
1009
-		}elseif($end_date){
1009
+		}elseif ($end_date) {
1010 1010
 			throw new EE_Error("not yet supported");
1011 1011
 		}
1012 1012
 
1013
-		if ( ! empty( $this->_req_data['s'] ) ) {
1014
-			$sstr = '%' . $this->_req_data['s'] . '%';
1013
+		if ( ! empty($this->_req_data['s'])) {
1014
+			$sstr = '%'.$this->_req_data['s'].'%';
1015 1015
 			$_where['OR'] = array(
1016
-				'Event.EVT_name' => array( 'LIKE', $sstr),
1017
-				'Event.EVT_desc' => array( 'LIKE', $sstr ),
1018
-				'Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
1019
-				'Attendee.ATT_full_name' => array( 'LIKE', $sstr ),
1020
-				'Attendee.ATT_fname' => array( 'LIKE', $sstr ),
1021
-				'Attendee.ATT_lname' => array( 'LIKE', $sstr ),
1022
-				'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ),
1023
-				'Attendee.ATT_email' => array('LIKE', $sstr ),
1024
-				'Attendee.ATT_address' => array( 'LIKE', $sstr ),
1025
-				'Attendee.ATT_address2' => array( 'LIKE', $sstr ),
1026
-				'Attendee.ATT_city' => array( 'LIKE', $sstr ),
1027
-				'REG_final_price' => array( 'LIKE', $sstr ),
1028
-				'REG_code' => array( 'LIKE', $sstr ),
1029
-				'REG_count' => array( 'LIKE' , $sstr ),
1030
-				'REG_group_size' => array( 'LIKE' , $sstr ),
1031
-				'Ticket.TKT_name' => array( 'LIKE', $sstr ),
1032
-				'Ticket.TKT_description' => array( 'LIKE', $sstr ),
1033
-				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $sstr )
1016
+				'Event.EVT_name' => array('LIKE', $sstr),
1017
+				'Event.EVT_desc' => array('LIKE', $sstr),
1018
+				'Event.EVT_short_desc' => array('LIKE', $sstr),
1019
+				'Attendee.ATT_full_name' => array('LIKE', $sstr),
1020
+				'Attendee.ATT_fname' => array('LIKE', $sstr),
1021
+				'Attendee.ATT_lname' => array('LIKE', $sstr),
1022
+				'Attendee.ATT_short_bio' => array('LIKE', $sstr),
1023
+				'Attendee.ATT_email' => array('LIKE', $sstr),
1024
+				'Attendee.ATT_address' => array('LIKE', $sstr),
1025
+				'Attendee.ATT_address2' => array('LIKE', $sstr),
1026
+				'Attendee.ATT_city' => array('LIKE', $sstr),
1027
+				'REG_final_price' => array('LIKE', $sstr),
1028
+				'REG_code' => array('LIKE', $sstr),
1029
+				'REG_count' => array('LIKE', $sstr),
1030
+				'REG_group_size' => array('LIKE', $sstr),
1031
+				'Ticket.TKT_name' => array('LIKE', $sstr),
1032
+				'Ticket.TKT_description' => array('LIKE', $sstr),
1033
+				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $sstr)
1034 1034
 				);
1035 1035
 		}
1036 1036
 
1037 1037
 		//capability checks
1038
-		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) {
1038
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) {
1039 1039
 			$_where['AND'] = array(
1040 1040
 				'Event.EVT_wp_user' => get_current_user_id()
1041 1041
 				);
1042 1042
 		}
1043 1043
 
1044 1044
 
1045
-		if( $count ){
1046
-			if ( $trash ) {
1047
-				return EEM_Registration::instance()->count_deleted( array( $_where ));
1048
-			} else if ( $incomplete ) {
1049
-				return EEM_Registration::instance()->count( array( $_where ));
1045
+		if ($count) {
1046
+			if ($trash) {
1047
+				return EEM_Registration::instance()->count_deleted(array($_where));
1048
+			} else if ($incomplete) {
1049
+				return EEM_Registration::instance()->count(array($_where));
1050 1050
 			} else {
1051
-				return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' ));
1051
+				return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only'));
1052 1052
 			}
1053 1053
 		} else {
1054 1054
 			//make sure we remove default where conditions cause all registrations matching query are returned
1055
-			$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' );
1056
-			if ( $per_page !== -1 ) {
1055
+			$query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only');
1056
+			if ($per_page !== -1) {
1057 1057
 				$query_params['limit'] = $limit;
1058 1058
 			}
1059
-			$registrations =  $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1059
+			$registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1060 1060
 
1061 1061
 
1062
-			if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration &&  $registrations[0]->event_obj()) {
1062
+			if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) {
1063 1063
 				$first_registration = $registrations[0];
1064 1064
 				//EEH_Debug_Tools::printr( $registrations[0], '$registrations  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
1065 1065
 				$event_name = $first_registration->event_obj()->name();
1066
-				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1066
+				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a'); // isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1067 1067
 				// edit event link
1068
-				if ( $event_name != '' ) {
1069
-					$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL );
1070
-					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
1071
-					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
1068
+				if ($event_name != '') {
1069
+					$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL);
1070
+					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>';
1071
+					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
1072 1072
 				}
1073 1073
 
1074
-				$back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL );
1075
-				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">&laquo; ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>';
1074
+				$back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL);
1075
+				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">&laquo; '.__('Back to All Registrations', 'event_espresso').'</a>';
1076 1076
 
1077 1077
 				$this->_template_args['before_admin_page_content'] = '
1078 1078
 			<div id="admin-page-header">
1079
-				<h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1>
1080
-				<h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3>
1081
-				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span>
1079
+				<h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1>
1080
+				<h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3>
1081
+				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span>
1082 1082
 			</div>
1083 1083
 			';
1084 1084
 
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
 
1117 1117
 		$this->_set_registration_object();
1118 1118
 
1119
-		if ( is_object( $this->_registration )) {
1119
+		if (is_object($this->_registration)) {
1120 1120
 			$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1121 1121
 			$this->_session = $transaction->session_data();
1122 1122
 
@@ -1124,10 +1124,10 @@  discard block
 block discarded – undo
1124 1124
 
1125 1125
 
1126 1126
 			$this->_template_args['reg_nmbr']['value'] = $this->_registration->ID();
1127
-			$this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' );
1127
+			$this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso');
1128 1128
 
1129
-			$this->_template_args['reg_datetime']['value'] =  $this->_registration->get_i18n_datetime( 'REG_date' );
1130
-			$this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' );
1129
+			$this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime('REG_date');
1130
+			$this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso');
1131 1131
 
1132 1132
 			$this->_template_args['grand_total'] = $transaction->total();
1133 1133
 
@@ -1135,19 +1135,19 @@  discard block
 block discarded – undo
1135 1135
 			// link back to overview
1136 1136
 			$this->_template_args['reg_overview_url'] = REG_ADMIN_URL;
1137 1137
 			$this->_template_args['registration'] = $this->_registration;
1138
-			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $event_id ), REG_ADMIN_URL );
1139
-			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions' ), admin_url( 'admin.php' ) );
1140
-			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id ), admin_url( 'admin.php' ) );
1138
+			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL);
1139
+			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php'));
1140
+			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php'));
1141 1141
 
1142 1142
 			//next and previous links
1143
-			$next_reg = $this->_registration->next(null, array(), 'REG_ID' );
1144
-			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : '';
1145
-			$previous_reg = $this->_registration->previous( null, array(), 'REG_ID' );
1146
-			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : '';
1143
+			$next_reg = $this->_registration->next(null, array(), 'REG_ID');
1144
+			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : '';
1145
+			$previous_reg = $this->_registration->previous(null, array(), 'REG_ID');
1146
+			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : '';
1147 1147
 
1148 1148
 			// grab header
1149
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php';
1150
-			$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1149
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php';
1150
+			$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1151 1151
 
1152 1152
 		} else {
1153 1153
 
@@ -1166,17 +1166,17 @@  discard block
 block discarded – undo
1166 1166
 
1167 1167
 
1168 1168
 	protected function _registration_details_metaboxes() {
1169
-		do_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this );
1169
+		do_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this);
1170 1170
 		$this->_set_registration_object();
1171 1171
 		$attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null;
1172
-		add_meta_box( 'edit-reg-status-mbox', __( 'Registration Status', 'event_espresso' ), array( $this, 'set_reg_status_buttons_metabox' ), $this->wp_page_slug, 'normal', 'high' );
1173
-		add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1174
-		if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) {
1175
-			add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1172
+		add_meta_box('edit-reg-status-mbox', __('Registration Status', 'event_espresso'), array($this, 'set_reg_status_buttons_metabox'), $this->wp_page_slug, 'normal', 'high');
1173
+		add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
1174
+		if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) {
1175
+			add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high');
1176 1176
 		}
1177
-		add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' );
1178
-		if ( $this->_registration->group_size() > 1 ) {
1179
-			add_meta_box( 'edit-reg-attendees-mbox', __( 'Other Registrations in this Transaction', 'event_espresso' ), array( $this, '_reg_attendees_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1177
+		add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high');
1178
+		if ($this->_registration->group_size() > 1) {
1179
+			add_meta_box('edit-reg-attendees-mbox', __('Other Registrations in this Transaction', 'event_espresso'), array($this, '_reg_attendees_meta_box'), $this->wp_page_slug, 'normal', 'high');
1180 1180
 		}
1181 1181
 	}
1182 1182
 
@@ -1197,23 +1197,23 @@  discard block
 block discarded – undo
1197 1197
 
1198 1198
 		//let's get an array of all possible buttons that we can just reference
1199 1199
 		$status_buttons = $this->_get_reg_status_buttons();
1200
-		$template_args[ 'reg_status_value' ] = $this->_registration->pretty_status();
1201
-		$template_args[ 'reg_status_class' ] = 'status-' . $this->_registration->status_ID();
1200
+		$template_args['reg_status_value'] = $this->_registration->pretty_status();
1201
+		$template_args['reg_status_class'] = 'status-'.$this->_registration->status_ID();
1202 1202
 		$template_args['attendee'] = $this->_registration->attendee();
1203
-		$template = REG_TEMPLATE_PATH . 'reg_status_change_buttons.template.php';
1204
-		if ( $this->_set_registration_object() ) {
1203
+		$template = REG_TEMPLATE_PATH.'reg_status_change_buttons.template.php';
1204
+		if ($this->_set_registration_object()) {
1205 1205
 			$current_status = $this->_registration->status_ID();
1206
-			unset( $status_buttons[$current_status] );
1207
-			if ( $current_status != EEM_Registration::status_id_pending_payment && $is_complete ) {
1208
-				unset( $status_buttons[EEM_Registration::status_id_pending_payment] );
1206
+			unset($status_buttons[$current_status]);
1207
+			if ($current_status != EEM_Registration::status_id_pending_payment && $is_complete) {
1208
+				unset($status_buttons[EEM_Registration::status_id_pending_payment]);
1209 1209
 			}
1210
-			$template_args['status_buttons'] = implode( "\n", $status_buttons );
1210
+			$template_args['status_buttons'] = implode("\n", $status_buttons);
1211 1211
 		}
1212 1212
 		$template_args['form_url'] = REG_ADMIN_URL;
1213 1213
 		$template_args['REG_ID'] = $this->_registration->ID();
1214
-		$template_args['nonce'] = wp_nonce_field( 'change_reg_status_nonce',  'change_reg_status_nonce', FALSE, FALSE );
1214
+		$template_args['nonce'] = wp_nonce_field('change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE);
1215 1215
 
1216
-		EEH_Template::display_template( $template, $template_args );
1216
+		EEH_Template::display_template($template, $template_args);
1217 1217
 
1218 1218
 	}
1219 1219
 
@@ -1227,11 +1227,11 @@  discard block
 block discarded – undo
1227 1227
 	private function _get_reg_status_buttons() {
1228 1228
 
1229 1229
 		$buttons = array(
1230
-			EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) . '">',
1231
-			EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_pending_payment . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) . '">',
1232
-			EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_not_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) . '">',
1233
-			EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_declined . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) . '">',
1234
-			EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_cancelled . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) . '">',
1230
+			EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence').'">',
1231
+			EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_pending_payment.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence').'">',
1232
+			EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_not_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence').'">',
1233
+			EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_declined.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence').'">',
1234
+			EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_cancelled.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence').'">',
1235 1235
 			);
1236 1236
 		return $buttons;
1237 1237
 	}
@@ -1245,13 +1245,13 @@  discard block
 block discarded – undo
1245 1245
 	 *
1246 1246
 	 * @return array  (array with reg_id(s) updated and whether update was successful.
1247 1247
 	 */
1248
-	protected function _set_registration_status_from_request( $status = false, $notify = false ) {
1249
-		$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? (array) $this->_req_data['_REG_ID'] : array();
1248
+	protected function _set_registration_status_from_request($status = false, $notify = false) {
1249
+		$REG_ID = isset($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array();
1250 1250
 
1251
-		$success = $this->_set_registration_status( $REG_ID, $status );
1251
+		$success = $this->_set_registration_status($REG_ID, $status);
1252 1252
 
1253 1253
 		//notify?
1254
-		if ( $success && $notify && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
1254
+		if ($success && $notify && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
1255 1255
 			$this->_process_resend_registration();
1256 1256
 		}
1257 1257
 
@@ -1269,19 +1269,19 @@  discard block
 block discarded – undo
1269 1269
 	 * @param bool $status
1270 1270
 	 * @return array (an array with 'success' key representing whether status change was successful, and 'REG_ID' as the array of updated registrations).
1271 1271
 	 */
1272
-	protected function _set_registration_status( $REG_ID, $status = false ) {
1272
+	protected function _set_registration_status($REG_ID, $status = false) {
1273 1273
 		$success = true;
1274 1274
 		// set default status if none is passed
1275 1275
 		$status = $status ? $status : EEM_Registration::status_id_pending_payment;
1276 1276
 
1277 1277
 		//typecast and sanitize reg_id
1278
-		$reg_ids = array_filter( (array) $REG_ID, 'absint' );
1278
+		$reg_ids = array_filter((array) $REG_ID, 'absint');
1279 1279
 
1280 1280
 		//loop through REG_ID's and change status
1281
-		foreach ( $reg_ids as $r_id ) {
1282
-			$registration = EEM_Registration::instance()->get_one_by_ID( $r_id );
1283
-			if ( $registration instanceof EE_Registration ) {
1284
-				$registration->set_status( $status );
1281
+		foreach ($reg_ids as $r_id) {
1282
+			$registration = EEM_Registration::instance()->get_one_by_ID($r_id);
1283
+			if ($registration instanceof EE_Registration) {
1284
+				$registration->set_status($status);
1285 1285
 				$result = $registration->save();
1286 1286
 
1287 1287
 				//verifying explicit fails because update *may* just return 0 for 0 rows affected
@@ -1293,7 +1293,7 @@  discard block
 block discarded – undo
1293 1293
 		$this->_req_data['_REG_ID'] = $reg_ids;
1294 1294
 
1295 1295
 		//return $success and processed registrations
1296
-		return array( 'REG_ID' => $reg_ids, 'success' => $success );
1296
+		return array('REG_ID' => $reg_ids, 'success' => $success);
1297 1297
 	}
1298 1298
 
1299 1299
 
@@ -1305,37 +1305,37 @@  discard block
 block discarded – undo
1305 1305
 	 * @param   bool    $notify indicates whether the _set_registration_status_from_request does notifications or not.
1306 1306
 	 * @return void
1307 1307
 	 */
1308
-	protected function _reg_status_change_return( $STS_ID, $notify = false ) {
1308
+	protected function _reg_status_change_return($STS_ID, $notify = false) {
1309 1309
 
1310
-		$result = ! empty( $STS_ID ) ? $this->_set_registration_status_from_request( $STS_ID, $notify ) : array( 'success' => false );
1310
+		$result = ! empty($STS_ID) ? $this->_set_registration_status_from_request($STS_ID, $notify) : array('success' => false);
1311 1311
 
1312 1312
 
1313
-		$success = isset( $result['success'] ) && $result['success'];
1313
+		$success = isset($result['success']) && $result['success'];
1314 1314
 
1315 1315
 		//setup success message
1316
-		if ( $success ) {
1317
-			$msg = is_array( $result['REG_ID'] ) && count( $result['REG_ID'] ) > 1  ? sprintf( __('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) :  sprintf( __('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) ;
1318
-			EE_Error::add_success( $msg );
1316
+		if ($success) {
1317
+			$msg = is_array($result['REG_ID']) && count($result['REG_ID']) > 1 ? sprintf(__('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')) : sprintf(__('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower'));
1318
+			EE_Error::add_success($msg);
1319 1319
 		} else {
1320
-			EE_Error::add_error( __('Something went wrong, and the status was not changed', 'event_espresso' ), __FILE__, __LINE__, __FUNCTION__ );
1320
+			EE_Error::add_error(__('Something went wrong, and the status was not changed', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
1321 1321
 		}
1322 1322
 
1323
-		$route = isset( $this->_req_data['return'] ) && $this->_req_data['return'] == 'view_registration' ? array( 'action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0] ) : array( 'action' => 'default' );
1323
+		$route = isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration' ? array('action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0]) : array('action' => 'default');
1324 1324
 		//unset nonces
1325
-		foreach ( $this->_req_data as $ref => $value ) {
1326
-			if ( strpos( $ref, 'nonce' ) !== false ) {
1327
-				unset( $this->_req_data[$ref] );
1325
+		foreach ($this->_req_data as $ref => $value) {
1326
+			if (strpos($ref, 'nonce') !== false) {
1327
+				unset($this->_req_data[$ref]);
1328 1328
 				continue;
1329 1329
 			}
1330 1330
 
1331
-			$value = is_array( $value ) ? array_map( 'urlencode', $value ) : urlencode( $value );
1331
+			$value = is_array($value) ? array_map('urlencode', $value) : urlencode($value);
1332 1332
 			$this->_req_data[$ref] = $value;
1333 1333
 		}
1334 1334
 
1335 1335
 		//merge request vars so that the reloaded list table contains any existing filter query params
1336
-		$route = array_merge( $this->_req_data, $route );
1336
+		$route = array_merge($this->_req_data, $route);
1337 1337
 
1338
-		$this->_redirect_after_action( false, '', '', $route, true );
1338
+		$this->_redirect_after_action(false, '', '', $route, true);
1339 1339
 	}
1340 1340
 
1341 1341
 
@@ -1347,29 +1347,29 @@  discard block
 block discarded – undo
1347 1347
 	protected function _change_reg_status() {
1348 1348
 		$this->_req_data['return'] = 'view_registration';
1349 1349
 		//set notify based on whether the send notifications toggle is set or not
1350
-		$notify = ! empty( $this->_req_data['txn_reg_status_change']['send_notifications'] );
1351
-		$this->_req_data[ '_reg_status_id' ] = isset( $this->_req_data[ '_reg_status_id' ] ) ? $this->_req_data[ '_reg_status_id' ] : '';
1350
+		$notify = ! empty($this->_req_data['txn_reg_status_change']['send_notifications']);
1351
+		$this->_req_data['_reg_status_id'] = isset($this->_req_data['_reg_status_id']) ? $this->_req_data['_reg_status_id'] : '';
1352 1352
 
1353
-		switch ( $this->_req_data['_reg_status_id'] ) {
1354
-			case EEH_Template::pretty_status( EEM_Registration::status_id_approved, false, 'sentence' ) :
1355
-				$this->approve_registration( $notify );
1353
+		switch ($this->_req_data['_reg_status_id']) {
1354
+			case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence') :
1355
+				$this->approve_registration($notify);
1356 1356
 				break;
1357
-			case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, false, 'sentence' ) :
1358
-				$this->pending_registration( $notify );
1357
+			case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence') :
1358
+				$this->pending_registration($notify);
1359 1359
 				break;
1360
-			case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, false, 'sentence' ) :
1361
-				$this->not_approve_registration( $notify );
1360
+			case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence') :
1361
+				$this->not_approve_registration($notify);
1362 1362
 				break;
1363
-			case EEH_Template::pretty_status( EEM_Registration::status_id_declined, false, 'sentence' ) :
1364
-				$this->decline_registration( $notify );
1363
+			case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence') :
1364
+				$this->decline_registration($notify);
1365 1365
 				break;
1366
-			case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, false, 'sentence' ) :
1367
-				$this->cancel_registration( $notify );
1366
+			case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence') :
1367
+				$this->cancel_registration($notify);
1368 1368
 				break;
1369 1369
 			default :
1370 1370
 				$result['success'] = false;
1371
-				unset( $this->_req_data['return'] );
1372
-				$this->_reg_status_change_return( '', false );
1371
+				unset($this->_req_data['return']);
1372
+				$this->_reg_status_change_return('', false);
1373 1373
 				break;
1374 1374
 		}
1375 1375
 	}
@@ -1382,8 +1382,8 @@  discard block
 block discarded – undo
1382 1382
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1383 1383
 	*		@return void
1384 1384
 	*/
1385
-	protected function approve_registration( $notify = false ) {
1386
-		$this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify );
1385
+	protected function approve_registration($notify = false) {
1386
+		$this->_reg_status_change_return(EEM_Registration::status_id_approved, $notify);
1387 1387
 	}
1388 1388
 
1389 1389
 
@@ -1395,8 +1395,8 @@  discard block
 block discarded – undo
1395 1395
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1396 1396
 	*		@return void
1397 1397
 	*/
1398
-	protected function decline_registration( $notify = false ) {
1399
-		$this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify );
1398
+	protected function decline_registration($notify = false) {
1399
+		$this->_reg_status_change_return(EEM_Registration::status_id_declined, $notify);
1400 1400
 	}
1401 1401
 
1402 1402
 
@@ -1408,8 +1408,8 @@  discard block
 block discarded – undo
1408 1408
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1409 1409
 	*		@return void
1410 1410
 	*/
1411
-	protected function cancel_registration( $notify = false ) {
1412
-		$this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify );
1411
+	protected function cancel_registration($notify = false) {
1412
+		$this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $notify);
1413 1413
 	}
1414 1414
 
1415 1415
 
@@ -1422,8 +1422,8 @@  discard block
 block discarded – undo
1422 1422
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1423 1423
 	*		@return void
1424 1424
 	*/
1425
-	protected function not_approve_registration( $notify = false ) {
1426
-		$this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify );
1425
+	protected function not_approve_registration($notify = false) {
1426
+		$this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $notify);
1427 1427
 	}
1428 1428
 
1429 1429
 
@@ -1434,8 +1434,8 @@  discard block
 block discarded – undo
1434 1434
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1435 1435
 	*		@return void
1436 1436
 	*/
1437
-	protected function pending_registration( $notify = false ) {
1438
-		$this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify );
1437
+	protected function pending_registration($notify = false) {
1438
+		$this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $notify);
1439 1439
 	}
1440 1440
 
1441 1441
 
@@ -1449,75 +1449,75 @@  discard block
 block discarded – undo
1449 1449
 	public function _reg_details_meta_box() {
1450 1450
 		EEH_Autoloader::register_line_item_display_autoloaders();
1451 1451
 		EEH_Autoloader::register_line_item_filter_autoloaders();
1452
-		EE_Registry::instance()->load_Helper( 'Line_Item' );
1452
+		EE_Registry::instance()->load_Helper('Line_Item');
1453 1453
 		$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1454 1454
 		$this->_session = $transaction->session_data();
1455 1455
 
1456 1456
 		$filters = new EE_Line_Item_Filter_Collection();
1457
-		$filters->add( new EE_Single_Registration_Line_Item_Filter( $this->_registration ) );
1458
-		$filters->add( new EE_Non_Zero_Line_Item_Filter() );
1459
-		$line_item_filter_processor = new EE_Line_Item_Filter_Processor( $filters, $transaction->total_line_item() );
1457
+		$filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration));
1458
+		$filters->add(new EE_Non_Zero_Line_Item_Filter());
1459
+		$line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item());
1460 1460
 		$filtered_line_item_tree = $line_item_filter_processor->process();
1461 1461
 
1462 1462
 		$this->_template_args['REG_ID'] = $this->_registration->ID();
1463
-		$line_item_display = new EE_Line_Item_Display( 'reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy' );
1464
-		$this->_template_args['line_item_table'] = $line_item_display->display_line_item( $filtered_line_item_tree, array( 'EE_Registration' => $this->_registration ) );
1463
+		$line_item_display = new EE_Line_Item_Display('reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy');
1464
+		$this->_template_args['line_item_table'] = $line_item_display->display_line_item($filtered_line_item_tree, array('EE_Registration' => $this->_registration));
1465 1465
 
1466 1466
 
1467 1467
 		$attendee = $this->_registration->attendee();
1468 1468
 
1469 1469
 
1470
-		$this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID() ), TXN_ADMIN_URL ), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart' ) : '';
1471
-		$this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration' ), REG_ADMIN_URL ), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt' ) : '';
1470
+		$this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID()), TXN_ADMIN_URL), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart') : '';
1471
+		$this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration'), REG_ADMIN_URL), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt') : '';
1472 1472
 
1473 1473
 
1474 1474
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
1475
-		$payment = $transaction->get_first_related( 'Payment' );
1475
+		$payment = $transaction->get_first_related('Payment');
1476 1476
 		$payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment;
1477
-		$payment_method = $payment->get_first_related( 'Payment_Method' );
1477
+		$payment_method = $payment->get_first_related('Payment_Method');
1478 1478
 		$payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method;
1479
-		$reg_status_class = 'status-' . $this->_registration->status_ID();
1479
+		$reg_status_class = 'status-'.$this->_registration->status_ID();
1480 1480
 		$reg_details = array(
1481 1481
 			'payment_method' => $payment_method->name(),
1482 1482
 			'response_msg' => $payment->gateway_response(),
1483
-			'registration_id' => $this->_registration->get( 'REG_code' ),
1483
+			'registration_id' => $this->_registration->get('REG_code'),
1484 1484
 			'registration_session' => $this->_registration->session_ID(),
1485
-			'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '',
1486
-			'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '',
1485
+			'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '',
1486
+			'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '',
1487 1487
 			);
1488 1488
 
1489 1489
 
1490
-		if ( isset( $reg_details['registration_id'] )) {
1490
+		if (isset($reg_details['registration_id'])) {
1491 1491
 			$this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id'];
1492
-			$this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' );
1492
+			$this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso');
1493 1493
 			$this->_template_args['reg_details']['registration_id']['class'] = 'regular-text';
1494 1494
 		}
1495 1495
 
1496
-		if ( isset( $reg_details['payment_method'] ) ) {
1496
+		if (isset($reg_details['payment_method'])) {
1497 1497
 			$this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method'];
1498
-			$this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' );
1498
+			$this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso');
1499 1499
 			$this->_template_args['reg_details']['payment_method']['class'] = 'regular-text';
1500 1500
 			$this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg'];
1501
-			$this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' );
1501
+			$this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso');
1502 1502
 			$this->_template_args['reg_details']['response_msg']['class'] = 'regular-text';
1503 1503
 		}
1504 1504
 
1505 1505
 		$this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session'];
1506
-		$this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
1506
+		$this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
1507 1507
 		$this->_template_args['reg_details']['registration_session']['class'] = 'regular-text';
1508 1508
 
1509 1509
 		$this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address'];
1510
-		$this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' );
1510
+		$this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso');
1511 1511
 		$this->_template_args['reg_details']['ip_address']['class'] = 'regular-text';
1512 1512
 
1513 1513
 		$this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent'];
1514
-		$this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
1514
+		$this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
1515 1515
 		$this->_template_args['reg_details']['user_agent']['class'] = 'large-text';
1516 1516
 
1517
-		$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL );
1517
+		$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL);
1518 1518
 
1519
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php';
1520
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1519
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php';
1520
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1521 1521
 
1522 1522
 	}
1523 1523
 
@@ -1531,14 +1531,14 @@  discard block
 block discarded – undo
1531 1531
 	*/
1532 1532
 	public function _reg_questions_meta_box() {
1533 1533
 		//allow someone to override this method entirely
1534
-		if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) {
1535
-			$form = $this->_get_reg_custom_questions_form( $this->_registration->ID() );
1536
-			$this->_template_args[ 'att_questions' ] = count( $form->subforms() ) > 0 ? $form->get_html_and_js() : '';
1534
+		if (apply_filters('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration)) {
1535
+			$form = $this->_get_reg_custom_questions_form($this->_registration->ID());
1536
+			$this->_template_args['att_questions'] = count($form->subforms()) > 0 ? $form->get_html_and_js() : '';
1537 1537
 			$this->_template_args['reg_questions_form_action'] = 'edit_registration';
1538 1538
 			$this->_template_args['REG_ID'] = $this->_registration->ID();
1539 1539
 
1540
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php';
1541
-			echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1540
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php';
1541
+			echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1542 1542
 		}
1543 1543
 	}
1544 1544
 
@@ -1552,12 +1552,12 @@  discard block
 block discarded – undo
1552 1552
 	 * @param        string $output
1553 1553
 	 * @return        string
1554 1554
 	 */
1555
-	public function form_before_question_group( $output ) {
1555
+	public function form_before_question_group($output) {
1556 1556
 		EE_Error::doing_it_wrong(
1557
-			__CLASS__ . '::' . __FUNCTION__,
1558
-			__( 'This method would have been protected but was used on a filter callback'
1557
+			__CLASS__.'::'.__FUNCTION__,
1558
+			__('This method would have been protected but was used on a filter callback'
1559 1559
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1560
-				'event_espresso' ),
1560
+				'event_espresso'),
1561 1561
 			'4.8.32.rc.000'
1562 1562
 		);
1563 1563
 		return '
@@ -1576,20 +1576,20 @@  discard block
 block discarded – undo
1576 1576
 	 * @param        string $output
1577 1577
 	 * @return        string
1578 1578
 	 */
1579
-	public function form_after_question_group( $output ) {
1579
+	public function form_after_question_group($output) {
1580 1580
 		EE_Error::doing_it_wrong(
1581
-			__CLASS__ . '::' . __FUNCTION__,
1582
-			__( 'This method would have been protected but was used on a filter callback'
1581
+			__CLASS__.'::'.__FUNCTION__,
1582
+			__('This method would have been protected but was used on a filter callback'
1583 1583
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1584
-				'event_espresso' ),
1584
+				'event_espresso'),
1585 1585
 			'4.8.32.rc.000'
1586 1586
 		);
1587 1587
 		return  '
1588 1588
 			<tr class="hide-if-no-js">
1589 1589
 				<th> </th>
1590 1590
 				<td class="reg-admin-edit-attendee-question-td">
1591
-					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '">
1592
-						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span>
1591
+					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'">
1592
+						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span>
1593 1593
 						<div class="dashicons dashicons-edit"></div>
1594 1594
 					</a>
1595 1595
 				</td>
@@ -1609,18 +1609,18 @@  discard block
 block discarded – undo
1609 1609
 	 * @param        string $label
1610 1610
 	 * @return        string
1611 1611
 	 */
1612
-	public function form_form_field_label_wrap( $label ) {
1612
+	public function form_form_field_label_wrap($label) {
1613 1613
 		EE_Error::doing_it_wrong(
1614
-			__CLASS__ . '::' . __FUNCTION__,
1615
-			__( 'This method would have been protected but was used on a filter callback'
1614
+			__CLASS__.'::'.__FUNCTION__,
1615
+			__('This method would have been protected but was used on a filter callback'
1616 1616
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1617
-				'event_espresso' ),
1617
+				'event_espresso'),
1618 1618
 			'4.8.32.rc.000'
1619 1619
 		);
1620 1620
 		return '
1621 1621
 			<tr>
1622 1622
 				<th>
1623
-					' . $label  . '
1623
+					' . $label.'
1624 1624
 				</th>';
1625 1625
 	}
1626 1626
 
@@ -1634,17 +1634,17 @@  discard block
 block discarded – undo
1634 1634
 	 * @param        string $input
1635 1635
 	 * @return        string
1636 1636
 	 */
1637
-	public function form_form_field_input__wrap( $input ) {
1637
+	public function form_form_field_input__wrap($input) {
1638 1638
 		EE_Error::doing_it_wrong(
1639
-			__CLASS__ . '::' . __FUNCTION__,
1640
-			__( 'This method would have been protected but was used on a filter callback'
1639
+			__CLASS__.'::'.__FUNCTION__,
1640
+			__('This method would have been protected but was used on a filter callback'
1641 1641
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1642
-				'event_espresso' ),
1642
+				'event_espresso'),
1643 1643
 			'4.8.32.rc.000'
1644 1644
 		);
1645 1645
 		return '
1646 1646
 				<td class="reg-admin-attendee-questions-input-td disabled-input">
1647
-					' . $input . '
1647
+					' . $input.'
1648 1648
 				</td>
1649 1649
 			</tr>';
1650 1650
 	}
@@ -1658,14 +1658,14 @@  discard block
 block discarded – undo
1658 1658
 	 * @return void
1659 1659
 	 */
1660 1660
 	protected function _update_attendee_registration_form() {
1661
-		do_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this );
1662
-		if( $_SERVER['REQUEST_METHOD'] == 'POST'){
1663
-			$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
1664
-			$success = $this->_save_reg_custom_questions_form( $REG_ID );
1665
-			if( $success ) {
1661
+		do_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this);
1662
+		if ($_SERVER['REQUEST_METHOD'] == 'POST') {
1663
+			$REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE;
1664
+			$success = $this->_save_reg_custom_questions_form($REG_ID);
1665
+			if ($success) {
1666 1666
 				$what = __('Registration Form', 'event_espresso');
1667
-				$route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' );
1668
-				$this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route );
1667
+				$route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default');
1668
+				$this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route);
1669 1669
 			}
1670 1670
 		}
1671 1671
 	}
@@ -1676,11 +1676,11 @@  discard block
 block discarded – undo
1676 1676
 	 * @param int $REG_ID
1677 1677
 	 * @return EE_Registration_Custom_Questions_Form
1678 1678
 	 */
1679
-	protected function _get_reg_custom_questions_form( $REG_ID ) {
1680
-		if( ! $this->_reg_custom_questions_form ) {
1681
-			require_once( REG_ADMIN . 'form_sections' . DS . 'EE_Registration_Custom_Questions_Form.form.php' );
1682
-			$this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form( EEM_Registration::instance()->get_one_by_ID( $REG_ID ) );
1683
-			$this->_reg_custom_questions_form->_construct_finalize( null, null );
1679
+	protected function _get_reg_custom_questions_form($REG_ID) {
1680
+		if ( ! $this->_reg_custom_questions_form) {
1681
+			require_once(REG_ADMIN.'form_sections'.DS.'EE_Registration_Custom_Questions_Form.form.php');
1682
+			$this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form(EEM_Registration::instance()->get_one_by_ID($REG_ID));
1683
+			$this->_reg_custom_questions_form->_construct_finalize(null, null);
1684 1684
 		}
1685 1685
 		return $this->_reg_custom_questions_form;
1686 1686
 	}
@@ -1693,17 +1693,17 @@  discard block
 block discarded – undo
1693 1693
 	 * @param bool $REG_ID
1694 1694
 	 * @return bool
1695 1695
 	 */
1696
-	private function _save_reg_custom_questions_form( $REG_ID = FALSE ) {
1696
+	private function _save_reg_custom_questions_form($REG_ID = FALSE) {
1697 1697
 
1698 1698
 		if ( ! $REG_ID) {
1699
-			EE_Error::add_error( __('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1699
+			EE_Error::add_error(__('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1700 1700
 		}
1701
-		$form = $this->_get_reg_custom_questions_form( $REG_ID );
1702
-		$form->receive_form_submission( $this->_req_data );
1701
+		$form = $this->_get_reg_custom_questions_form($REG_ID);
1702
+		$form->receive_form_submission($this->_req_data);
1703 1703
 		$success = false;
1704
-		if( $form->is_valid() ) {
1705
-			foreach( $form->subforms() as $question_group_id => $question_group_form ) {
1706
-				foreach( $question_group_form->inputs() as $question_id => $input ) {
1704
+		if ($form->is_valid()) {
1705
+			foreach ($form->subforms() as $question_group_id => $question_group_form) {
1706
+				foreach ($question_group_form->inputs() as $question_id => $input) {
1707 1707
 					$where_conditions = array(
1708 1708
 							'QST_ID' => $question_id,
1709 1709
 							'REG_ID' => $REG_ID
@@ -1711,19 +1711,19 @@  discard block
 block discarded – undo
1711 1711
 					$possibly_new_values = array(
1712 1712
 							'ANS_value' => $input->normalized_value()
1713 1713
 						);
1714
-					$answer = EEM_Answer::instance()->get_one( array( $where_conditions ) );
1715
-					if( $answer instanceof EE_Answer ) {
1716
-						$success = $answer->save( $possibly_new_values );
1714
+					$answer = EEM_Answer::instance()->get_one(array($where_conditions));
1715
+					if ($answer instanceof EE_Answer) {
1716
+						$success = $answer->save($possibly_new_values);
1717 1717
 					} else {
1718 1718
 						//insert it then
1719
-						$cols_n_vals = array_merge( $where_conditions, $possibly_new_values );
1720
-						$answer = EE_Answer::new_instance( $cols_n_vals );
1719
+						$cols_n_vals = array_merge($where_conditions, $possibly_new_values);
1720
+						$answer = EE_Answer::new_instance($cols_n_vals);
1721 1721
 						$success = $answer->save();
1722 1722
 					}
1723 1723
 				}
1724 1724
 			}
1725 1725
 		} else {
1726
-			EE_Error::add_error( $form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__ );
1726
+			EE_Error::add_error($form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__);
1727 1727
 		}
1728 1728
 		return $success;
1729 1729
 	}
@@ -1741,29 +1741,29 @@  discard block
 block discarded – undo
1741 1741
 		$registrations = $REG->get_all(array(
1742 1742
 			array(
1743 1743
 				'TXN_ID'=>$this->_registration->transaction_ID(),
1744
-				'REG_ID'=>array('!=',$this->_registration->ID())
1744
+				'REG_ID'=>array('!=', $this->_registration->ID())
1745 1745
 			),
1746 1746
 			'force_join'=>array('Attendee')));
1747 1747
 
1748 1748
 		$this->_template_args['attendees'] = array();
1749 1749
 		$this->_template_args['attendee_notice'] = '';
1750
-		if ( empty( $registrations)  || ( is_array($registrations) &&  ! EEH_Array::get_one_item_from_array($registrations) ) ) {
1751
-			EE_Error::add_error( __('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1750
+		if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) {
1751
+			EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1752 1752
 			$this->_template_args['attendee_notice'] = EE_Error::get_notices();
1753 1753
 		} else {
1754 1754
 
1755 1755
 			$att_nmbr = 1;
1756
-			foreach ( $registrations as $registration ) {
1756
+			foreach ($registrations as $registration) {
1757 1757
 				/* @var $registration EE_Registration */
1758 1758
 				$attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object();
1759
-				$this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1760
-				$this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1761
-				$this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1762
-				$this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->final_price();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1759
+				$this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1760
+				$this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1761
+				$this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1762
+				$this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->final_price(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1763 1763
 
1764
-				$this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() );
1764
+				$this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array());
1765 1765
 
1766
-				$this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1766
+				$this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1767 1767
 
1768 1768
 				$att_nmbr++;
1769 1769
 			}
@@ -1775,8 +1775,8 @@  discard block
 block discarded – undo
1775 1775
 
1776 1776
 	//			$this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees'  ), REG_ADMIN_URL );
1777 1777
 		}
1778
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php';
1779
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1778
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php';
1779
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1780 1780
 
1781 1781
 	}
1782 1782
 
@@ -1797,11 +1797,11 @@  discard block
 block discarded – undo
1797 1797
 		$attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object();
1798 1798
 
1799 1799
 		//now let's determine if this is not the primary registration.  If it isn't then we set the primary_registration object for reference BUT ONLY if the Attendee object loaded is not the same as the primary registration object (that way we know if we need to show cereate button or not)
1800
-		if ( ! $this->_registration->is_primary_registrant() ) {
1800
+		if ( ! $this->_registration->is_primary_registrant()) {
1801 1801
 			$primary_registration = $this->_registration->get_primary_registration();
1802 1802
 			$primary_attendee = $primary_registration->attendee();
1803 1803
 
1804
-			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) {
1804
+			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) {
1805 1805
 				//in here?  This means the displayed registration is not the primary registrant but ALREADY HAS its own custom attendee object so let's not worry about the primary reg.
1806 1806
 				$primary_registration = NULL;
1807 1807
 			}
@@ -1810,27 +1810,27 @@  discard block
 block discarded – undo
1810 1810
 		}
1811 1811
 
1812 1812
 		$this->_template_args['ATT_ID'] = $attendee->ID();
1813
-		$this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname;
1814
-		$this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname;
1815
-		$this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email;
1813
+		$this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname;
1814
+		$this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname;
1815
+		$this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email;
1816 1816
 		$this->_template_args['phone'] = $attendee->phone();
1817 1817
 
1818
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $attendee );
1818
+		$this->_template_args['formatted_address'] = EEH_Address::format($attendee);
1819 1819
 
1820 1820
 
1821 1821
 		//edit link
1822
-		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1823
-		$this->_template_args['att_edit_label'] = __('View/Edit Contact' );
1822
+		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1823
+		$this->_template_args['att_edit_label'] = __('View/Edit Contact');
1824 1824
 
1825 1825
 		//create link
1826
-		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'duplicate_attendee',  '_REG_ID' => $this->_registration->ID() ), REG_ADMIN_URL ): '';
1826
+		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID()), REG_ADMIN_URL) : '';
1827 1827
 		$this->_template_args['create_label'] = __('Create Contact', 'event_espresso');
1828 1828
 
1829 1829
 		$this->_template_args['att_check'] = $att_check;
1830 1830
 
1831 1831
 
1832
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php';
1833
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1832
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php';
1833
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1834 1834
 	}
1835 1835
 
1836 1836
 
@@ -1843,7 +1843,7 @@  discard block
 block discarded – undo
1843 1843
 	 * @access protected
1844 1844
 	 * @return void
1845 1845
 	 */
1846
-	protected function _trash_or_restore_registrations( $trash = TRUE ) {
1846
+	protected function _trash_or_restore_registrations($trash = TRUE) {
1847 1847
 		$REGM = EEM_Registration::instance();
1848 1848
 
1849 1849
 		$success = 1;
@@ -1853,26 +1853,26 @@  discard block
 block discarded – undo
1853 1853
 		$dtts = array();
1854 1854
 
1855 1855
 		//if empty _REG_ID then get out because there's nothing to do
1856
-		if ( empty( $this->_req_data['_REG_ID'] ) ) {
1856
+		if (empty($this->_req_data['_REG_ID'])) {
1857 1857
 			$msg = $trash ? __('In order to trash registrations you must select which ones you wish to trash by clicking the checkboxes.', 'event_espresso') : __('In order to restore registrations you must select which ones you wish to restore by clicking the checkboxes.', 'event_espresso');
1858
-			EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ );
1859
-			$this->_redirect_after_action(FALSE, '', '', array(), TRUE );
1858
+			EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__);
1859
+			$this->_redirect_after_action(FALSE, '', '', array(), TRUE);
1860 1860
 		}
1861 1861
 
1862 1862
 		//Checkboxes
1863
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1863
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1864 1864
 			// if array has more than one element than success message should be plural
1865
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1865
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1866 1866
 			// cycle thru checkboxes
1867
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1867
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1868 1868
 
1869 1869
 				$REG = $REGM->get_one_by_ID($REG_ID);
1870 1870
 				$payment_count = $REG->get_first_related('Transaction')->count_related('Payment');
1871
-				if ( $payment_count > 0 ) {
1872
-					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' );
1871
+				if ($payment_count > 0) {
1872
+					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __('Unknown Attendee', 'event_espresso');
1873 1873
 					$error = 1;
1874 1874
 					$success = 0;
1875
-					EE_Error::add_error( sprintf( __('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name ), __FILE__, __FUNCTION__, __LINE__ );
1875
+					EE_Error::add_error(sprintf(__('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name), __FILE__, __FUNCTION__, __LINE__);
1876 1876
 					continue; //can't trash this registration because it has payments.
1877 1877
 				}
1878 1878
 				$ticket = $REG->get_first_related('Ticket');
@@ -1881,7 +1881,7 @@  discard block
 block discarded – undo
1881 1881
 				$dtts = array_merge($dtts, $dtt);
1882 1882
 
1883 1883
 				$updated = $trash ? $REG->delete() : $REG->restore();
1884
-				if ( !$updated ) {
1884
+				if ( ! $updated) {
1885 1885
 					$success = 0;
1886 1886
 				} else {
1887 1887
 					$success = 2;
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
 			$tickets[$ticket->ID()] = $ticket;
1897 1897
 			$dtts = $ticket->get_many_related('Datetime');
1898 1898
 			$updated = $trash ? $REG->delete() : $REG->restore();
1899
-			if ( ! $updated ) {
1899
+			if ( ! $updated) {
1900 1900
 				$success = 0;
1901 1901
 			}
1902 1902
 
@@ -1906,10 +1906,10 @@  discard block
 block discarded – undo
1906 1906
 		EEM_Ticket::instance()->update_tickets_sold($tickets);
1907 1907
 		EEM_Datetime::instance()->update_sold($dtts);
1908 1908
 
1909
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
1910
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
1909
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
1910
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
1911 1911
 		$overwrite_msgs = $error ? TRUE : FALSE;
1912
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs );
1912
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs);
1913 1913
 	}
1914 1914
 
1915 1915
 
@@ -1933,16 +1933,16 @@  discard block
 block discarded – undo
1933 1933
 		$success = 1;
1934 1934
 
1935 1935
 		//Checkboxes
1936
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1936
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1937 1937
 			// if array has more than one element than success message should be plural
1938
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1938
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1939 1939
 			// cycle thru checkboxes
1940
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1940
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1941 1941
 				$REG = $REG_MDL->get_one_by_ID($REG_ID);
1942
-				if ( ! $REG instanceof EE_Registration )
1942
+				if ( ! $REG instanceof EE_Registration)
1943 1943
 					continue;
1944 1944
 				$deleted = $this->_delete_registration($REG);
1945
-				if ( !$deleted ) {
1945
+				if ( ! $deleted) {
1946 1946
 					$success = 0;
1947 1947
 				}
1948 1948
 			}
@@ -1952,15 +1952,15 @@  discard block
 block discarded – undo
1952 1952
 			$REG_ID = $this->_req_data['_REG_ID'];
1953 1953
 			$REG = $REG_MDL->get_one_by_ID($REG_ID);
1954 1954
 			$deleted = $this->_delete_registration($REG);
1955
-			if ( ! $deleted ) {
1955
+			if ( ! $deleted) {
1956 1956
 				$success = 0;
1957 1957
 			}
1958 1958
 
1959 1959
 		}
1960 1960
 
1961
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
1962
-		$action_desc = __( 'permanently deleted.', 'event_espresso' );
1963
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE );
1961
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
1962
+		$action_desc = __('permanently deleted.', 'event_espresso');
1963
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE);
1964 1964
 	}
1965 1965
 
1966 1966
 
@@ -1972,31 +1972,31 @@  discard block
 block discarded – undo
1972 1972
 	 * @param  EE_Registration $REG registration to be deleted permenantly
1973 1973
 	 * @return boolean              true = successful deletion, false = fail.
1974 1974
 	 */
1975
-	protected function _delete_registration( EE_Registration $REG ) {
1975
+	protected function _delete_registration(EE_Registration $REG) {
1976 1976
 		//first we start with the transaction... ultimately, we WILL not delete permanently if there are any related registrations on the transaction that are NOT trashed.
1977 1977
 		$TXN = $REG->get_first_related('Transaction');
1978 1978
 		$REGS = $TXN->get_many_related('Registration');
1979 1979
 
1980 1980
 		$all_trashed = TRUE;
1981
-		foreach ( $REGS as $registration ) {
1982
-			if ( ! $registration->get('REG_deleted') )
1981
+		foreach ($REGS as $registration) {
1982
+			if ( ! $registration->get('REG_deleted'))
1983 1983
 				$all_trashed = FALSE;
1984 1984
 		}
1985 1985
 
1986
-		if ( ! $all_trashed ) {
1987
-			EE_Error::add_error( __('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1986
+		if ( ! $all_trashed) {
1987
+			EE_Error::add_error(__('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1988 1988
 			return false;
1989 1989
 		}
1990 1990
 
1991 1991
 		//k made it here so that means we can delete all the related transactions and their answers (but let's do them separately from THIS one).
1992
-		foreach ( $REGS as $registration ) {
1992
+		foreach ($REGS as $registration) {
1993 1993
 
1994 1994
 			//delete related answers
1995 1995
 			$registration->delete_related_permanently('Answer');
1996 1996
 
1997 1997
 			//remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact)
1998 1998
 			$attendee = $registration->get_first_related('Attendee');
1999
-			if ( $attendee instanceof EE_Attendee ) {
1999
+			if ($attendee instanceof EE_Attendee) {
2000 2000
 				$registration->_remove_relation_to($attendee, 'Attendee');
2001 2001
 			}
2002 2002
 
@@ -2006,7 +2006,7 @@  discard block
 block discarded – undo
2006 2006
 			//now delete permanently the checkins related to this registration.
2007 2007
 			$registration->delete_related_permanently('Checkin');
2008 2008
 
2009
-			if ( $registration->ID() === $REG->ID() )
2009
+			if ($registration->ID() === $REG->ID())
2010 2010
 				continue; //we don't want to delete permanently the existing registration just yet.
2011 2011
 
2012 2012
 			//remove relation to transaction for these registrations if NOT the existing registrations
@@ -2039,35 +2039,35 @@  discard block
 block discarded – undo
2039 2039
 	 * @return void
2040 2040
 	 */
2041 2041
 	public function new_registration() {
2042
-		if ( ! $this->_set_reg_event() ) {
2043
-			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') );
2042
+		if ( ! $this->_set_reg_event()) {
2043
+			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso'));
2044 2044
 		}
2045
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2045
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2046 2046
 		// gotta start with a clean slate if we're not coming here via ajax
2047 2047
 		if (
2048
-			! defined('DOING_AJAX' )
2049
-			&& ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ) )
2048
+			! defined('DOING_AJAX')
2049
+			&& ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error']))
2050 2050
 		) {
2051
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2051
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2052 2052
 		}
2053 2053
 
2054
-		$this->_template_args['event_name'] = '' ;
2054
+		$this->_template_args['event_name'] = '';
2055 2055
 		// event name
2056
-		if ( $this->_reg_event ) {
2056
+		if ($this->_reg_event) {
2057 2057
 			$this->_template_args['event_name'] = $this->_reg_event->name();
2058
-			$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL );
2059
-			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
2060
-			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
2058
+			$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL);
2059
+			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>';
2060
+			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
2061 2061
 		}
2062 2062
 
2063 2063
 		$this->_template_args['step_content'] = $this->_get_registration_step_content();
2064 2064
 
2065
-		if ( defined('DOING_AJAX' ) ) {
2065
+		if (defined('DOING_AJAX')) {
2066 2066
 			$this->_return_json();
2067 2067
 		}
2068 2068
 		// grab header
2069
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php';
2070
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2069
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php';
2070
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2071 2071
 
2072 2072
 		//$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
2073 2073
 		// the details template wrapper
@@ -2084,7 +2084,7 @@  discard block
 block discarded – undo
2084 2084
 	 * @return string html
2085 2085
 	 */
2086 2086
 	protected function _get_registration_step_content() {
2087
-		if ( isset( $_COOKIE[ 'ee_registration_added' ] ) && $_COOKIE[ 'ee_registration_added' ] ) {
2087
+		if (isset($_COOKIE['ee_registration_added']) && $_COOKIE['ee_registration_added']) {
2088 2088
 			$warning_msg = sprintf(
2089 2089
 				__(
2090 2090
 					'%2$sWARNING!!!%3$s%1$sPlease do not use the back button to return to this page for the purpose of adding another registration.%1$sThis can result in lost and/or corrupted data.%1$sIf you wish to add another registration, then please click the%1$s%7$s"Add Another New Registration to Event"%8$s button%1$son the Transaction details page, after you are redirected.%1$s%1$s%4$s redirecting in %5$s seconds %6$s',
@@ -2100,7 +2100,7 @@  discard block
 block discarded – undo
2100 2100
 				'</b>'
2101 2101
 			);
2102 2102
 			return '
2103
-	<div id="ee-add-reg-back-button-dv"><p>' . $warning_msg . '</p></div>
2103
+	<div id="ee-add-reg-back-button-dv"><p>' . $warning_msg.'</p></div>
2104 2104
 	<script >
2105 2105
 		// WHOAH !!! it appears that someone is using the back button from the Transaction admin page
2106 2106
 		// after just adding a new registration... we gotta try to put a stop to that !!!
@@ -2135,16 +2135,16 @@  discard block
 block discarded – undo
2135 2135
 		$cart = EE_Registry::instance()->SSN->cart();
2136 2136
 		$step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions';
2137 2137
 
2138
-		switch ( $step ) {
2138
+		switch ($step) {
2139 2139
 			case 'ticket' :
2140 2140
 				$hidden_fields['processing_registration']['value'] = 1;
2141 2141
 				$template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso');
2142
-				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event );
2142
+				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event);
2143 2143
 				$template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso');
2144 2144
 				$template_args['show_notification_toggle'] = FALSE;
2145 2145
 				break;
2146 2146
 			case 'questions' :
2147
-				$hidden_fields[ 'processing_registration' ][ 'value' ] = 2;
2147
+				$hidden_fields['processing_registration']['value'] = 2;
2148 2148
 				$template_args['title'] = __('Step Two: Add Registrant Details for this Registration', 'event_espresso');
2149 2149
 				//in theory we should be able to run EED_SPCO at this point because the cart should have been setup properly by the first process_reg_step run.
2150 2150
 				$template_args['content'] = EED_Single_Page_Checkout::registration_checkout_for_admin();
@@ -2153,10 +2153,10 @@  discard block
 block discarded – undo
2153 2153
 				break;
2154 2154
 		}
2155 2155
 
2156
-		$this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route.
2156
+		$this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route.
2157 2157
 
2158 2158
 		return EEH_Template::display_template(
2159
-			REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE
2159
+			REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE
2160 2160
 		);
2161 2161
 	}
2162 2162
 
@@ -2171,11 +2171,11 @@  discard block
 block discarded – undo
2171 2171
 	*		@return boolean
2172 2172
 	*/
2173 2173
 	private function _set_reg_event() {
2174
-		if ( is_object( $this->_reg_event )) {
2174
+		if (is_object($this->_reg_event)) {
2175 2175
 			return TRUE;
2176 2176
 		}
2177
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
2178
-		if ( ! $EVT_ID ) {
2177
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
2178
+		if ( ! $EVT_ID) {
2179 2179
 			return FALSE;
2180 2180
 		}
2181 2181
 
@@ -2196,82 +2196,82 @@  discard block
 block discarded – undo
2196 2196
 	public function process_reg_step() {
2197 2197
 		EE_System::do_not_cache();
2198 2198
 		$this->_set_reg_event();
2199
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2199
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2200 2200
 
2201 2201
 		//what step are we on?
2202 2202
 		$cart = EE_Registry::instance()->SSN->cart();
2203 2203
 		$step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions';
2204 2204
 
2205 2205
 		//if doing ajax then we need to verify the nonce
2206
-		if ( defined( 'DOING_AJAX' ) ) {
2207
-			$nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : '';
2208
-			$this->_verify_nonce( $nonce, $this->_req_nonce );
2206
+		if (defined('DOING_AJAX')) {
2207
+			$nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : '';
2208
+			$this->_verify_nonce($nonce, $this->_req_nonce);
2209 2209
 		}
2210 2210
 
2211
-		switch ( $step ) {
2211
+		switch ($step) {
2212 2212
 
2213 2213
 			case 'ticket' :
2214 2214
 				//process ticket selection
2215 2215
 				$success = EED_Ticket_Selector::instance()->process_ticket_selections();
2216
-				if ( $success ) {
2217
-					EE_Error::add_success( __('Tickets Selected. Now complete the registration.'), 'event_espresso');
2216
+				if ($success) {
2217
+					EE_Error::add_success(__('Tickets Selected. Now complete the registration.'), 'event_espresso');
2218 2218
 				} else {
2219 2219
 					$query_args['step_error'] = $this->_req_data['step_error'] = TRUE;
2220 2220
 				}
2221
-				if ( defined('DOING_AJAX') ) {
2221
+				if (defined('DOING_AJAX')) {
2222 2222
 					$this->new_registration(); //display next step
2223 2223
 				} else {
2224 2224
 					$query_args['action'] = 'new_registration';
2225 2225
 					$query_args['processing_registration'] = 1;
2226 2226
 					$query_args['event_id'] = $this->_reg_event->ID();
2227
-					$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2227
+					$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2228 2228
 				}
2229 2229
 				break;
2230 2230
 
2231 2231
 			case 'questions' :
2232
-				if( ! isset( $this->_req_data[ 'txn_reg_status_change' ], $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] ) ) {
2233
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 );
2232
+				if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['send_notifications'])) {
2233
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15);
2234 2234
 				}
2235 2235
 				//process registration
2236 2236
 				$transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin();
2237
-				if ( $cart instanceof EE_Cart ) {
2237
+				if ($cart instanceof EE_Cart) {
2238 2238
 					$grand_total = $cart->get_cart_grand_total();
2239
-					if ( $grand_total instanceof EE_Line_Item ) {
2239
+					if ($grand_total instanceof EE_Line_Item) {
2240 2240
 						$grand_total->save_this_and_descendants_to_txn();
2241 2241
 					}
2242 2242
 				}
2243
-				if ( ! $transaction instanceof EE_Transaction ) {
2243
+				if ( ! $transaction instanceof EE_Transaction) {
2244 2244
 					$query_args = array(
2245 2245
 						'action' => 'new_registration',
2246 2246
 						'processing_registration' => 2,
2247 2247
 						'event_id' => $this->_reg_event->ID()
2248 2248
 					);
2249 2249
 
2250
-					if ( defined('DOING_AJAX' )) {
2250
+					if (defined('DOING_AJAX')) {
2251 2251
 						//display registration form again because there are errors (maybe validation?)
2252 2252
 						$this->new_registration();
2253 2253
 						return;
2254 2254
 					} else {
2255
-						$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2255
+						$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2256 2256
 						return;
2257 2257
 					}
2258 2258
 				}
2259 2259
 				/** @type EE_Transaction_Payments $transaction_payments */
2260
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
2260
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
2261 2261
 				// maybe update status, and make sure to save transaction if not done already
2262
-				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid( $transaction )) {
2262
+				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid($transaction)) {
2263 2263
 					$transaction->save();
2264 2264
 				}
2265
-				EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2265
+				EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2266 2266
 				$this->_req_data = array();
2267 2267
 				$query_args = array(
2268 2268
 					'action'        => 'redirect_to_txn',
2269 2269
 					'TXN_ID'        => $transaction->ID(),
2270 2270
 					'EVT_ID'        => $this->_reg_event->ID(),
2271
-					'event_name'    => urlencode( $this->_reg_event->name() ),
2271
+					'event_name'    => urlencode($this->_reg_event->name()),
2272 2272
 					'redirect_from' => 'new_registration'
2273 2273
 				);
2274
-				$this->_redirect_after_action( false, '', '', $query_args, true );
2274
+				$this->_redirect_after_action(false, '', '', $query_args, true);
2275 2275
 				break;
2276 2276
 		}
2277 2277
 
@@ -2288,21 +2288,21 @@  discard block
 block discarded – undo
2288 2288
 	 */
2289 2289
 	public function redirect_to_txn() {
2290 2290
 		EE_System::do_not_cache();
2291
-		EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2291
+		EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2292 2292
 		$query_args = array(
2293 2293
 			'action' => 'view_transaction',
2294
-			'TXN_ID' => isset( $this->_req_data['TXN_ID'] ) ? absint( $this->_req_data[ 'TXN_ID' ] )  : 0,
2294
+			'TXN_ID' => isset($this->_req_data['TXN_ID']) ? absint($this->_req_data['TXN_ID']) : 0,
2295 2295
 			'page'   => 'espresso_transactions'
2296 2296
 		);
2297
-		if ( isset( $this->_req_data[ 'EVT_ID' ], $this->_req_data[ 'redirect_from' ] ) ) {
2298
-			$query_args['EVT_ID'] = $this->_req_data[ 'EVT_ID' ];
2299
-			$query_args['event_name'] = urlencode( $this->_req_data[ 'event_name' ] );
2300
-			$query_args['redirect_from'] = $this->_req_data[ 'redirect_from' ];
2297
+		if (isset($this->_req_data['EVT_ID'], $this->_req_data['redirect_from'])) {
2298
+			$query_args['EVT_ID'] = $this->_req_data['EVT_ID'];
2299
+			$query_args['event_name'] = urlencode($this->_req_data['event_name']);
2300
+			$query_args['redirect_from'] = $this->_req_data['redirect_from'];
2301 2301
 		}
2302 2302
 		EE_Error::add_success(
2303
-			__( 'Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso' )
2303
+			__('Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso')
2304 2304
 		);
2305
-		$this->_redirect_after_action( false, '', '', $query_args, true );
2305
+		$this->_redirect_after_action(false, '', '', $query_args, true);
2306 2306
 	}
2307 2307
 
2308 2308
 
@@ -2313,7 +2313,7 @@  discard block
 block discarded – undo
2313 2313
 	*		@return void
2314 2314
 	*/
2315 2315
 	protected function _attendee_contact_list_table() {
2316
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2316
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2317 2317
 		$this->_search_btn_label = __('Contacts', 'event_espresso');
2318 2318
 		$this->display_admin_list_table_page_with_no_sidebar();
2319 2319
 	}
@@ -2328,10 +2328,10 @@  discard block
 block discarded – undo
2328 2328
 	*		@access public
2329 2329
 	*		@return array
2330 2330
 	*/
2331
-	public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) {
2331
+	public function get_attendees($per_page, $count = FALSE, $trash = FALSE) {
2332 2332
 
2333
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2334
-		require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' );
2333
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2334
+		require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php');
2335 2335
 		$ATT_MDL = EEM_Attendee::instance();
2336 2336
 
2337 2337
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
@@ -2359,47 +2359,47 @@  discard block
 block discarded – undo
2359 2359
 				$orderby = 'ATT_lname';
2360 2360
 		}
2361 2361
 
2362
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
2362
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
2363 2363
 
2364
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
2365
-		$per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10;
2366
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
2364
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
2365
+		$per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10;
2366
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
2367 2367
 
2368 2368
 		$_where = array();
2369 2369
 
2370
-		if ( isset( $this->_req_data['s'] ) ) {
2371
-			$sstr = '%' . $this->_req_data['s'] . '%';
2370
+		if (isset($this->_req_data['s'])) {
2371
+			$sstr = '%'.$this->_req_data['s'].'%';
2372 2372
 			$_where['OR'] = array(
2373
-				'Registration.Event.EVT_name' => array( 'LIKE', $sstr),
2374
-				'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ),
2375
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
2376
-				'ATT_fname' => array( 'LIKE', $sstr ),
2377
-				'ATT_lname' => array( 'LIKE', $sstr ),
2378
-				'ATT_short_bio' => array( 'LIKE', $sstr ),
2379
-				'ATT_email' => array('LIKE', $sstr ),
2380
-				'ATT_address' => array( 'LIKE', $sstr ),
2381
-				'ATT_address2' => array( 'LIKE', $sstr ),
2382
-				'ATT_city' => array( 'LIKE', $sstr ),
2383
-				'Country.CNT_name' => array( 'LIKE', $sstr ),
2384
-				'State.STA_name' => array('LIKE', $sstr ),
2385
-				'ATT_phone' => array( 'LIKE', $sstr ),
2386
-				'Registration.REG_final_price' => array( 'LIKE', $sstr ),
2387
-				'Registration.REG_code' => array( 'LIKE', $sstr ),
2388
-				'Registration.REG_count' => array( 'LIKE' , $sstr ),
2389
-				'Registration.REG_group_size' => array( 'LIKE' , $sstr )
2373
+				'Registration.Event.EVT_name' => array('LIKE', $sstr),
2374
+				'Registration.Event.EVT_desc' => array('LIKE', $sstr),
2375
+				'Registration.Event.EVT_short_desc' => array('LIKE', $sstr),
2376
+				'ATT_fname' => array('LIKE', $sstr),
2377
+				'ATT_lname' => array('LIKE', $sstr),
2378
+				'ATT_short_bio' => array('LIKE', $sstr),
2379
+				'ATT_email' => array('LIKE', $sstr),
2380
+				'ATT_address' => array('LIKE', $sstr),
2381
+				'ATT_address2' => array('LIKE', $sstr),
2382
+				'ATT_city' => array('LIKE', $sstr),
2383
+				'Country.CNT_name' => array('LIKE', $sstr),
2384
+				'State.STA_name' => array('LIKE', $sstr),
2385
+				'ATT_phone' => array('LIKE', $sstr),
2386
+				'Registration.REG_final_price' => array('LIKE', $sstr),
2387
+				'Registration.REG_code' => array('LIKE', $sstr),
2388
+				'Registration.REG_count' => array('LIKE', $sstr),
2389
+				'Registration.REG_group_size' => array('LIKE', $sstr)
2390 2390
 				);
2391 2391
 		}
2392 2392
 
2393 2393
 
2394
-		$offset = ($current_page-1)*$per_page;
2395
-		$limit = $count ? NULL : array( $offset, $per_page );
2394
+		$offset = ($current_page - 1) * $per_page;
2395
+		$limit = $count ? NULL : array($offset, $per_page);
2396 2396
 
2397
-		if ( $trash ) {
2398
-			$_where['status'] = array( '!=', 'publish' );
2399
-			$all_attendees = $count ? $ATT_MDL->count( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)): $ATT_MDL->get_all( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2397
+		if ($trash) {
2398
+			$_where['status'] = array('!=', 'publish');
2399
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2400 2400
 		} else {
2401
-			$_where['status'] = array( 'IN', array( 'publish' ) );
2402
-			$all_attendees = $count ? $ATT_MDL->count( array($_where, 'order_by'=>array($orderby=>$sort),'limit'=>$limit)) : $ATT_MDL->get_all( array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit) );
2401
+			$_where['status'] = array('IN', array('publish'));
2402
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2403 2403
 		}
2404 2404
 
2405 2405
 		return $all_attendees;
@@ -2416,10 +2416,10 @@  discard block
 block discarded – undo
2416 2416
 	 */
2417 2417
 	protected function _resend_registration() {
2418 2418
 		$this->_process_resend_registration();
2419
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array(
2419
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array(
2420 2420
 			'action' => 'default'
2421 2421
 		);
2422
-		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE );
2422
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2423 2423
 	}
2424 2424
 
2425 2425
 
@@ -2427,26 +2427,26 @@  discard block
 block discarded – undo
2427 2427
 
2428 2428
 
2429 2429
 
2430
-	public function _registrations_report(){
2431
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2432
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2430
+	public function _registrations_report() {
2431
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2432
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2433 2433
 				array(
2434 2434
 					'page' => 'espresso_batch',
2435 2435
 					'batch' => 'file',
2436
-					'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2437
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' ),
2438
-					'return_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2439
-				)) );
2436
+					'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2437
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\RegistrationsReport'),
2438
+					'return_url' => urlencode($this->_req_data['return_url']),
2439
+				)));
2440 2440
 		} else {
2441 2441
 			$new_request_args = array(
2442 2442
 				'export' => 'report',
2443 2443
 				'action' => 'registrations_report_for_event',
2444
-				'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2444
+				'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2445 2445
 			);
2446 2446
 			$this->_req_data = array_merge($this->_req_data, $new_request_args);
2447 2447
 
2448
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2449
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2448
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2449
+				require_once(EE_CLASSES.'EE_Export.class.php');
2450 2450
 				$EE_Export = EE_Export::instance($this->_req_data);
2451 2451
 				$EE_Export->export();
2452 2452
 			}
@@ -2455,26 +2455,26 @@  discard block
 block discarded – undo
2455 2455
 
2456 2456
 
2457 2457
 
2458
-	public function _contact_list_export(){
2459
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2460
-			require_once(EE_CLASSES . 'EE_Export.class.php');
2458
+	public function _contact_list_export() {
2459
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2460
+			require_once(EE_CLASSES.'EE_Export.class.php');
2461 2461
 			$EE_Export = EE_Export::instance($this->_req_data);
2462 2462
 			$EE_Export->export_attendees();
2463 2463
 		}
2464 2464
 	}
2465 2465
 
2466
-	public function _contact_list_report(){
2467
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2468
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2466
+	public function _contact_list_report() {
2467
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2468
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2469 2469
 				array(
2470 2470
 					'page' => 'espresso_batch',
2471 2471
 					'batch' => 'file',
2472
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\AttendeesReport' ),
2473
-					'return_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2474
-				)) );
2472
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\AttendeesReport'),
2473
+					'return_url' => urlencode($this->_req_data['return_url']),
2474
+				)));
2475 2475
 		} else {
2476
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2477
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2476
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2477
+				require_once(EE_CLASSES.'EE_Export.class.php');
2478 2478
 				$EE_Export = EE_Export::instance($this->_req_data);
2479 2479
 				$EE_Export->report_attendees();
2480 2480
 			}
@@ -2494,73 +2494,73 @@  discard block
 block discarded – undo
2494 2494
 	 * @return void
2495 2495
 	 */
2496 2496
 	protected function _duplicate_attendee() {
2497
-		$action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default';
2497
+		$action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default';
2498 2498
 		//verify we have necessary info
2499
-		if ( empty($this->_req_data['_REG_ID'] )  ) {
2500
-			EE_Error::add_error( __('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'),  __FILE__, __LINE__, __FUNCTION__ );
2501
-			$query_args = array( 'action' => $action );
2499
+		if (empty($this->_req_data['_REG_ID'])) {
2500
+			EE_Error::add_error(__('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
2501
+			$query_args = array('action' => $action);
2502 2502
 			$this->_redirect_after_action('', '', '', $query_args, TRUE);
2503 2503
 		}
2504 2504
 
2505 2505
 		//okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration.
2506
-		$registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] );
2506
+		$registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']);
2507 2507
 		$attendee = $registration->attendee();
2508 2508
 
2509 2509
 		//remove relation of existing attendee on registration
2510
-		$registration->_remove_relation_to($attendee, 'Attendee' );
2510
+		$registration->_remove_relation_to($attendee, 'Attendee');
2511 2511
 		//new attendee
2512 2512
 		$new_attendee = clone $attendee;
2513
-		$new_attendee->set( 'ATT_ID', 0 );
2513
+		$new_attendee->set('ATT_ID', 0);
2514 2514
 		$new_attendee->save();
2515 2515
 
2516 2516
 		//add new attendee to reg
2517
-		$registration->_add_relation_to( $new_attendee, 'Attendee');
2517
+		$registration->_add_relation_to($new_attendee, 'Attendee');
2518 2518
 
2519
-		EE_Error::add_success( __('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso') );
2519
+		EE_Error::add_success(__('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso'));
2520 2520
 
2521 2521
 		//redirect to edit page for attendee
2522
-		$query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' );
2522
+		$query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee');
2523 2523
 
2524
-		$this->_redirect_after_action( '', '', '', $query_args, TRUE );
2524
+		$this->_redirect_after_action('', '', '', $query_args, TRUE);
2525 2525
 	}
2526 2526
 
2527 2527
 
2528 2528
 	//related to cpt routes
2529 2529
 	protected function _insert_update_cpt_item($post_id, $post) {
2530 2530
 		$success = true;
2531
-		$attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id );
2531
+		$attendee = EEM_Attendee::instance()->get_one_by_ID($post_id);
2532 2532
 		//for attendee updates
2533
-		if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) {
2533
+		if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) {
2534 2534
 			//note we should only be UPDATING attendees at this point.
2535 2535
 			$updated_fields = array(
2536 2536
 				'ATT_fname' => $this->_req_data['ATT_fname'],
2537 2537
 				'ATT_lname' => $this->_req_data['ATT_lname'],
2538
-				'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'],
2538
+				'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'],
2539 2539
 				'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '',
2540 2540
 				'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '',
2541
-				'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '',
2542
-				'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '',
2543
-				'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '',
2544
-				'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '',
2545
-				'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '',
2546
-				'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : ''
2541
+				'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '',
2542
+				'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '',
2543
+				'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '',
2544
+				'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '',
2545
+				'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '',
2546
+				'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : ''
2547 2547
 				);
2548
-			foreach ( $updated_fields as $field => $value ) {
2548
+			foreach ($updated_fields as $field => $value) {
2549 2549
 				$attendee->set($field, $value);
2550 2550
 			}
2551 2551
 
2552 2552
 			$success = $attendee->save();
2553 2553
 
2554
-			$attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() );
2555
-			foreach ( $attendee_update_callbacks as $a_callback ) {
2556
-				if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) {
2557
-					throw new EE_Error( sprintf( __('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback ) );
2554
+			$attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array());
2555
+			foreach ($attendee_update_callbacks as $a_callback) {
2556
+				if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) {
2557
+					throw new EE_Error(sprintf(__('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback));
2558 2558
 				}
2559 2559
 			}
2560 2560
 		}
2561 2561
 
2562
-		if ( $success === FALSE )
2563
-			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2562
+		if ($success === FALSE)
2563
+			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
2564 2564
 
2565 2565
 	}
2566 2566
 
@@ -2580,17 +2580,17 @@  discard block
 block discarded – undo
2580 2580
 		remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2581 2581
 		remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2582 2582
 
2583
-		if ( post_type_supports( 'espresso_attendees', 'excerpt') ) {
2584
-			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' );
2583
+		if (post_type_supports('espresso_attendees', 'excerpt')) {
2584
+			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal');
2585 2585
 		}
2586 2586
 
2587
-		if ( post_type_supports( 'espresso_attendees', 'comments') ) {
2587
+		if (post_type_supports('espresso_attendees', 'comments')) {
2588 2588
 			add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2589 2589
 		}
2590 2590
 
2591
-		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' );
2592
-		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' );
2593
-		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array( $this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2591
+		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core');
2592
+		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2593
+		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array($this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2594 2594
 	}
2595 2595
 
2596 2596
 
@@ -2599,10 +2599,10 @@  discard block
 block discarded – undo
2599 2599
 	 * @param  WP_Post $post wp post object
2600 2600
 	 * @return string        attendee contact info ( and form )
2601 2601
 	 */
2602
-	public function attendee_contact_info( $post ) {
2602
+	public function attendee_contact_info($post) {
2603 2603
 		//get attendee object ( should already have it )
2604 2604
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2605
-		$template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php';
2605
+		$template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php';
2606 2606
 		EEH_Template::display_template($template, $this->_template_args);
2607 2607
 	}
2608 2608
 
@@ -2618,12 +2618,12 @@  discard block
 block discarded – undo
2618 2618
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2619 2619
 		$this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input(
2620 2620
 				new EE_Question_Form_Input(
2621
-				EE_Question::new_instance( array(
2621
+				EE_Question::new_instance(array(
2622 2622
 					'QST_ID' => 0,
2623 2623
 					'QST_display_text' => __('State/Province', 'event_espresso'),
2624 2624
 					'QST_system' => 'admin-state'
2625 2625
 					)),
2626
-				EE_Answer::new_instance( array(
2626
+				EE_Answer::new_instance(array(
2627 2627
 					'ANS_ID' => 0,
2628 2628
 					'ANS_value' => $this->_cpt_model_obj->state_ID()
2629 2629
 					)),
@@ -2636,12 +2636,12 @@  discard block
 block discarded – undo
2636 2636
 			));
2637 2637
 		$this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input(
2638 2638
 				new EE_Question_Form_Input(
2639
-				EE_Question::new_instance( array(
2639
+				EE_Question::new_instance(array(
2640 2640
 					'QST_ID' => 0,
2641 2641
 					'QST_display_text' => __('Country', 'event_espresso'),
2642 2642
 					'QST_system' => 'admin-country'
2643 2643
 					)),
2644
-				EE_Answer::new_instance( array(
2644
+				EE_Answer::new_instance(array(
2645 2645
 					'ANS_ID' => 0,
2646 2646
 					'ANS_value' => $this->_cpt_model_obj->country_ID()
2647 2647
 					)),
@@ -2652,8 +2652,8 @@  discard block
 block discarded – undo
2652 2652
 					'append_qstn_id' => FALSE
2653 2653
 					)
2654 2654
 				));
2655
-		$template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php';
2656
-		EEH_Template::display_template($template, $this->_template_args );
2655
+		$template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php';
2656
+		EEH_Template::display_template($template, $this->_template_args);
2657 2657
 
2658 2658
 	}
2659 2659
 
@@ -2663,11 +2663,11 @@  discard block
 block discarded – undo
2663 2663
 	*		@access protected
2664 2664
 	*		@return void
2665 2665
 	*/
2666
-	public function attendee_registrations_meta_box( $post ) {
2666
+	public function attendee_registrations_meta_box($post) {
2667 2667
 
2668 2668
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2669 2669
 		$this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration');
2670
-		$template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php';
2670
+		$template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php';
2671 2671
 		EEH_Template::display_template($template, $this->_template_args);
2672 2672
 
2673 2673
 	}
@@ -2681,8 +2681,8 @@  discard block
 block discarded – undo
2681 2681
 	 * @return string        html for new form.
2682 2682
 	 */
2683 2683
 	public function after_title_form_fields($post) {
2684
-		if ( $post->post_type == 'espresso_attendees' ) {
2685
-			$template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php';
2684
+		if ($post->post_type == 'espresso_attendees') {
2685
+			$template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php';
2686 2686
 			$template_args['attendee'] = $this->_cpt_model_obj;
2687 2687
 			EEH_Template::display_template($template, $template_args);
2688 2688
 		}
@@ -2699,21 +2699,21 @@  discard block
 block discarded – undo
2699 2699
 	*		@access protected
2700 2700
 	*		@return void
2701 2701
 	*/
2702
-	protected function _trash_or_restore_attendees( $trash = TRUE ) {
2702
+	protected function _trash_or_restore_attendees($trash = TRUE) {
2703 2703
 
2704
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2704
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2705 2705
 
2706 2706
 		$ATT_MDL = EEM_Attendee::instance();
2707 2707
 
2708 2708
 		$success = 1;
2709 2709
 		//Checkboxes
2710
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2710
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2711 2711
 			// if array has more than one element than success message should be plural
2712
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
2712
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
2713 2713
 			// cycle thru checkboxes
2714
-			while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) {
2715
-				$updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID);
2716
-				if ( !$updated ) {
2714
+			while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) {
2715
+				$updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID);
2716
+				if ( ! $updated) {
2717 2717
 					$success = 0;
2718 2718
 				}
2719 2719
 			}
@@ -2722,18 +2722,18 @@  discard block
 block discarded – undo
2722 2722
 			// grab single id and delete
2723 2723
 			$ATT_ID = absint($this->_req_data['ATT_ID']);
2724 2724
 			//get attendee
2725
-			$att = $ATT_MDL->get_one_by_ID( $ATT_ID );
2725
+			$att = $ATT_MDL->get_one_by_ID($ATT_ID);
2726 2726
 			$updated = $trash ? $att->set_status('trash') : $att->set_status('publish');
2727 2727
 			$updated = $att->save();
2728
-			if ( ! $updated ) {
2728
+			if ( ! $updated) {
2729 2729
 				$success = 0;
2730 2730
 			}
2731 2731
 
2732 2732
 		}
2733 2733
 
2734
-		$what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' );
2735
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
2736
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) );
2734
+		$what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso');
2735
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
2736
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list'));
2737 2737
 
2738 2738
 	}
2739 2739
 
Please login to merge, or discard this patch.