Completed
Branch old/BUG-7514-7935-7936-price-o... (518ae6)
by
unknown
13:33 queued 11:14
created
core/admin/EE_Admin_List_Table.core.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
  */
33 33
 
34 34
 if ( ! class_exists( 'WP_List_Table' )) {
35
-    require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
35
+	require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
36 36
 }
37 37
 
38 38
 abstract class EE_Admin_List_Table extends WP_List_Table {
Please login to merge, or discard this patch.
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
  * ------------------------------------------------------------------------
32 32
  */
33 33
 
34
-if ( ! class_exists( 'WP_List_Table' )) {
35
-    require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
34
+if ( ! class_exists('WP_List_Table')) {
35
+    require_once(ABSPATH.'wp-admin/includes/class-wp-list-table.php');
36 36
 }
37 37
 
38 38
 abstract class EE_Admin_List_Table extends WP_List_Table {
@@ -215,16 +215,16 @@  discard block
 block discarded – undo
215 215
 	 * constructor
216 216
 	 * @param EE_Admin_Page object $admin_page we use this for obtaining everything we need in the list table.
217 217
 	 */
218
-	public function __construct( EE_Admin_Page $admin_page ) {
218
+	public function __construct(EE_Admin_Page $admin_page) {
219 219
 		$this->_admin_page = $admin_page;
220 220
 		$this->_req_data = $this->_admin_page->get_request_data();
221 221
 		$this->_view = $this->_admin_page->get_view();
222
-		$this->_views = empty( $this->_views ) ? $this->_admin_page->get_list_table_view_RLs() : $this->_views;
222
+		$this->_views = empty($this->_views) ? $this->_admin_page->get_list_table_view_RLs() : $this->_views;
223 223
 		$this->_current_page = $this->get_pagenum();
224
-		$this->_screen = $this->_admin_page->get_current_page() . '_' . $this->_admin_page->get_current_view();
225
-		$this->_yes_no = array(  __('No', 'event_espresso'), __('Yes', 'event_espresso'));
224
+		$this->_screen = $this->_admin_page->get_current_page().'_'.$this->_admin_page->get_current_view();
225
+		$this->_yes_no = array(__('No', 'event_espresso'), __('Yes', 'event_espresso'));
226 226
 
227
-		$this->_per_page = $this->get_items_per_page( $this->_screen . '_per_page', 10 );
227
+		$this->_per_page = $this->get_items_per_page($this->_screen.'_per_page', 10);
228 228
 
229 229
 		$this->_setup_data();
230 230
 		$this->_add_view_counts();
@@ -307,17 +307,17 @@  discard block
 block discarded – undo
307 307
 	 * @return html string
308 308
 	 */
309 309
 	protected function _get_hidden_fields() {
310
-		$action = isset( $this->_req_data['route'] ) ? $this->_req_data['route'] : '';
311
-		$action = empty( $action ) && isset( $this->_req_data['action'] ) ? $this->_req_data['action'] : $action;
310
+		$action = isset($this->_req_data['route']) ? $this->_req_data['route'] : '';
311
+		$action = empty($action) && isset($this->_req_data['action']) ? $this->_req_data['action'] : $action;
312 312
 		//if action is STILL empty, then we set it to default
313
-		$action = empty( $action ) ? 'default' : $action;
314
-		$field = '<input type="hidden" name="page" value="' . $this->_req_data['page'] . '" />' . "\n";
315
-		$field .= '<input type="hidden" name="route" value="'. $action .'" />' . "\n";/**/
316
-		$field .= '<input type="hidden" name="perpage" value="' . $this->_per_page . '" />' . "\n";
313
+		$action = empty($action) ? 'default' : $action;
314
+		$field = '<input type="hidden" name="page" value="'.$this->_req_data['page'].'" />'."\n";
315
+		$field .= '<input type="hidden" name="route" value="'.$action.'" />'."\n"; /**/
316
+		$field .= '<input type="hidden" name="perpage" value="'.$this->_per_page.'" />'."\n";
317 317
 
318 318
 		$bulk_actions = $this->_get_bulk_actions();
319
-		foreach ( $bulk_actions as $bulk_action => $label ) {
320
-			$field .= '<input type="hidden" name="' . $bulk_action . '_nonce" value="' . wp_create_nonce  ( $bulk_action . '_nonce' ) . '" />' . "\n";
319
+		foreach ($bulk_actions as $bulk_action => $label) {
320
+			$field .= '<input type="hidden" name="'.$bulk_action.'_nonce" value="'.wp_create_nonce($bulk_action.'_nonce').'" />'."\n";
321 321
 		}
322 322
 
323 323
 		return $field;
@@ -347,15 +347,15 @@  discard block
 block discarded – undo
347 347
 		 *
348 348
 		 * @var array
349 349
 		 */
350
-		$_sortable = apply_filters( "FHEE_manage_{$this->screen->id}_sortable_columns", $_sortable, $this->_screen );
350
+		$_sortable = apply_filters("FHEE_manage_{$this->screen->id}_sortable_columns", $_sortable, $this->_screen);
351 351
 
352 352
 		$sortable = array();
353
-		foreach ( $_sortable as $id => $data ) {
354
-			if ( empty( $data ) )
353
+		foreach ($_sortable as $id => $data) {
354
+			if (empty($data))
355 355
 				continue;
356 356
 
357 357
 			//fix for offset errors with WP_List_Table default get_columninfo()
358
-			if ( is_array($data) ) {
358
+			if (is_array($data)) {
359 359
 				$_data[0] = key($data);
360 360
 				$_data[1] = isset($data[1]) ? $data[1] : false;
361 361
 			} else {
@@ -364,13 +364,13 @@  discard block
 block discarded – undo
364 364
 
365 365
 			$data = (array) $data;
366 366
 
367
-			if ( !isset( $data[1] ) )
367
+			if ( ! isset($data[1]))
368 368
 				$_data[1] = false;
369 369
 
370 370
 
371 371
 			$sortable[$id] = $_data;
372 372
 		}
373
-		$this->_column_headers = array( $columns, $hidden, $sortable );
373
+		$this->_column_headers = array($columns, $hidden, $sortable);
374 374
 	}
375 375
 
376 376
 
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
 	protected function _get_bulk_actions() {
387 387
 		$actions = array();
388 388
 		//the _views property should have the bulk_actions, so let's go through and extract them into a properly formatted array for the wp_list_table();
389
-		foreach ( $this->_views as $view => $args) {
390
-			if ( isset( $args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view )
389
+		foreach ($this->_views as $view => $args) {
390
+			if (isset($args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view)
391 391
 				//each bulk action will correspond with a admin page route, so we can check whatever the capability is for that page route and skip adding the bulk action if no access for the current logged in user.
392
-				foreach ( $args['bulk_action'] as $route =>$label ) {
393
-					if ( $this->_admin_page->check_user_access( $route, true ) ) {
392
+				foreach ($args['bulk_action'] as $route =>$label) {
393
+					if ($this->_admin_page->check_user_access($route, true)) {
394 394
 						$actions[$route] = $label;
395 395
 					}
396 396
 				}
@@ -408,18 +408,18 @@  discard block
 block discarded – undo
408 408
 	 */
409 409
 	private function _filters() {
410 410
 		$classname = get_class($this);
411
-		$filters = apply_filters( "FHEE__{$classname}__filters", (array) $this->_get_table_filters(), $this, $this->_screen );
411
+		$filters = apply_filters("FHEE__{$classname}__filters", (array) $this->_get_table_filters(), $this, $this->_screen);
412 412
 
413
-		if ( empty( $filters )) {
413
+		if (empty($filters)) {
414 414
 			return;
415 415
 		}
416
-		foreach ( $filters as $filter ) {
416
+		foreach ($filters as $filter) {
417 417
 			echo $filter;
418 418
 		}
419 419
 		//add filter button at end
420
-		echo '<input type="submit" class="button-secondary" value="' . __('Filter', 'event_espresso') . '" id="post-query-submit" />';
420
+		echo '<input type="submit" class="button-secondary" value="'.__('Filter', 'event_espresso').'" id="post-query-submit" />';
421 421
 		//add reset filters button at end
422
-		echo '<a class="button button-secondary"  href="' . $this->_admin_page->get_current_page_view_url() . '" style="display:inline-block">' . __('Reset Filters', 'event_espresso') . '</a>';
422
+		echo '<a class="button button-secondary"  href="'.$this->_admin_page->get_current_page_view_url().'" style="display:inline-block">'.__('Reset Filters', 'event_espresso').'</a>';
423 423
 	}
424 424
 
425 425
 
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 			array(
437 437
 				'total_items' => $total_items,
438 438
 				'per_page' => $this->_per_page,
439
-				'total_pages' => ceil($total_items / $this->_per_page )
439
+				'total_pages' => ceil($total_items / $this->_per_page)
440 440
 			)
441 441
 		);
442 442
 	}
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	 *
453 453
 	 * @return string html content for the column
454 454
 	 */
455
-	public function column_default( $item, $column_name ) {
455
+	public function column_default($item, $column_name) {
456 456
 		/**
457 457
 		 * Dynamic hook allowing for adding additional column content in this list table.
458 458
 		 * Note that $this->screen->id is in the format
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 		 * hook prefix ("event-espresso") will be different.
463 463
 		 *
464 464
 		 */
465
-		do_action( 'AHEE__EE_Admin_List_Table__column_' . $column_name . '__' . $this->screen->id, $item, $this->_screen );
465
+		do_action('AHEE__EE_Admin_List_Table__column_'.$column_name.'__'.$this->screen->id, $item, $this->_screen);
466 466
 	}
467 467
 
468 468
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 		 *
479 479
 		 * @var array
480 480
 		 */
481
-		$columns = apply_filters( 'FHEE_manage_'.$this->screen->id.'_columns', $this->_columns, $this->_screen );
481
+		$columns = apply_filters('FHEE_manage_'.$this->screen->id.'_columns', $this->_columns, $this->_screen);
482 482
 		return $columns;
483 483
 	}
484 484
 
@@ -490,18 +490,18 @@  discard block
 block discarded – undo
490 490
 		$views = $this->get_views();
491 491
 		$assembled_views = '';
492 492
 
493
-		if ( empty( $views )) {
493
+		if (empty($views)) {
494 494
 			return;
495 495
 		}
496 496
 		echo "<ul class='subsubsub'>\n";
497
-		foreach ( $views as $view ) {
498
-			$count = isset($view['count'] ) && !empty($view['count']) ? absint( $view['count'] )  : 0;
499
-			if ( isset( $view['slug'] ) && isset( $view['class'] ) && isset( $view['url'] ) && isset( $view['label']) ) {
500
-				$assembled_views[ $view['slug'] ] = "\t<li class='" . $view['class'] . "'>" . '<a href="' . $view['url'] . '">' . $view['label'] . '</a> <span class="count">(' . $count . ')</span>';
497
+		foreach ($views as $view) {
498
+			$count = isset($view['count']) && ! empty($view['count']) ? absint($view['count']) : 0;
499
+			if (isset($view['slug']) && isset($view['class']) && isset($view['url']) && isset($view['label'])) {
500
+				$assembled_views[$view['slug']] = "\t<li class='".$view['class']."'>".'<a href="'.$view['url'].'">'.$view['label'].'</a> <span class="count">('.$count.')</span>';
501 501
 			}
502 502
 		}
503 503
 
504
-		echo is_array( $assembled_views) && ! empty( $assembled_views ) ? implode( " |</li>\n", $assembled_views ) . "</li>\n" : '';
504
+		echo is_array($assembled_views) && ! empty($assembled_views) ? implode(" |</li>\n", $assembled_views)."</li>\n" : '';
505 505
 		echo "</ul>";
506 506
 	}
507 507
 
@@ -514,10 +514,10 @@  discard block
 block discarded – undo
514 514
 	 *
515 515
 	 * @param object $item The current item
516 516
 	 */
517
-	public function single_row( $item ) {
518
-		$row_class = $this->_get_row_class( $item );
519
-		echo '<tr' . $row_class . '>';
520
-		$this->single_row_columns( $item );
517
+	public function single_row($item) {
518
+		$row_class = $this->_get_row_class($item);
519
+		echo '<tr'.$row_class.'>';
520
+		$this->single_row_columns($item);
521 521
 		echo '</tr>';
522 522
 	}
523 523
 
@@ -528,16 +528,16 @@  discard block
 block discarded – undo
528 528
 	 * @param  object $item the current item
529 529
 	 * @return string
530 530
 	 */
531
-	protected function _get_row_class( $item ) {
531
+	protected function _get_row_class($item) {
532 532
 		static $row_class = '';
533
-		$row_class = ( $row_class == '' ? 'alternate' : '' );
533
+		$row_class = ($row_class == '' ? 'alternate' : '');
534 534
 
535 535
 		$new_row = $row_class;
536 536
 
537
-		if ( !empty($this->_ajax_sorting_callback) )
537
+		if ( ! empty($this->_ajax_sorting_callback))
538 538
 			$new_row .= ' rowsortable';
539 539
 
540
-		return ' class="' . $new_row . '"';
540
+		return ' class="'.$new_row.'"';
541 541
 	}
542 542
 
543 543
 
@@ -552,13 +552,13 @@  discard block
 block discarded – undo
552 552
 
553 553
 	public function get_hidden_columns() {
554 554
 		$user_id = get_current_user_id();
555
-		$has_default = get_user_option('default'. $this->screen->id . 'columnshidden', $user_id);
556
-		if ( empty( $has_default ) && !empty($this->_hidden_columns ) ) {
557
-			update_user_option($user_id, 'default'.$this->screen->id . 'columnshidden', TRUE);
558
-			update_user_option($user_id, 'manage' . $this->screen->id . 'columnshidden', $this->_hidden_columns, TRUE );
555
+		$has_default = get_user_option('default'.$this->screen->id.'columnshidden', $user_id);
556
+		if (empty($has_default) && ! empty($this->_hidden_columns)) {
557
+			update_user_option($user_id, 'default'.$this->screen->id.'columnshidden', TRUE);
558
+			update_user_option($user_id, 'manage'.$this->screen->id.'columnshidden', $this->_hidden_columns, TRUE);
559 559
 		}
560
-		$ref = 'manage' . $this->screen->id . 'columnshidden';
561
-		$saved_columns = (array) get_user_option( $ref, $user_id );
560
+		$ref = 'manage'.$this->screen->id.'columnshidden';
561
+		$saved_columns = (array) get_user_option($ref, $user_id);
562 562
 		return $saved_columns;
563 563
 	}
564 564
 
@@ -574,31 +574,31 @@  discard block
 block discarded – undo
574 574
 	 *
575 575
 	 * @param object $item The current item
576 576
 	 */
577
-	protected function single_row_columns( $item ) {
578
-		list( $columns, $hidden ) = $this->get_column_info();
577
+	protected function single_row_columns($item) {
578
+		list($columns, $hidden) = $this->get_column_info();
579 579
 
580
-		foreach ( $columns as $column_name => $column_display_name ) {
580
+		foreach ($columns as $column_name => $column_display_name) {
581 581
 			$class = "class='$column_name column-$column_name'";
582 582
 
583 583
 			$style = '';
584
-			if ( in_array( $column_name, $hidden ) )
584
+			if (in_array($column_name, $hidden))
585 585
 				$style = ' style="display:none;"';
586 586
 
587 587
 			$attributes = "$class$style";
588 588
 
589
-			if ( 'cb' == $column_name ) {
589
+			if ('cb' == $column_name) {
590 590
 				echo '<th scope="row" class="check-column">';
591
-				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_cb_content', $this->column_cb( $item ), $item, $this );
591
+				echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_cb_content', $this->column_cb($item), $item, $this);
592 592
 				echo '</th>';
593 593
 			}
594
-			elseif ( method_exists( $this, 'column_' . $column_name ) ) {
594
+			elseif (method_exists($this, 'column_'.$column_name)) {
595 595
 				echo "<td $attributes>";
596
-				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_' . $column_name . '__column_content', call_user_func( array( $this, 'column_' . $column_name ), $item ), $item, $this );
596
+				echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_'.$column_name.'__column_content', call_user_func(array($this, 'column_'.$column_name), $item), $item, $this);
597 597
 				echo "</td>";
598 598
 			}
599 599
 			else {
600 600
 				echo "<td $attributes>";
601
-				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_default__column_content', $this->column_default( $item, $column_name ), $item, $column_name, $this );
601
+				echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_default__column_content', $this->column_default($item, $column_name), $item, $column_name, $this);
602 602
 				echo "</td>";
603 603
 			}
604 604
 		}
@@ -606,19 +606,19 @@  discard block
 block discarded – undo
606 606
 
607 607
 
608 608
 
609
-	public function extra_tablenav( $which ) {
610
-		if ( $which == 'top' ) {
609
+	public function extra_tablenav($which) {
610
+		if ($which == 'top') {
611 611
 			$this->_filters();
612 612
 			echo $this->_get_hidden_fields();
613 613
 			echo '<br class="clear">';
614
-		}else{
614
+		} else {
615 615
 			echo '<div class="list-table-bottom-buttons alignleft actions">';
616
-			foreach($this->_bottom_buttons as $type => $action){
617
-				$route = isset( $action['route'] ) ? $action['route'] : '';
618
-				$extra_request = isset( $action['extra_request'] ) ? $action['extra_request'] : '';
616
+			foreach ($this->_bottom_buttons as $type => $action) {
617
+				$route = isset($action['route']) ? $action['route'] : '';
618
+				$extra_request = isset($action['extra_request']) ? $action['extra_request'] : '';
619 619
 				echo $this->_admin_page->get_action_link_or_button($route, $type, $extra_request);
620 620
 			}
621
-			do_action( 'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', $this, $this->_screen );
621
+			do_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', $this, $this->_screen);
622 622
 			echo '</div>';
623 623
 		}
624 624
 		//echo $this->_entries_per_page_dropdown;
@@ -668,13 +668,13 @@  discard block
 block discarded – undo
668 668
 	 *
669 669
 	 * @return string The assembled action elements container.
670 670
 	 */
671
-	protected function _action_string( $action_items, $item, $action_container = 'ul', $action_class = '', $action_id = '' ) {
671
+	protected function _action_string($action_items, $item, $action_container = 'ul', $action_class = '', $action_id = '') {
672 672
 		$content = '';
673
-		$action_class = ! empty( $action_class ) ? ' class="' . $action_class . '"' : '';
674
-		$action_id = ! empty( $action_id ) ? ' id="' . $action_id . '"' : '';
675
-		$content .= ! empty( $action_container ) ? '<' . $action_container . $action_class . $action_id . '>' : '';
676
-		$content .= apply_filters( 'FHEE__EE_Admin_List_Table___action_string__action_items', $action_items, $item, $this );
677
-		$content .= ! empty( $container ) ? '</' . $container . '>' : '';
673
+		$action_class = ! empty($action_class) ? ' class="'.$action_class.'"' : '';
674
+		$action_id = ! empty($action_id) ? ' id="'.$action_id.'"' : '';
675
+		$content .= ! empty($action_container) ? '<'.$action_container.$action_class.$action_id.'>' : '';
676
+		$content .= apply_filters('FHEE__EE_Admin_List_Table___action_string__action_items', $action_items, $item, $this);
677
+		$content .= ! empty($container) ? '</'.$container.'>' : '';
678 678
 		return $content;
679 679
 	}
680 680
 }
Please login to merge, or discard this patch.
Braces   +20 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 
6 7
 /**
@@ -351,8 +352,9 @@  discard block
 block discarded – undo
351 352
 
352 353
 		$sortable = array();
353 354
 		foreach ( $_sortable as $id => $data ) {
354
-			if ( empty( $data ) )
355
-				continue;
355
+			if ( empty( $data ) ) {
356
+							continue;
357
+			}
356 358
 
357 359
 			//fix for offset errors with WP_List_Table default get_columninfo()
358 360
 			if ( is_array($data) ) {
@@ -364,8 +366,9 @@  discard block
 block discarded – undo
364 366
 
365 367
 			$data = (array) $data;
366 368
 
367
-			if ( !isset( $data[1] ) )
368
-				$_data[1] = false;
369
+			if ( !isset( $data[1] ) ) {
370
+							$_data[1] = false;
371
+			}
369 372
 
370 373
 
371 374
 			$sortable[$id] = $_data;
@@ -387,11 +390,12 @@  discard block
 block discarded – undo
387 390
 		$actions = array();
388 391
 		//the _views property should have the bulk_actions, so let's go through and extract them into a properly formatted array for the wp_list_table();
389 392
 		foreach ( $this->_views as $view => $args) {
390
-			if ( isset( $args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view )
391
-				//each bulk action will correspond with a admin page route, so we can check whatever the capability is for that page route and skip adding the bulk action if no access for the current logged in user.
393
+			if ( isset( $args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view ) {
394
+							//each bulk action will correspond with a admin page route, so we can check whatever the capability is for that page route and skip adding the bulk action if no access for the current logged in user.
392 395
 				foreach ( $args['bulk_action'] as $route =>$label ) {
393 396
 					if ( $this->_admin_page->check_user_access( $route, true ) ) {
394 397
 						$actions[$route] = $label;
398
+			}
395 399
 					}
396 400
 				}
397 401
 		}
@@ -534,8 +538,9 @@  discard block
 block discarded – undo
534 538
 
535 539
 		$new_row = $row_class;
536 540
 
537
-		if ( !empty($this->_ajax_sorting_callback) )
538
-			$new_row .= ' rowsortable';
541
+		if ( !empty($this->_ajax_sorting_callback) ) {
542
+					$new_row .= ' rowsortable';
543
+		}
539 544
 
540 545
 		return ' class="' . $new_row . '"';
541 546
 	}
@@ -581,8 +586,9 @@  discard block
 block discarded – undo
581 586
 			$class = "class='$column_name column-$column_name'";
582 587
 
583 588
 			$style = '';
584
-			if ( in_array( $column_name, $hidden ) )
585
-				$style = ' style="display:none;"';
589
+			if ( in_array( $column_name, $hidden ) ) {
590
+							$style = ' style="display:none;"';
591
+			}
586 592
 
587 593
 			$attributes = "$class$style";
588 594
 
@@ -590,13 +596,11 @@  discard block
 block discarded – undo
590 596
 				echo '<th scope="row" class="check-column">';
591 597
 				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_cb_content', $this->column_cb( $item ), $item, $this );
592 598
 				echo '</th>';
593
-			}
594
-			elseif ( method_exists( $this, 'column_' . $column_name ) ) {
599
+			} elseif ( method_exists( $this, 'column_' . $column_name ) ) {
595 600
 				echo "<td $attributes>";
596 601
 				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_' . $column_name . '__column_content', call_user_func( array( $this, 'column_' . $column_name ), $item ), $item, $this );
597 602
 				echo "</td>";
598
-			}
599
-			else {
603
+			} else {
600 604
 				echo "<td $attributes>";
601 605
 				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_default__column_content', $this->column_default( $item, $column_name ), $item, $column_name, $this );
602 606
 				echo "</td>";
@@ -611,7 +615,7 @@  discard block
 block discarded – undo
611 615
 			$this->_filters();
612 616
 			echo $this->_get_hidden_fields();
613 617
 			echo '<br class="clear">';
614
-		}else{
618
+		} else{
615 619
 			echo '<div class="list-table-bottom-buttons alignleft actions">';
616 620
 			foreach($this->_bottom_buttons as $type => $action){
617 621
 				$route = isset( $action['route'] ) ? $action['route'] : '';
Please login to merge, or discard this patch.
core/admin/EE_Admin_Page_CPT.core.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,8 +78,8 @@
 block discarded – undo
78 78
 
79 79
 
80 80
 	/**
81
-	* @var EE_CPT_Base
82
-	*/
81
+	 * @var EE_CPT_Base
82
+	 */
83 83
 	protected $_cpt_model_obj = FALSE;
84 84
 
85 85
 
Please login to merge, or discard this patch.
Spacing   +227 added lines, -227 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @param  object $post    The post object of the cpt that was saved.
109 109
 	 * @return void
110 110
 	 */
111
-	abstract protected function _insert_update_cpt_item( $post_id, $post );
111
+	abstract protected function _insert_update_cpt_item($post_id, $post);
112 112
 
113 113
 
114 114
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 * @param  string $post_id The ID of the cpt that was trashed
122 122
 	 * @return void
123 123
 	 */
124
-	abstract public function trash_cpt_item( $post_id );
124
+	abstract public function trash_cpt_item($post_id);
125 125
 
126 126
 
127 127
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 * @param  string $post_id theID of the cpt that was untrashed
133 133
 	 * @return void
134 134
 	 */
135
-	abstract public function restore_cpt_item( $post_id );
135
+	abstract public function restore_cpt_item($post_id);
136 136
 
137 137
 
138 138
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 * @param  string $post_id the ID of the cpt that was deleted
144 144
 	 * @return void
145 145
 	 */
146
-	abstract public function delete_cpt_item( $post_id );
146
+	abstract public function delete_cpt_item($post_id);
147 147
 
148 148
 
149 149
 
@@ -156,25 +156,25 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	protected function _before_page_setup() {
158 158
 
159
-		$page = isset( $this->_req_data['page'] ) ? $this->_req_data['page'] : $this->page_slug;
159
+		$page = isset($this->_req_data['page']) ? $this->_req_data['page'] : $this->page_slug;
160 160
 
161
-		$this->_cpt_routes = array_merge(array('create_new'=>$this->page_slug, 'edit' => $this->page_slug, 'trash' => $this->page_slug), $this->_cpt_routes );
161
+		$this->_cpt_routes = array_merge(array('create_new'=>$this->page_slug, 'edit' => $this->page_slug, 'trash' => $this->page_slug), $this->_cpt_routes);
162 162
 
163 163
 		//let's see if the current route has a value for cpt_object_slug if it does we use that instead of the page
164
-		$this->_cpt_object = isset($this->_req_data['action']) && isset( $this->_cpt_routes[$this->_req_data['action']] ) ? get_post_type_object($this->_cpt_routes[$this->_req_data['action']]) : get_post_type_object( $page );
164
+		$this->_cpt_object = isset($this->_req_data['action']) && isset($this->_cpt_routes[$this->_req_data['action']]) ? get_post_type_object($this->_cpt_routes[$this->_req_data['action']]) : get_post_type_object($page);
165 165
 
166 166
 		//tweak pagenow for page loading.
167
-		add_action( 'current_screen', array( $this, 'modify_pagenow') );
167
+		add_action('current_screen', array($this, 'modify_pagenow'));
168 168
 
169 169
 
170 170
 		//TODO the below will need to be reworked to account for the cpt routes that are NOT based off of page but action param.
171 171
 		//get current page from autosave
172
-		$current_page = isset( $this->_req_data['ee_autosave_data']['ee-cpt-hidden-inputs']['current_page'] ) ? $this->_req_data['ee_autosave_data']['ee-cpt-hidden-inputs']['current_page'] : NULL;
173
-		$this->_current_page = isset( $this->_req_data['current_page'] ) ? $this->_req_data['current_page'] : $current_page;
172
+		$current_page = isset($this->_req_data['ee_autosave_data']['ee-cpt-hidden-inputs']['current_page']) ? $this->_req_data['ee_autosave_data']['ee-cpt-hidden-inputs']['current_page'] : NULL;
173
+		$this->_current_page = isset($this->_req_data['current_page']) ? $this->_req_data['current_page'] : $current_page;
174 174
 
175 175
 
176 176
 		//autosave... make sure its only for the correct page
177
-		if ( !empty($this->_current_page ) && $this->_current_page == $this->page_slug ) {
177
+		if ( ! empty($this->_current_page) && $this->_current_page == $this->page_slug) {
178 178
 			//setup autosave ajax hook
179 179
 			//add_action('wp_ajax_ee-autosave', array( $this, 'do_extra_autosave_stuff' ), 10 ); //TODO reactivate when 4.2 autosave is implemented
180 180
 		}
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 *
191 191
 	 * @return void
192 192
 	 */
193
-	public function modify_pagenow( $current_screen ) {
193
+	public function modify_pagenow($current_screen) {
194 194
 		global $pagenow;
195 195
 		//corresponding pagenow maps for our custom routes.
196 196
 		$pagenow_map = array(
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 			);
201 201
 
202 202
 		//possibly reset pagenow.
203
-		if ( ! empty( $this->_req_data['page'] ) && $this->_req_data['page'] == $this->page_slug && !empty( $this->_req_data['action'] ) && isset( $pagenow_map[$this->_req_data['action'] ] ) ) {
203
+		if ( ! empty($this->_req_data['page']) && $this->_req_data['page'] == $this->page_slug && ! empty($this->_req_data['action']) && isset($pagenow_map[$this->_req_data['action']])) {
204 204
 			$pagenow = $pagenow_map[$this->_req_data['action']];
205 205
 		}
206 206
 	}
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	 * @param  array $ids an array of ids for containers that hold form inputs we want autosave to pickup.  Typically you would send along the id of a metabox container.
216 216
 	 * @return void
217 217
 	 */
218
-	protected function _register_autosave_containers( $ids ) {
219
-		$this->_autosave_containers = array_merge( $this->_autosave_fields, (array) $ids );
218
+	protected function _register_autosave_containers($ids) {
219
+		$this->_autosave_containers = array_merge($this->_autosave_fields, (array) $ids);
220 220
 	}
221 221
 
222 222
 
@@ -231,22 +231,22 @@  discard block
 block discarded – undo
231 231
 
232 232
 		$containers = array();
233 233
 
234
-		if ( empty( $wp_meta_boxes ) )
234
+		if (empty($wp_meta_boxes))
235 235
 			return;
236 236
 
237
-		$current_metaboxes = isset( $wp_meta_boxes[$this->page_slug] ) ? $wp_meta_boxes[$this->page_slug] : array();
237
+		$current_metaboxes = isset($wp_meta_boxes[$this->page_slug]) ? $wp_meta_boxes[$this->page_slug] : array();
238 238
 
239
-		foreach ( $current_metaboxes as $box_context ) {
240
-			foreach ( $box_context as $box_details ) {
241
-				foreach ( $box_details as $box ) {
242
-					if ( is_array( $box['callback'] ) && ( $box['callback'][0] instanceof EE_Admin_Page || $box['callback'][0] instanceof EE_Admin_Hooks ) ){
239
+		foreach ($current_metaboxes as $box_context) {
240
+			foreach ($box_context as $box_details) {
241
+				foreach ($box_details as $box) {
242
+					if (is_array($box['callback']) && ($box['callback'][0] instanceof EE_Admin_Page || $box['callback'][0] instanceof EE_Admin_Hooks)) {
243 243
 						$containers[] = $box['id'];
244 244
 					}
245 245
 				}
246 246
 			}
247 247
 		}
248 248
 
249
-		$this->_autosave_containers = array_merge( $this->_autosave_containers, $containers );
249
+		$this->_autosave_containers = array_merge($this->_autosave_containers, $containers);
250 250
 
251 251
 		//add hidden inputs container
252 252
 		$this->_autosave_containers[] = 'ee-cpt-hidden-inputs';
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 		wp_enqueue_script('cpt-autosave');/**/ //todo re-enable when we start doing autosave again in 4.2
264 264
 
265 265
 		//filter _autosave_containers
266
-		$containers = apply_filters( 'FHEE__EE_Admin_Page_CPT___load_autosave_scripts_styles__containers', $this->_autosave_containers, $this );
267
-		$containers = apply_filters( 'FHEE__EE_Admin_Page_CPT__' . get_class($this) . '___load_autosave_scripts_styles__containers', $containers, $this );
266
+		$containers = apply_filters('FHEE__EE_Admin_Page_CPT___load_autosave_scripts_styles__containers', $this->_autosave_containers, $this);
267
+		$containers = apply_filters('FHEE__EE_Admin_Page_CPT__'.get_class($this).'___load_autosave_scripts_styles__containers', $containers, $this);
268 268
 
269
-		wp_localize_script('event_editor_js', 'EE_AUTOSAVE_IDS', $containers ); //todo once we enable autosaves, this needs to be switched to localize with "cpt-autosave"
269
+		wp_localize_script('event_editor_js', 'EE_AUTOSAVE_IDS', $containers); //todo once we enable autosaves, this needs to be switched to localize with "cpt-autosave"
270 270
 
271 271
 		$unsaved_data_msg = array(
272
-			'eventmsg' => sprintf( __("The changes you made to this %s will be lost if you navigate away from this page.", 'event_espresso'), $this->_cpt_object->labels->singular_name),
272
+			'eventmsg' => sprintf(__("The changes you made to this %s will be lost if you navigate away from this page.", 'event_espresso'), $this->_cpt_object->labels->singular_name),
273 273
 			'inputChanged' => 0
274 274
 			);
275 275
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	public function load_page_dependencies() {
282 282
 		try {
283 283
 			$this->_load_page_dependencies();
284
-		} catch ( EE_Error $e ) {
284
+		} catch (EE_Error $e) {
285 285
 			$e->get_error();
286 286
 		}
287 287
 	}
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	protected function _load_page_dependencies() {
298 298
 
299 299
 		//we only add stuff if this is a cpt_route!
300
-		if ( !$this->_cpt_route ) {
300
+		if ( ! $this->_cpt_route) {
301 301
 			parent::_load_page_dependencies();
302 302
 			return;
303 303
 		}
@@ -307,72 +307,72 @@  discard block
 block discarded – undo
307 307
 
308 308
 		//the following filters are for setting all the redirects on DEFAULT WP custom post type actions
309 309
 		//let's add a hidden input to the post-edit form so we know when we have to trigger our custom redirects!  Otherwise the redirects will happen on ALL post saves which wouldn't be good of course!
310
-		add_action('edit_form_after_title', array( $this, 'cpt_post_form_hidden_input') );
310
+		add_action('edit_form_after_title', array($this, 'cpt_post_form_hidden_input'));
311 311
 
312 312
 		//inject our Admin page nav tabs...
313 313
 		//let's make sure the nav tabs are set if they aren't already
314 314
 		//if ( empty( $this->_nav_tabs ) ) $this->_set_nav_tabs();
315
-		add_action('post_edit_form_tag', array( $this, 'inject_nav_tabs' ) );
315
+		add_action('post_edit_form_tag', array($this, 'inject_nav_tabs'));
316 316
 
317 317
 		//modify the post_updated messages array
318
-		add_action('post_updated_messages', array( $this, 'post_update_messages' ), 10 );
318
+		add_action('post_updated_messages', array($this, 'post_update_messages'), 10);
319 319
 
320 320
 		//add shortlink button to cpt edit screens.  We can do this as a universal thing BECAUSE, cpts use the same format for shortlinks as posts!
321
-		add_filter( 'get_shortlink', array( $this, 'add_shortlink_button_to_editor' ), 10, 4 );
321
+		add_filter('get_shortlink', array($this, 'add_shortlink_button_to_editor'), 10, 4);
322 322
 
323 323
 		//This basically allows us to change the title of the "publish" metabox area on CPT pages by setting a 'publishbox' value in the $_labels property array in the child class.
324
-		if ( !empty($this->_labels['publishbox'] ) ) {
324
+		if ( ! empty($this->_labels['publishbox'])) {
325 325
 
326
-			$box_label = is_array( $this->_labels['publishbox'] ) && isset( $this->_labels['publishbox'][$this->_req_action]) ? $this->_labels['publishbox'][$this->_req_action] : $this->_labels['publishbox'];
326
+			$box_label = is_array($this->_labels['publishbox']) && isset($this->_labels['publishbox'][$this->_req_action]) ? $this->_labels['publishbox'][$this->_req_action] : $this->_labels['publishbox'];
327 327
 
328
-			remove_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', $this->_cpt_routes[$this->_req_action], 'side', 'core' );
329
-			add_meta_box( 'submitdiv', $box_label, 'post_submit_meta_box', $this->_cpt_routes[$this->_req_action], 'side', 'core' );
328
+			remove_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', $this->_cpt_routes[$this->_req_action], 'side', 'core');
329
+			add_meta_box('submitdiv', $box_label, 'post_submit_meta_box', $this->_cpt_routes[$this->_req_action], 'side', 'core');
330 330
 		}
331 331
 
332 332
 		//let's add page_templates metabox if this cpt added support for it.
333
-		if ( $this->_supports_page_templates($this->_cpt_object->name) ) {
334
-			add_meta_box( 'page_templates', __('Page Template', 'event_espresso' ), array( $this, 'page_template_meta_box' ), $this->_cpt_routes[$this->_req_action], 'side', 'default' );
333
+		if ($this->_supports_page_templates($this->_cpt_object->name)) {
334
+			add_meta_box('page_templates', __('Page Template', 'event_espresso'), array($this, 'page_template_meta_box'), $this->_cpt_routes[$this->_req_action], 'side', 'default');
335 335
 		}/**/
336 336
 
337 337
 
338 338
 		//this is a filter that allows the addition of extra html after the permalink field on the wp post edit-form
339
-		if ( method_exists( $this, 'extra_permalink_field_buttons' ) )
340
-			add_filter('get_sample_permalink_html', array( $this, 'extra_permalink_field_buttons' ), 10, 4 );
339
+		if (method_exists($this, 'extra_permalink_field_buttons'))
340
+			add_filter('get_sample_permalink_html', array($this, 'extra_permalink_field_buttons'), 10, 4);
341 341
 
342 342
 		//add preview button
343
-		add_filter('get_sample_permalink_html', array($this, 'preview_button_html'), 5, 4 );
343
+		add_filter('get_sample_permalink_html', array($this, 'preview_button_html'), 5, 4);
344 344
 
345 345
 
346 346
 		//insert our own post_stati dropdown
347
-		add_action('post_submitbox_misc_actions', array($this, 'custom_post_stati_dropdown' ), 10 );
347
+		add_action('post_submitbox_misc_actions', array($this, 'custom_post_stati_dropdown'), 10);
348 348
 
349 349
 		//This allows adding additional information to the publish post submitbox on the wp post edit form
350
-		if ( method_exists( $this, 'extra_misc_actions_publish_box' ) )
351
-			add_action('post_submitbox_misc_actions', array( $this, 'extra_misc_actions_publish_box' ), 10 );
350
+		if (method_exists($this, 'extra_misc_actions_publish_box'))
351
+			add_action('post_submitbox_misc_actions', array($this, 'extra_misc_actions_publish_box'), 10);
352 352
 
353 353
 		//This allows for adding additional stuff after the title field on the wp post edit form.  This is also before the wp_editor for post description field.
354
-		if ( method_exists( $this, 'edit_form_after_title' ) )
355
-			add_action('edit_form_after_title', array( $this, 'edit_form_after_title' ), 10 );
354
+		if (method_exists($this, 'edit_form_after_title'))
355
+			add_action('edit_form_after_title', array($this, 'edit_form_after_title'), 10);
356 356
 
357 357
 
358 358
 		/**
359 359
 		 * Filtering WP's esc_url to capture urls pointing to core wp routes so they point to our route.
360 360
 		 */
361
-		add_filter( 'clean_url', array( $this, 'switch_core_wp_urls_with_ours' ), 10, 3 );
361
+		add_filter('clean_url', array($this, 'switch_core_wp_urls_with_ours'), 10, 3);
362 362
 
363 363
 
364 364
 		parent::_load_page_dependencies();
365 365
 
366 366
 		//notice we are ALSO going to load the pagenow hook set for this route (see _before_page_setup for the reset of the pagenow global ). This is for any plugins that are doing things properly and hooking into the load page hook for core wp cpt routes.
367 367
 		global $pagenow;
368
-		do_action( 'load-' . $pagenow );
368
+		do_action('load-'.$pagenow);
369 369
 
370 370
 		$this->modify_current_screen();
371
-		add_action( 'admin_enqueue_scripts', array( $this, 'setup_autosave_hooks'), 30 );
371
+		add_action('admin_enqueue_scripts', array($this, 'setup_autosave_hooks'), 30);
372 372
 		//we route REALLY early.
373 373
 		try {
374 374
 			$this->_route_admin_request();
375
-		} catch ( EE_Error $e ) {
375
+		} catch (EE_Error $e) {
376 376
 			$e->get_error();
377 377
 		}
378 378
 	}
@@ -391,21 +391,21 @@  discard block
 block discarded – undo
391 391
 	 *
392 392
 	 * @return string possibly a new url for our route.
393 393
 	 */
394
-	public function switch_core_wp_urls_with_ours( $good_protocol_url, $original_url, $_context ) {
394
+	public function switch_core_wp_urls_with_ours($good_protocol_url, $original_url, $_context) {
395 395
 		$routes_to_match = array(
396 396
 			0 => array(
397 397
 				'edit.php?post_type=espresso_attendees',
398 398
 				'admin.php?page=espresso_registrations&action=contact_list'
399 399
 				),
400 400
 			 1 => array(
401
-			 	'edit.php?post_type=' . $this->_cpt_object->name,
402
-			 	'admin.php?page=' . $this->_cpt_object->name
401
+			 	'edit.php?post_type='.$this->_cpt_object->name,
402
+			 	'admin.php?page='.$this->_cpt_object->name
403 403
 				)
404 404
 			);
405 405
 
406
-		foreach( $routes_to_match as $route_matches ) {
407
-			if ( strpos( $good_protocol_url, $route_matches[0] ) !== false ) {
408
-				return str_replace( $route_matches[0], $route_matches[1], $good_protocol_url );
406
+		foreach ($routes_to_match as $route_matches) {
407
+			if (strpos($good_protocol_url, $route_matches[0]) !== false) {
408
+				return str_replace($route_matches[0], $route_matches[1], $good_protocol_url);
409 409
 
410 410
 			}
411 411
 		}
@@ -421,10 +421,10 @@  discard block
 block discarded – undo
421 421
 	 * @param string $cpt_name The cpt slug we're checking on.
422 422
 	 * @return bool True supported, false not.
423 423
 	 */
424
-	private function _supports_page_templates( $cpt_name ) {
424
+	private function _supports_page_templates($cpt_name) {
425 425
 		$cpt_args = EE_Register_CPTs::get_CPTs();
426
-		$cpt_args = isset( $cpt_args[$cpt_name] ) ? $cpt_args[$cpt_name]['args'] : array();
427
-		return ! empty( $cpt_args['page_templates'] ) ? TRUE : FALSE;
426
+		$cpt_args = isset($cpt_args[$cpt_name]) ? $cpt_args[$cpt_name]['args'] : array();
427
+		return ! empty($cpt_args['page_templates']) ? TRUE : FALSE;
428 428
 	}
429 429
 
430 430
 
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 	public function page_template_meta_box() {
440 440
 		global $post;
441 441
 		$template = '';
442
-		if ( count( get_page_templates( $post ) ) != 0 ) {
443
-			$page_template = get_post_meta( $post->ID, '_wp_page_template', TRUE );
444
-			$template = !empty( $page_template ) ? $page_template : '';
442
+		if (count(get_page_templates($post)) != 0) {
443
+			$page_template = get_post_meta($post->ID, '_wp_page_template', TRUE);
444
+			$template = ! empty($page_template) ? $page_template : '';
445 445
 		}
446 446
 		?>
447 447
 		<p><strong><?php _e('Template') ?></strong></p>
@@ -465,10 +465,10 @@  discard block
 block discarded – undo
465 465
 	 * @param  string $new_slug  what the slug is
466 466
 	 * @return string            The new html string for the permalink area
467 467
 	 */
468
-	public function preview_button_html( $return, $id, $new_title, $new_slug ) {
469
-		$post = get_post( $id );
470
-		if ( 'publish' != get_post_status( $post ) ) {
471
-			$return .= '<span_id="view-post-btn"><a href="' . wp_get_shortlink($id, 'post') . '" class="button button-small">' . __('Preview', 'event_espresso') . '</a></span>' . "\n";
468
+	public function preview_button_html($return, $id, $new_title, $new_slug) {
469
+		$post = get_post($id);
470
+		if ('publish' != get_post_status($post)) {
471
+			$return .= '<span_id="view-post-btn"><a href="'.wp_get_shortlink($id, 'post').'" class="button button-small">'.__('Preview', 'event_espresso').'</a></span>'."\n";
472 472
 		}
473 473
 		return $return;
474 474
 	}
@@ -488,18 +488,18 @@  discard block
 block discarded – undo
488 488
 			'cur_status' =>  $this->_cpt_model_obj->status(),
489 489
 			'statuses' => $statuses,
490 490
 			'cur_status_label' => $cur_status_label,
491
-			'localized_status_save' => sprintf( __('Save %s', 'event_espresso'), $cur_status_label )
491
+			'localized_status_save' => sprintf(__('Save %s', 'event_espresso'), $cur_status_label)
492 492
 			);
493 493
 
494 494
 		//we'll add a trash post status (WP doesn't add one for some reason)
495
-		if ( $this->_cpt_model_obj->status() == 'trash' ) {
495
+		if ($this->_cpt_model_obj->status() == 'trash') {
496 496
 			$template_args['cur_status_label'] = __('Trashed', 'event_espresso');
497 497
 			$statuses['trash'] = __('Trashed', 'event_espresso');
498 498
 			$template_args['statuses'] = $statuses;
499 499
 		}
500 500
 
501
-		$template = EE_ADMIN_TEMPLATE . 'status_dropdown.template.php';
502
-		EEH_Template::display_template( $template, $template_args );
501
+		$template = EE_ADMIN_TEMPLATE.'status_dropdown.template.php';
502
+		EEH_Template::display_template($template, $template_args);
503 503
 	}
504 504
 
505 505
 
@@ -538,22 +538,22 @@  discard block
 block discarded – undo
538 538
 	public function do_extra_autosave_stuff() {
539 539
 
540 540
 		//next let's check for the autosave nonce (we'll use _verify_nonce )
541
-		$nonce = isset( $this->_req_data['autosavenonce'] ) ? $this->_req_data['autosavenonce'] : NULL;
542
-		$this->_verify_nonce( $nonce, 'autosave' );
541
+		$nonce = isset($this->_req_data['autosavenonce']) ? $this->_req_data['autosavenonce'] : NULL;
542
+		$this->_verify_nonce($nonce, 'autosave');
543 543
 
544 544
 
545 545
 		//make sure we define doing autosave (cause WP isn't triggering this we want to make sure we define it)
546
-		if ( !defined('DOING_AUTOSAVE') ) define('DOING_AUTOSAVE', true);
546
+		if ( ! defined('DOING_AUTOSAVE')) define('DOING_AUTOSAVE', true);
547 547
 
548 548
 		//if we made it here then the nonce checked out.  Let's run our methods and actions
549
-		if ( method_exists( $this, '_ee_autosave_' . $this->_current_view ) ) {
550
-			call_user_func( array( $this, '_ee_autosave_' . $this->_current_view ) );
549
+		if (method_exists($this, '_ee_autosave_'.$this->_current_view)) {
550
+			call_user_func(array($this, '_ee_autosave_'.$this->_current_view));
551 551
 		} else {
552 552
 			$this->_template_args['success'] = TRUE;
553 553
 		}
554 554
 
555
-		do_action( 'AHEE__EE_Admin_Page_CPT__do_extra_autosave_stuff__global_after', $this );
556
-		do_action( 'AHEE__EE_Admin_Page_CPT__do_extra_autosave_stuff__after_' . get_class( $this ), $this );
555
+		do_action('AHEE__EE_Admin_Page_CPT__do_extra_autosave_stuff__global_after', $this);
556
+		do_action('AHEE__EE_Admin_Page_CPT__do_extra_autosave_stuff__after_'.get_class($this), $this);
557 557
 
558 558
 		//now let's return json
559 559
 		$this->_return_json();
@@ -573,18 +573,18 @@  discard block
 block discarded – undo
573 573
 	protected function _extend_page_config_for_cpt() {
574 574
 
575 575
 		//before doing anything we need to make sure this runs ONLY when the loaded page matches the set page_slug
576
-		if ( ( isset( $this->_req_data['page'] ) && $this->_req_data['page'] != $this->page_slug ) )
576
+		if ((isset($this->_req_data['page']) && $this->_req_data['page'] != $this->page_slug))
577 577
 			return;
578 578
 
579 579
 		//set page routes and page config but ONLY if we're not viewing a custom setup cpt route as defined in _cpt_routes
580
-		if ( !empty( $this->_cpt_object ) ) {
581
-			$this->_page_routes = array_merge( array(
580
+		if ( ! empty($this->_cpt_object)) {
581
+			$this->_page_routes = array_merge(array(
582 582
 				'create_new' => '_create_new_cpt_item',
583 583
 				'edit' => '_edit_cpt_item'
584
-				), $this->_page_routes );
584
+				), $this->_page_routes);
585 585
 
586 586
 
587
-			$this->_page_config = array_merge( array(
587
+			$this->_page_config = array_merge(array(
588 588
 				'create_new' => array(
589 589
 					'nav' => array(
590 590
 						'label' => $this->_cpt_object->labels->add_new_item,
@@ -606,23 +606,23 @@  discard block
 block discarded – undo
606 606
 		}
607 607
 
608 608
 		//load the next section only if this is a matching cpt route as set in the cpt routes array.
609
-		if ( !isset( $this->_cpt_routes[$this->_req_action] ) )
609
+		if ( ! isset($this->_cpt_routes[$this->_req_action]))
610 610
 			return;
611 611
 
612 612
 
613
-		$this->_cpt_route = isset( $this->_cpt_routes[$this->_req_action] ) ? TRUE : FALSE;
613
+		$this->_cpt_route = isset($this->_cpt_routes[$this->_req_action]) ? TRUE : FALSE;
614 614
 		//add_action('FHEE__EE_Admin_Page___load_page_dependencies__after_load', array( $this, 'modify_current_screen') );
615 615
 
616 616
 
617
-		if ( empty( $this->_cpt_object ) ) {
618
-			$msg = sprintf( __('This page has been set as being related to a registered custom post type, however, the custom post type object could not be retrieved. There are two possible reasons for this:  1. The "%s" does not match a registered post type. or 2. The custom post type is not registered for the "%s" action as indexed in the "$_cpt_routes" property on this class (%s).'), $this->page_slug, $this->_req_action, get_class($this) );
619
-			throw new EE_Error( $msg );
617
+		if (empty($this->_cpt_object)) {
618
+			$msg = sprintf(__('This page has been set as being related to a registered custom post type, however, the custom post type object could not be retrieved. There are two possible reasons for this:  1. The "%s" does not match a registered post type. or 2. The custom post type is not registered for the "%s" action as indexed in the "$_cpt_routes" property on this class (%s).'), $this->page_slug, $this->_req_action, get_class($this));
619
+			throw new EE_Error($msg);
620 620
 		}
621 621
 
622 622
 
623
-		if ( $this->_cpt_route ) {
624
-			$id = isset( $this->_req_data['post'] ) ? $this->_req_data['post'] : NULL;
625
-			$this->_set_model_object( $id );
623
+		if ($this->_cpt_route) {
624
+			$id = isset($this->_req_data['post']) ? $this->_req_data['post'] : NULL;
625
+			$this->_set_model_object($id);
626 626
 		}
627 627
 
628 628
 	}
@@ -638,17 +638,17 @@  discard block
 block discarded – undo
638 638
 	 * @param int $id The id to retrieve the model object for. If empty we set a default object.
639 639
 	 * @return void
640 640
 	 */
641
-	protected function _set_model_object( $id = NULL ) {
641
+	protected function _set_model_object($id = NULL) {
642 642
 
643
-		if ( empty( $this->_cpt_model_names ) || ! isset( $this->_cpt_routes[ $this->_req_action ] ) || ( is_object( $this->_cpt_model_obj ) && $this->_cpt_model_obj->ID() == $id )) {
643
+		if (empty($this->_cpt_model_names) || ! isset($this->_cpt_routes[$this->_req_action]) || (is_object($this->_cpt_model_obj) && $this->_cpt_model_obj->ID() == $id)) {
644 644
 			//get out cuz we either don't have a model name OR the object has already been set and it has the same id as what has been sent.
645 645
 			return;
646 646
 		}
647 647
 		// load CPT object model
648
-		$model = EE_Registry::instance()->load_model( $this->_cpt_model_names[$this->_req_action] );
649
-		$this->_cpt_model_obj = ! empty( $id ) ? $model->get_one_by_ID( $id ) : $model->create_default_object();
648
+		$model = EE_Registry::instance()->load_model($this->_cpt_model_names[$this->_req_action]);
649
+		$this->_cpt_model_obj = ! empty($id) ? $model->get_one_by_ID($id) : $model->create_default_object();
650 650
 		//d( $this->_cpt_model_obj );
651
-		do_action( 'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object' );
651
+		do_action('AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object');
652 652
 	}
653 653
 
654 654
 
@@ -662,47 +662,47 @@  discard block
 block discarded – undo
662 662
 	 */
663 663
 	public function admin_init_global() {
664 664
 
665
-		$post = isset( $this->_req_data['post'] ) ? get_post( $this->_req_data['post'] ) : NULL;
665
+		$post = isset($this->_req_data['post']) ? get_post($this->_req_data['post']) : NULL;
666 666
 
667 667
 		//its possible this is a new save so let's catch that instead
668
-		$post = isset( $this->_req_data['post_ID'] ) ? get_post( $this->_req_data['post_ID'] ) : $post;
668
+		$post = isset($this->_req_data['post_ID']) ? get_post($this->_req_data['post_ID']) : $post;
669 669
 		$post_type = $post ? $post->post_type : false;
670 670
 
671 671
 		$current_route = isset($this->_req_data['current_route']) ? $this->_req_data['current_route'] : 'shouldneverwork';
672 672
 
673
-		$route_to_check = $post_type && isset( $this->_cpt_routes[$current_route]) ? $this->_cpt_routes[$current_route] : '';
673
+		$route_to_check = $post_type && isset($this->_cpt_routes[$current_route]) ? $this->_cpt_routes[$current_route] : '';
674 674
 
675
-		add_filter( 'get_delete_post_link', array( $this, 'modify_delete_post_link'), 10, 3 );
676
-		add_filter( 'get_edit_post_link', array( $this, 'modify_edit_post_link'), 10, 3 );
675
+		add_filter('get_delete_post_link', array($this, 'modify_delete_post_link'), 10, 3);
676
+		add_filter('get_edit_post_link', array($this, 'modify_edit_post_link'), 10, 3);
677 677
 
678 678
 
679
-		if ( $post_type === $route_to_check ) {
680
-			add_filter('redirect_post_location', array( $this, 'cpt_post_location_redirect'), 10, 2 );
679
+		if ($post_type === $route_to_check) {
680
+			add_filter('redirect_post_location', array($this, 'cpt_post_location_redirect'), 10, 2);
681 681
 			//catch trashed wp redirect
682
-			add_filter('wp_redirect', array( $this, 'cpt_trash_post_location_redirect' ), 10, 2 );
682
+			add_filter('wp_redirect', array($this, 'cpt_trash_post_location_redirect'), 10, 2);
683 683
 		}
684 684
 
685 685
 		//now let's filter redirect if we're on a revision page and the revision is for an event CPT.
686
-		$revision = isset( $this->_req_data['revision'] ) ? $this->_req_data['revision'] : NULL;
686
+		$revision = isset($this->_req_data['revision']) ? $this->_req_data['revision'] : NULL;
687 687
 
688 688
 		/**var_dump($this->_req_data);
689 689
 		exit();/**/
690 690
 
691
-		if ( !empty( $revision ) ) {
692
-			$action = isset( $this->_req_data['action'] ) ? $this->_req_data['action'] : NULL;
691
+		if ( ! empty($revision)) {
692
+			$action = isset($this->_req_data['action']) ? $this->_req_data['action'] : NULL;
693 693
 
694 694
 			//doing a restore?
695
-			if ( !empty( $action ) && $action == 'restore' ) {
695
+			if ( ! empty($action) && $action == 'restore') {
696 696
 
697 697
 				//get post for revision
698
-				$rev_post = get_post( $revision );
699
-				$rev_parent = get_post( $rev_post->post_parent );
698
+				$rev_post = get_post($revision);
699
+				$rev_parent = get_post($rev_post->post_parent);
700 700
 
701 701
 				//only do our redirect filter AND our restore revision action if the post_type for the parent is one of our cpts.
702
-				if ( $rev_parent && $rev_parent->post_type == $this->page_slug ) {
703
-					add_filter('wp_redirect', array($this, 'revision_redirect'), 10, 2 );
702
+				if ($rev_parent && $rev_parent->post_type == $this->page_slug) {
703
+					add_filter('wp_redirect', array($this, 'revision_redirect'), 10, 2);
704 704
 					//restores of revisions
705
-					add_action('wp_restore_post_revision', array($this, 'restore_revision'), 10, 2 );
705
+					add_action('wp_restore_post_revision', array($this, 'restore_revision'), 10, 2);
706 706
 				}
707 707
 			}
708 708
 
@@ -711,15 +711,15 @@  discard block
 block discarded – undo
711 711
 		//NOTE we ONLY want to run these hooks if we're on the right class for the given post type.  Otherwise we could see some really freaky things happen!
712 712
 
713 713
 
714
-		if ( $post_type && $post_type === $route_to_check ) {
714
+		if ($post_type && $post_type === $route_to_check) {
715 715
 			//$post_id, $post
716
-			add_action('save_post', array( $this, 'insert_update'), 10, 2 );
716
+			add_action('save_post', array($this, 'insert_update'), 10, 2);
717 717
 
718 718
 			//$post_id
719
-			add_action('trashed_post', array( $this, 'trash_cpt_item' ), 10 );
720
-			add_action('trashed_post', array( $this, 'dont_permanently_delete_ee_cpts'), 10 );
721
-			add_action('untrashed_post', array( $this, 'restore_cpt_item'), 10 );
722
-			add_action('after_delete_post', array( $this, 'delete_cpt_item'), 10 );
719
+			add_action('trashed_post', array($this, 'trash_cpt_item'), 10);
720
+			add_action('trashed_post', array($this, 'dont_permanently_delete_ee_cpts'), 10);
721
+			add_action('untrashed_post', array($this, 'restore_cpt_item'), 10);
722
+			add_action('after_delete_post', array($this, 'delete_cpt_item'), 10);
723 723
 		}
724 724
 
725 725
 	}
@@ -734,15 +734,15 @@  discard block
 block discarded – undo
734 734
 	 * @return void
735 735
 	 */
736 736
 	public function verify_cpt_object() {
737
-		$label = !empty( $this->_cpt_object ) ? $this->_cpt_object->labels->singular_name : $this->page_label;
737
+		$label = ! empty($this->_cpt_object) ? $this->_cpt_object->labels->singular_name : $this->page_label;
738 738
 		// verify event object
739
-		if ( ! $this->_cpt_model_obj instanceof EE_CPT_Base ) {
740
-			throw new EE_Error( sprintf( __('Something has gone wrong with the page load because we are unable to set up the object for the %1$s.  This usually happens when the given id for the page route is NOT for the correct custom post type for this page', 'event_espresso' ), $label ) );
739
+		if ( ! $this->_cpt_model_obj instanceof EE_CPT_Base) {
740
+			throw new EE_Error(sprintf(__('Something has gone wrong with the page load because we are unable to set up the object for the %1$s.  This usually happens when the given id for the page route is NOT for the correct custom post type for this page', 'event_espresso'), $label));
741 741
 		}
742 742
 		//if auto-draft then throw an error
743
-		if ( $this->_cpt_model_obj->get('status') == 'auto-draft' ) {
743
+		if ($this->_cpt_model_obj->get('status') == 'auto-draft') {
744 744
 			EE_Error::overwrite_errors();
745
-			EE_Error::add_error( sprintf( __('This %1$s was saved without a title, description, or excerpt which means that none of the extra details you added were saved properly.  All autodrafts will show up in the "draft" view of your event list table.  You can delete them from there. Please click the "Add %1$s" button to refresh and restart.'), $label ), __FILE__, __FUNCTION__, __LINE__ );
745
+			EE_Error::add_error(sprintf(__('This %1$s was saved without a title, description, or excerpt which means that none of the extra details you added were saved properly.  All autodrafts will show up in the "draft" view of your event list table.  You can delete them from there. Please click the "Add %1$s" button to refresh and restart.'), $label), __FILE__, __FUNCTION__, __LINE__);
746 746
 		}
747 747
 	}
748 748
 
@@ -771,22 +771,22 @@  discard block
 block discarded – undo
771 771
 	public function load_global_scripts_styles() {
772 772
 		parent::load_global_scripts_styles();
773 773
 
774
-		if ( $this->_cpt_model_obj instanceof EE_CPT_Base ) {
774
+		if ($this->_cpt_model_obj instanceof EE_CPT_Base) {
775 775
 			//setup custom post status object for localize script but only if we've got a cpt object
776 776
 			$statuses = $this->_cpt_model_obj->get_custom_post_statuses();
777 777
 
778
-			if ( !empty($statuses) ) {
778
+			if ( ! empty($statuses)) {
779 779
 				//get ALL statuses!
780 780
 				$statuses = $this->_cpt_model_obj->get_all_post_statuses();
781 781
 				//setup object
782 782
 				$ee_cpt_statuses = array();
783
-				foreach ( $statuses as $status => $label ) {
783
+				foreach ($statuses as $status => $label) {
784 784
 					$ee_cpt_statuses[$status] = array(
785 785
 						'label' => $label,
786
-						'save_label' => sprintf( __('Save as %s', 'event_espresso'), $label )
786
+						'save_label' => sprintf(__('Save as %s', 'event_espresso'), $label)
787 787
 						);
788 788
 				}
789
-				wp_localize_script('ee_admin_js', 'eeCPTstatuses', $ee_cpt_statuses );
789
+				wp_localize_script('ee_admin_js', 'eeCPTstatuses', $ee_cpt_statuses);
790 790
 			}
791 791
 		}
792 792
 	}
@@ -800,10 +800,10 @@  discard block
 block discarded – undo
800 800
 	 * @param  WP_Post $post    Post object from WP
801 801
 	 * @return void
802 802
 	 */
803
-	public function insert_update( $post_id, $post ) {
803
+	public function insert_update($post_id, $post) {
804 804
 
805 805
 		//make sure that if this is a revision OR trash action that we don't do any updates!
806
-		if ( isset( $this->_req_data['action'] ) && ( $this->_req_data['action'] == 'restore' || $this->_req_data['action'] == 'trash' ) )
806
+		if (isset($this->_req_data['action']) && ($this->_req_data['action'] == 'restore' || $this->_req_data['action'] == 'trash'))
807 807
 			return;
808 808
 
809 809
 		//check for autosave and update our req_data property accordingly.
@@ -818,19 +818,19 @@  discard block
 block discarded – undo
818 818
 		}/**/ //TODO reactivate after autosave is implemented in 4.2
819 819
 
820 820
 		//take care of updating any selected page_template IF this cpt supports it.
821
-		if ( $this->_supports_page_templates($post->post_type ) && !empty( $this->_req_data['page_template'] ) ) {
821
+		if ($this->_supports_page_templates($post->post_type) && ! empty($this->_req_data['page_template'])) {
822 822
 			$post->page_template = $this->_req_data['page_template'];
823
-			$page_templates = wp_get_theme()->get_page_templates( $post );
824
-			if ( 'default' != $this->_req_data['page_template']  && ! isset( $page_templates[ $this->_req_data['page_template'] ] ) ) {
825
-				EE_Error::add_error( __('Invalid Page Template.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
823
+			$page_templates = wp_get_theme()->get_page_templates($post);
824
+			if ('default' != $this->_req_data['page_template'] && ! isset($page_templates[$this->_req_data['page_template']])) {
825
+				EE_Error::add_error(__('Invalid Page Template.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
826 826
 			} else {
827
-				update_post_meta( $post_id, '_wp_page_template', $this->_req_data['page_template'] );
827
+				update_post_meta($post_id, '_wp_page_template', $this->_req_data['page_template']);
828 828
 			}
829 829
 		}
830 830
 
831
-		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
831
+		if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
832 832
 			return; //TODO we'll remove this after reimplementing autosave in 4.2
833
-		$this->_insert_update_cpt_item( $post_id, $post );
833
+		$this->_insert_update_cpt_item($post_id, $post);
834 834
 	}
835 835
 
836 836
 
@@ -843,8 +843,8 @@  discard block
 block discarded – undo
843 843
 	 * @param  int    $post_id ID of the post
844 844
 	 * @return void
845 845
 	 */
846
-	public function dont_permanently_delete_ee_cpts( $post_id ) {
847
-		delete_post_meta( $post_id, '_wp_trash_meta_status' );
846
+	public function dont_permanently_delete_ee_cpts($post_id) {
847
+		delete_post_meta($post_id, '_wp_trash_meta_status');
848 848
 		delete_post_meta($post_id, '_wp_trash_meta_time');
849 849
 
850 850
 		//our cpts may have comments so let's take care of that too
@@ -863,14 +863,14 @@  discard block
 block discarded – undo
863 863
 	 * @param  int    $revision_id ID of revision being restored
864 864
 	 * @return void
865 865
 	 */
866
-	public function restore_revision( $post_id, $revision_id ) {
867
-		$this->_restore_cpt_item( $post_id, $revision_id );
866
+	public function restore_revision($post_id, $revision_id) {
867
+		$this->_restore_cpt_item($post_id, $revision_id);
868 868
 
869 869
 		//global action
870
-		do_action( 'AHEE_EE_Admin_Page_CPT__restore_revision', $post_id, $revision_id);
870
+		do_action('AHEE_EE_Admin_Page_CPT__restore_revision', $post_id, $revision_id);
871 871
 
872 872
 		//class specific action so you can limit hooking into a specific page.
873
-		do_action( 'AHEE_EE_Admin_Page_CPT_' . get_class($this) . '__restore_revision', $post_id, $revision_id );
873
+		do_action('AHEE_EE_Admin_Page_CPT_'.get_class($this).'__restore_revision', $post_id, $revision_id);
874 874
 	}
875 875
 
876 876
 
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 	 * @param  int $revision_id ID of revision for item
882 882
 	 * @return void
883 883
 	 */
884
-	abstract protected function _restore_cpt_item( $post_id, $revision_id );
884
+	abstract protected function _restore_cpt_item($post_id, $revision_id);
885 885
 
886 886
 
887 887
 
@@ -900,9 +900,9 @@  discard block
 block discarded – undo
900 900
 	 */
901 901
 	public function modify_current_screen() {
902 902
 		//ONLY do this if the current page_route IS a cpt route
903
-		if ( !$this->_cpt_route ) return;
903
+		if ( ! $this->_cpt_route) return;
904 904
 		//routing things REALLY early b/c this is a cpt admin page
905
-		set_current_screen( $this->_cpt_routes[$this->_req_action]);
905
+		set_current_screen($this->_cpt_routes[$this->_req_action]);
906 906
 		$this->_current_screen = get_current_screen();
907 907
 		$this->_current_screen->base = 'event-espresso';
908 908
 		$this->_add_help_tabs(); //we make sure we add any help tabs back in!
@@ -923,8 +923,8 @@  discard block
 block discarded – undo
923 923
 	 * @param string $title The new title (or existing if there is no editor_title defined)
924 924
 	 * @return string
925 925
 	 */
926
-	public function add_custom_editor_default_title( $title ) {
927
-		return isset( $this->_labels['editor_title'][$this->_cpt_routes[$this->_req_action]] ) ? $this->_labels['editor_title'][$this->_cpt_routes[$this->_req_action]] : $title;
926
+	public function add_custom_editor_default_title($title) {
927
+		return isset($this->_labels['editor_title'][$this->_cpt_routes[$this->_req_action]]) ? $this->_labels['editor_title'][$this->_cpt_routes[$this->_req_action]] : $title;
928 928
 	}
929 929
 
930 930
 
@@ -937,11 +937,11 @@  discard block
 block discarded – undo
937 937
 	 * @param bool   $allow_slugs Whether to allow post slugs in the shortlink.
938 938
 	 * @return string
939 939
 	 */
940
-	public function add_shortlink_button_to_editor( $shortlink, $id, $context, $allow_slugs ) {
941
-		if ( !empty( $id ) && '' != get_option('permalink_structure') ) {
942
-			$post = get_post( $id );
943
-			if ( isset($post->post_type) && $this->page_slug == $post->post_type )
944
-			$shortlink = home_url('?p=' . $post->ID);
940
+	public function add_shortlink_button_to_editor($shortlink, $id, $context, $allow_slugs) {
941
+		if ( ! empty($id) && '' != get_option('permalink_structure')) {
942
+			$post = get_post($id);
943
+			if (isset($post->post_type) && $this->page_slug == $post->post_type)
944
+			$shortlink = home_url('?p='.$post->ID);
945 945
 		}
946 946
 		return $shortlink;
947 947
 	}
@@ -954,10 +954,10 @@  discard block
 block discarded – undo
954 954
 	 * @return void
955 955
 	 */
956 956
 	public function route_admin_request() {
957
-		if ( $this->_cpt_route ) return;
957
+		if ($this->_cpt_route) return;
958 958
 		try {
959 959
 			$this->_route_admin_request();
960
-		} catch ( EE_Error $e ) {
960
+		} catch (EE_Error $e) {
961 961
 			$e->get_error();
962 962
 		}
963 963
 	}
@@ -970,12 +970,12 @@  discard block
 block discarded – undo
970 970
 	 * @return string html
971 971
 	 */
972 972
 	public function cpt_post_form_hidden_input() {
973
-		echo '<input type="hidden" name="ee_cpt_item_redirect_url" value="' . $this->_admin_base_url . '" />';
973
+		echo '<input type="hidden" name="ee_cpt_item_redirect_url" value="'.$this->_admin_base_url.'" />';
974 974
 
975 975
 		//we're also going to add the route value and the current page so we can direct autosave parsing correctly
976 976
 		echo '<div id="ee-cpt-hidden-inputs">';
977
-		echo '<input type="hidden" id="current_route" name="current_route" value="' . $this->_current_view . '" />';
978
-		echo '<input type="hidden" id="current_page" name="current_page" value="' . $this->page_slug . '" />';
977
+		echo '<input type="hidden" id="current_route" name="current_route" value="'.$this->_current_view.'" />';
978
+		echo '<input type="hidden" id="current_page" name="current_page" value="'.$this->page_slug.'" />';
979 979
 		echo '</div>';
980 980
 	}
981 981
 
@@ -988,12 +988,12 @@  discard block
 block discarded – undo
988 988
 	 * @param  int    $status   Status for http header
989 989
 	 * @return string           new (or original) url to redirect to.
990 990
 	 */
991
-	public function revision_redirect( $location, $status ) {
991
+	public function revision_redirect($location, $status) {
992 992
 		//get revision
993 993
 		$rev_id = isset($this->_req_data['revision']) ? $this->_req_data['revision'] : NULL;
994 994
 
995 995
 		//can't do anything without revision so let's get out if not present
996
-		if ( empty( $rev_id ) )
996
+		if (empty($rev_id))
997 997
 			return $location;
998 998
 
999 999
 		//get rev_post_data
@@ -1007,8 +1007,8 @@  discard block
 block discarded – undo
1007 1007
 				'message' => 5
1008 1008
 			);
1009 1009
 
1010
-		$this->_process_notices( $query_args, TRUE );
1011
-		return self::add_query_args_and_nonce( $query_args, $admin_url );
1010
+		$this->_process_notices($query_args, TRUE);
1011
+		return self::add_query_args_and_nonce($query_args, $admin_url);
1012 1012
 	}
1013 1013
 
1014 1014
 
@@ -1021,16 +1021,16 @@  discard block
 block discarded – undo
1021 1021
 	 * @param  string $context optional, defaults to display.  How to write the '&'
1022 1022
 	 * @return string          the link
1023 1023
 	 */
1024
-	public function modify_edit_post_link( $link, $id, $context ) {
1025
-		$post = get_post( $id );
1026
-		if ( !isset( $this->_req_data['action'] ) || !isset( $this->_cpt_routes[$this->_req_data['action']] ) || $post->post_type !== $this->_cpt_routes[$this->_req_data['action']] )
1024
+	public function modify_edit_post_link($link, $id, $context) {
1025
+		$post = get_post($id);
1026
+		if ( ! isset($this->_req_data['action']) || ! isset($this->_cpt_routes[$this->_req_data['action']]) || $post->post_type !== $this->_cpt_routes[$this->_req_data['action']])
1027 1027
 			return $link;
1028 1028
 		$query_args = array(
1029 1029
 			'action' => isset($this->_cpt_edit_routes[$post->post_type]) ? $this->_cpt_edit_routes[$post->post_type] : 'edit',
1030 1030
 			'post' => $id
1031 1031
 			);
1032 1032
 
1033
-		return self::add_query_args_and_nonce( $query_args, $this->_admin_base_url );
1033
+		return self::add_query_args_and_nonce($query_args, $this->_admin_base_url);
1034 1034
 	}
1035 1035
 
1036 1036
 
@@ -1042,12 +1042,12 @@  discard block
 block discarded – undo
1042 1042
 	 * @param  bool   $force_delete whether this is forcing a hard delete instead of trash
1043 1043
 	 * @return string               new delete link
1044 1044
 	 */
1045
-	public function modify_delete_post_link( $delete_link, $post_id, $force_delete ) {
1045
+	public function modify_delete_post_link($delete_link, $post_id, $force_delete) {
1046 1046
 		$post = get_post($post_id);
1047
-		if ( !isset( $this->_req_data['action'] ) || ( isset( $this->_cpt_routes[$this->_req_data['action']] ) && $post->post_type !== $this->_cpt_routes[$this->_req_data['action']] ) )
1047
+		if ( ! isset($this->_req_data['action']) || (isset($this->_cpt_routes[$this->_req_data['action']]) && $post->post_type !== $this->_cpt_routes[$this->_req_data['action']]))
1048 1048
 			return $delete_link;
1049 1049
 
1050
-		return add_query_arg( array('current_route' => 'trash' ), $delete_link );
1050
+		return add_query_arg(array('current_route' => 'trash'), $delete_link);
1051 1051
 	}
1052 1052
 
1053 1053
 
@@ -1058,16 +1058,16 @@  discard block
 block discarded – undo
1058 1058
 	 * @param  string $status   status
1059 1059
 	 * @return string           url to redirect to
1060 1060
 	 */
1061
-	public function cpt_trash_post_location_redirect( $location, $status ) {
1062
-		if ( isset( $this->_req_data['action'] ) && $this->_req_data['action'] !== 'trash' && empty( $this->_req_data['post'] ) )
1061
+	public function cpt_trash_post_location_redirect($location, $status) {
1062
+		if (isset($this->_req_data['action']) && $this->_req_data['action'] !== 'trash' && empty($this->_req_data['post']))
1063 1063
 			return $location;
1064 1064
 
1065
-		$post = get_post( $this->_req_data['post'] );
1066
-		$query_args = array( 'action' => 'default' );
1065
+		$post = get_post($this->_req_data['post']);
1066
+		$query_args = array('action' => 'default');
1067 1067
 		$this->_cpt_object = get_post_type_object($post->post_type);
1068
-		EE_Error::add_success( sprintf( __('%s trashed.', 'event_espresso'), $this->_cpt_object->labels->singular_name) );
1069
-		$this->_process_notices( $query_args, TRUE );
1070
-		return self::add_query_args_and_nonce( $query_args, $this->_admin_base_url );
1068
+		EE_Error::add_success(sprintf(__('%s trashed.', 'event_espresso'), $this->_cpt_object->labels->singular_name));
1069
+		$this->_process_notices($query_args, TRUE);
1070
+		return self::add_query_args_and_nonce($query_args, $this->_admin_base_url);
1071 1071
 	}
1072 1072
 
1073 1073
 
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
 	 * @param  string $post_id  This is the 'ID' value of the wp_posts table
1083 1083
 	 * @return string           the new location to redirect to
1084 1084
 	 */
1085
-	public function cpt_post_location_redirect( $location, $post_id ) {
1085
+	public function cpt_post_location_redirect($location, $post_id) {
1086 1086
 		//we DO have a match so let's setup the url
1087 1087
 
1088 1088
 		//we have to get the post to determine our route
@@ -1090,14 +1090,14 @@  discard block
 block discarded – undo
1090 1090
 		$edit_route = $this->_cpt_edit_routes[$post->post_type];
1091 1091
 
1092 1092
 		//shared query_args
1093
-		$query_args = array( 'action' => $edit_route, 'post' => $post_id );
1093
+		$query_args = array('action' => $edit_route, 'post' => $post_id);
1094 1094
 		$admin_url = $this->_admin_base_url;
1095 1095
 //		$append = '';
1096 1096
 
1097
-		if ( isset( $this->_req_data['save'] ) || isset( $this->_req_data['publish'] ) ) {
1098
-			$status = get_post_status( $post_id );
1099
-			if ( isset( $this->_req_data['publish'] ) ) {
1100
-				switch ( $status ) {
1097
+		if (isset($this->_req_data['save']) || isset($this->_req_data['publish'])) {
1098
+			$status = get_post_status($post_id);
1099
+			if (isset($this->_req_data['publish'])) {
1100
+				switch ($status) {
1101 1101
 					case 'pending':
1102 1102
 						$message = 8;
1103 1103
 						break;
@@ -1110,13 +1110,13 @@  discard block
 block discarded – undo
1110 1110
 			} else {
1111 1111
 					$message = 'draft' == $status ? 10 : 1;
1112 1112
 			}
1113
-		} else if ( isset( $this->_req_data['addmeta']) && $this->_req_data['addmeta'] ) {
1113
+		} else if (isset($this->_req_data['addmeta']) && $this->_req_data['addmeta']) {
1114 1114
 			$message = 2;
1115 1115
 //			$append = '#postcustom';
1116
-		} else if ( isset( $this->_req_data['deletemeta']) && $this->_req_data['deletemeta'] ) {
1116
+		} else if (isset($this->_req_data['deletemeta']) && $this->_req_data['deletemeta']) {
1117 1117
 			$message = 3;
1118 1118
 //			$append = '#postcustom';
1119
-		} elseif ( $this->_req_data['action'] == 'post-quickpress-save-cont' ) {
1119
+		} elseif ($this->_req_data['action'] == 'post-quickpress-save-cont') {
1120 1120
 			$message = 7;
1121 1121
 		} else {
1122 1122
 			$message = 4;
@@ -1124,12 +1124,12 @@  discard block
 block discarded – undo
1124 1124
 
1125 1125
 		//change the message if the post type is not viewable on the frontend
1126 1126
 		$this->_cpt_object = get_post_type_object($post->post_type);
1127
-		$message = $message === 1 && !$this->_cpt_object->publicly_queryable ? 4 : $message;
1127
+		$message = $message === 1 && ! $this->_cpt_object->publicly_queryable ? 4 : $message;
1128 1128
 
1129
-		$query_args = array_merge( array( 'message' => $message ), $query_args );
1129
+		$query_args = array_merge(array('message' => $message), $query_args);
1130 1130
 
1131
-		$this->_process_notices( $query_args, TRUE );
1132
-		return self::add_query_args_and_nonce( $query_args, $admin_url );
1131
+		$this->_process_notices($query_args, TRUE);
1132
+		return self::add_query_args_and_nonce($query_args, $admin_url);
1133 1133
 	}
1134 1134
 
1135 1135
 
@@ -1161,10 +1161,10 @@  discard block
 block discarded – undo
1161 1161
 	 * @param  array $messages the original messages array
1162 1162
 	 * @return array           the new messages array
1163 1163
 	 */
1164
-	public function post_update_messages( $messages ) {
1164
+	public function post_update_messages($messages) {
1165 1165
 		global $post;
1166
-		$id = isset( $this->_req_data['post'] ) ? $this->_req_data['post'] : NULL;
1167
-		$id = empty( $id ) && is_object( $post ) ? $post->ID : NULL;
1166
+		$id = isset($this->_req_data['post']) ? $this->_req_data['post'] : NULL;
1167
+		$id = empty($id) && is_object($post) ? $post->ID : NULL;
1168 1168
 
1169 1169
 //		$post_type = $post ? $post->post_type : false;
1170 1170
 
@@ -1177,9 +1177,9 @@  discard block
 block discarded – undo
1177 1177
 			0 => '', //Unused. Messages start at index 1.
1178 1178
 
1179 1179
 			1 => sprintf(
1180
-				__( '%1$s updated. %2$sView %1$s%3$s', 'event_espresso'),
1180
+				__('%1$s updated. %2$sView %1$s%3$s', 'event_espresso'),
1181 1181
 				$this->_cpt_object->labels->singular_name,
1182
-				'<a href="' . esc_url( get_permalink( $id )) . '">',
1182
+				'<a href="'.esc_url(get_permalink($id)).'">',
1183 1183
 				'</a>'
1184 1184
 			),
1185 1185
 
@@ -1187,38 +1187,38 @@  discard block
 block discarded – undo
1187 1187
 
1188 1188
 			3 => __('Custom field deleted.'),
1189 1189
 
1190
-			4 => sprintf( __( '%1$s updated.', 'event_espresso'), $this->_cpt_object->labels->singular_name ),
1190
+			4 => sprintf(__('%1$s updated.', 'event_espresso'), $this->_cpt_object->labels->singular_name),
1191 1191
 
1192
-			5 => isset( $_GET['revision'] ) ? sprintf( __('%s restored to revision from %s', 'event_espresso'), $this->_cpt_object->labels->singular_name, wp_post_revision_title( (int) $_GET['revision'], FALSE ) ) : FALSE,
1192
+			5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'event_espresso'), $this->_cpt_object->labels->singular_name, wp_post_revision_title((int) $_GET['revision'], FALSE)) : FALSE,
1193 1193
 
1194 1194
 			6 => sprintf(
1195
-					__( '%1$s published. %2$sView %1$s%3$s', 'event_espresso'),
1195
+					__('%1$s published. %2$sView %1$s%3$s', 'event_espresso'),
1196 1196
 					$this->_cpt_object->labels->singular_name,
1197
-					'<a href="' . esc_url( get_permalink( $id )) . '">',
1197
+					'<a href="'.esc_url(get_permalink($id)).'">',
1198 1198
 					'</a>'
1199 1199
 				),
1200 1200
 
1201
-			7 => sprintf( __( '%1$s saved.', 'event_espresso'), $this->_cpt_object->labels->singular_name ),
1201
+			7 => sprintf(__('%1$s saved.', 'event_espresso'), $this->_cpt_object->labels->singular_name),
1202 1202
 
1203 1203
 			8 => sprintf(
1204 1204
 				__('%1$s submitted. %2$sPreview %1$s%3$s', 'event_espresso'),
1205 1205
 				$this->_cpt_object->labels->singular_name,
1206
-				'<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $id ))) . '">',
1206
+				'<a target="_blank" href="'.esc_url(add_query_arg('preview', 'true', get_permalink($id))).'">',
1207 1207
 				'</a>'
1208 1208
 			),
1209 1209
 
1210 1210
 			9 => sprintf(
1211
-				__( '%1$s scheduled for: %2$s. %3$s">Preview %1$s%3$s', 'event_espresso'),
1211
+				__('%1$s scheduled for: %2$s. %3$s">Preview %1$s%3$s', 'event_espresso'),
1212 1212
 				$this->_cpt_object->labels->singular_name,
1213
-				'<strong>' . date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date )) . '</strong>',
1214
-				'<a target="_blank" href="' . esc_url( get_permalink( $id )),
1213
+				'<strong>'.date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)).'</strong>',
1214
+				'<a target="_blank" href="'.esc_url(get_permalink($id)),
1215 1215
 				'</a>'
1216 1216
 			),
1217 1217
 
1218 1218
 			10 => sprintf(
1219 1219
 				__('%1$s draft updated. %2$s">Preview page%3$s', 'event_espresso'),
1220 1220
 				$this->_cpt_object->labels->singular_name,
1221
-				'<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $id ))) ,
1221
+				'<a target="_blank" href="'.esc_url(add_query_arg('preview', 'true', get_permalink($id))),
1222 1222
 				'</a>'
1223 1223
 			)
1224 1224
 		);
@@ -1245,24 +1245,24 @@  discard block
 block discarded – undo
1245 1245
 		$post_type_object = $this->_cpt_object;
1246 1246
 		$title = $post_type_object->labels->add_new_item;
1247 1247
 		$editing = TRUE;
1248
-		wp_enqueue_script( 'autosave' );
1249
-		$post = $post = get_default_post_to_edit( $this->_cpt_routes[$this->_req_action], TRUE );
1248
+		wp_enqueue_script('autosave');
1249
+		$post = $post = get_default_post_to_edit($this->_cpt_routes[$this->_req_action], TRUE);
1250 1250
 		$post_ID = $post->ID;
1251 1251
 		$is_IE = $is_IE;
1252 1252
 
1253
-		add_action( 'admin_print_styles', array( $this, 'add_new_admin_page_global' ) );
1253
+		add_action('admin_print_styles', array($this, 'add_new_admin_page_global'));
1254 1254
 
1255 1255
 		//modify the default editor title field with default title.
1256
-		add_filter('enter_title_here', array( $this, 'add_custom_editor_default_title' ), 10 );
1256
+		add_filter('enter_title_here', array($this, 'add_custom_editor_default_title'), 10);
1257 1257
 
1258
-		include_once WP_ADMIN_PATH . 'edit-form-advanced.php';
1258
+		include_once WP_ADMIN_PATH.'edit-form-advanced.php';
1259 1259
 	}
1260 1260
 
1261 1261
 
1262 1262
 
1263 1263
 
1264 1264
 	public function add_new_admin_page_global() {
1265
-		$admin_page = !empty( $this->_req_data['post'] ) ? 'post-php' : 'post-new-php';
1265
+		$admin_page = ! empty($this->_req_data['post']) ? 'post-php' : 'post-new-php';
1266 1266
 		?>
1267 1267
 		<script type="text/javascript">
1268 1268
 			adminpage = '<?php echo $admin_page; ?>';
@@ -1284,16 +1284,16 @@  discard block
 block discarded – undo
1284 1284
 	 */
1285 1285
 	protected function _edit_cpt_item() {
1286 1286
 		global $post, $title, $is_IE, $post_type, $post_type_object;
1287
-		$post_id = isset( $this->_req_data['post'] ) ? $this->_req_data['post'] : NULL;
1288
-		$post = !empty( $post_id ) ? get_post( $post_id, OBJECT, 'edit' ) : NULL;
1287
+		$post_id = isset($this->_req_data['post']) ? $this->_req_data['post'] : NULL;
1288
+		$post = ! empty($post_id) ? get_post($post_id, OBJECT, 'edit') : NULL;
1289 1289
 
1290
-		if ( empty ( $post ) ) {
1291
-			wp_die( __('You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?') );
1290
+		if (empty ($post)) {
1291
+			wp_die(__('You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?'));
1292 1292
 		}
1293 1293
 
1294
-		if ( ! empty( $_GET['get-post-lock'] ) ) {
1295
-			wp_set_post_lock( $post_id );
1296
-			wp_redirect( get_edit_post_link( $post_id, 'url' ) );
1294
+		if ( ! empty($_GET['get-post-lock'])) {
1295
+			wp_set_post_lock($post_id);
1296
+			wp_redirect(get_edit_post_link($post_id, 'url'));
1297 1297
 			exit();
1298 1298
 		}
1299 1299
 
@@ -1305,32 +1305,32 @@  discard block
 block discarded – undo
1305 1305
 		$post_type_object = $this->_cpt_object;
1306 1306
 		$is_IE = $is_IE;
1307 1307
 
1308
-		if ( ! wp_check_post_lock( $post->ID ) ) {
1309
-			$active_post_lock = wp_set_post_lock( $post->ID );
1308
+		if ( ! wp_check_post_lock($post->ID)) {
1309
+			$active_post_lock = wp_set_post_lock($post->ID);
1310 1310
 			//wp_enqueue_script('autosave');
1311 1311
 		}
1312 1312
 
1313 1313
 		$title = $this->_cpt_object->labels->edit_item;
1314 1314
 
1315
-		add_action('admin_footer', '_admin_notice_post_locked' );
1315
+		add_action('admin_footer', '_admin_notice_post_locked');
1316 1316
 
1317
-		if ( isset( $this->_cpt_routes[$this->_req_data['action']] ) && !isset( $this->_labels['hide_add_button_on_cpt_route'][$this->_req_data['action']] ) ) {
1318
-			$create_new_action = apply_filters( 'FHEE__EE_Admin_Page_CPT___edit_cpt_item__create_new_action', 'create_new', $this );
1317
+		if (isset($this->_cpt_routes[$this->_req_data['action']]) && ! isset($this->_labels['hide_add_button_on_cpt_route'][$this->_req_data['action']])) {
1318
+			$create_new_action = apply_filters('FHEE__EE_Admin_Page_CPT___edit_cpt_item__create_new_action', 'create_new', $this);
1319 1319
 
1320
-			$post_new_file = EE_Admin_Page::add_query_args_and_nonce( array('action' => $create_new_action, 'page' => $this->page_slug), 'admin.php' );
1320
+			$post_new_file = EE_Admin_Page::add_query_args_and_nonce(array('action' => $create_new_action, 'page' => $this->page_slug), 'admin.php');
1321 1321
 		}
1322 1322
 
1323
-		if ( post_type_supports($this->_cpt_routes[$this->_req_action], 'comments') ) {
1323
+		if (post_type_supports($this->_cpt_routes[$this->_req_action], 'comments')) {
1324 1324
 			wp_enqueue_script('admin-comments');
1325 1325
 			enqueue_comment_hotkeys_js();
1326 1326
 		}
1327 1327
 
1328
-		add_action( 'admin_print_styles', array( $this, 'add_new_admin_page_global' ) );
1328
+		add_action('admin_print_styles', array($this, 'add_new_admin_page_global'));
1329 1329
 
1330 1330
 		//modify the default editor title field with default title.
1331
-		add_filter('enter_title_here', array( $this, 'add_custom_editor_default_title' ), 10 );
1331
+		add_filter('enter_title_here', array($this, 'add_custom_editor_default_title'), 10);
1332 1332
 
1333
-		include_once WP_ADMIN_PATH . 'edit-form-advanced.php';
1333
+		include_once WP_ADMIN_PATH.'edit-form-advanced.php';
1334 1334
 
1335 1335
 	}
1336 1336
 
Please login to merge, or discard this patch.
Braces   +52 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * EE_Admin_Page_CPT class
4 6
  *
@@ -231,8 +233,9 @@  discard block
 block discarded – undo
231 233
 
232 234
 		$containers = array();
233 235
 
234
-		if ( empty( $wp_meta_boxes ) )
235
-			return;
236
+		if ( empty( $wp_meta_boxes ) ) {
237
+					return;
238
+		}
236 239
 
237 240
 		$current_metaboxes = isset( $wp_meta_boxes[$this->page_slug] ) ? $wp_meta_boxes[$this->page_slug] : array();
238 241
 
@@ -336,8 +339,9 @@  discard block
 block discarded – undo
336 339
 
337 340
 
338 341
 		//this is a filter that allows the addition of extra html after the permalink field on the wp post edit-form
339
-		if ( method_exists( $this, 'extra_permalink_field_buttons' ) )
340
-			add_filter('get_sample_permalink_html', array( $this, 'extra_permalink_field_buttons' ), 10, 4 );
342
+		if ( method_exists( $this, 'extra_permalink_field_buttons' ) ) {
343
+					add_filter('get_sample_permalink_html', array( $this, 'extra_permalink_field_buttons' ), 10, 4 );
344
+		}
341 345
 
342 346
 		//add preview button
343 347
 		add_filter('get_sample_permalink_html', array($this, 'preview_button_html'), 5, 4 );
@@ -347,12 +351,14 @@  discard block
 block discarded – undo
347 351
 		add_action('post_submitbox_misc_actions', array($this, 'custom_post_stati_dropdown' ), 10 );
348 352
 
349 353
 		//This allows adding additional information to the publish post submitbox on the wp post edit form
350
-		if ( method_exists( $this, 'extra_misc_actions_publish_box' ) )
351
-			add_action('post_submitbox_misc_actions', array( $this, 'extra_misc_actions_publish_box' ), 10 );
354
+		if ( method_exists( $this, 'extra_misc_actions_publish_box' ) ) {
355
+					add_action('post_submitbox_misc_actions', array( $this, 'extra_misc_actions_publish_box' ), 10 );
356
+		}
352 357
 
353 358
 		//This allows for adding additional stuff after the title field on the wp post edit form.  This is also before the wp_editor for post description field.
354
-		if ( method_exists( $this, 'edit_form_after_title' ) )
355
-			add_action('edit_form_after_title', array( $this, 'edit_form_after_title' ), 10 );
359
+		if ( method_exists( $this, 'edit_form_after_title' ) ) {
360
+					add_action('edit_form_after_title', array( $this, 'edit_form_after_title' ), 10 );
361
+		}
356 362
 
357 363
 
358 364
 		/**
@@ -543,7 +549,9 @@  discard block
 block discarded – undo
543 549
 
544 550
 
545 551
 		//make sure we define doing autosave (cause WP isn't triggering this we want to make sure we define it)
546
-		if ( !defined('DOING_AUTOSAVE') ) define('DOING_AUTOSAVE', true);
552
+		if ( !defined('DOING_AUTOSAVE') ) {
553
+			define('DOING_AUTOSAVE', true);
554
+		}
547 555
 
548 556
 		//if we made it here then the nonce checked out.  Let's run our methods and actions
549 557
 		if ( method_exists( $this, '_ee_autosave_' . $this->_current_view ) ) {
@@ -573,8 +581,9 @@  discard block
 block discarded – undo
573 581
 	protected function _extend_page_config_for_cpt() {
574 582
 
575 583
 		//before doing anything we need to make sure this runs ONLY when the loaded page matches the set page_slug
576
-		if ( ( isset( $this->_req_data['page'] ) && $this->_req_data['page'] != $this->page_slug ) )
577
-			return;
584
+		if ( ( isset( $this->_req_data['page'] ) && $this->_req_data['page'] != $this->page_slug ) ) {
585
+					return;
586
+		}
578 587
 
579 588
 		//set page routes and page config but ONLY if we're not viewing a custom setup cpt route as defined in _cpt_routes
580 589
 		if ( !empty( $this->_cpt_object ) ) {
@@ -606,8 +615,9 @@  discard block
 block discarded – undo
606 615
 		}
607 616
 
608 617
 		//load the next section only if this is a matching cpt route as set in the cpt routes array.
609
-		if ( !isset( $this->_cpt_routes[$this->_req_action] ) )
610
-			return;
618
+		if ( !isset( $this->_cpt_routes[$this->_req_action] ) ) {
619
+					return;
620
+		}
611 621
 
612 622
 
613 623
 		$this->_cpt_route = isset( $this->_cpt_routes[$this->_req_action] ) ? TRUE : FALSE;
@@ -803,8 +813,9 @@  discard block
 block discarded – undo
803 813
 	public function insert_update( $post_id, $post ) {
804 814
 
805 815
 		//make sure that if this is a revision OR trash action that we don't do any updates!
806
-		if ( isset( $this->_req_data['action'] ) && ( $this->_req_data['action'] == 'restore' || $this->_req_data['action'] == 'trash' ) )
807
-			return;
816
+		if ( isset( $this->_req_data['action'] ) && ( $this->_req_data['action'] == 'restore' || $this->_req_data['action'] == 'trash' ) ) {
817
+					return;
818
+		}
808 819
 
809 820
 		//check for autosave and update our req_data property accordingly.
810 821
 		/*if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE && isset( $this->_req_data['ee_autosave_data'] ) ) {
@@ -828,8 +839,10 @@  discard block
 block discarded – undo
828 839
 			}
829 840
 		}
830 841
 
831
-		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
832
-			return; //TODO we'll remove this after reimplementing autosave in 4.2
842
+		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
843
+					return;
844
+		}
845
+		//TODO we'll remove this after reimplementing autosave in 4.2
833 846
 		$this->_insert_update_cpt_item( $post_id, $post );
834 847
 	}
835 848
 
@@ -900,7 +913,9 @@  discard block
 block discarded – undo
900 913
 	 */
901 914
 	public function modify_current_screen() {
902 915
 		//ONLY do this if the current page_route IS a cpt route
903
-		if ( !$this->_cpt_route ) return;
916
+		if ( !$this->_cpt_route ) {
917
+			return;
918
+		}
904 919
 		//routing things REALLY early b/c this is a cpt admin page
905 920
 		set_current_screen( $this->_cpt_routes[$this->_req_action]);
906 921
 		$this->_current_screen = get_current_screen();
@@ -940,8 +955,9 @@  discard block
 block discarded – undo
940 955
 	public function add_shortlink_button_to_editor( $shortlink, $id, $context, $allow_slugs ) {
941 956
 		if ( !empty( $id ) && '' != get_option('permalink_structure') ) {
942 957
 			$post = get_post( $id );
943
-			if ( isset($post->post_type) && $this->page_slug == $post->post_type )
944
-			$shortlink = home_url('?p=' . $post->ID);
958
+			if ( isset($post->post_type) && $this->page_slug == $post->post_type ) {
959
+						$shortlink = home_url('?p=' . $post->ID);
960
+			}
945 961
 		}
946 962
 		return $shortlink;
947 963
 	}
@@ -954,7 +970,9 @@  discard block
 block discarded – undo
954 970
 	 * @return void
955 971
 	 */
956 972
 	public function route_admin_request() {
957
-		if ( $this->_cpt_route ) return;
973
+		if ( $this->_cpt_route ) {
974
+			return;
975
+		}
958 976
 		try {
959 977
 			$this->_route_admin_request();
960 978
 		} catch ( EE_Error $e ) {
@@ -993,8 +1011,9 @@  discard block
 block discarded – undo
993 1011
 		$rev_id = isset($this->_req_data['revision']) ? $this->_req_data['revision'] : NULL;
994 1012
 
995 1013
 		//can't do anything without revision so let's get out if not present
996
-		if ( empty( $rev_id ) )
997
-			return $location;
1014
+		if ( empty( $rev_id ) ) {
1015
+					return $location;
1016
+		}
998 1017
 
999 1018
 		//get rev_post_data
1000 1019
 		$rev = get_post($rev_id);
@@ -1023,8 +1042,9 @@  discard block
 block discarded – undo
1023 1042
 	 */
1024 1043
 	public function modify_edit_post_link( $link, $id, $context ) {
1025 1044
 		$post = get_post( $id );
1026
-		if ( !isset( $this->_req_data['action'] ) || !isset( $this->_cpt_routes[$this->_req_data['action']] ) || $post->post_type !== $this->_cpt_routes[$this->_req_data['action']] )
1027
-			return $link;
1045
+		if ( !isset( $this->_req_data['action'] ) || !isset( $this->_cpt_routes[$this->_req_data['action']] ) || $post->post_type !== $this->_cpt_routes[$this->_req_data['action']] ) {
1046
+					return $link;
1047
+		}
1028 1048
 		$query_args = array(
1029 1049
 			'action' => isset($this->_cpt_edit_routes[$post->post_type]) ? $this->_cpt_edit_routes[$post->post_type] : 'edit',
1030 1050
 			'post' => $id
@@ -1044,8 +1064,9 @@  discard block
 block discarded – undo
1044 1064
 	 */
1045 1065
 	public function modify_delete_post_link( $delete_link, $post_id, $force_delete ) {
1046 1066
 		$post = get_post($post_id);
1047
-		if ( !isset( $this->_req_data['action'] ) || ( isset( $this->_cpt_routes[$this->_req_data['action']] ) && $post->post_type !== $this->_cpt_routes[$this->_req_data['action']] ) )
1048
-			return $delete_link;
1067
+		if ( !isset( $this->_req_data['action'] ) || ( isset( $this->_cpt_routes[$this->_req_data['action']] ) && $post->post_type !== $this->_cpt_routes[$this->_req_data['action']] ) ) {
1068
+					return $delete_link;
1069
+		}
1049 1070
 
1050 1071
 		return add_query_arg( array('current_route' => 'trash' ), $delete_link );
1051 1072
 	}
@@ -1059,8 +1080,9 @@  discard block
 block discarded – undo
1059 1080
 	 * @return string           url to redirect to
1060 1081
 	 */
1061 1082
 	public function cpt_trash_post_location_redirect( $location, $status ) {
1062
-		if ( isset( $this->_req_data['action'] ) && $this->_req_data['action'] !== 'trash' && empty( $this->_req_data['post'] ) )
1063
-			return $location;
1083
+		if ( isset( $this->_req_data['action'] ) && $this->_req_data['action'] !== 'trash' && empty( $this->_req_data['post'] ) ) {
1084
+					return $location;
1085
+		}
1064 1086
 
1065 1087
 		$post = get_post( $this->_req_data['post'] );
1066 1088
 		$query_args = array( 'action' => 'default' );
Please login to merge, or discard this patch.
core/admin/EE_Admin_Page_CPT_Init.core.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	public function do_initial_loads() {
33 33
 		//we want to use the corresponding admin page object (but not route it!).  To do this we just set _routing to false.  That way this page object is being loaded on all pages to make sure we hook into admin properly.  But note... we are ONLY doing this if the given page is NOT pages we WANT to load ;)
34 34
 		//This is important because we have hooks that help redirect custom post type saves
35
-		if ( !isset( $_REQUEST['page'] ) || ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] != $this->_menu_map->menu_slug ) ) {
35
+		if ( ! isset($_REQUEST['page']) || (isset($_REQUEST['page']) && $_REQUEST['page'] != $this->_menu_map->menu_slug)) {
36 36
 			$this->_routing = FALSE;
37 37
 			$this->_initialize_admin_page();
38 38
 		} else {
@@ -40,17 +40,17 @@  discard block
 block discarded – undo
40 40
 			$this->_initialize_admin_page();
41 41
 			//added for 4.1 to completely disable autosave for our pages. This can be removed once we fully enable autosave functionality
42 42
 			remove_filter('wp_print_scripts', 'wp_just_in_time_script_localization');
43
-			add_filter('wp_print_scripts', array($this, 'wp_just_in_time_script_localization'), 100 );
43
+			add_filter('wp_print_scripts', array($this, 'wp_just_in_time_script_localization'), 100);
44 44
 			//end removal of autosave functionality.
45 45
 		}
46 46
 	}
47 47
 
48 48
 	public function wp_just_in_time_script_localization() {
49
-		wp_localize_script( 'autosave', 'autosaveL10n', array(
49
+		wp_localize_script('autosave', 'autosaveL10n', array(
50 50
 			'autosaveInterval' => 172800,
51 51
 			'savingText' => __('Saving Draft&#8230;'),
52 52
 			'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')
53
-		) );
53
+		));
54 54
 	}
55 55
 
56 56
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
core/admin/EE_Admin_Page_Init.core.php 2 patches
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -88,16 +88,16 @@  discard block
 block discarded – undo
88 88
 		$this->_set_init_properties();
89 89
 
90 90
 		//global styles/scripts across all wp admin pages
91
-		add_action('admin_enqueue_scripts', array($this, 'load_wp_global_scripts_styles'), 5 );
91
+		add_action('admin_enqueue_scripts', array($this, 'load_wp_global_scripts_styles'), 5);
92 92
 
93 93
 		//load initial stuff.
94 94
 		$this->_set_file_and_folder_name();
95 95
 
96 96
 		$this->_set_menu_map();
97 97
 
98
-		if ( empty( $this->_menu_map ) || is_array( $this->_menu_map ) )
98
+		if (empty($this->_menu_map) || is_array($this->_menu_map))
99 99
 			 {
100
-			 	EE_Error::doing_it_wrong( get_class( $this ) . '::$_menu_map', sprintf( __('The EE4 addon with the class %s is setting up the _menu_map property incorrectly for this version of EE core.  Please see Admin_Page_Init class examples in core for the new way of setting this property up.', 'event_espresso' ), get_class( $this ) ), '4.4.0' );
100
+			 	EE_Error::doing_it_wrong(get_class($this).'::$_menu_map', sprintf(__('The EE4 addon with the class %s is setting up the _menu_map property incorrectly for this version of EE core.  Please see Admin_Page_Init class examples in core for the new way of setting this property up.', 'event_espresso'), get_class($this)), '4.4.0');
101 101
 			 	return;
102 102
 			 }
103 103
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	public function load_wp_global_scripts_styles() {
160 160
 		/** STYLES **/
161 161
 		//register
162
-		wp_register_style('espresso_menu', EE_ADMIN_URL . 'assets/admin-menu-styles.css');
162
+		wp_register_style('espresso_menu', EE_ADMIN_URL.'assets/admin-menu-styles.css');
163 163
 
164 164
 
165 165
 
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
 
202 202
 
203 203
 	protected function _set_capability() {
204
-		$capability = empty($this->capability) ?  $this->_menu_map->capability : $this->capability;
205
-		$this->capability = apply_filters( 'FHEE_' . $this->_menu_map->menu_slug . '_capability', $capability );
204
+		$capability = empty($this->capability) ? $this->_menu_map->capability : $this->capability;
205
+		$this->capability = apply_filters('FHEE_'.$this->_menu_map->menu_slug.'_capability', $capability);
206 206
 	}
207 207
 
208 208
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	public function initialize_admin_page() {
221 221
 		//let's check user access first
222 222
 		$this->_check_user_access();
223
-		if ( !is_object( $this->_loaded_page_object) ) return;
223
+		if ( ! is_object($this->_loaded_page_object)) return;
224 224
 		$this->_loaded_page_object->route_admin_request();
225 225
 		return;
226 226
 	}
@@ -232,25 +232,25 @@  discard block
 block discarded – undo
232 232
 
233 233
 
234 234
 	public function set_page_dependencies($wp_page_slug) {
235
-		if ( !$this->_load_page ) return;
235
+		if ( ! $this->_load_page) return;
236 236
 
237
-		if ( !is_object($this->_loaded_page_object) ) {
237
+		if ( ! is_object($this->_loaded_page_object)) {
238 238
 			$msg[] = __('We can\'t load the page because we\'re missing a valid page object that tells us what to load', 'event_espresso');
239
-			$msg[] = $msg[0] . "\r\n" . sprintf(
239
+			$msg[] = $msg[0]."\r\n".sprintf(
240 240
 				__('The custom slug you have set for this page is %s. This means we\'re looking for the class %s_Admin_Page (found in %s_Admin_Page.core.php) within your %s directory', 'event_espresso'),
241 241
 				 $this->_file_name,
242 242
 				 $this->_file_name,
243
-				 $this->_folder_path . $this->_file_name,
243
+				 $this->_folder_path.$this->_file_name,
244 244
 				 $this->_menu_map->menu_slug
245 245
 			);
246
-			throw new EE_Error( implode( '||', $msg) );
246
+			throw new EE_Error(implode('||', $msg));
247 247
 		}
248 248
 
249 249
 		$this->_loaded_page_object->set_wp_page_slug($wp_page_slug);
250
-		$page_hook = 'load-' . $wp_page_slug;
250
+		$page_hook = 'load-'.$wp_page_slug;
251 251
 		//hook into page load hook so all page specific stuff get's loaded.
252
-		if ( !empty($wp_page_slug) )
253
-			add_action($page_hook, array($this->_loaded_page_object, 'load_page_dependencies') );
252
+		if ( ! empty($wp_page_slug))
253
+			add_action($page_hook, array($this->_loaded_page_object, 'load_page_dependencies'));
254 254
 	}
255 255
 
256 256
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function do_initial_loads() {
263 263
 		//no loading or initializing if menu map is setup incorrectly.
264
-		if ( empty( $this->_menu_map ) || is_array( $this->_menu_map ) ) {
264
+		if (empty($this->_menu_map) || is_array($this->_menu_map)) {
265 265
 			return;
266 266
 		}
267 267
 		$this->_initialize_admin_page();
@@ -278,19 +278,19 @@  discard block
 block discarded – undo
278 278
 		$bt = debug_backtrace();
279 279
 		//for more reliable determination of folder name
280 280
 		//we're using this to get the actual folder name of the CALLING class (i.e. the child class that extends this).  Why?  Because $this->menu_slug may be different than the folder name (to avoid conflicts with other plugins)
281
-		$class = get_class( $this );
282
-		foreach ( $bt as $index => $values ) {
283
-			if ( isset( $values['class'] ) && $values['class'] == $class ) {
281
+		$class = get_class($this);
282
+		foreach ($bt as $index => $values) {
283
+			if (isset($values['class']) && $values['class'] == $class) {
284 284
 				$file_index = $index - 1;
285
-				$this->_folder_name = basename(dirname($bt[$file_index]['file']) );
286
-				if ( !empty( $this->_folder_name ) ) break;
285
+				$this->_folder_name = basename(dirname($bt[$file_index]['file']));
286
+				if ( ! empty($this->_folder_name)) break;
287 287
 			}
288 288
 		}
289 289
 
290
-		$this->_folder_path = EE_ADMIN_PAGES . $this->_folder_name . DS;
290
+		$this->_folder_path = EE_ADMIN_PAGES.$this->_folder_name.DS;
291 291
 
292
-		$this->_file_name = preg_replace( '/^ee/' , 'EE', $this->_folder_name );
293
-		$this->_file_name = ucwords( str_replace('_', ' ', $this->_file_name) );
292
+		$this->_file_name = preg_replace('/^ee/', 'EE', $this->_folder_name);
293
+		$this->_file_name = ucwords(str_replace('_', ' ', $this->_file_name));
294 294
 		$this->_file_name = str_replace(' ', '_', $this->_file_name);
295 295
 	}
296 296
 
@@ -302,19 +302,19 @@  discard block
 block discarded – undo
302 302
 	 * @param bool $extend This indicates whether we're checking the extend directory for any register_hooks files/classes
303 303
 	 * @return array
304 304
 	 */
305
-	public function register_hooks( $extend = FALSE ) {
305
+	public function register_hooks($extend = FALSE) {
306 306
 
307 307
 		//get a list of files in the directory that have the "Hook" in their name an
308 308
 
309 309
 		//if this is an extended check (i.e. caf is active) then we will scan the caffeinated/extend directory first and any hook files that are found will be have their reference added to the $_files_hook array property.  Then, we make sure that when we loop through the core decaf directories to find hook files that we skip over any hooks files that have already been set by caf.
310
-		if ( $extend ) {
311
-			$hook_files_glob_path = apply_filters( 'FHEE__EE_Admin_Page_Init__register_hooks__hook_files_glob_path__extend', EE_CORE_CAF_ADMIN_EXTEND . $this->_folder_name . DS . '*' . $this->_file_name . '_Hooks_Extend.class.php' );
312
-			$this->_hook_paths = $this->_register_hook_files( $hook_files_glob_path, $extend );
310
+		if ($extend) {
311
+			$hook_files_glob_path = apply_filters('FHEE__EE_Admin_Page_Init__register_hooks__hook_files_glob_path__extend', EE_CORE_CAF_ADMIN_EXTEND.$this->_folder_name.DS.'*'.$this->_file_name.'_Hooks_Extend.class.php');
312
+			$this->_hook_paths = $this->_register_hook_files($hook_files_glob_path, $extend);
313 313
 		}
314 314
 
315 315
 		//loop through decaf folders
316
-		$hook_files_glob_path = apply_filters( 'FHEE__EE_Admin_Page_Init__register_hooks__hook_files_glob_path', $this->_folder_path . '*' . $this->_file_name . '_Hooks.class.php' );
317
-		$this->_hook_paths = array_merge( $this->_register_hook_files( $hook_files_glob_path ), $this->_hook_paths );  //making sure any extended hook paths are later in the array than the core hook paths!
316
+		$hook_files_glob_path = apply_filters('FHEE__EE_Admin_Page_Init__register_hooks__hook_files_glob_path', $this->_folder_path.'*'.$this->_file_name.'_Hooks.class.php');
317
+		$this->_hook_paths = array_merge($this->_register_hook_files($hook_files_glob_path), $this->_hook_paths); //making sure any extended hook paths are later in the array than the core hook paths!
318 318
 
319 319
 		return $this->_hook_paths;
320 320
 
@@ -322,27 +322,27 @@  discard block
 block discarded – undo
322 322
 
323 323
 
324 324
 
325
-	protected function _register_hook_files( $hook_files_glob_path, $extend = FALSE ) {
325
+	protected function _register_hook_files($hook_files_glob_path, $extend = FALSE) {
326 326
 		$hook_paths = array();
327
-		if ( $hook_files = glob( $hook_files_glob_path ) ) {
328
-			if ( empty( $hook_files ) ) {
327
+		if ($hook_files = glob($hook_files_glob_path)) {
328
+			if (empty($hook_files)) {
329 329
 				return array();
330 330
 			}
331
-			foreach ( $hook_files as $file ) {
331
+			foreach ($hook_files as $file) {
332 332
 				//lets get the linked admin.
333
-				$hook_file = $extend ? str_replace( EE_CORE_CAF_ADMIN_EXTEND . $this->_folder_name . DS, '', $file ) : str_replace($this->_folder_path, '', $file );
334
-				$replace = $extend ? '_' . $this->_file_name . '_Hooks_Extend.class.php' : '_' . $this->_file_name . '_Hooks.class.php';
335
-				$rel_admin = str_replace( $replace, '', $hook_file);
333
+				$hook_file = $extend ? str_replace(EE_CORE_CAF_ADMIN_EXTEND.$this->_folder_name.DS, '', $file) : str_replace($this->_folder_path, '', $file);
334
+				$replace = $extend ? '_'.$this->_file_name.'_Hooks_Extend.class.php' : '_'.$this->_file_name.'_Hooks.class.php';
335
+				$rel_admin = str_replace($replace, '', $hook_file);
336 336
 				$rel_admin = strtolower($rel_admin);
337 337
 				$hook_paths[] = $file;
338 338
 
339 339
 				//make sure we haven't already got a hook setup for this page path
340
-				if ( in_array( $rel_admin, $this->_files_hooked ) )
340
+				if (in_array($rel_admin, $this->_files_hooked))
341 341
 					continue;
342 342
 
343 343
 				$this->hook_file = $hook_file;
344
-				$rel_admin_hook = 'FHEE_do_other_page_hooks_' . $rel_admin;
345
-				$filter = add_filter( $rel_admin_hook, array($this, 'load_admin_hook') );
344
+				$rel_admin_hook = 'FHEE_do_other_page_hooks_'.$rel_admin;
345
+				$filter = add_filter($rel_admin_hook, array($this, 'load_admin_hook'));
346 346
 				$this->_files_hooked[] = $rel_admin;
347 347
 			}
348 348
 		}
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 	protected function _initialize_admin_page() {
368 368
 
369 369
 		//JUST CHECK WE'RE ON RIGHT PAGE.
370
-		if ( (!isset( $_REQUEST['page'] ) || $_REQUEST['page'] != $this->_menu_map->menu_slug) && $this->_routing )
370
+		if (( ! isset($_REQUEST['page']) || $_REQUEST['page'] != $this->_menu_map->menu_slug) && $this->_routing)
371 371
 			return; //not on the right page so let's get out.
372 372
 		$this->_load_page = TRUE;
373 373
 
@@ -375,30 +375,30 @@  discard block
 block discarded – undo
375 375
 //		spl_autoload_register(array( $this, 'set_autoloaders') );
376 376
 
377 377
 		//we don't need to do a page_request check here because it's only called via WP menu system.
378
-		$admin_page = $this->_file_name . '_Admin_Page';
379
-		$hook_suffix = $this->_menu_map->menu_slug . '_' . $admin_page;
378
+		$admin_page = $this->_file_name.'_Admin_Page';
379
+		$hook_suffix = $this->_menu_map->menu_slug.'_'.$admin_page;
380 380
 		$admin_page = apply_filters("FHEE__EE_Admin_Page_Init___initialize_admin_page__admin_page__{$hook_suffix}", $admin_page);
381 381
 
382 382
 		// define requested admin page class name then load the file and instantiate
383
-		$path_to_file = str_replace( array( '\\', '/' ), DS, $this->_folder_path . $admin_page . '.core.php' );
384
-		$path_to_file=apply_filters("FHEE__EE_Admin_Page_Init___initialize_admin_page__path_to_file__{$hook_suffix}",$path_to_file );//so if the file would be in EE_ADMIN/attendees/Attendee_Admin_Page.core.php, the filter would be FHEE__EE_Admin_Page_Init___initialize_admin_page__path_to_file__attendees_Attendee_Admin_Page
383
+		$path_to_file = str_replace(array('\\', '/'), DS, $this->_folder_path.$admin_page.'.core.php');
384
+		$path_to_file = apply_filters("FHEE__EE_Admin_Page_Init___initialize_admin_page__path_to_file__{$hook_suffix}", $path_to_file); //so if the file would be in EE_ADMIN/attendees/Attendee_Admin_Page.core.php, the filter would be FHEE__EE_Admin_Page_Init___initialize_admin_page__path_to_file__attendees_Attendee_Admin_Page
385 385
 
386
-		if ( is_readable( $path_to_file )) {
386
+		if (is_readable($path_to_file)) {
387 387
 			// This is a place where EE plugins can hook in to make sure their own files are required in the appropriate place
388
-			do_action( 'AHEE__EE_Admin_Page___initialize_admin_page__before_initialization' );
389
-			do_action( 'AHEE__EE_Admin_Page___initialize_admin_page__before_initialization_' . $this->_menu_map->menu_slug );
390
-			require_once( $path_to_file );
391
-			$a = new ReflectionClass( $admin_page );
392
-			$this->_loaded_page_object = $a->newInstance( $this->_routing );
388
+			do_action('AHEE__EE_Admin_Page___initialize_admin_page__before_initialization');
389
+			do_action('AHEE__EE_Admin_Page___initialize_admin_page__before_initialization_'.$this->_menu_map->menu_slug);
390
+			require_once($path_to_file);
391
+			$a = new ReflectionClass($admin_page);
392
+			$this->_loaded_page_object = $a->newInstance($this->_routing);
393 393
 		}
394
-		do_action( 'AHEE__EE_Admin_Page___initialize_admin_page__after_initialization' );
395
-		do_action( 'AHEE__EE_Admin_Page___initialize_admin_page__after_initialization_' . $this->_menu_map->menu_slug );
394
+		do_action('AHEE__EE_Admin_Page___initialize_admin_page__after_initialization');
395
+		do_action('AHEE__EE_Admin_Page___initialize_admin_page__after_initialization_'.$this->_menu_map->menu_slug);
396 396
 	}
397 397
 
398 398
 
399 399
 
400 400
 	public function get_admin_page_name() {
401
-		return $this->_file_name . '_Admin_Page';
401
+		return $this->_file_name.'_Admin_Page';
402 402
 	}
403 403
 
404 404
 
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
 	 * @return bool|die true if pass (or admin) wp_die if fail
432 432
 	 */
433 433
 	private function _check_user_access() {
434
-		if ( ! EE_Registry::instance()->CAP->current_user_can( $this->_menu_map->capability, $this->_menu_map->menu_slug ) ) {
435
-			wp_die( __('You don\'t have access to this page.'), '', array( 'back_link' => true ) );
434
+		if ( ! EE_Registry::instance()->CAP->current_user_can($this->_menu_map->capability, $this->_menu_map->menu_slug)) {
435
+			wp_die(__('You don\'t have access to this page.'), '', array('back_link' => true));
436 436
 		}
437 437
 		return true;
438 438
 	}
Please login to merge, or discard this patch.
Braces   +22 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -220,7 +222,9 @@  discard block
 block discarded – undo
220 222
 	public function initialize_admin_page() {
221 223
 		//let's check user access first
222 224
 		$this->_check_user_access();
223
-		if ( !is_object( $this->_loaded_page_object) ) return;
225
+		if ( !is_object( $this->_loaded_page_object) ) {
226
+			return;
227
+		}
224 228
 		$this->_loaded_page_object->route_admin_request();
225 229
 		return;
226 230
 	}
@@ -232,7 +236,9 @@  discard block
 block discarded – undo
232 236
 
233 237
 
234 238
 	public function set_page_dependencies($wp_page_slug) {
235
-		if ( !$this->_load_page ) return;
239
+		if ( !$this->_load_page ) {
240
+			return;
241
+		}
236 242
 
237 243
 		if ( !is_object($this->_loaded_page_object) ) {
238 244
 			$msg[] = __('We can\'t load the page because we\'re missing a valid page object that tells us what to load', 'event_espresso');
@@ -249,8 +255,9 @@  discard block
 block discarded – undo
249 255
 		$this->_loaded_page_object->set_wp_page_slug($wp_page_slug);
250 256
 		$page_hook = 'load-' . $wp_page_slug;
251 257
 		//hook into page load hook so all page specific stuff get's loaded.
252
-		if ( !empty($wp_page_slug) )
253
-			add_action($page_hook, array($this->_loaded_page_object, 'load_page_dependencies') );
258
+		if ( !empty($wp_page_slug) ) {
259
+					add_action($page_hook, array($this->_loaded_page_object, 'load_page_dependencies') );
260
+		}
254 261
 	}
255 262
 
256 263
 
@@ -283,7 +290,9 @@  discard block
 block discarded – undo
283 290
 			if ( isset( $values['class'] ) && $values['class'] == $class ) {
284 291
 				$file_index = $index - 1;
285 292
 				$this->_folder_name = basename(dirname($bt[$file_index]['file']) );
286
-				if ( !empty( $this->_folder_name ) ) break;
293
+				if ( !empty( $this->_folder_name ) ) {
294
+					break;
295
+				}
287 296
 			}
288 297
 		}
289 298
 
@@ -337,8 +346,9 @@  discard block
 block discarded – undo
337 346
 				$hook_paths[] = $file;
338 347
 
339 348
 				//make sure we haven't already got a hook setup for this page path
340
-				if ( in_array( $rel_admin, $this->_files_hooked ) )
341
-					continue;
349
+				if ( in_array( $rel_admin, $this->_files_hooked ) ) {
350
+									continue;
351
+				}
342 352
 
343 353
 				$this->hook_file = $hook_file;
344 354
 				$rel_admin_hook = 'FHEE_do_other_page_hooks_' . $rel_admin;
@@ -367,8 +377,10 @@  discard block
 block discarded – undo
367 377
 	protected function _initialize_admin_page() {
368 378
 
369 379
 		//JUST CHECK WE'RE ON RIGHT PAGE.
370
-		if ( (!isset( $_REQUEST['page'] ) || $_REQUEST['page'] != $this->_menu_map->menu_slug) && $this->_routing )
371
-			return; //not on the right page so let's get out.
380
+		if ( (!isset( $_REQUEST['page'] ) || $_REQUEST['page'] != $this->_menu_map->menu_slug) && $this->_routing ) {
381
+					return;
382
+		}
383
+		//not on the right page so let's get out.
372 384
 		$this->_load_page = TRUE;
373 385
 
374 386
 		//let's set page specific autoloaders.  Note that this just sets autoloaders for THIS set of admin pages.
Please login to merge, or discard this patch.
core/admin/EE_Admin_Page_Loader.core.php 2 patches
Braces   +14 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -237,8 +238,9 @@  discard block
 block discarded – undo
237 238
 		//first let's order the menu groups by their internal menu order (note usort type hinting to ensure the incoming array is EE_Admin_Page_Menu_Map objects )
238 239
 		usort( $this->_admin_menu_groups, array( $this, '_sort_menu_maps' ) );
239 240
 		foreach ( $this->_admin_menu_groups as $group ) {
240
-			if ( ! $group instanceof EE_Admin_Page_Menu_Group )
241
-				throw new EE_Error( sprintf( __('Unable to continue sorting the menu groups array because there is an invalid value for the menu groups.  All values in this array are required to be a EE_Admin_Page_Menu_Group object.  Instead there was: %s', 'event_espresso'), print_r($group, TRUE) ) );
241
+			if ( ! $group instanceof EE_Admin_Page_Menu_Group ) {
242
+							throw new EE_Error( sprintf( __('Unable to continue sorting the menu groups array because there is an invalid value for the menu groups.  All values in this array are required to be a EE_Admin_Page_Menu_Group object.  Instead there was: %s', 'event_espresso'), print_r($group, TRUE) ) );
243
+			}
242 244
 			$groups[$group->menu_slug] = $group;
243 245
 		}
244 246
 		return $groups;
@@ -494,8 +496,9 @@  discard block
 block discarded – undo
494 496
 		//let's sort the groups, make sure it's a valid group, add header (if to show).
495 497
 		foreach ( $pages_array as $group => $menu_maps ) {
496 498
 			//valid_group?
497
-			if ( ! array_key_exists( $group, $menu_groups ) )
498
-				continue;
499
+			if ( ! array_key_exists( $group, $menu_groups ) ) {
500
+							continue;
501
+			}
499 502
 
500 503
 			//sort pages.
501 504
 			usort( $menu_maps, array( $this, '_sort_menu_maps' ) );
@@ -510,8 +513,9 @@  discard block
 block discarded – undo
510 513
 
511 514
 		//now let's setup the _prepped_menu_maps property
512 515
 		foreach ( $menu_groups as $group => $group_objs ) {
513
-			if ( isset( $pages_array[$group] ) )
514
-				$this->_prepped_menu_maps = array_merge( $this->_prepped_menu_maps, $pages_array[$group] );
516
+			if ( isset( $pages_array[$group] ) ) {
517
+							$this->_prepped_menu_maps = array_merge( $this->_prepped_menu_maps, $pages_array[$group] );
518
+			}
515 519
 		}/**/
516 520
 
517 521
 	}
@@ -656,8 +660,9 @@  discard block
 block discarded – undo
656 660
 	 * @return int    sort order
657 661
 	 */
658 662
 	private function _sort_menu_maps( EE_Admin_Page_Menu_Map $a, EE_Admin_Page_Menu_Map $b ) {
659
-		if ( $a->menu_order == $b->menu_order )
660
-			return 0;
663
+		if ( $a->menu_order == $b->menu_order ) {
664
+					return 0;
665
+		}
661 666
 		return ($a->menu_order < $b->menu_order) ? -1 : 1;
662 667
 	}
663 668
 
Please login to merge, or discard this patch.
Spacing   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 		//let's do a scan and see what installed pages we have
120 120
 		$this->_get_installed_pages();
121 121
 		//set menus (has to be done on every load - we're not actually loading the page just setting the menus and where they point to).
122
-		add_action('admin_menu', array( $this, 'set_menus' ));
123
-		add_action( 'network_admin_menu', array( $this, 'set_network_menus' ) );
122
+		add_action('admin_menu', array($this, 'set_menus'));
123
+		add_action('network_admin_menu', array($this, 'set_network_menus'));
124 124
 	}
125 125
 
126 126
 
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
 	 * @return void
134 134
 	 */
135 135
 	private function _define_caffeinated_constants() {
136
-		define( 'EE_CORE_CAF_ADMIN', EE_PLUGIN_DIR_PATH . 'caffeinated/admin/');
137
-		define( 'EE_CORE_CAF_ADMIN_URL', EE_PLUGIN_DIR_URL . 'caffeinated/admin/');
138
-		define( 'EE_CORE_CAF_ADMIN_NEW', EE_CORE_CAF_ADMIN . 'new/');
139
-		define( 'EE_CORE_CAF_ADMIN_EXTEND', EE_CORE_CAF_ADMIN . 'extend/');
140
-		define( 'EE_CORE_CAF_ADMIN_EXTEND_URL', EE_CORE_CAF_ADMIN_URL . 'extend/');
141
-		define( 'EE_CORE_CAF_ADMIN_HOOKS', EE_CORE_CAF_ADMIN . 'hooks/');
136
+		define('EE_CORE_CAF_ADMIN', EE_PLUGIN_DIR_PATH.'caffeinated/admin/');
137
+		define('EE_CORE_CAF_ADMIN_URL', EE_PLUGIN_DIR_URL.'caffeinated/admin/');
138
+		define('EE_CORE_CAF_ADMIN_NEW', EE_CORE_CAF_ADMIN.'new/');
139
+		define('EE_CORE_CAF_ADMIN_EXTEND', EE_CORE_CAF_ADMIN.'extend/');
140
+		define('EE_CORE_CAF_ADMIN_EXTEND_URL', EE_CORE_CAF_ADMIN_URL.'extend/');
141
+		define('EE_CORE_CAF_ADMIN_HOOKS', EE_CORE_CAF_ADMIN.'hooks/');
142 142
 	}
143 143
 
144 144
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
 		//set array of EE_Admin_Page_Menu_Group objects
158 158
 		$groups = array(
159
-			'main' => new EE_Admin_Page_Menu_Group( array(
159
+			'main' => new EE_Admin_Page_Menu_Group(array(
160 160
 				'menu_label' => __('Main', 'event_espresso'),
161 161
 				'show_on_menu' => EE_Admin_Page_Menu_Map::NONE,
162 162
 				'menu_slug' => 'main',
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 				'menu_order' => 0,
165 165
 				'parent_slug' => 'espresso_events',
166 166
 				)),
167
-			'management' => new EE_Admin_Page_Menu_Group( array(
167
+			'management' => new EE_Admin_Page_Menu_Group(array(
168 168
 				'menu_label' => __('Management', 'event_espresso'),
169 169
 				'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
170 170
 				'menu_slug' => 'management',
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 				'menu_order' => 10,
173 173
 				'parent_slug' => 'espresso_events'
174 174
 				)),
175
-			'settings' => new EE_Admin_Page_Menu_Group( array(
175
+			'settings' => new EE_Admin_Page_Menu_Group(array(
176 176
 				'menu_label' => __('Settings', 'event_espresso'),
177 177
 				'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
178 178
 				'menu_slug' => 'settings',
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 				'menu_order' => 30,
181 181
 				'parent_slug' => 'espresso_events'
182 182
 				)),
183
-			'templates' => new EE_Admin_Page_Menu_Group( array(
183
+			'templates' => new EE_Admin_Page_Menu_Group(array(
184 184
 				'menu_label' => __('Templates', 'event_espresso'),
185 185
 				'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
186 186
 				'menu_slug' => 'templates',
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 				'menu_order' => 40,
189 189
 				'parent_slug' => 'espresso_events'
190 190
 				)),
191
-			'extras' => new EE_Admin_Page_Menu_Group( array(
191
+			'extras' => new EE_Admin_Page_Menu_Group(array(
192 192
 				'menu_label' => __('Extras', 'event_espresso'),
193 193
 				'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN,
194 194
 				'menu_slug' => 'extras',
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 				'parent_slug' => 'espresso_events',
198 198
 				'maintenance_mode_parent' => 'espresso_maintenance_settings'
199 199
 				)),
200
-			'tools' => new EE_Admin_Page_Menu_Group( array(
200
+			'tools' => new EE_Admin_Page_Menu_Group(array(
201 201
 				'menu_label' => __("Tools", "event_espresso"),
202 202
 				'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
203 203
 				'menu_slug' => 'tools',
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 				'menu_order' => 60,
206 206
 				'parent_slug' => 'espresso_events'
207 207
 				)),
208
-			'addons' => new EE_Admin_Page_Menu_Group( array(
208
+			'addons' => new EE_Admin_Page_Menu_Group(array(
209 209
 				'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN,
210 210
 				'menu_label' => __('Add-ons', 'event_espresso'),
211 211
 				'menu_slug' => 'addons',
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 				))
216 216
 			);
217 217
 
218
-		$this->_admin_menu_groups = apply_filters( 'FHEE__EE_Admin_Page_Loader___set_menu_groups__admin_menu_groups', $groups );
218
+		$this->_admin_menu_groups = apply_filters('FHEE__EE_Admin_Page_Loader___set_menu_groups__admin_menu_groups', $groups);
219 219
 	}
220 220
 
221 221
 
@@ -233,10 +233,10 @@  discard block
 block discarded – undo
233 233
 	private function _rearrange_menu_groups() {
234 234
 		$groups = array();
235 235
 		//first let's order the menu groups by their internal menu order (note usort type hinting to ensure the incoming array is EE_Admin_Page_Menu_Map objects )
236
-		usort( $this->_admin_menu_groups, array( $this, '_sort_menu_maps' ) );
237
-		foreach ( $this->_admin_menu_groups as $group ) {
238
-			if ( ! $group instanceof EE_Admin_Page_Menu_Group )
239
-				throw new EE_Error( sprintf( __('Unable to continue sorting the menu groups array because there is an invalid value for the menu groups.  All values in this array are required to be a EE_Admin_Page_Menu_Group object.  Instead there was: %s', 'event_espresso'), print_r($group, TRUE) ) );
236
+		usort($this->_admin_menu_groups, array($this, '_sort_menu_maps'));
237
+		foreach ($this->_admin_menu_groups as $group) {
238
+			if ( ! $group instanceof EE_Admin_Page_Menu_Group)
239
+				throw new EE_Error(sprintf(__('Unable to continue sorting the menu groups array because there is an invalid value for the menu groups.  All values in this array are required to be a EE_Admin_Page_Menu_Group object.  Instead there was: %s', 'event_espresso'), print_r($group, TRUE)));
240 240
 			$groups[$group->menu_slug] = $group;
241 241
 		}
242 242
 		return $groups;
@@ -254,48 +254,48 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	private function _get_installed_pages() {
256 256
 		$installed_refs = array();
257
-		$exclude = array( 'assets', 'templates' );
257
+		$exclude = array('assets', 'templates');
258 258
 		// grab everything in the  admin core directory
259
-		$admin_screens = glob( EE_ADMIN_PAGES . '*', GLOB_ONLYDIR );
260
-		if ( $admin_screens ) {
261
-			foreach( $admin_screens as $admin_screen ) {
259
+		$admin_screens = glob(EE_ADMIN_PAGES.'*', GLOB_ONLYDIR);
260
+		if ($admin_screens) {
261
+			foreach ($admin_screens as $admin_screen) {
262 262
 				// files and anything in the exclude array need not apply
263
-				if ( is_dir( $admin_screen ) && ! in_array( basename( $admin_screen ), $exclude )) {
263
+				if (is_dir($admin_screen) && ! in_array(basename($admin_screen), $exclude)) {
264 264
 					// these folders represent the different EE admin pages
265
-					$installed_refs[ basename( $admin_screen ) ] = $admin_screen;
265
+					$installed_refs[basename($admin_screen)] = $admin_screen;
266 266
 				}
267 267
 			}
268 268
 		}
269 269
 
270
-		if ( empty( $installed_refs ) ) {
270
+		if (empty($installed_refs)) {
271 271
 			$error_msg[] = __('There are no EE_Admin pages detected, it looks like EE did not install properly', 'event_espresso');
272
-			$error_msg[] = $error_msg[0] . "\r\n" . sprintf( __('Check that the %s folder exists and is writable. Maybe try deactivating, then reactivating Event Espresso again.', 'event_espresso'), EE_ADMIN_PAGES );
273
-			throw new EE_Error( implode( '||', $error_msg ));
272
+			$error_msg[] = $error_msg[0]."\r\n".sprintf(__('Check that the %s folder exists and is writable. Maybe try deactivating, then reactivating Event Espresso again.', 'event_espresso'), EE_ADMIN_PAGES);
273
+			throw new EE_Error(implode('||', $error_msg));
274 274
 		}
275 275
 
276 276
 		//this just checks the caffeinated folder and takes care of setting up any caffeinated stuff.
277 277
 		$installed_refs = $this->_set_caffeinated($installed_refs);
278 278
 		//allow plugins to add in their own pages (note at this point they will need to have an autoloader defined for their class) OR hook into EEH_Autoloader::load_admin_page() to add their path.;
279
-		$installed_refs = apply_filters( 'FHEE__EE_Admin_Page_Loader___get_installed_pages__installed_refs', $installed_refs );
280
-		$this->_caffeinated_extends = apply_filters( 'FHEE__EE_Admin_Page_Loader___get_installed_pages__caffeinated_extends', $this->_caffeinated_extends );
279
+		$installed_refs = apply_filters('FHEE__EE_Admin_Page_Loader___get_installed_pages__installed_refs', $installed_refs);
280
+		$this->_caffeinated_extends = apply_filters('FHEE__EE_Admin_Page_Loader___get_installed_pages__caffeinated_extends', $this->_caffeinated_extends);
281 281
 
282 282
 		//loop through admin pages and setup the $_installed_pages array.
283 283
 		$hooks_ref = array();
284
-		foreach ( $installed_refs as $page => $path ) {
284
+		foreach ($installed_refs as $page => $path) {
285 285
 			// set autoloaders for our admin page classes based on included path information
286
-			EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder( $path );
286
+			EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder($path);
287 287
 			// build list of installed pages
288
-			$this->_installed_pages[$page] = $this->_load_admin_page( $page, $path );
288
+			$this->_installed_pages[$page] = $this->_load_admin_page($page, $path);
289 289
 			// verify returned object
290
-			if ( $this->_installed_pages[$page] instanceof EE_Admin_Page_Init ) {
291
-				if ( ! $this->_installed_pages[$page]->get_menu_map() instanceof EE_Admin_Page_Menu_Map ) {
290
+			if ($this->_installed_pages[$page] instanceof EE_Admin_Page_Init) {
291
+				if ( ! $this->_installed_pages[$page]->get_menu_map() instanceof EE_Admin_Page_Menu_Map) {
292 292
 					continue;
293 293
 				}
294 294
 
295 295
 				//skip if in full maintenance mode and maintenance_mode_parent is set
296 296
 				$maintenance_mode_parent = $this->_installed_pages[$page]->get_menu_map()->maintenance_mode_parent;
297
-				if ( empty( $maintenance_mode_parent ) && EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) {
298
-					unset( $installed_refs[$page] );
297
+				if (empty($maintenance_mode_parent) && EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
298
+					unset($installed_refs[$page]);
299 299
 					continue;
300 300
 				}
301 301
 
@@ -303,45 +303,45 @@  discard block
 block discarded – undo
303 303
 				//flag for register hooks on extended pages b/c extended pages use the default INIT.
304 304
 				$extend = FALSE;
305 305
 				//now that we've got the admin_init objects... lets see if there are any caffeinated pages extending the originals.  If there are then let's hook into the init admin filter and load our extend instead.
306
-				if ( isset( $this->_caffeinated_extends[$page] ) ) {
306
+				if (isset($this->_caffeinated_extends[$page])) {
307 307
 					$this->_current_caf_extend_slug = $page;
308
-					$path_hook = 'FHEE__EE_Admin_Page_Init___initialize_admin_page__path_to_file__' . $this->_installed_pages[$page]->get_menu_map()->menu_slug . '_' . $this->_installed_pages[$page]->get_admin_page_name();
309
-					$path_runtime = 'return "' . $this->_caffeinated_extends[$this->_current_caf_extend_slug]["path"] . '";';
310
-					$page_hook = 'FHEE__EE_Admin_Page_Init___initialize_admin_page__admin_page__' . $this->_installed_pages[$page]->get_menu_map()->menu_slug . '_' . $this->_installed_pages[$page]->get_admin_page_name();
311
-					$page_runtime = 'return "' . $this->_caffeinated_extends[$this->_current_caf_extend_slug]["admin_page"] . '";';
308
+					$path_hook = 'FHEE__EE_Admin_Page_Init___initialize_admin_page__path_to_file__'.$this->_installed_pages[$page]->get_menu_map()->menu_slug.'_'.$this->_installed_pages[$page]->get_admin_page_name();
309
+					$path_runtime = 'return "'.$this->_caffeinated_extends[$this->_current_caf_extend_slug]["path"].'";';
310
+					$page_hook = 'FHEE__EE_Admin_Page_Init___initialize_admin_page__admin_page__'.$this->_installed_pages[$page]->get_menu_map()->menu_slug.'_'.$this->_installed_pages[$page]->get_admin_page_name();
311
+					$page_runtime = 'return "'.$this->_caffeinated_extends[$this->_current_caf_extend_slug]["admin_page"].'";';
312 312
 
313
-					$hook_function_path = create_function( '$path_to_file', $path_runtime);
314
-					$hook_function_page = create_function( '$admin_page', $page_runtime );
313
+					$hook_function_path = create_function('$path_to_file', $path_runtime);
314
+					$hook_function_page = create_function('$admin_page', $page_runtime);
315 315
 
316
-					add_filter( $path_hook, $hook_function_path );
317
-					add_filter( $page_hook, $hook_function_page );
316
+					add_filter($path_hook, $hook_function_path);
317
+					add_filter($page_hook, $hook_function_page);
318 318
 					$extend = TRUE;
319 319
 				}
320 320
 				//let's do the registered hooks
321
-				$extended_hooks = $this->_installed_pages[$page]->register_hooks( $extend );
321
+				$extended_hooks = $this->_installed_pages[$page]->register_hooks($extend);
322 322
 				$hooks_ref = array_merge($hooks_ref, $extended_hooks);
323 323
 			}
324 324
 		}
325 325
 
326 326
 		//the hooks_ref is all the pages where we have $extended _Hooks files that will extend a class in a different folder.  So we want to make sure we load the file for the parent.
327 327
 		//first make sure we've got unique values
328
-		$hooks_ref = array_unique( $hooks_ref );
328
+		$hooks_ref = array_unique($hooks_ref);
329 329
 		//now let's loop and require!
330
-		foreach ( $hooks_ref as $path ) {
331
-			require_once( $path );
330
+		foreach ($hooks_ref as $path) {
331
+			require_once($path);
332 332
 		}
333 333
 		//make sure we have menu slugs global setup. Used in EE_Admin_Page->page_setup() to ensure we don't do a full class load for an admin page that isn't requested.
334 334
 		global $ee_menu_slugs;
335 335
 		$ee_menu_slugs = $this->_menu_slugs;
336 336
 
337 337
 		//we need to loop again to run any early code
338
-		foreach ( $installed_refs as $page => $path ) {
339
-			if ( $this->_installed_pages[$page] instanceof EE_Admin_Page_Init ) {
338
+		foreach ($installed_refs as $page => $path) {
339
+			if ($this->_installed_pages[$page] instanceof EE_Admin_Page_Init) {
340 340
 				$this->_installed_pages[$page]->do_initial_loads();
341 341
 			}
342 342
 		}
343 343
 
344
-		do_action( 'AHEE__EE_Admin_Page_Loader___get_installed_pages_loaded', $this->_installed_pages );
344
+		do_action('AHEE__EE_Admin_Page_Loader___get_installed_pages_loaded', $this->_installed_pages);
345 345
 
346 346
 	}
347 347
 
@@ -353,9 +353,9 @@  discard block
 block discarded – undo
353 353
 	 * @param string $page_slug
354 354
 	 * @return EE_Admin_Page
355 355
 	 */
356
-	public function get_admin_page_object( $page_slug = '' ) {
357
-		if ( isset( $this->_installed_pages[ $page_slug ] )) {
358
-			return $this->_installed_pages[ $page_slug ]->loaded_page_object();
356
+	public function get_admin_page_object($page_slug = '') {
357
+		if (isset($this->_installed_pages[$page_slug])) {
358
+			return $this->_installed_pages[$page_slug]->loaded_page_object();
359 359
 		}
360 360
 		return NULL;
361 361
 	}
@@ -368,9 +368,9 @@  discard block
 block discarded – undo
368 368
 	 * @param $dir_name
369 369
 	 * @return string
370 370
 	 */
371
-	private function _get_classname_for_admin_page( $dir_name = '' ) {
372
-		$class_name = str_replace( '_', ' ', strtolower( $dir_name ));
373
-		return str_replace( ' ', '_', ucwords( $class_name )) . '_Admin_Page';
371
+	private function _get_classname_for_admin_page($dir_name = '') {
372
+		$class_name = str_replace('_', ' ', strtolower($dir_name));
373
+		return str_replace(' ', '_', ucwords($class_name)).'_Admin_Page';
374 374
 	}
375 375
 
376 376
 
@@ -381,9 +381,9 @@  discard block
 block discarded – undo
381 381
 	 * @param $dir_name
382 382
 	 * @return string
383 383
 	 */
384
-	private function _get_classname_for_admin_init_page( $dir_name = '' ) {
385
-		$class_name = str_replace( '_', ' ', strtolower( $dir_name ));
386
-		return str_replace( ' ', '_', ucwords( $class_name )) . '_Admin_Page_Init';
384
+	private function _get_classname_for_admin_init_page($dir_name = '') {
385
+		$class_name = str_replace('_', ' ', strtolower($dir_name));
386
+		return str_replace(' ', '_', ucwords($class_name)).'_Admin_Page_Init';
387 387
 	}
388 388
 
389 389
 
@@ -396,13 +396,13 @@  discard block
 block discarded – undo
396 396
 	 * @throws EE_Error
397 397
 	 * @return object|bool  return page object if valid, bool false if not.
398 398
 	 */
399
-	private function _load_admin_page( $page = '', $path = '' ) {
400
-		$class_name = $this->_get_classname_for_admin_init_page( $page );
401
- 		EE_Registry::instance()->load_file( $path, $class_name, 'core' );
402
-		if ( ! class_exists( $class_name )) {
403
-			$error_msg[] = sprintf( __('Something went wrong with loading the %s admin page.', 'event_espresso' ), $page);
404
-			$error_msg[] = $error_msg[0] . "\r\n" . sprintf( __( 'There is no Init class in place for the %s admin page.', 'event_espresso') . '<br />' . __( 'Make sure you have <strong>%s</strong> defined. If this is a non-EE-core admin page then you also must have an autoloader in place for your class', 'event_espresso'), $page, $class_name );
405
-			throw new EE_Error( implode( '||', $error_msg ));
399
+	private function _load_admin_page($page = '', $path = '') {
400
+		$class_name = $this->_get_classname_for_admin_init_page($page);
401
+ 		EE_Registry::instance()->load_file($path, $class_name, 'core');
402
+		if ( ! class_exists($class_name)) {
403
+			$error_msg[] = sprintf(__('Something went wrong with loading the %s admin page.', 'event_espresso'), $page);
404
+			$error_msg[] = $error_msg[0]."\r\n".sprintf(__('There is no Init class in place for the %s admin page.', 'event_espresso').'<br />'.__('Make sure you have <strong>%s</strong> defined. If this is a non-EE-core admin page then you also must have an autoloader in place for your class', 'event_espresso'), $page, $class_name);
405
+			throw new EE_Error(implode('||', $error_msg));
406 406
 		}
407 407
 		$a = new ReflectionClass($class_name);
408 408
 		return  $a->newInstance();
@@ -421,9 +421,9 @@  discard block
 block discarded – undo
421 421
 	public function set_menus() {
422 422
 		//prep the menu pages (sort, group.)
423 423
 		$this->_prep_pages();
424
-		foreach( $this->_prepped_menu_maps as $menu_map ) {
425
-			if ( EE_Registry::instance()->CAP->current_user_can( $menu_map->capability, $menu_map->menu_slug ) ) {
426
-				$menu_map->add_menu_page( FALSE );
424
+		foreach ($this->_prepped_menu_maps as $menu_map) {
425
+			if (EE_Registry::instance()->CAP->current_user_can($menu_map->capability, $menu_map->menu_slug)) {
426
+				$menu_map->add_menu_page(FALSE);
427 427
 			}
428 428
 		}
429 429
 	}
@@ -436,11 +436,11 @@  discard block
 block discarded – undo
436 436
 	 *
437 437
 	 * @return void
438 438
 	 */
439
-	public function set_network_menus(){
439
+	public function set_network_menus() {
440 440
 		$this->_prep_pages();
441
-		foreach( $this->_prepped_menu_maps as $menu_map ) {
442
-			if ( EE_Registry::instance()->CAP->current_user_can( $menu_map->capability, $menu_map->menu_slug ) ) {
443
-				$menu_map->add_menu_page( TRUE );
441
+		foreach ($this->_prepped_menu_maps as $menu_map) {
442
+			if (EE_Registry::instance()->CAP->current_user_can($menu_map->capability, $menu_map->menu_slug)) {
443
+				$menu_map->add_menu_page(TRUE);
444 444
 			}
445 445
 		}
446 446
 	}
@@ -461,22 +461,22 @@  discard block
 block discarded – undo
461 461
 		//rearrange _admin_menu_groups to be indexed by group slug.
462 462
 		$menu_groups = $this->_rearrange_menu_groups();
463 463
 
464
-		foreach( $this->_installed_pages as $page ) {
465
-			if ( $page instanceof EE_Admin_page_Init ) {
464
+		foreach ($this->_installed_pages as $page) {
465
+			if ($page instanceof EE_Admin_page_Init) {
466 466
 				$page_map = $page->get_menu_map();
467 467
 				//if we've got an array then the menu map is in the old format so let's throw a persistent notice that the admin system isn't setup correctly for this item.
468
-				if ( is_array( $page_map ) || empty( $page_map ) ) {
469
-					EE_Error::add_persistent_admin_notice( 'menu_map_warning_' . str_replace(' ', '_', $page->label) . '_' . EVENT_ESPRESSO_VERSION, sprintf( __('The admin page for %s was not correctly setup because it is using an older method for integrating with Event Espresso Core.  This means that full functionality for this component is not available.  This error message usually appears with an Add-on that is out of date.  Make sure you update all your Event Espresso 4 add-ons to the latest version to ensure they have necessary compatibility updates in place.', 'event_espresso' ), $page->label ) );
468
+				if (is_array($page_map) || empty($page_map)) {
469
+					EE_Error::add_persistent_admin_notice('menu_map_warning_'.str_replace(' ', '_', $page->label).'_'.EVENT_ESPRESSO_VERSION, sprintf(__('The admin page for %s was not correctly setup because it is using an older method for integrating with Event Espresso Core.  This means that full functionality for this component is not available.  This error message usually appears with an Add-on that is out of date.  Make sure you update all your Event Espresso 4 add-ons to the latest version to ensure they have necessary compatibility updates in place.', 'event_espresso'), $page->label));
470 470
 					continue;
471 471
 				}
472 472
 
473 473
 				//if page map is NOT a EE_Admin_Page_Menu_Map object then throw error.
474
-				if ( ! $page_map instanceof EE_Admin_Page_Menu_Map ) {
475
-					throw new EE_Error( sprintf( __('The menu map for %s must be an EE_Admin_Page_Menu_Map object.  Instead it is %s.  Please double check that the menu map has been configured correctly.', 'event_espresso'), $page->label, $page_map ) );
474
+				if ( ! $page_map instanceof EE_Admin_Page_Menu_Map) {
475
+					throw new EE_Error(sprintf(__('The menu map for %s must be an EE_Admin_Page_Menu_Map object.  Instead it is %s.  Please double check that the menu map has been configured correctly.', 'event_espresso'), $page->label, $page_map));
476 476
 				}
477 477
 
478 478
 				//use the maintenance_mode_parent property and maintenance mode status to determine if this page even gets added to array.
479
-				if ( empty( $page_map->maintenance_mode_parent ) &&  EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) {
479
+				if (empty($page_map->maintenance_mode_parent) && EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
480 480
 					continue;
481 481
 				}
482 482
 
@@ -485,21 +485,21 @@  discard block
 block discarded – undo
485 485
 			}
486 486
 		}
487 487
 
488
-		if ( empty( $pages_array )) {
489
-			throw new EE_Error(__('Something went wrong when prepping the admin pages', 'event_espresso') );
488
+		if (empty($pages_array)) {
489
+			throw new EE_Error(__('Something went wrong when prepping the admin pages', 'event_espresso'));
490 490
 		}
491 491
 
492 492
 		//let's sort the groups, make sure it's a valid group, add header (if to show).
493
-		foreach ( $pages_array as $group => $menu_maps ) {
493
+		foreach ($pages_array as $group => $menu_maps) {
494 494
 			//valid_group?
495
-			if ( ! array_key_exists( $group, $menu_groups ) )
495
+			if ( ! array_key_exists($group, $menu_groups))
496 496
 				continue;
497 497
 
498 498
 			//sort pages.
499
-			usort( $menu_maps, array( $this, '_sort_menu_maps' ) );
499
+			usort($menu_maps, array($this, '_sort_menu_maps'));
500 500
 
501 501
 			//prepend header
502
-			array_unshift( $menu_maps, $menu_groups[$group] );
502
+			array_unshift($menu_maps, $menu_groups[$group]);
503 503
 
504 504
 			//reset $pages_array with prepped data
505 505
 			$pages_array[$group] = $menu_maps;
@@ -507,9 +507,9 @@  discard block
 block discarded – undo
507 507
 
508 508
 
509 509
 		//now let's setup the _prepped_menu_maps property
510
-		foreach ( $menu_groups as $group => $group_objs ) {
511
-			if ( isset( $pages_array[$group] ) )
512
-				$this->_prepped_menu_maps = array_merge( $this->_prepped_menu_maps, $pages_array[$group] );
510
+		foreach ($menu_groups as $group => $group_objs) {
511
+			if (isset($pages_array[$group]))
512
+				$this->_prepped_menu_maps = array_merge($this->_prepped_menu_maps, $pages_array[$group]);
513 513
 		}/**/
514 514
 
515 515
 	}
@@ -529,10 +529,10 @@  discard block
 block discarded – undo
529 529
 	 * @param array $installed_refs the original installed_refs array that may contain our NEW EE_Admin_Pages to be loaded.
530 530
 	 * @return array
531 531
 	 */
532
-	private function _set_caffeinated( $installed_refs ) {
532
+	private function _set_caffeinated($installed_refs) {
533 533
 
534 534
 		//first let's check if there IS a caffeinated folder. If there is not then lets get out.
535
-		if ( ! is_dir( EE_PLUGIN_DIR_PATH . 'caffeinated' . DS . 'admin' ) || ( defined( 'EE_DECAF' ) && EE_DECAF )) {
535
+		if ( ! is_dir(EE_PLUGIN_DIR_PATH.'caffeinated'.DS.'admin') || (defined('EE_DECAF') && EE_DECAF)) {
536 536
 			return $installed_refs;
537 537
 		}
538 538
 
@@ -541,15 +541,15 @@  discard block
 block discarded – undo
541 541
 		$exclude = array('tickets');
542 542
 
543 543
 		//okay let's setup an "New" pages first (we'll return installed refs later)
544
-		$new_admin_screens = glob( EE_CORE_CAF_ADMIN . 'new/*', GLOB_ONLYDIR );
545
-		if ( $new_admin_screens ) {
546
-			foreach( $new_admin_screens as $admin_screen ) {
544
+		$new_admin_screens = glob(EE_CORE_CAF_ADMIN.'new/*', GLOB_ONLYDIR);
545
+		if ($new_admin_screens) {
546
+			foreach ($new_admin_screens as $admin_screen) {
547 547
 				// files and anything in the exclude array need not apply
548
-				if ( is_dir( $admin_screen ) && ! in_array( basename( $admin_screen ), $exclude )) {
548
+				if (is_dir($admin_screen) && ! in_array(basename($admin_screen), $exclude)) {
549 549
 					// these folders represent the different NEW EE admin pages
550
-					$installed_refs[ basename( $admin_screen ) ] = $admin_screen;
550
+					$installed_refs[basename($admin_screen)] = $admin_screen;
551 551
 					// set autoloaders for our admin page classes based on included path information
552
-					EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder( $admin_screen );
552
+					EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder($admin_screen);
553 553
 //					$this->_caf_autoloader[] = array(
554 554
 //						'dir' => 'new',
555 555
 //						'folder' => basename( $admin_screen )
@@ -559,18 +559,18 @@  discard block
 block discarded – undo
559 559
 		}
560 560
 
561 561
 		//let's see if there are any EXTENDS to setup in the $_caffeinated_extends array (that will be used later for hooking into the _initialize_admin_age in the related core_init admin page)
562
-		$extends = glob( EE_CORE_CAF_ADMIN . 'extend/*', GLOB_ONLYDIR );
563
-		if ( $extends ) {
564
-			foreach( $extends as $extend ) {
565
-				if ( is_dir( $extend ) ) {
566
-					$extend_ref = basename( $extend );
562
+		$extends = glob(EE_CORE_CAF_ADMIN.'extend/*', GLOB_ONLYDIR);
563
+		if ($extends) {
564
+			foreach ($extends as $extend) {
565
+				if (is_dir($extend)) {
566
+					$extend_ref = basename($extend);
567 567
 					//now let's make sure there is a file that matches the expected format
568
-					$filename = str_replace(' ', '_', ucwords( str_replace('_', ' ', $extend_ref ) ) );
569
-					$filename = 'Extend_' . $filename . '_Admin_Page';
570
-					$this->_caffeinated_extends[$extend_ref]['path'] = str_replace( array( '\\', '/' ), DS, EE_CORE_CAF_ADMIN . 'extend' . DS . $extend_ref . DS . $filename . '.core.php' );
568
+					$filename = str_replace(' ', '_', ucwords(str_replace('_', ' ', $extend_ref)));
569
+					$filename = 'Extend_'.$filename.'_Admin_Page';
570
+					$this->_caffeinated_extends[$extend_ref]['path'] = str_replace(array('\\', '/'), DS, EE_CORE_CAF_ADMIN.'extend'.DS.$extend_ref.DS.$filename.'.core.php');
571 571
 					$this->_caffeinated_extends[$extend_ref]['admin_page'] = $filename;
572 572
 					// set autoloaders for our admin page classes based on included path information
573
-					EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder( $extend );
573
+					EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder($extend);
574 574
 //					$this->_caf_autoloader[] = array(
575 575
 //						'dir' => 'extend',
576 576
 //						'folder' => $extend_ref
@@ -581,22 +581,22 @@  discard block
 block discarded – undo
581 581
 
582 582
 		//let's see if there are any HOOK files and instantiate them if there are (so that hooks are loaded early!).
583 583
 		$ee_admin_hooks = array();
584
-		$hooks = glob( EE_CORE_CAF_ADMIN . 'hooks/*.class.php' );
585
-		if ( $hooks ) {
586
-			foreach ( $hooks as $hook ) {
587
-				if ( is_readable( $hook ) ) {
584
+		$hooks = glob(EE_CORE_CAF_ADMIN.'hooks/*.class.php');
585
+		if ($hooks) {
586
+			foreach ($hooks as $hook) {
587
+				if (is_readable($hook)) {
588 588
 					require_once $hook;
589
-					$classname = str_replace( EE_CORE_CAF_ADMIN . 'hooks/', '', $hook );
589
+					$classname = str_replace(EE_CORE_CAF_ADMIN.'hooks/', '', $hook);
590 590
 					$classname = str_replace('.class.php', '', $classname);
591
-					if ( class_exists( $classname ) ) {
592
-						$a = new ReflectionClass( $classname );
591
+					if (class_exists($classname)) {
592
+						$a = new ReflectionClass($classname);
593 593
 						$ee_admin_hooks[] = $a->newInstance();
594 594
 					}
595 595
 				}
596 596
 			}
597 597
 		}/**/
598 598
 
599
-		$ee_admin_hooks = apply_filters( 'FHEE__EE_Admin_Page_Loader__set_caffeinated__ee_admin_hooks', $ee_admin_hooks );
599
+		$ee_admin_hooks = apply_filters('FHEE__EE_Admin_Page_Loader__set_caffeinated__ee_admin_hooks', $ee_admin_hooks);
600 600
 
601 601
 		return $installed_refs;
602 602
 
@@ -653,8 +653,8 @@  discard block
 block discarded – undo
653 653
 	 * @param  EE_Admin_Page_Menu_Map $b being compared to
654 654
 	 * @return int    sort order
655 655
 	 */
656
-	private function _sort_menu_maps( EE_Admin_Page_Menu_Map $a, EE_Admin_Page_Menu_Map $b ) {
657
-		if ( $a->menu_order == $b->menu_order )
656
+	private function _sort_menu_maps(EE_Admin_Page_Menu_Map $a, EE_Admin_Page_Menu_Map $b) {
657
+		if ($a->menu_order == $b->menu_order)
658 658
 			return 0;
659 659
 		return ($a->menu_order < $b->menu_order) ? -1 : 1;
660 660
 	}
Please login to merge, or discard this patch.
core/admin/EE_Admin_Page_Menu_Map.core.php 2 patches
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @package 		Event Espresso
16 16
  * @subpackage 	admin
17 17
  */
18
-abstract class EE_Admin_Page_Menu_Map  {
18
+abstract class EE_Admin_Page_Menu_Map {
19 19
 
20 20
 
21 21
 	/**
@@ -155,28 +155,28 @@  discard block
 block discarded – undo
155 155
 	 *                            		are present.
156 156
 	 * @return void
157 157
 	 */
158
-	public function __construct( $menu_args, $required ) {
158
+	public function __construct($menu_args, $required) {
159 159
 		//filter all args before processing so plugins can manipulate various settings for menus.
160
-		$menu_args = apply_filters( 'FHEE__EE_Admin_Page_Menu_Map__construct__menu_args', $menu_args, $required, get_class( $this ) );
160
+		$menu_args = apply_filters('FHEE__EE_Admin_Page_Menu_Map__construct__menu_args', $menu_args, $required, get_class($this));
161 161
 
162 162
 
163 163
 		//verify that required keys are present in the incoming array.
164
-		$missing = array_diff( (array) $required, array_keys( (array) $menu_args ) );
164
+		$missing = array_diff((array) $required, array_keys((array) $menu_args));
165 165
 
166
-		if ( !empty( $missing ) ) {
167
-			throw new EE_Error( sprintf( __('%s is missing some expected keys in the argument array.  The following keys are missing: %s', 'event_espresso'), get_class( $this ), implode(', ', $missing ) ) );
166
+		if ( ! empty($missing)) {
167
+			throw new EE_Error(sprintf(__('%s is missing some expected keys in the argument array.  The following keys are missing: %s', 'event_espresso'), get_class($this), implode(', ', $missing)));
168 168
 		}
169 169
 
170 170
 		//made it here okay, so let's set the properties!
171
-		foreach ( $menu_args as $prop => $value ) {
171
+		foreach ($menu_args as $prop => $value) {
172 172
 
173
-			switch ( $prop ) {
173
+			switch ($prop) {
174 174
 				case 'show_on_menu' :
175 175
 					$value = (int) $value;
176 176
 					break;
177 177
 				case 'admin_init_page' :
178
-					if ( in_array( 'admin_init_page', $required ) && ! $value instanceof EE_Admin_Page_Init ) {
179
-						throw new EE_Error( sprintf( __('The value for the "admin_init_page" argument must be an instance of an EE_Admin_Page_Init object.  Instead %s was given as the value.', 'event_espresso'), print_r($value, TRUE) ) );
178
+					if (in_array('admin_init_page', $required) && ! $value instanceof EE_Admin_Page_Init) {
179
+						throw new EE_Error(sprintf(__('The value for the "admin_init_page" argument must be an instance of an EE_Admin_Page_Init object.  Instead %s was given as the value.', 'event_espresso'), print_r($value, TRUE)));
180 180
 					}
181 181
 					break;
182 182
 				case 'menu_callback' :
@@ -187,24 +187,24 @@  discard block
 block discarded – undo
187 187
 					break;
188 188
 
189 189
 			}
190
-			if ( ! EEH_Class_Tools::has_property( $this, $prop ) )
191
-				throw new EE_Error( sprintf( __('The $menu_args coming into %s has a index key (%s) representing a property that is not defined by the class.  Perhaps there is a typo?', 'event_espresso'), get_class( $this ), $prop ) );
190
+			if ( ! EEH_Class_Tools::has_property($this, $prop))
191
+				throw new EE_Error(sprintf(__('The $menu_args coming into %s has a index key (%s) representing a property that is not defined by the class.  Perhaps there is a typo?', 'event_espresso'), get_class($this), $prop));
192 192
 			$this->{$prop} = $value;
193 193
 
194 194
 		}
195 195
 
196 196
 		//filter capabilities (both static and dynamic)
197
-		$this->capability = apply_filters( 'FHEE_management_capability', $this->capability, NULL );
198
-		$this->capability = apply_filters( 'FHEE_' . $this->menu_slug . '_capability', $this->capability, NULL );
197
+		$this->capability = apply_filters('FHEE_management_capability', $this->capability, NULL);
198
+		$this->capability = apply_filters('FHEE_'.$this->menu_slug.'_capability', $this->capability, NULL);
199 199
 
200 200
 		//Might need to change parent slug depending on maintenance mode.
201
-		if ( ! empty( $this->maintenance_mode_parent ) && EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance )  {
201
+		if ( ! empty($this->maintenance_mode_parent) && EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
202 202
 			$this->parent_slug = $this->maintenance_mode_parent;
203 203
 		}
204 204
 
205 205
 		//if empty menu_callback let's set default (but only if we have admin page init object)
206
-		if ( empty( $this->menu_callback ) && $this->admin_init_page instanceof EE_Admin_Page_Init )
207
-			$this->menu_callback = array( $this->admin_init_page, 'initialize_admin_page' );
206
+		if (empty($this->menu_callback) && $this->admin_init_page instanceof EE_Admin_Page_Init)
207
+			$this->menu_callback = array($this->admin_init_page, 'initialize_admin_page');
208 208
 
209 209
 	}
210 210
 
@@ -226,21 +226,21 @@  discard block
 block discarded – undo
226 226
 	 * @param boolean $network_admin whether this is being added to the network admin page or not
227 227
 	 * @since  4.4.0
228 228
 	 */
229
-	public function add_menu_page( $network_admin = FALSE ) {
229
+	public function add_menu_page($network_admin = FALSE) {
230 230
 
231 231
 		$show_on_menu_int = (int) $this->show_on_menu;
232
-		if( ( $network_admin && in_array( $show_on_menu_int, array( self::BLOG_AND_NETWORK_ADMIN, self::NETWORK_ADMIN_ONLY ), TRUE ) )
232
+		if (($network_admin && in_array($show_on_menu_int, array(self::BLOG_AND_NETWORK_ADMIN, self::NETWORK_ADMIN_ONLY), TRUE))
233 233
 				||
234
-			( ! $network_admin && in_array( $show_on_menu_int, array( self::BLOG_AND_NETWORK_ADMIN, self::BLOG_ADMIN_ONLY ), TRUE )) ){
234
+			( ! $network_admin && in_array($show_on_menu_int, array(self::BLOG_AND_NETWORK_ADMIN, self::BLOG_ADMIN_ONLY), TRUE))) {
235 235
 			$wp_page_slug = $this->_add_menu_page();
236
-		}else{
236
+		} else {
237 237
 			$wp_page_slug = '';
238 238
 		}
239 239
 
240
-		if ( !empty( $wp_page_slug ) && $this->admin_init_page instanceof EE_Admin_Page_Init ) {
240
+		if ( ! empty($wp_page_slug) && $this->admin_init_page instanceof EE_Admin_Page_Init) {
241 241
 			try {
242
-				$this->admin_init_page->set_page_dependencies( $wp_page_slug );
243
-			} catch( EE_Error $e ) {
242
+				$this->admin_init_page->set_page_dependencies($wp_page_slug);
243
+			} catch (EE_Error $e) {
244 244
 				$e->get_error();
245 245
 			}
246 246
 		}
@@ -293,12 +293,12 @@  discard block
 block discarded – undo
293 293
 	public $position;
294 294
 
295 295
 
296
-	public function __construct( $menu_args ) {
297
-		$required = array( 'menu_label', 'parent_slug', 'menu_slug', 'menu_group', 'menu_order', 'admin_init_page');
296
+	public function __construct($menu_args) {
297
+		$required = array('menu_label', 'parent_slug', 'menu_slug', 'menu_group', 'menu_order', 'admin_init_page');
298 298
 
299
-		parent::__construct( $menu_args, $required );
299
+		parent::__construct($menu_args, $required);
300 300
 
301
-		$this->position = ! empty( $this->position ) ? (int) $this->position : $this->position;
301
+		$this->position = ! empty($this->position) ? (int) $this->position : $this->position;
302 302
 	}
303 303
 
304 304
 
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 	 * Uses the proper WP utility for registering a menu page for the main WP pages.
307 307
 	 */
308 308
 	protected function _add_menu_page() {
309
-		$main =  add_menu_page( $this->title, $this->menu_label, $this->capability, $this->parent_slug, $this->menu_callback, $this->icon_url, $this->position );
310
-		if ( ! empty( $this->subtitle ) ) {
311
-			add_submenu_page( $this->parent_slug, $this->subtitle, $this->subtitle, $this->capability, $this->menu_slug, $this->menu_callback );
309
+		$main = add_menu_page($this->title, $this->menu_label, $this->capability, $this->parent_slug, $this->menu_callback, $this->icon_url, $this->position);
310
+		if ( ! empty($this->subtitle)) {
311
+			add_submenu_page($this->parent_slug, $this->subtitle, $this->subtitle, $this->capability, $this->menu_slug, $this->menu_callback);
312 312
 		}
313 313
 		return $main;
314 314
 	}
@@ -325,13 +325,13 @@  discard block
 block discarded – undo
325 325
  */
326 326
 class EE_Admin_Page_Sub_Menu extends EE_Admin_Page_Main_Menu {
327 327
 
328
-	public function __construct( $menu_args ) {
329
-		parent::__construct( $menu_args );
328
+	public function __construct($menu_args) {
329
+		parent::__construct($menu_args);
330 330
 	}
331 331
 
332 332
 
333 333
 	protected function _add_menu_page() {
334
-		return add_submenu_page( $this->parent_slug, $this->title, $this->menu_label, $this->capability, $this->menu_slug, $this->menu_callback );
334
+		return add_submenu_page($this->parent_slug, $this->title, $this->menu_label, $this->capability, $this->menu_slug, $this->menu_callback);
335 335
 	}
336 336
 
337 337
 } //end class EE_Admin_Page_Menu_Map
@@ -352,18 +352,18 @@  discard block
 block discarded – undo
352 352
 
353 353
 
354 354
 
355
-	public function __construct( $menu_args = array() ) {
356
-		$required = array( 'menu_label', 'menu_slug', 'menu_order', 'parent_slug' );
357
-		parent::__construct( $menu_args, $required );
355
+	public function __construct($menu_args = array()) {
356
+		$required = array('menu_label', 'menu_slug', 'menu_order', 'parent_slug');
357
+		parent::__construct($menu_args, $required);
358 358
 	}
359 359
 
360 360
 
361 361
 	protected function _add_menu_page() {
362
-		return add_submenu_page( $this->parent_slug, $this->menu_label, $this->_group_link(), $this->capability, $this->menu_slug, '__return_false' );
362
+		return add_submenu_page($this->parent_slug, $this->menu_label, $this->_group_link(), $this->capability, $this->menu_slug, '__return_false');
363 363
 	}
364 364
 
365 365
 
366 366
 	private function _group_link() {
367
-		return '<span class="ee_menu_group"  onclick="return false;">' . $this->menu_label . '</span>';
367
+		return '<span class="ee_menu_group"  onclick="return false;">'.$this->menu_label.'</span>';
368 368
 	}
369 369
 } //end EE_Admin_Page_Menu_Group
Please login to merge, or discard this patch.
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -187,8 +187,9 @@  discard block
 block discarded – undo
187 187
 					break;
188 188
 
189 189
 			}
190
-			if ( ! EEH_Class_Tools::has_property( $this, $prop ) )
191
-				throw new EE_Error( sprintf( __('The $menu_args coming into %s has a index key (%s) representing a property that is not defined by the class.  Perhaps there is a typo?', 'event_espresso'), get_class( $this ), $prop ) );
190
+			if ( ! EEH_Class_Tools::has_property( $this, $prop ) ) {
191
+							throw new EE_Error( sprintf( __('The $menu_args coming into %s has a index key (%s) representing a property that is not defined by the class.  Perhaps there is a typo?', 'event_espresso'), get_class( $this ), $prop ) );
192
+			}
192 193
 			$this->{$prop} = $value;
193 194
 
194 195
 		}
@@ -203,8 +204,9 @@  discard block
 block discarded – undo
203 204
 		}
204 205
 
205 206
 		//if empty menu_callback let's set default (but only if we have admin page init object)
206
-		if ( empty( $this->menu_callback ) && $this->admin_init_page instanceof EE_Admin_Page_Init )
207
-			$this->menu_callback = array( $this->admin_init_page, 'initialize_admin_page' );
207
+		if ( empty( $this->menu_callback ) && $this->admin_init_page instanceof EE_Admin_Page_Init ) {
208
+					$this->menu_callback = array( $this->admin_init_page, 'initialize_admin_page' );
209
+		}
208 210
 
209 211
 	}
210 212
 
@@ -233,7 +235,7 @@  discard block
 block discarded – undo
233 235
 				||
234 236
 			( ! $network_admin && in_array( $show_on_menu_int, array( self::BLOG_AND_NETWORK_ADMIN, self::BLOG_ADMIN_ONLY ), TRUE )) ){
235 237
 			$wp_page_slug = $this->_add_menu_page();
236
-		}else{
238
+		} else{
237 239
 			$wp_page_slug = '';
238 240
 		}
239 241
 
Please login to merge, or discard this patch.
core/admin/EE_Help_Tour.core.php 2 patches
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	public function __construct($caf = FALSE) {
117 117
 		$this->_is_caf = $caf;
118
-		$this->_req_data = array_merge( $_GET, $_POST );
118
+		$this->_req_data = array_merge($_GET, $_POST);
119 119
 		$this->_set_tour_properties();
120 120
 		$this->_set_tour_stops();
121 121
 		$this->_set_tour_options();
@@ -158,36 +158,36 @@  discard block
 block discarded – undo
158 158
 	 * @access protected
159 159
 	 * @return void
160 160
 	 */
161
-	protected function _set_tour_options( $options = array() ) {
161
+	protected function _set_tour_options($options = array()) {
162 162
 		$defaults = array(
163
-			'tipLocation' => 'bottom',         // 'top', 'bottom', 'right', 'left' in relation to parent
164
-		  	'nubPosition' => 'auto',           // override on a per tooltip bases. can be "auto", "right", "top", "bottom", "left"
165
-		  	'tipAdjustmentY' => 0, 			//allow for adjustment of tip
166
-		  	'tipAdjustmentX' => 0,			//allow for adjustment of tip
163
+			'tipLocation' => 'bottom', // 'top', 'bottom', 'right', 'left' in relation to parent
164
+		  	'nubPosition' => 'auto', // override on a per tooltip bases. can be "auto", "right", "top", "bottom", "left"
165
+		  	'tipAdjustmentY' => 0, //allow for adjustment of tip
166
+		  	'tipAdjustmentX' => 0, //allow for adjustment of tip
167 167
 		  	'scroll' => true, //whether to scrollTo the next step or not
168
-		  	'scrollSpeed' => 300,              // Page scrolling speed in ms
169
-		  	'timer' => 0,	                // 0 = off, all other numbers = time(ms)
170
-		  	'autoStart' => true,			// true or false - false tour starts when restart called
171
-		  	'startTimerOnClick' => true,       // true/false to start timer on first click
172
-		  	'nextButton' => true,              // true/false for next button visibility
168
+		  	'scrollSpeed' => 300, // Page scrolling speed in ms
169
+		  	'timer' => 0, // 0 = off, all other numbers = time(ms)
170
+		  	'autoStart' => true, // true or false - false tour starts when restart called
171
+		  	'startTimerOnClick' => true, // true/false to start timer on first click
172
+		  	'nextButton' => true, // true/false for next button visibility
173 173
 		  	'button_text' => __('Next', 'event_espresso'),
174
-		  	'tipAnimation' => 'fade',           // 'pop' or 'fade' in each tip
175
-		  	'pauseAfter' => array(),                // array of indexes where to pause the tour after
176
-		  	'tipAnimationFadeSpeed' => 300,    // if 'fade'- speed in ms of transition
177
-		  	'cookieMonster' => true,           // true/false for whether cookies are used
178
-		  	'cookieName' => $this->get_slug(),         // choose your own cookie name (setup will add the prefix for the specific page joyride)
179
-	  		'cookieDomain' => false,           // set to false or yoursite.com
174
+		  	'tipAnimation' => 'fade', // 'pop' or 'fade' in each tip
175
+		  	'pauseAfter' => array(), // array of indexes where to pause the tour after
176
+		  	'tipAnimationFadeSpeed' => 300, // if 'fade'- speed in ms of transition
177
+		  	'cookieMonster' => true, // true/false for whether cookies are used
178
+		  	'cookieName' => $this->get_slug(), // choose your own cookie name (setup will add the prefix for the specific page joyride)
179
+	  		'cookieDomain' => false, // set to false or yoursite.com
180 180
 		  	//'tipContainer' => 'body',            // Where the tip be attached if not inline
181
-		  	'modal' => false, 					// Whether to cover page with modal during the tour
182
-		  	'expose' => false,					// Whether to expose the elements at each step in the tour (requires modal:true),
183
-		  	'postExposeCallback' => 'EEHelpTour.postExposeCallback',    // A method to call after an element has been exposed
184
-		  	'preRideCallback' => 'EEHelpTour_preRideCallback',    // A method to call before the tour starts (passed index, tip, and cloned exposed element)
185
-		  	'postRideCallback' => 'EEHelpTour_postRideCallback',       // a method to call once the tour closes.  This will correspond to the name of a js method that will have to be defined in loaded js.
186
-		  	'preStepCallback' => 'EEHelpTour_preStepCallback',    // A method to call before each step
187
-		  	'postStepCallback' => 'EEHelpTour_postStepCallback',        // A method to call after each step (remember this will correspond with a js method that you will have to define in a js file BEFORE ee-help-tour.js loads, if the default methods do not exist, then ee-help-tour.js just substitues empty functions $.noop)/**/
181
+		  	'modal' => false, // Whether to cover page with modal during the tour
182
+		  	'expose' => false, // Whether to expose the elements at each step in the tour (requires modal:true),
183
+		  	'postExposeCallback' => 'EEHelpTour.postExposeCallback', // A method to call after an element has been exposed
184
+		  	'preRideCallback' => 'EEHelpTour_preRideCallback', // A method to call before the tour starts (passed index, tip, and cloned exposed element)
185
+		  	'postRideCallback' => 'EEHelpTour_postRideCallback', // a method to call once the tour closes.  This will correspond to the name of a js method that will have to be defined in loaded js.
186
+		  	'preStepCallback' => 'EEHelpTour_preStepCallback', // A method to call before each step
187
+		  	'postStepCallback' => 'EEHelpTour_postStepCallback', // A method to call after each step (remember this will correspond with a js method that you will have to define in a js file BEFORE ee-help-tour.js loads, if the default methods do not exist, then ee-help-tour.js just substitues empty functions $.noop)/**/
188 188
 			);
189 189
 
190
-		$options = !empty( $options ) && is_array($options)  ? array_merge( $defaults, $options ) : $defaults;
190
+		$options = ! empty($options) && is_array($options) ? array_merge($defaults, $options) : $defaults;
191 191
 		$this->_options = $options;
192 192
 	}
193 193
 
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
 	 * @return string slug for the tour
203 203
 	 */
204 204
 	public function get_slug() {
205
-		if ( empty( $this->_slug ) )
206
-			throw new EE_Error( sprintf(__('There is no slug set for the help tour class (%s). Make sure that the $_slug property is set in the class constructor', 'event_espresso'), get_class($this) ) );
205
+		if (empty($this->_slug))
206
+			throw new EE_Error(sprintf(__('There is no slug set for the help tour class (%s). Make sure that the $_slug property is set in the class constructor', 'event_espresso'), get_class($this)));
207 207
 		return $this->_slug;
208 208
 	}
209 209
 
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	 * @return string
216 216
 	 */
217 217
 	public function get_label() {
218
-		if ( empty( $this->_label ) )
219
-			throw new EE_Error( sprintf( __('There is no label set for the help tour class (%s). Make sure that the $_label property is set in the class constructor', 'event_espresso'), get_class($this) ) );
218
+		if (empty($this->_label))
219
+			throw new EE_Error(sprintf(__('There is no label set for the help tour class (%s). Make sure that the $_label property is set in the class constructor', 'event_espresso'), get_class($this)));
220 220
 		return $this->_label;
221 221
 	}
222 222
 
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
 	 * @return array
228 228
 	 */
229 229
 	public function get_stops() {
230
-		foreach( $this->_stops as $ind => $stop ) {
231
-			if ( ! isset( $stop['button_text'] ) ) {
230
+		foreach ($this->_stops as $ind => $stop) {
231
+			if ( ! isset($stop['button_text'])) {
232 232
 				$this->_stops[$ind]['button_text'] = $this->_options['button_text'];
233 233
 			}
234 234
 		}
@@ -243,12 +243,12 @@  discard block
 block discarded – undo
243 243
 	 */
244 244
 	public function get_options() {
245 245
 		//let's make sure there are not pauses set
246
-		foreach ( $this->_stops as $ind => $stop ) {
247
-			if ( isset( $stop['pause_after'] ) && $stop['pause_after'] ) {
246
+		foreach ($this->_stops as $ind => $stop) {
247
+			if (isset($stop['pause_after']) && $stop['pause_after']) {
248 248
 				$this->_options['pauseAfter'][] = $ind;
249 249
 			}
250 250
 		}
251
-		return apply_filters( 'FHEE__' . get_class($this) . '__get_options', $this->_options, $this );
251
+		return apply_filters('FHEE__'.get_class($this).'__get_options', $this->_options, $this);
252 252
 	}
253 253
 
254 254
 }
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if (!defined('EVENT_ESPRESSO_VERSION')) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -202,8 +203,9 @@  discard block
 block discarded – undo
202 203
 	 * @return string slug for the tour
203 204
 	 */
204 205
 	public function get_slug() {
205
-		if ( empty( $this->_slug ) )
206
-			throw new EE_Error( sprintf(__('There is no slug set for the help tour class (%s). Make sure that the $_slug property is set in the class constructor', 'event_espresso'), get_class($this) ) );
206
+		if ( empty( $this->_slug ) ) {
207
+					throw new EE_Error( sprintf(__('There is no slug set for the help tour class (%s). Make sure that the $_slug property is set in the class constructor', 'event_espresso'), get_class($this) ) );
208
+		}
207 209
 		return $this->_slug;
208 210
 	}
209 211
 
@@ -215,8 +217,9 @@  discard block
 block discarded – undo
215 217
 	 * @return string
216 218
 	 */
217 219
 	public function get_label() {
218
-		if ( empty( $this->_label ) )
219
-			throw new EE_Error( sprintf( __('There is no label set for the help tour class (%s). Make sure that the $_label property is set in the class constructor', 'event_espresso'), get_class($this) ) );
220
+		if ( empty( $this->_label ) ) {
221
+					throw new EE_Error( sprintf( __('There is no label set for the help tour class (%s). Make sure that the $_label property is set in the class constructor', 'event_espresso'), get_class($this) ) );
222
+		}
220 223
 		return $this->_label;
221 224
 	}
222 225
 
Please login to merge, or discard this patch.
core/admin/EE_Help_Tour_final_stop.class.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			'action' => 'admin_option_settings',
61 61
 			'page' => 'espresso_general_settings'
62 62
 			);
63
-		return '<p>' . sprintf( __('That\'s it for the tour!  At any time you can restart a tour by clicking on this help dropdown and then clicking one of the Tour buttons.  There are help tours available on all Event Espresso Admin pages.  If you want to turn off help tours for all pages, %sgo here%s. All the best with your events!', 'event_espresso'), '<a href="' . EE_Admin_Page::add_query_args_and_nonce($query_args, admin_url('admin.php') ) . '">', '</a>' ) . '</p>';
63
+		return '<p>'.sprintf(__('That\'s it for the tour!  At any time you can restart a tour by clicking on this help dropdown and then clicking one of the Tour buttons.  There are help tours available on all Event Espresso Admin pages.  If you want to turn off help tours for all pages, %sgo here%s. All the best with your events!', 'event_espresso'), '<a href="'.EE_Admin_Page::add_query_args_and_nonce($query_args, admin_url('admin.php')).'">', '</a>').'</p>';
64 64
 	}
65 65
 
66 66
 }
67 67
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
core/admin/templates/about_admin_wrapper.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <div class="wrap espresso-admin about-wrap">
2 2
 
3 3
 	<h1><?php  echo $admin_page_title; ?></h1>
4
-	<div class="about-text"><?php echo !empty($admin_page_subtitle) ? $admin_page_subtitle : ''; ?></div>
5
-	<div class="ee-badge"><img class="" src=" <?php echo EE_GLOBAL_ASSETS_URL; ?>images/event-espresso-cup-90x90.png" width="90" height="90" alt="<?php printf( esc_attr__( '%s Logo', 'event_espresso' ), 'Event Espresso' ); ?>"/><br /><?php printf( __('Version %s', 'event_espresso' ),  EVENT_ESPRESSO_VERSION ); ?></div>
4
+	<div class="about-text"><?php echo ! empty($admin_page_subtitle) ? $admin_page_subtitle : ''; ?></div>
5
+	<div class="ee-badge"><img class="" src=" <?php echo EE_GLOBAL_ASSETS_URL; ?>images/event-espresso-cup-90x90.png" width="90" height="90" alt="<?php printf(esc_attr__('%s Logo', 'event_espresso'), 'Event Espresso'); ?>"/><br /><?php printf(__('Version %s', 'event_espresso'), EVENT_ESPRESSO_VERSION); ?></div>
6 6
 
7 7
 	<?php echo $nav_tabs; ?>
8 8
 
9 9
 
10 10
 <?php
11
-	do_action( 'AHEE__admin_wrapper__template__before_about_admin_page_content' );
11
+	do_action('AHEE__admin_wrapper__template__before_about_admin_page_content');
12 12
 	echo $about_admin_page_content;
13
-	do_action( 'AHEE__admin_wrapper__template__after_about_admin_page_content' );
13
+	do_action('AHEE__admin_wrapper__template__after_about_admin_page_content');
14 14
 ?>
15 15
 
16 16
 </div>
Please login to merge, or discard this patch.