Completed
Branch FET-7011-toggle-country-state-... (8ac228)
by
unknown
16:14
created
admin_pages/registrations/Registrations_Admin_Page.core.php 1 patch
Spacing   +581 added lines, -581 removed lines patch added patch discarded remove patch
@@ -56,26 +56,26 @@  discard block
 block discarded – undo
56 56
 	 * @param bool $routing
57 57
 	 * @return Registrations_Admin_Page
58 58
 	 */
59
-	public function __construct( $routing = TRUE ) {
60
-		parent::__construct( $routing );
61
-		add_action( 'wp_loaded', array( $this, 'wp_loaded' ));
59
+	public function __construct($routing = TRUE) {
60
+		parent::__construct($routing);
61
+		add_action('wp_loaded', array($this, 'wp_loaded'));
62 62
 	}
63 63
 
64 64
 
65 65
 
66 66
 	public function wp_loaded() {
67 67
 		// when adding a new registration...
68
-		if ( isset( $this->_req_data[ 'action' ] ) && $this->_req_data[ 'action' ] == 'new_registration' ) {
68
+		if (isset($this->_req_data['action']) && $this->_req_data['action'] == 'new_registration') {
69 69
 			EE_System::do_not_cache();
70 70
 			if (
71
-				! isset( $this->_req_data[ 'processing_registration' ] )
72
-				|| absint( $this->_req_data[ 'processing_registration' ] ) !== 1
71
+				! isset($this->_req_data['processing_registration'])
72
+				|| absint($this->_req_data['processing_registration']) !== 1
73 73
 			) {
74 74
 				// and it's NOT the attendee information reg step
75 75
 				// force cookie expiration by setting time to last week
76
-				setcookie( 'ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/' );
76
+				setcookie('ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/');
77 77
 				// and update the global
78
-				$_COOKIE[ 'ee_registration_added' ] = 0;
78
+				$_COOKIE['ee_registration_added'] = 0;
79 79
 			}
80 80
 		}
81 81
 	}
@@ -109,16 +109,16 @@  discard block
 block discarded – undo
109 109
 				'trash' => 'post.php'
110 110
 			);
111 111
 
112
-		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 );
112
+		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10);
113 113
 		//add filters so that the comment urls don't take users to a confusing 404 page
114
-		add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 );
114
+		add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3);
115 115
 	}
116 116
 
117 117
 
118
-	public function clear_comment_link( $link, $comment, $args ) {
118
+	public function clear_comment_link($link, $comment, $args) {
119 119
 		//gotta make sure this only happens on this route
120
-		$post_type = get_post_type( $comment->comment_post_ID);
121
-		if ( $post_type == 'espresso_attendees' )
120
+		$post_type = get_post_type($comment->comment_post_ID);
121
+		if ($post_type == 'espresso_attendees')
122 122
 			return '#commentsdiv';
123 123
 		return $link;
124 124
 	}
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
 	protected function _ajax_hooks() {
128 128
 		//todo: all hooks for registrations ajax goes in here
129
-		add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' ));
129
+		add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status'));
130 130
 	}
131 131
 
132 132
 
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
 				'add-attendee' => __('Add Contact', 'event_espresso'),
142 142
 				'edit' => __('Edit Contact', 'event_espresso'),
143 143
 				'report'=>  __("Event Registrations CSV Report", "event_espresso"),
144
-				'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ),
145
-				'contact_list_report' => __( 'Contact List Report', 'event_espresso' ),
144
+				'report_all' => __('All Registrations CSV Report', 'event_espresso'),
145
+				'contact_list_report' => __('Contact List Report', 'event_espresso'),
146 146
 				'contact_list_export'=>  __("Export Data", "event_espresso"),
147 147
 			),
148 148
 			'publishbox' => array(
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 
171 171
 		$this->_get_registration_status_array();
172 172
 
173
-		$reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0;
174
-		$att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0;
175
-		$att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id;
173
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0;
174
+		$att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0;
175
+		$att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id;
176 176
 
177 177
 		$this->_page_routes = array(
178 178
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
 				'restore_registrations' => array(
207 207
 					'func' => '_trash_or_restore_registrations',
208
-					'args' => array( 'trash' => FALSE ),
208
+					'args' => array('trash' => FALSE),
209 209
 					'noheader' => TRUE,
210 210
 					'capability' => 'ee_delete_registrations'
211 211
 					),
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 						'filename' => 'registrations_overview_other'
439 439
 					)
440 440
                 ),
441
-				'help_tour' => array( 'Registration_Overview_Help_Tour' ),
441
+				'help_tour' => array('Registration_Overview_Help_Tour'),
442 442
 				'qtips' => array('Registration_List_Table_Tips'),
443 443
 				'list_table' => 'EE_Registrations_List_Table',
444 444
 				'require_nonce' => FALSE
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 					'order' => 15,
451 451
 					'url' => isset($this->_req_data['_REG_ID'])
452 452
 						? add_query_arg(
453
-							array('_REG_ID' => $this->_req_data['_REG_ID'] ),
453
+							array('_REG_ID' => $this->_req_data['_REG_ID']),
454 454
 							$this->_current_page_view_url
455 455
 						)
456 456
 						: $this->_admin_base_url,
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
 						'filename' => 'registrations_details_registrant_details'
475 475
 					)
476 476
 				),
477
-				'help_tour' => array( 'Registration_Details_Help_Tour' ),
478
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_registration_details_metaboxes' ) ),
477
+				'help_tour' => array('Registration_Details_Help_Tour'),
478
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_registration_details_metaboxes')),
479 479
 				'require_nonce' => FALSE
480 480
 			),
481 481
 
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 					'order' => 15,
500 500
 					'persistent' => FALSE
501 501
 				),
502
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes' ) ),
502
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes')),
503 503
 				'require_nonce' => FALSE
504 504
 			),
505 505
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 					'label' => __('Edit Contact', 'event_espresso'),
509 509
 					'order' => 15,
510 510
 					'persistent' => FALSE,
511
-					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url
511
+					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID']), $this->_current_page_view_url) : $this->_admin_base_url
512 512
 				),
513 513
 				'metaboxes' => array('attendee_editor_metaboxes'),
514 514
 				'require_nonce' => FALSE
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 						'filename' => 'registrations_contact_list_other'
539 539
 					)
540 540
                 ),
541
-				'help_tour' => array( 'Contact_List_Help_Tour' ),
541
+				'help_tour' => array('Contact_List_Help_Tour'),
542 542
 				'metaboxes' => array(),
543 543
 				'require_nonce' => FALSE
544 544
 			),
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 	protected function _add_screen_options() {}
558 558
 	protected function _add_feature_pointers() {}
559 559
 	public function admin_init() {
560
-		EE_Registry::$i18n_js_strings[ 'update_att_qstns' ] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' );
560
+		EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso');
561 561
 	}
562 562
 	public function admin_notices() {}
563 563
 	public function admin_footer_scripts() {}
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 	*		@return void
576 576
 	*/
577 577
 	private function _get_registration_status_array() {
578
-		self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE);
578
+		self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE);
579 579
 	}
580 580
 
581 581
 
@@ -598,11 +598,11 @@  discard block
 block discarded – undo
598 598
 	public function load_scripts_styles() {
599 599
 		//style
600 600
 		//wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION );
601
-		wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
601
+		wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
602 602
 		wp_enqueue_style('espresso_reg');
603 603
 
604 604
 		//script
605
-		wp_register_script('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
605
+		wp_register_script('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
606 606
 		wp_enqueue_script('espresso_reg');
607 607
 	}
608 608
 
@@ -611,9 +611,9 @@  discard block
 block discarded – undo
611 611
 	public function load_scripts_styles_edit_attendee() {
612 612
 		//stuff to only show up on our attendee edit details page.
613 613
 		$attendee_details_translations = array(
614
-			'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') )
614
+			'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created'))
615 615
 			);
616
-		wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations );
616
+		wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations);
617 617
 		wp_enqueue_script('jquery-validate');
618 618
 	}
619 619
 
@@ -622,8 +622,8 @@  discard block
 block discarded – undo
622 622
 		//styles
623 623
 		wp_enqueue_style('espresso-ui-theme');
624 624
 		//scripts
625
-		$this->_get_reg_custom_questions_form( $this->_registration->ID() );
626
-		$this->_reg_custom_questions_form->wp_enqueue_scripts( true );
625
+		$this->_get_reg_custom_questions_form($this->_registration->ID());
626
+		$this->_reg_custom_questions_form->wp_enqueue_scripts(true);
627 627
 	}
628 628
 
629 629
 
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 
634 634
 	public function load_scripts_styles_contact_list() {
635 635
 		wp_deregister_style('espresso_reg');
636
-		wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
636
+		wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
637 637
 		wp_enqueue_style('espresso_att');
638 638
 	}
639 639
 
@@ -642,9 +642,9 @@  discard block
 block discarded – undo
642 642
 
643 643
 
644 644
 	public function load_scripts_styles_new_registration() {
645
-		wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE );
645
+		wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE);
646 646
 		wp_enqueue_script('ee-spco-for-admin');
647
-		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
647
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
648 648
 		EE_Form_Section_Proper::wp_enqueue_scripts();
649 649
 		EED_Ticket_Selector::load_tckt_slctr_assets();
650 650
 		EE_Datepicker_Input::enqueue_styles_and_scripts();
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 		//for notification related bulk actions we need to make sure only active messengers have an option.
672 672
 		EED_Messages::set_autoloaders();
673 673
 		/** @type EE_Message_Resource_Manager $message_resource_manager */
674
-		$message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
674
+		$message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
675 675
 		$active_mts = $message_resource_manager->list_of_active_message_types();
676 676
 		//key= bulk_action_slug, value= message type.
677 677
 		$match_array = array(
@@ -684,23 +684,23 @@  discard block
 block discarded – undo
684 684
 
685 685
 		/** setup reg status bulk actions **/
686 686
 		$def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso');
687
-		if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
687
+		if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
688 688
 			$def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso');
689 689
 		}
690 690
 		$def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso');
691
-		if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
691
+		if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
692 692
 			$def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso');
693 693
 		}
694 694
 		$def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso');
695
-		if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
695
+		if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
696 696
 			$def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso');
697 697
 		}
698 698
 		$def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso');
699
-		if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
699
+		if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
700 700
 			$def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso');
701 701
 		}
702 702
 		$def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso');
703
-		if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
703
+		if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
704 704
 			$def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso');
705 705
 		}
706 706
 
@@ -709,29 +709,29 @@  discard block
 block discarded – undo
709 709
 				'slug' => 'all',
710 710
 				'label' => __('View All Registrations', 'event_espresso'),
711 711
 				'count' => 0,
712
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
712
+				'bulk_action' => array_merge($def_reg_status_actions, array(
713 713
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
714
-					) )
714
+					))
715 715
 				),
716 716
 			'month' => array(
717 717
 				'slug' => 'month',
718 718
 				'label' => __('This Month', 'event_espresso'),
719 719
 				'count' => 0,
720
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
720
+				'bulk_action' => array_merge($def_reg_status_actions, array(
721 721
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
722 722
 					))
723 723
 				),
724 724
 			'today' => array(
725 725
 				'slug' => 'today',
726
-				'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp' ) ) ),
726
+				'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp'))),
727 727
 				'count' => 0,
728
-				'bulk_action' => array_merge( $def_reg_status_actions,  array(
728
+				'bulk_action' => array_merge($def_reg_status_actions, array(
729 729
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
730 730
 					))
731 731
 				)
732 732
 			);
733 733
 
734
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) {
734
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) {
735 735
 			$this->_views['incomplete'] = array(
736 736
 				'slug' => 'incomplete',
737 737
 				'label' => __('Incomplete', 'event_espresso'),
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 				)
768 768
 			);
769 769
 
770
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) {
770
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) {
771 771
 			$this->_views['trash'] = array(
772 772
 				'slug' => 'trash',
773 773
 				'label' => __('Trash', 'event_espresso'),
@@ -806,18 +806,18 @@  discard block
 block discarded – undo
806 806
 				'desc' => __('View Transaction Invoice', 'event_espresso')
807 807
 				),
808 808
  			);
809
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
809
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
810 810
 			$fc_items['resend_registration'] = array(
811 811
 				'class' => 'dashicons dashicons-email-alt',
812 812
 				'desc' => __('Resend Registration Details', 'event_espresso')
813 813
 				);
814 814
 		} else {
815
-			$fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' );
815
+			$fc_items['blank'] = array('class' => 'blank', 'desc' => '');
816 816
 		}
817 817
 
818
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
819
-			$related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' );
820
-			if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) {
818
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
819
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
820
+			if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) {
821 821
 				$fc_items['view_related_messages'] = array(
822 822
 					'class' => $related_for_icon['css_class'],
823 823
 					'desc' => $related_for_icon['label'],
@@ -827,35 +827,35 @@  discard block
 block discarded – undo
827 827
 
828 828
 		$sc_items = array(
829 829
 			'approved_status' => array(
830
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
831
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
830
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved,
831
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')
832 832
 				),
833 833
 			'pending_status' => array(
834
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
835
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' )
834
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment,
835
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence')
836 836
 				),
837 837
 			'wait_list' => array(
838
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_wait_list,
839
-				'desc'  => EEH_Template::pretty_status( EEM_Registration::status_id_wait_list, false, 'sentence' )
838
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_wait_list,
839
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence')
840 840
 			),
841 841
 			'incomplete_status' => array(
842
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete,
843
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' )
842
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete,
843
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence')
844 844
 			),
845 845
 			'not_approved' => array(
846
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
847
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' )
846
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved,
847
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')
848 848
 				),
849 849
 			'declined_status' => array(
850
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
851
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
850
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined,
851
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence')
852 852
 				),
853 853
 			'cancelled_status' => array(
854
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
855
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
854
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled,
855
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence')
856 856
 				)
857 857
 			);
858
-		return array_merge( $fc_items, $sc_items );
858
+		return array_merge($fc_items, $sc_items);
859 859
 	}
860 860
 
861 861
 
@@ -869,45 +869,45 @@  discard block
 block discarded – undo
869 869
 	 */
870 870
 	protected function _registrations_overview_list_table() {
871 871
 		$this->_template_args['admin_page_header'] = '';
872
-		$EVT_ID = ! empty( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : 0;
873
-		if ( $EVT_ID ) {
874
-			if ( EE_Registry::instance()->CAP->current_user_can(
872
+		$EVT_ID = ! empty($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : 0;
873
+		if ($EVT_ID) {
874
+			if (EE_Registry::instance()->CAP->current_user_can(
875 875
 				'ee_edit_registrations',
876 876
 				'espresso_registrations_new_registration',
877 877
 				$EVT_ID
878 878
 				)
879 879
 			) {
880
-				$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
880
+				$this->_admin_page_title .= ' '.$this->get_action_link_or_button(
881 881
 					'new_registration',
882 882
 					'add-registrant',
883
-					array( 'event_id' => $EVT_ID ),
883
+					array('event_id' => $EVT_ID),
884 884
 					'add-new-h2'
885 885
 				);
886 886
 			}
887
-			$event = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
888
-			if ( $event instanceof EE_Event ) {
887
+			$event = EEM_Event::instance()->get_one_by_ID($EVT_ID);
888
+			if ($event instanceof EE_Event) {
889 889
 				$this->_template_args['admin_page_header'] = sprintf(
890
-					__( '%s Viewing registrations for the event: %s%s', 'event_espresso' ),
890
+					__('%s Viewing registrations for the event: %s%s', 'event_espresso'),
891 891
 					'<h3 style="line-height:1.5em;">',
892
-					'<br /><a href="' . EE_Admin_Page::add_query_args_and_nonce(
893
-						array( 'action' => 'edit', 'post' => $event->ID() ),
892
+					'<br /><a href="'.EE_Admin_Page::add_query_args_and_nonce(
893
+						array('action' => 'edit', 'post' => $event->ID()),
894 894
 						EVENTS_ADMIN_URL
895
-					) . '">&nbsp;' . $event->get( 'EVT_name' ) . '&nbsp;</a>&nbsp;',
895
+					).'">&nbsp;'.$event->get('EVT_name').'&nbsp;</a>&nbsp;',
896 896
 					'</h3>'
897 897
 				);
898 898
 			}
899
-			$DTT_ID = ! empty( $this->_req_data['datetime_id'] ) ? absint( $this->_req_data['datetime_id'] ) : 0;
900
-			$datetime = EEM_Datetime::instance()->get_one_by_ID( $DTT_ID );
901
-			if ( $datetime instanceof EE_Datetime && $this->_template_args['admin_page_header'] !== '' ) {
902
-				$this->_template_args['admin_page_header'] = substr( $this->_template_args['admin_page_header'], 0, -5 );
899
+			$DTT_ID = ! empty($this->_req_data['datetime_id']) ? absint($this->_req_data['datetime_id']) : 0;
900
+			$datetime = EEM_Datetime::instance()->get_one_by_ID($DTT_ID);
901
+			if ($datetime instanceof EE_Datetime && $this->_template_args['admin_page_header'] !== '') {
902
+				$this->_template_args['admin_page_header'] = substr($this->_template_args['admin_page_header'], 0, -5);
903 903
 				$this->_template_args['admin_page_header'] .= ' &nbsp;<span class="drk-grey-text">';
904 904
 				$this->_template_args['admin_page_header'] .= '<span class="dashicons dashicons-calendar"></span>';
905 905
 				$this->_template_args['admin_page_header'] .= $datetime->name();
906
-				$this->_template_args['admin_page_header'] .= ' ( ' . $datetime->start_date() . ' )';
906
+				$this->_template_args['admin_page_header'] .= ' ( '.$datetime->start_date().' )';
907 907
 				$this->_template_args['admin_page_header'] .= '</span></h3>';
908 908
 			}
909 909
 		}
910
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() );
910
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items());
911 911
 		$this->display_admin_list_table_page_with_no_sidebar();
912 912
 	}
913 913
 
@@ -922,19 +922,19 @@  discard block
 block discarded – undo
922 922
 	 */
923 923
 	private function _set_registration_object() {
924 924
 		//get out if we've already set the object
925
-		if ( is_object( $this->_registration )) {
925
+		if (is_object($this->_registration)) {
926 926
 			return TRUE;
927 927
 		}
928 928
 
929 929
 	    $REG = EEM_Registration::instance();
930 930
 
931
-		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
931
+		$REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE;
932 932
 
933
-		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID ))
933
+		if ($this->_registration = $REG->get_one_by_ID($REG_ID))
934 934
 			return TRUE;
935 935
 		else {
936
-			$error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID );
937
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
936
+			$error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID);
937
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
938 938
 			$this->_registration = NULL;
939 939
 			return FALSE;
940 940
 		}
@@ -952,25 +952,25 @@  discard block
 block discarded – undo
952 952
 	 * @throws \EE_Error
953 953
 	 * @return mixed (int|array)  int = count || array of registration objects
954 954
 	 */
955
-	public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) {
956
-		$EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE;
957
-		$CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE;
958
-		$DTT_ID = isset( $this->_req_data['datetime_id'] ) ? absint( $this->_req_data['datetime_id'] ) : null;
959
-		$reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE;
960
-		$month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april
961
-		$today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'today' ? TRUE : FALSE;
962
-		$this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'month' ? TRUE  : FALSE;
955
+	public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) {
956
+		$EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE;
957
+		$CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE;
958
+		$DTT_ID = isset($this->_req_data['datetime_id']) ? absint($this->_req_data['datetime_id']) : null;
959
+		$reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE;
960
+		$month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april
961
+		$today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'today' ? TRUE : FALSE;
962
+		$this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'month' ? TRUE : FALSE;
963 963
 		$start_date = FALSE;
964 964
 		$end_date = FALSE;
965 965
 		$_where = array();
966
-		$trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE;
967
-		$incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE;
966
+		$trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE;
967
+		$incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE;
968 968
 
969 969
 		//set orderby
970 970
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
971 971
 
972 972
 
973
-		switch ( $this->_req_data['orderby'] ) {
973
+		switch ($this->_req_data['orderby']) {
974 974
 			case '_REG_ID':
975 975
 				$orderby = 'REG_ID';
976 976
 				break;
@@ -990,30 +990,30 @@  discard block
 block discarded – undo
990 990
 				$orderby = 'REG_date';
991 991
 		}
992 992
 
993
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
994
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
995
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
993
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
994
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
995
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
996 996
 
997 997
 
998
-		$offset = ($current_page-1)*$per_page;
999
-		$limit = $count  ? NULL : array( $offset, $per_page );
998
+		$offset = ($current_page - 1) * $per_page;
999
+		$limit = $count ? NULL : array($offset, $per_page);
1000 1000
 
1001
-		if($EVT_ID){
1002
-			$_where['EVT_ID']=$EVT_ID;
1001
+		if ($EVT_ID) {
1002
+			$_where['EVT_ID'] = $EVT_ID;
1003 1003
 		}
1004
-		if($CAT_ID){
1004
+		if ($CAT_ID) {
1005 1005
 			$_where['Event.Term_Taxonomy.term_id'] = $CAT_ID;
1006 1006
 		}
1007 1007
 		//if DTT is included we filter by that datetime.
1008
-		if ( $DTT_ID ) {
1008
+		if ($DTT_ID) {
1009 1009
 			$_where['Ticket.Datetime.DTT_ID'] = $DTT_ID;
1010 1010
 		}
1011
-		if ( $incomplete ) {
1011
+		if ($incomplete) {
1012 1012
 			$_where['STS_ID'] = EEM_Registration::status_id_incomplete;
1013 1013
 		} else if ( ! $trash) {
1014
-			$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
1014
+			$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
1015 1015
 		}
1016
-		if($reg_status){
1016
+		if ($reg_status) {
1017 1017
 			$_where['STS_ID'] = $reg_status;
1018 1018
 		}
1019 1019
 
@@ -1025,103 +1025,103 @@  discard block
 block discarded – undo
1025 1025
 		$time_start = ' 00:00:00';
1026 1026
 		$time_end = ' 23:59:59';
1027 1027
 
1028
-		if($today_a || $today ){
1028
+		if ($today_a || $today) {
1029 1029
 			$curdate = date('Y-m-d', current_time('timestamp'));
1030
-			$_where['REG_date']= array('BETWEEN',
1030
+			$_where['REG_date'] = array('BETWEEN',
1031 1031
 				array(
1032
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ),
1033
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ),
1032
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_start, 'Y-m-d H:i:s'),
1033
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_end, 'Y-m-d H:i:s'),
1034 1034
 			));
1035
-		}elseif($this_month_a || $this_month){
1035
+		}elseif ($this_month_a || $this_month) {
1036 1036
 			$this_month_r = date('m', current_time('timestamp'));
1037
-			$days_this_month = date( 't', current_time('timestamp') );
1038
-			$_where['REG_date']= array('BETWEEN',
1037
+			$days_this_month = date('t', current_time('timestamp'));
1038
+			$_where['REG_date'] = array('BETWEEN',
1039 1039
 				array(
1040
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ),
1041
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' )
1040
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'),
1041
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s')
1042 1042
 			));
1043
-		}elseif($month_range){
1043
+		}elseif ($month_range) {
1044 1044
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1045
-			$month_r = !empty($pieces[0]) ? date('m', strtotime( $month_range ) ) : '';
1046
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
1047
-			$days_in_month = date('t', strtotime($year_r .  '-' . $month_r . '-' . '01') );
1048
-			$_where['REG_date']= array('BETWEEN',
1049
-				array(  EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month .  ' 23:59:59', 'Y-m-d H:i:s' ) ) );
1050
-		}elseif($start_date && $end_date){
1045
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($month_range)) : '';
1046
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1047
+			$days_in_month = date('t', strtotime($year_r.'-'.$month_r.'-'.'01'));
1048
+			$_where['REG_date'] = array('BETWEEN',
1049
+				array(EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-'.$days_in_month.' 23:59:59', 'Y-m-d H:i:s')));
1050
+		}elseif ($start_date && $end_date) {
1051 1051
 			throw new EE_Error("not yet supported");
1052
-		}elseif($start_date){
1052
+		}elseif ($start_date) {
1053 1053
 			throw new EE_Error("not yet supported");
1054
-		}elseif($end_date){
1054
+		}elseif ($end_date) {
1055 1055
 			throw new EE_Error("not yet supported");
1056 1056
 		}
1057 1057
 
1058
-		if ( ! empty( $this->_req_data['s'] ) ) {
1059
-			$sstr = '%' . $this->_req_data['s'] . '%';
1058
+		if ( ! empty($this->_req_data['s'])) {
1059
+			$sstr = '%'.$this->_req_data['s'].'%';
1060 1060
 			$_where['OR'] = array(
1061
-				'Event.EVT_name' => array( 'LIKE', $sstr),
1062
-				'Event.EVT_desc' => array( 'LIKE', $sstr ),
1063
-				'Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
1064
-				'Attendee.ATT_full_name' => array( 'LIKE', $sstr ),
1065
-				'Attendee.ATT_fname' => array( 'LIKE', $sstr ),
1066
-				'Attendee.ATT_lname' => array( 'LIKE', $sstr ),
1067
-				'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ),
1068
-				'Attendee.ATT_email' => array('LIKE', $sstr ),
1069
-				'Attendee.ATT_address' => array( 'LIKE', $sstr ),
1070
-				'Attendee.ATT_address2' => array( 'LIKE', $sstr ),
1071
-				'Attendee.ATT_city' => array( 'LIKE', $sstr ),
1072
-				'REG_final_price' => array( 'LIKE', $sstr ),
1073
-				'REG_code' => array( 'LIKE', $sstr ),
1074
-				'REG_count' => array( 'LIKE' , $sstr ),
1075
-				'REG_group_size' => array( 'LIKE' , $sstr ),
1076
-				'Ticket.TKT_name' => array( 'LIKE', $sstr ),
1077
-				'Ticket.TKT_description' => array( 'LIKE', $sstr ),
1078
-				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $sstr )
1061
+				'Event.EVT_name' => array('LIKE', $sstr),
1062
+				'Event.EVT_desc' => array('LIKE', $sstr),
1063
+				'Event.EVT_short_desc' => array('LIKE', $sstr),
1064
+				'Attendee.ATT_full_name' => array('LIKE', $sstr),
1065
+				'Attendee.ATT_fname' => array('LIKE', $sstr),
1066
+				'Attendee.ATT_lname' => array('LIKE', $sstr),
1067
+				'Attendee.ATT_short_bio' => array('LIKE', $sstr),
1068
+				'Attendee.ATT_email' => array('LIKE', $sstr),
1069
+				'Attendee.ATT_address' => array('LIKE', $sstr),
1070
+				'Attendee.ATT_address2' => array('LIKE', $sstr),
1071
+				'Attendee.ATT_city' => array('LIKE', $sstr),
1072
+				'REG_final_price' => array('LIKE', $sstr),
1073
+				'REG_code' => array('LIKE', $sstr),
1074
+				'REG_count' => array('LIKE', $sstr),
1075
+				'REG_group_size' => array('LIKE', $sstr),
1076
+				'Ticket.TKT_name' => array('LIKE', $sstr),
1077
+				'Ticket.TKT_description' => array('LIKE', $sstr),
1078
+				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $sstr)
1079 1079
 			);
1080 1080
 		}
1081 1081
 
1082 1082
 		//capability checks
1083
-		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) {
1083
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) {
1084 1084
 			$_where['AND'] = array(
1085 1085
 				'Event.EVT_wp_user' => get_current_user_id()
1086 1086
 				);
1087 1087
 		}
1088 1088
 
1089
-		if( $count ){
1090
-			if ( $trash ) {
1091
-				return EEM_Registration::instance()->count_deleted( array( $_where ));
1092
-			} else if ( $incomplete ) {
1093
-				return EEM_Registration::instance()->count( array( $_where ));
1089
+		if ($count) {
1090
+			if ($trash) {
1091
+				return EEM_Registration::instance()->count_deleted(array($_where));
1092
+			} else if ($incomplete) {
1093
+				return EEM_Registration::instance()->count(array($_where));
1094 1094
 			} else {
1095
-				return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' ));
1095
+				return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only'));
1096 1096
 			}
1097 1097
 		} else {
1098 1098
 			//make sure we remove default where conditions cause all registrations matching query are returned
1099
-			$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' );
1100
-			if ( $per_page !== -1 ) {
1099
+			$query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only');
1100
+			if ($per_page !== -1) {
1101 1101
 				$query_params['limit'] = $limit;
1102 1102
 			}
1103
-			$registrations =  $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1103
+			$registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1104 1104
 
1105
-			if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration &&  $registrations[0]->event_obj()) {
1105
+			if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) {
1106 1106
 				$first_registration = $registrations[0];
1107 1107
 				//EEH_Debug_Tools::printr( $registrations[0], '$registrations  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
1108 1108
 				$event_name = $first_registration->event_obj()->name();
1109
-				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1109
+				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a'); // isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1110 1110
 				// edit event link
1111
-				if ( $event_name != '' ) {
1112
-					$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL );
1113
-					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
1114
-					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
1111
+				if ($event_name != '') {
1112
+					$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL);
1113
+					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>';
1114
+					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
1115 1115
 				}
1116 1116
 
1117
-				$back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL );
1118
-				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">&laquo; ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>';
1117
+				$back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL);
1118
+				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">&laquo; '.__('Back to All Registrations', 'event_espresso').'</a>';
1119 1119
 
1120 1120
 				$this->_template_args['before_admin_page_content'] = '
1121 1121
 			<div id="admin-page-header">
1122
-				<h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1>
1123
-				<h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3>
1124
-				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span>
1122
+				<h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1>
1123
+				<h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3>
1124
+				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span>
1125 1125
 			</div>
1126 1126
 			';
1127 1127
 
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
 
1160 1160
 		$this->_set_registration_object();
1161 1161
 
1162
-		if ( is_object( $this->_registration )) {
1162
+		if (is_object($this->_registration)) {
1163 1163
 			$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1164 1164
 			$this->_session = $transaction->session_data();
1165 1165
 
@@ -1167,10 +1167,10 @@  discard block
 block discarded – undo
1167 1167
 
1168 1168
 
1169 1169
 			$this->_template_args['reg_nmbr']['value'] = $this->_registration->ID();
1170
-			$this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' );
1170
+			$this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso');
1171 1171
 
1172
-			$this->_template_args['reg_datetime']['value'] =  $this->_registration->get_i18n_datetime( 'REG_date' );
1173
-			$this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' );
1172
+			$this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime('REG_date');
1173
+			$this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso');
1174 1174
 
1175 1175
 			$this->_template_args['grand_total'] = $transaction->total();
1176 1176
 
@@ -1178,19 +1178,19 @@  discard block
 block discarded – undo
1178 1178
 			// link back to overview
1179 1179
 			$this->_template_args['reg_overview_url'] = REG_ADMIN_URL;
1180 1180
 			$this->_template_args['registration'] = $this->_registration;
1181
-			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $event_id ), REG_ADMIN_URL );
1182
-			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions' ), admin_url( 'admin.php' ) );
1183
-			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id ), admin_url( 'admin.php' ) );
1181
+			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL);
1182
+			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php'));
1183
+			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php'));
1184 1184
 
1185 1185
 			//next and previous links
1186
-			$next_reg = $this->_registration->next(null, array(), 'REG_ID' );
1187
-			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : '';
1188
-			$previous_reg = $this->_registration->previous( null, array(), 'REG_ID' );
1189
-			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : '';
1186
+			$next_reg = $this->_registration->next(null, array(), 'REG_ID');
1187
+			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : '';
1188
+			$previous_reg = $this->_registration->previous(null, array(), 'REG_ID');
1189
+			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : '';
1190 1190
 
1191 1191
 			// grab header
1192
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php';
1193
-			$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1192
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php';
1193
+			$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1194 1194
 
1195 1195
 		} else {
1196 1196
 
@@ -1209,17 +1209,17 @@  discard block
 block discarded – undo
1209 1209
 
1210 1210
 
1211 1211
 	protected function _registration_details_metaboxes() {
1212
-		do_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this );
1212
+		do_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this);
1213 1213
 		$this->_set_registration_object();
1214 1214
 		$attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null;
1215
-		add_meta_box( 'edit-reg-status-mbox', __( 'Registration Status', 'event_espresso' ), array( $this, 'set_reg_status_buttons_metabox' ), $this->wp_page_slug, 'normal', 'high' );
1216
-		add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1217
-		if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) {
1218
-			add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1215
+		add_meta_box('edit-reg-status-mbox', __('Registration Status', 'event_espresso'), array($this, 'set_reg_status_buttons_metabox'), $this->wp_page_slug, 'normal', 'high');
1216
+		add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
1217
+		if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) {
1218
+			add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high');
1219 1219
 		}
1220
-		add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' );
1221
-		if ( $this->_registration->group_size() > 1 ) {
1222
-			add_meta_box( 'edit-reg-attendees-mbox', __( 'Other Registrations in this Transaction', 'event_espresso' ), array( $this, '_reg_attendees_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1220
+		add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high');
1221
+		if ($this->_registration->group_size() > 1) {
1222
+			add_meta_box('edit-reg-attendees-mbox', __('Other Registrations in this Transaction', 'event_espresso'), array($this, '_reg_attendees_meta_box'), $this->wp_page_slug, 'normal', 'high');
1223 1223
 		}
1224 1224
 	}
1225 1225
 
@@ -1261,25 +1261,25 @@  discard block
 block discarded – undo
1261 1261
 				'html_id'         => 'reg-status-change-form',
1262 1262
 				'layout_strategy' => new EE_Admin_Two_Column_Layout(),
1263 1263
 				'subsections'     => array(
1264
-					'return' => new EE_Hidden_Input( array(
1264
+					'return' => new EE_Hidden_Input(array(
1265 1265
 						'name'    => 'return',
1266 1266
 						'default' => 'view_registration'
1267
-					) ),
1268
-					'REG_ID' => new EE_Hidden_Input( array(
1267
+					)),
1268
+					'REG_ID' => new EE_Hidden_Input(array(
1269 1269
 						'name'    => 'REG_ID',
1270 1270
 						'default' => $this->_registration->ID()
1271
-					) ),
1271
+					)),
1272 1272
 					'current_status' => new EE_Form_Section_HTML(
1273 1273
 						EEH_HTML::tr(
1274 1274
 							EEH_HTML::th(
1275 1275
 								EEH_HTML::label(
1276
-									EEH_HTML::strong( __( 'Current Registration Status', 'event_espresso' ) )
1276
+									EEH_HTML::strong(__('Current Registration Status', 'event_espresso'))
1277 1277
 								)
1278
-							) .
1278
+							).
1279 1279
 							EEH_HTML::td(
1280 1280
 								EEH_HTML::strong(
1281 1281
 									$this->_registration->pretty_status(),
1282
-									'', 'status-' . $this->_registration->status_ID(), 'line-height: 1em; font-size: 1.5em; font-weight: bold;'
1282
+									'', 'status-'.$this->_registration->status_ID(), 'line-height: 1em; font-size: 1.5em; font-weight: bold;'
1283 1283
 								)
1284 1284
 							)
1285 1285
 						)
@@ -1287,22 +1287,22 @@  discard block
 block discarded – undo
1287 1287
 					'reg_status' => new EE_Select_Input(
1288 1288
 						$this->_get_reg_statuses(),
1289 1289
 						array(
1290
-							'html_label_text' => __( 'Change Registration Status to', 'event_espresso' ),
1290
+							'html_label_text' => __('Change Registration Status to', 'event_espresso'),
1291 1291
 							'default'         => $this->_registration->status_ID(),
1292 1292
 						)
1293 1293
 					),
1294 1294
 					'send_notifications' => new EE_Yes_No_Input(
1295 1295
 						array(
1296
-							'html_label_text' => __( 'Send Related Messages', 'event_espresso' ),
1296
+							'html_label_text' => __('Send Related Messages', 'event_espresso'),
1297 1297
 							'default'         => false,
1298
-							'html_help_text'  => __( 'If set to "Yes", then the related messages will be sent to the registrant.', 'event_espresso' ),
1298
+							'html_help_text'  => __('If set to "Yes", then the related messages will be sent to the registrant.', 'event_espresso'),
1299 1299
 						)
1300 1300
 					),
1301
-					'submit' => new EE_Submit_Input( array(
1301
+					'submit' => new EE_Submit_Input(array(
1302 1302
 						'html_class'      => 'button-primary',
1303 1303
 						'html_label_text' => '&nbsp;',
1304
-						'default'         => __( 'Update Registration Status', 'event_espresso' )
1305
-					) ),
1304
+						'default'         => __('Update Registration Status', 'event_espresso')
1305
+					)),
1306 1306
 				),
1307 1307
 			)
1308 1308
 		);
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
 	 * Returns an array of all the buttons for the various statuses and switch status actions
1316 1316
 	 * @return string
1317 1317
 	 */
1318
-	protected function _get_current_reg_status_help_text( $STS_ID = '' ) {
1318
+	protected function _get_current_reg_status_help_text($STS_ID = '') {
1319 1319
 		//$reg_status_help_text = array(
1320 1320
 		//	'RAP' => __( 'XXXXXXXXXXX', 'event_espresso' ),
1321 1321
 		//	'RAP' => __( 'XXXXXXXXXXX', 'event_espresso' ),
@@ -1348,14 +1348,14 @@  discard block
 block discarded – undo
1348 1348
 	 */
1349 1349
 	protected function _get_reg_statuses() {
1350 1350
 		$reg_status_array = EEM_Registration::instance()->reg_status_array();
1351
-		unset ( $reg_status_array[ EEM_Registration::status_id_incomplete ] );
1351
+		unset ($reg_status_array[EEM_Registration::status_id_incomplete]);
1352 1352
 		// get current reg status
1353 1353
 		$current_status = $this->_registration->status_ID();
1354 1354
 		// is registration for free event? This will determine whether to display the pending payment option
1355
-		if ( $current_status != EEM_Registration::status_id_pending_payment && $this->_registration->transaction()->is_free() ) {
1356
-			unset( $reg_status_array[ EEM_Registration::status_id_pending_payment ] );
1355
+		if ($current_status != EEM_Registration::status_id_pending_payment && $this->_registration->transaction()->is_free()) {
1356
+			unset($reg_status_array[EEM_Registration::status_id_pending_payment]);
1357 1357
 		}
1358
-		return EEM_Status::instance()->localized_status( $reg_status_array, false, 'sentence' );
1358
+		return EEM_Status::instance()->localized_status($reg_status_array, false, 'sentence');
1359 1359
 	}
1360 1360
 
1361 1361
 
@@ -1368,15 +1368,15 @@  discard block
 block discarded – undo
1368 1368
 	 *
1369 1369
 	 * @return array  (array with reg_id(s) updated and whether update was successful.
1370 1370
 	 */
1371
-	protected function _set_registration_status_from_request( $status = false, $notify = false ) {
1372
-		if ( isset( $this->_req_data[ 'reg_status_change_form' ] ) ) {
1373
-			$REG_IDs = isset( $this->_req_data[ 'reg_status_change_form' ][ 'REG_ID' ] )
1374
-				? (array)$this->_req_data[ 'reg_status_change_form' ][ 'REG_ID' ]
1371
+	protected function _set_registration_status_from_request($status = false, $notify = false) {
1372
+		if (isset($this->_req_data['reg_status_change_form'])) {
1373
+			$REG_IDs = isset($this->_req_data['reg_status_change_form']['REG_ID'])
1374
+				? (array) $this->_req_data['reg_status_change_form']['REG_ID']
1375 1375
 				: array();
1376 1376
 		} else {
1377
-			$REG_IDs = isset( $this->_req_data[ '_REG_ID' ] ) ? (array)$this->_req_data[ '_REG_ID' ] : array();
1377
+			$REG_IDs = isset($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array();
1378 1378
 		}
1379
-		$success = $this->_set_registration_status( $REG_IDs, $status );
1379
+		$success = $this->_set_registration_status($REG_IDs, $status);
1380 1380
 		//notify?
1381 1381
 		if (
1382 1382
 			$success
@@ -1403,21 +1403,21 @@  discard block
 block discarded – undo
1403 1403
 	 * @param bool $status
1404 1404
 	 * @return array (an array with 'success' key representing whether status change was successful, and 'REG_ID' as the array of updated registrations).
1405 1405
 	 */
1406
-	protected function _set_registration_status( $REG_IDs = array(), $status = false ) {
1406
+	protected function _set_registration_status($REG_IDs = array(), $status = false) {
1407 1407
 		$success = false;
1408 1408
 		// typecast $REG_IDs
1409
-		$REG_IDs = (array)$REG_IDs;
1410
-		if ( ! empty( $REG_IDs ) ) {
1409
+		$REG_IDs = (array) $REG_IDs;
1410
+		if ( ! empty($REG_IDs)) {
1411 1411
 			$success = true;
1412 1412
 			// set default status if none is passed
1413 1413
 			$status = $status ? $status : EEM_Registration::status_id_pending_payment;
1414 1414
 			// sanitize $REG_IDs
1415
-			$REG_IDs = array_filter( $REG_IDs, 'absint' );
1415
+			$REG_IDs = array_filter($REG_IDs, 'absint');
1416 1416
 			//loop through REG_ID's and change status
1417
-			foreach ( $REG_IDs as $REG_ID ) {
1418
-				$registration = EEM_Registration::instance()->get_one_by_ID( $REG_ID );
1419
-				if ( $registration instanceof EE_Registration ) {
1420
-					$registration->set_status( $status );
1417
+			foreach ($REG_IDs as $REG_ID) {
1418
+				$registration = EEM_Registration::instance()->get_one_by_ID($REG_ID);
1419
+				if ($registration instanceof EE_Registration) {
1420
+					$registration->set_status($status);
1421 1421
 					$result = $registration->save();
1422 1422
 					// verifying explicit fails because update *may* just return 0 for 0 rows affected
1423 1423
 					$success = $result !== false ? $success : false;
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
 		//reset _req_data['_REG_ID'] for any potential future messages notifications
1428 1428
 		$this->_req_data['_REG_ID'] = $REG_IDs;
1429 1429
 		//return $success and processed registrations
1430
-		return array( 'REG_ID' => $REG_IDs, 'success' => $success );
1430
+		return array('REG_ID' => $REG_IDs, 'success' => $success);
1431 1431
 	}
1432 1432
 
1433 1433
 
@@ -1439,49 +1439,49 @@  discard block
 block discarded – undo
1439 1439
 	 * @param   bool    $notify indicates whether the _set_registration_status_from_request does notifications or not.
1440 1440
 	 * @return void
1441 1441
 	 */
1442
-	protected function _reg_status_change_return( $STS_ID, $notify = false ) {
1443
-		$result = ! empty( $STS_ID )
1444
-            ? $this->_set_registration_status_from_request( $STS_ID, $notify )
1445
-            : array( 'success' => false );
1446
-		$success = isset( $result['success'] ) && $result['success'];
1442
+	protected function _reg_status_change_return($STS_ID, $notify = false) {
1443
+		$result = ! empty($STS_ID)
1444
+            ? $this->_set_registration_status_from_request($STS_ID, $notify)
1445
+            : array('success' => false);
1446
+		$success = isset($result['success']) && $result['success'];
1447 1447
 		//setup success message
1448
-		if ( $success ) {
1449
-			if ( is_array( $result[ 'REG_ID' ] ) && count( $result[ 'REG_ID' ] ) === 1 ) {
1448
+		if ($success) {
1449
+			if (is_array($result['REG_ID']) && count($result['REG_ID']) === 1) {
1450 1450
 				$msg = sprintf(
1451
-					__( 'Registration status has been set to %s', 'event_espresso' ),
1452
-					EEH_Template::pretty_status( $STS_ID, false, 'lower' )
1451
+					__('Registration status has been set to %s', 'event_espresso'),
1452
+					EEH_Template::pretty_status($STS_ID, false, 'lower')
1453 1453
 				);
1454 1454
 			} else {
1455 1455
 				$msg = sprintf(
1456
-					__( 'Registrations have been set to %s.', 'event_espresso' ),
1457
-					EEH_Template::pretty_status( $STS_ID, false, 'lower' )
1456
+					__('Registrations have been set to %s.', 'event_espresso'),
1457
+					EEH_Template::pretty_status($STS_ID, false, 'lower')
1458 1458
 				);
1459 1459
 			}
1460
-			EE_Error::add_success( $msg );
1460
+			EE_Error::add_success($msg);
1461 1461
 		} else {
1462 1462
 			EE_Error::add_error(
1463
-				__( 'Something went wrong, and the status was not changed', 'event_espresso' ),
1463
+				__('Something went wrong, and the status was not changed', 'event_espresso'),
1464 1464
 				__FILE__, __LINE__, __FUNCTION__
1465 1465
 			);
1466 1466
 		}
1467
-		if ( isset( $this->_req_data[ 'return' ] ) && $this->_req_data[ 'return' ] == 'view_registration' ) {
1468
-			$route = array( 'action' => 'view_registration', '_REG_ID' => reset( $result[ 'REG_ID' ] ) );
1467
+		if (isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration') {
1468
+			$route = array('action' => 'view_registration', '_REG_ID' => reset($result['REG_ID']));
1469 1469
 		} else {
1470
-			$route = array( 'action' => 'default' );
1470
+			$route = array('action' => 'default');
1471 1471
 		}
1472 1472
 		//unset nonces
1473
-		foreach ( $this->_req_data as $ref => $value ) {
1474
-			if ( strpos( $ref, 'nonce' ) !== false ) {
1475
-				unset( $this->_req_data[$ref] );
1473
+		foreach ($this->_req_data as $ref => $value) {
1474
+			if (strpos($ref, 'nonce') !== false) {
1475
+				unset($this->_req_data[$ref]);
1476 1476
 				continue;
1477 1477
 			}
1478 1478
 
1479
-			$value = is_array( $value ) ? array_map( 'urlencode', $value ) : urlencode( $value );
1479
+			$value = is_array($value) ? array_map('urlencode', $value) : urlencode($value);
1480 1480
 			$this->_req_data[$ref] = $value;
1481 1481
 		}
1482 1482
 		//merge request vars so that the reloaded list table contains any existing filter query params
1483
-		$route = array_merge( $this->_req_data, $route );
1484
-		$this->_redirect_after_action( $success, '', '', $route, true );
1483
+		$route = array_merge($this->_req_data, $route);
1484
+		$this->_redirect_after_action($success, '', '', $route, true);
1485 1485
 	}
1486 1486
 
1487 1487
 
@@ -1492,51 +1492,51 @@  discard block
 block discarded – undo
1492 1492
 	protected function _change_reg_status() {
1493 1493
 		$this->_req_data['return'] = 'view_registration';
1494 1494
 		//set notify based on whether the send notifications toggle is set or not
1495
-		$notify = ! empty( $this->_req_data['reg_status_change_form']['send_notifications'] );
1495
+		$notify = ! empty($this->_req_data['reg_status_change_form']['send_notifications']);
1496 1496
 		//$notify = ! empty( $this->_req_data['txn_reg_status_change']['send_notifications'] );
1497
-		$this->_req_data[ 'reg_status_change_form' ][ 'reg_status' ] = isset(
1498
-			$this->_req_data[ 'reg_status_change_form' ][ 'reg_status' ]
1497
+		$this->_req_data['reg_status_change_form']['reg_status'] = isset(
1498
+			$this->_req_data['reg_status_change_form']['reg_status']
1499 1499
 		)
1500
-			? $this->_req_data[ 'reg_status_change_form' ][ 'reg_status' ]
1500
+			? $this->_req_data['reg_status_change_form']['reg_status']
1501 1501
 			: '';
1502 1502
 
1503
-		switch ( $this->_req_data[ 'reg_status_change_form' ]['reg_status'] ) {
1503
+		switch ($this->_req_data['reg_status_change_form']['reg_status']) {
1504 1504
 
1505 1505
 			case EEM_Registration::status_id_approved :
1506
-			case EEH_Template::pretty_status( EEM_Registration::status_id_approved, false, 'sentence' ) :
1507
-				$this->approve_registration( $notify );
1506
+			case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence') :
1507
+				$this->approve_registration($notify);
1508 1508
 				break;
1509 1509
 
1510 1510
 			case EEM_Registration::status_id_pending_payment :
1511
-			case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, false, 'sentence' ) :
1512
-				$this->pending_registration( $notify );
1511
+			case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence') :
1512
+				$this->pending_registration($notify);
1513 1513
 				break;
1514 1514
 
1515 1515
 			case EEM_Registration::status_id_not_approved :
1516
-			case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, false, 'sentence' ) :
1517
-				$this->not_approve_registration( $notify );
1516
+			case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence') :
1517
+				$this->not_approve_registration($notify);
1518 1518
 				break;
1519 1519
 
1520 1520
 			case EEM_Registration::status_id_declined :
1521
-			case EEH_Template::pretty_status( EEM_Registration::status_id_declined, false, 'sentence' ) :
1522
-				$this->decline_registration( $notify );
1521
+			case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence') :
1522
+				$this->decline_registration($notify);
1523 1523
 				break;
1524 1524
 
1525 1525
 			case EEM_Registration::status_id_cancelled :
1526
-			case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, false, 'sentence' ) :
1527
-				$this->cancel_registration( $notify );
1526
+			case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence') :
1527
+				$this->cancel_registration($notify);
1528 1528
 				break;
1529 1529
 
1530 1530
 			case EEM_Registration::status_id_wait_list :
1531
-			case EEH_Template::pretty_status( EEM_Registration::status_id_wait_list, false, 'sentence' ) :
1532
-				$this->waitlist_registration( $notify );
1531
+			case EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence') :
1532
+				$this->waitlist_registration($notify);
1533 1533
 				break;
1534 1534
 
1535 1535
 			case EEM_Registration::status_id_incomplete :
1536 1536
 			default :
1537 1537
 				$result['success'] = false;
1538
-				unset( $this->_req_data['return'] );
1539
-				$this->_reg_status_change_return( '', false );
1538
+				unset($this->_req_data['return']);
1539
+				$this->_reg_status_change_return('', false);
1540 1540
 				break;
1541 1541
 		}
1542 1542
 	}
@@ -1550,8 +1550,8 @@  discard block
 block discarded – undo
1550 1550
 	 * @param bool $notify whether or not to notify the registrant about their approval.
1551 1551
 	 * @return void
1552 1552
 	 */
1553
-	protected function approve_registration( $notify = false ) {
1554
-		$this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify );
1553
+	protected function approve_registration($notify = false) {
1554
+		$this->_reg_status_change_return(EEM_Registration::status_id_approved, $notify);
1555 1555
 	}
1556 1556
 
1557 1557
 
@@ -1563,8 +1563,8 @@  discard block
 block discarded – undo
1563 1563
 	 * @param bool $notify whether or not to notify the registrant about their status change.
1564 1564
 	 * @return void
1565 1565
 	 */
1566
-	protected function decline_registration( $notify = false ) {
1567
-		$this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify );
1566
+	protected function decline_registration($notify = false) {
1567
+		$this->_reg_status_change_return(EEM_Registration::status_id_declined, $notify);
1568 1568
 	}
1569 1569
 
1570 1570
 
@@ -1576,8 +1576,8 @@  discard block
 block discarded – undo
1576 1576
 	 * @param bool $notify whether or not to notify the registrant about their status change.
1577 1577
 	 * @return void
1578 1578
 	 */
1579
-	protected function cancel_registration( $notify = false ) {
1580
-		$this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify );
1579
+	protected function cancel_registration($notify = false) {
1580
+		$this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $notify);
1581 1581
 	}
1582 1582
 
1583 1583
 
@@ -1589,8 +1589,8 @@  discard block
 block discarded – undo
1589 1589
 	 * @param bool $notify whether or not to notify the registrant about their status change.
1590 1590
 	 * @return void
1591 1591
 	 */
1592
-	protected function not_approve_registration( $notify = false ) {
1593
-		$this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify );
1592
+	protected function not_approve_registration($notify = false) {
1593
+		$this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $notify);
1594 1594
 	}
1595 1595
 
1596 1596
 
@@ -1602,8 +1602,8 @@  discard block
 block discarded – undo
1602 1602
 	 * @param bool $notify whether or not to notify the registrant about their status change.
1603 1603
 	 * @return void
1604 1604
 	 */
1605
-	protected function pending_registration( $notify = false ) {
1606
-		$this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify );
1605
+	protected function pending_registration($notify = false) {
1606
+		$this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $notify);
1607 1607
 	}
1608 1608
 
1609 1609
 
@@ -1615,8 +1615,8 @@  discard block
 block discarded – undo
1615 1615
 	 * @param bool $notify whether or not to notify the registrant about their status change.
1616 1616
 	 * @return void
1617 1617
 	 */
1618
-	protected function waitlist_registration( $notify = false ) {
1619
-		$this->_reg_status_change_return( EEM_Registration::status_id_wait_list, $notify );
1618
+	protected function waitlist_registration($notify = false) {
1619
+		$this->_reg_status_change_return(EEM_Registration::status_id_wait_list, $notify);
1620 1620
 	}
1621 1621
 
1622 1622
 
@@ -1630,14 +1630,14 @@  discard block
 block discarded – undo
1630 1630
 	public function _reg_details_meta_box() {
1631 1631
 		EEH_Autoloader::register_line_item_display_autoloaders();
1632 1632
 		EEH_Autoloader::register_line_item_filter_autoloaders();
1633
-		EE_Registry::instance()->load_helper( 'Line_Item' );
1633
+		EE_Registry::instance()->load_helper('Line_Item');
1634 1634
 		$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1635 1635
 		$this->_session = $transaction->session_data();
1636 1636
 
1637 1637
 		$filters = new EE_Line_Item_Filter_Collection();
1638 1638
 		//$filters->add( new EE_Non_Zero_Line_Item_Filter() );
1639
-		$filters->add( new EE_Single_Registration_Line_Item_Filter( $this->_registration ) );
1640
-		$line_item_filter_processor = new EE_Line_Item_Filter_Processor( $filters, $transaction->total_line_item() );
1639
+		$filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration));
1640
+		$line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item());
1641 1641
 		$filtered_line_item_tree = $line_item_filter_processor->process();
1642 1642
 		$line_item_display = new EE_Line_Item_Display(
1643 1643
 			'reg_admin_table',
@@ -1645,7 +1645,7 @@  discard block
 block discarded – undo
1645 1645
 		);
1646 1646
 		$this->_template_args['line_item_table'] = $line_item_display->display_line_item(
1647 1647
 			$filtered_line_item_tree,
1648
-			array( 'EE_Registration' => $this->_registration )
1648
+			array('EE_Registration' => $this->_registration)
1649 1649
 		);
1650 1650
 		$attendee = $this->_registration->attendee();
1651 1651
 
@@ -1655,7 +1655,7 @@  discard block
 block discarded – undo
1655 1655
 				'espresso_transactions_view_transaction'
1656 1656
 			)
1657 1657
 		) {
1658
-			$this->_template_args[ 'view_transaction_button' ] =  EEH_Template::get_button_or_link(
1658
+			$this->_template_args['view_transaction_button'] = EEH_Template::get_button_or_link(
1659 1659
 				EE_Admin_Page::add_query_args_and_nonce(
1660 1660
 					array(
1661 1661
 						'action' => 'view_transaction',
@@ -1663,12 +1663,12 @@  discard block
 block discarded – undo
1663 1663
 					),
1664 1664
 					TXN_ADMIN_URL
1665 1665
 				),
1666
-				esc_html__( ' View Transaction' ),
1666
+				esc_html__(' View Transaction'),
1667 1667
 				'button secondary-button right',
1668 1668
 				'dashicons dashicons-cart'
1669 1669
 			);
1670 1670
 		} else {
1671
-			$this->_template_args[ 'view_transaction_button' ] = '';
1671
+			$this->_template_args['view_transaction_button'] = '';
1672 1672
 		}
1673 1673
 
1674 1674
 		if (
@@ -1678,7 +1678,7 @@  discard block
 block discarded – undo
1678 1678
 				'espresso_registrations_resend_registration'
1679 1679
 			)
1680 1680
 		) {
1681
-			$this->_template_args[ 'resend_registration_button' ] = EEH_Template::get_button_or_link(
1681
+			$this->_template_args['resend_registration_button'] = EEH_Template::get_button_or_link(
1682 1682
 				EE_Admin_Page::add_query_args_and_nonce(
1683 1683
 					array(
1684 1684
 						'action' 		=> 'resend_registration',
@@ -1687,55 +1687,55 @@  discard block
 block discarded – undo
1687 1687
 					),
1688 1688
 					REG_ADMIN_URL
1689 1689
 				),
1690
-				esc_html__( ' Resend Registration' ),
1690
+				esc_html__(' Resend Registration'),
1691 1691
 				'button secondary-button right',
1692 1692
 				'dashicons dashicons-email-alt'
1693 1693
 			);
1694 1694
 		} else {
1695
-			$this->_template_args[ 'resend_registration_button' ] = '';
1695
+			$this->_template_args['resend_registration_button'] = '';
1696 1696
 		}
1697 1697
 
1698 1698
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
1699
-		$payment = $transaction->get_first_related( 'Payment' );
1699
+		$payment = $transaction->get_first_related('Payment');
1700 1700
 		$payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment;
1701
-		$payment_method = $payment->get_first_related( 'Payment_Method' );
1701
+		$payment_method = $payment->get_first_related('Payment_Method');
1702 1702
 		$payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method;
1703 1703
 
1704 1704
 		$reg_details = array(
1705 1705
 			'payment_method' => $payment_method->name(),
1706 1706
 			'response_msg' => $payment->gateway_response(),
1707
-			'registration_id' => $this->_registration->get( 'REG_code' ),
1707
+			'registration_id' => $this->_registration->get('REG_code'),
1708 1708
 			'registration_session' => $this->_registration->session_ID(),
1709
-			'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '',
1710
-			'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '',
1709
+			'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '',
1710
+			'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '',
1711 1711
 		);
1712 1712
 
1713 1713
 
1714
-		if ( isset( $reg_details['registration_id'] )) {
1714
+		if (isset($reg_details['registration_id'])) {
1715 1715
 			$this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id'];
1716
-			$this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' );
1716
+			$this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso');
1717 1717
 			$this->_template_args['reg_details']['registration_id']['class'] = 'regular-text';
1718 1718
 		}
1719 1719
 
1720
-		if ( isset( $reg_details['payment_method'] ) ) {
1720
+		if (isset($reg_details['payment_method'])) {
1721 1721
 			$this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method'];
1722
-			$this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' );
1722
+			$this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso');
1723 1723
 			$this->_template_args['reg_details']['payment_method']['class'] = 'regular-text';
1724 1724
 			$this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg'];
1725
-			$this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' );
1725
+			$this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso');
1726 1726
 			$this->_template_args['reg_details']['response_msg']['class'] = 'regular-text';
1727 1727
 		}
1728 1728
 
1729 1729
 		$this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session'];
1730
-		$this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
1730
+		$this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
1731 1731
 		$this->_template_args['reg_details']['registration_session']['class'] = 'regular-text';
1732 1732
 
1733 1733
 		$this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address'];
1734
-		$this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' );
1734
+		$this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso');
1735 1735
 		$this->_template_args['reg_details']['ip_address']['class'] = 'regular-text';
1736 1736
 
1737 1737
 		$this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent'];
1738
-		$this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
1738
+		$this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
1739 1739
 		$this->_template_args['reg_details']['user_agent']['class'] = 'large-text';
1740 1740
 
1741 1741
 		$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(
@@ -1748,8 +1748,8 @@  discard block
 block discarded – undo
1748 1748
 		$this->_template_args['REG_ID'] = $this->_registration->ID();
1749 1749
 		$this->_template_args['event_id'] = $this->_registration->event_ID();
1750 1750
 
1751
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php';
1752
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1751
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php';
1752
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1753 1753
 
1754 1754
 	}
1755 1755
 
@@ -1763,14 +1763,14 @@  discard block
 block discarded – undo
1763 1763
 	*/
1764 1764
 	public function _reg_questions_meta_box() {
1765 1765
 		//allow someone to override this method entirely
1766
-		if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) {
1767
-			$form = $this->_get_reg_custom_questions_form( $this->_registration->ID() );
1768
-			$this->_template_args[ 'att_questions' ] = count( $form->subforms() ) > 0 ? $form->get_html_and_js() : '';
1766
+		if (apply_filters('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration)) {
1767
+			$form = $this->_get_reg_custom_questions_form($this->_registration->ID());
1768
+			$this->_template_args['att_questions'] = count($form->subforms()) > 0 ? $form->get_html_and_js() : '';
1769 1769
 			$this->_template_args['reg_questions_form_action'] = 'edit_registration';
1770 1770
 			$this->_template_args['REG_ID'] = $this->_registration->ID();
1771 1771
 
1772
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php';
1773
-			echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1772
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php';
1773
+			echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1774 1774
 		}
1775 1775
 	}
1776 1776
 
@@ -1784,12 +1784,12 @@  discard block
 block discarded – undo
1784 1784
 	 * @param        string $output
1785 1785
 	 * @return        string
1786 1786
 	 */
1787
-	public function form_before_question_group( $output ) {
1787
+	public function form_before_question_group($output) {
1788 1788
 		EE_Error::doing_it_wrong(
1789
-			__CLASS__ . '::' . __FUNCTION__,
1790
-			__( 'This method would have been protected but was used on a filter callback'
1789
+			__CLASS__.'::'.__FUNCTION__,
1790
+			__('This method would have been protected but was used on a filter callback'
1791 1791
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1792
-				'event_espresso' ),
1792
+				'event_espresso'),
1793 1793
 			'4.8.32.rc.000'
1794 1794
 		);
1795 1795
 		return '
@@ -1808,20 +1808,20 @@  discard block
 block discarded – undo
1808 1808
 	 * @param        string $output
1809 1809
 	 * @return        string
1810 1810
 	 */
1811
-	public function form_after_question_group( $output ) {
1811
+	public function form_after_question_group($output) {
1812 1812
 		EE_Error::doing_it_wrong(
1813
-			__CLASS__ . '::' . __FUNCTION__,
1814
-			__( 'This method would have been protected but was used on a filter callback'
1813
+			__CLASS__.'::'.__FUNCTION__,
1814
+			__('This method would have been protected but was used on a filter callback'
1815 1815
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1816
-				'event_espresso' ),
1816
+				'event_espresso'),
1817 1817
 			'4.8.32.rc.000'
1818 1818
 		);
1819 1819
 		return  '
1820 1820
 			<tr class="hide-if-no-js">
1821 1821
 				<th> </th>
1822 1822
 				<td class="reg-admin-edit-attendee-question-td">
1823
-					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '">
1824
-						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span>
1823
+					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'">
1824
+						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span>
1825 1825
 						<div class="dashicons dashicons-edit"></div>
1826 1826
 					</a>
1827 1827
 				</td>
@@ -1841,18 +1841,18 @@  discard block
 block discarded – undo
1841 1841
 	 * @param        string $label
1842 1842
 	 * @return        string
1843 1843
 	 */
1844
-	public function form_form_field_label_wrap( $label ) {
1844
+	public function form_form_field_label_wrap($label) {
1845 1845
 		EE_Error::doing_it_wrong(
1846
-			__CLASS__ . '::' . __FUNCTION__,
1847
-			__( 'This method would have been protected but was used on a filter callback'
1846
+			__CLASS__.'::'.__FUNCTION__,
1847
+			__('This method would have been protected but was used on a filter callback'
1848 1848
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1849
-				'event_espresso' ),
1849
+				'event_espresso'),
1850 1850
 			'4.8.32.rc.000'
1851 1851
 		);
1852 1852
 		return '
1853 1853
 			<tr>
1854 1854
 				<th>
1855
-					' . $label  . '
1855
+					' . $label.'
1856 1856
 				</th>';
1857 1857
 	}
1858 1858
 
@@ -1866,17 +1866,17 @@  discard block
 block discarded – undo
1866 1866
 	 * @param        string $input
1867 1867
 	 * @return        string
1868 1868
 	 */
1869
-	public function form_form_field_input__wrap( $input ) {
1869
+	public function form_form_field_input__wrap($input) {
1870 1870
 		EE_Error::doing_it_wrong(
1871
-			__CLASS__ . '::' . __FUNCTION__,
1872
-			__( 'This method would have been protected but was used on a filter callback'
1871
+			__CLASS__.'::'.__FUNCTION__,
1872
+			__('This method would have been protected but was used on a filter callback'
1873 1873
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1874
-				'event_espresso' ),
1874
+				'event_espresso'),
1875 1875
 			'4.8.32.rc.000'
1876 1876
 		);
1877 1877
 		return '
1878 1878
 				<td class="reg-admin-attendee-questions-input-td disabled-input">
1879
-					' . $input . '
1879
+					' . $input.'
1880 1880
 				</td>
1881 1881
 			</tr>';
1882 1882
 	}
@@ -1890,14 +1890,14 @@  discard block
 block discarded – undo
1890 1890
 	 * @return void
1891 1891
 	 */
1892 1892
 	protected function _update_attendee_registration_form() {
1893
-		do_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this );
1894
-		if( $_SERVER['REQUEST_METHOD'] == 'POST'){
1895
-			$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
1896
-			$success = $this->_save_reg_custom_questions_form( $REG_ID );
1897
-			if( $success ) {
1893
+		do_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this);
1894
+		if ($_SERVER['REQUEST_METHOD'] == 'POST') {
1895
+			$REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE;
1896
+			$success = $this->_save_reg_custom_questions_form($REG_ID);
1897
+			if ($success) {
1898 1898
 				$what = __('Registration Form', 'event_espresso');
1899
-				$route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' );
1900
-				$this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route );
1899
+				$route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default');
1900
+				$this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route);
1901 1901
 			}
1902 1902
 		}
1903 1903
 	}
@@ -1908,11 +1908,11 @@  discard block
 block discarded – undo
1908 1908
 	 * @param int $REG_ID
1909 1909
 	 * @return EE_Registration_Custom_Questions_Form
1910 1910
 	 */
1911
-	protected function _get_reg_custom_questions_form( $REG_ID ) {
1912
-		if( ! $this->_reg_custom_questions_form ) {
1913
-			require_once( REG_ADMIN . 'form_sections' . DS . 'EE_Registration_Custom_Questions_Form.form.php' );
1914
-			$this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form( EEM_Registration::instance()->get_one_by_ID( $REG_ID ) );
1915
-			$this->_reg_custom_questions_form->_construct_finalize( null, null );
1911
+	protected function _get_reg_custom_questions_form($REG_ID) {
1912
+		if ( ! $this->_reg_custom_questions_form) {
1913
+			require_once(REG_ADMIN.'form_sections'.DS.'EE_Registration_Custom_Questions_Form.form.php');
1914
+			$this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form(EEM_Registration::instance()->get_one_by_ID($REG_ID));
1915
+			$this->_reg_custom_questions_form->_construct_finalize(null, null);
1916 1916
 		}
1917 1917
 		return $this->_reg_custom_questions_form;
1918 1918
 	}
@@ -1925,17 +1925,17 @@  discard block
 block discarded – undo
1925 1925
 	 * @param bool $REG_ID
1926 1926
 	 * @return bool
1927 1927
 	 */
1928
-	private function _save_reg_custom_questions_form( $REG_ID = FALSE ) {
1928
+	private function _save_reg_custom_questions_form($REG_ID = FALSE) {
1929 1929
 
1930 1930
 		if ( ! $REG_ID) {
1931
-			EE_Error::add_error( __('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1931
+			EE_Error::add_error(__('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1932 1932
 		}
1933
-		$form = $this->_get_reg_custom_questions_form( $REG_ID );
1934
-		$form->receive_form_submission( $this->_req_data );
1933
+		$form = $this->_get_reg_custom_questions_form($REG_ID);
1934
+		$form->receive_form_submission($this->_req_data);
1935 1935
 		$success = false;
1936
-		if( $form->is_valid() ) {
1937
-			foreach( $form->subforms() as $question_group_id => $question_group_form ) {
1938
-				foreach( $question_group_form->inputs() as $question_id => $input ) {
1936
+		if ($form->is_valid()) {
1937
+			foreach ($form->subforms() as $question_group_id => $question_group_form) {
1938
+				foreach ($question_group_form->inputs() as $question_id => $input) {
1939 1939
 					$where_conditions = array(
1940 1940
 							'QST_ID' => $question_id,
1941 1941
 							'REG_ID' => $REG_ID
@@ -1943,19 +1943,19 @@  discard block
 block discarded – undo
1943 1943
 					$possibly_new_values = array(
1944 1944
 							'ANS_value' => $input->normalized_value()
1945 1945
 						);
1946
-					$answer = EEM_Answer::instance()->get_one( array( $where_conditions ) );
1947
-					if( $answer instanceof EE_Answer ) {
1948
-						$success = $answer->save( $possibly_new_values );
1946
+					$answer = EEM_Answer::instance()->get_one(array($where_conditions));
1947
+					if ($answer instanceof EE_Answer) {
1948
+						$success = $answer->save($possibly_new_values);
1949 1949
 					} else {
1950 1950
 						//insert it then
1951
-						$cols_n_vals = array_merge( $where_conditions, $possibly_new_values );
1952
-						$answer = EE_Answer::new_instance( $cols_n_vals );
1951
+						$cols_n_vals = array_merge($where_conditions, $possibly_new_values);
1952
+						$answer = EE_Answer::new_instance($cols_n_vals);
1953 1953
 						$success = $answer->save();
1954 1954
 					}
1955 1955
 				}
1956 1956
 			}
1957 1957
 		} else {
1958
-			EE_Error::add_error( $form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__ );
1958
+			EE_Error::add_error($form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__);
1959 1959
 		}
1960 1960
 		return $success;
1961 1961
 	}
@@ -1973,31 +1973,31 @@  discard block
 block discarded – undo
1973 1973
 		$registrations = $REG->get_all(array(
1974 1974
 			array(
1975 1975
 				'TXN_ID'=>$this->_registration->transaction_ID(),
1976
-				'REG_ID'=>array('!=',$this->_registration->ID())
1976
+				'REG_ID'=>array('!=', $this->_registration->ID())
1977 1977
 			),
1978 1978
 			'force_join'=>array('Attendee')));
1979 1979
 
1980 1980
 		$this->_template_args['attendees'] = array();
1981 1981
 		$this->_template_args['attendee_notice'] = '';
1982
-		if ( empty( $registrations)  || ( is_array($registrations) &&  ! EEH_Array::get_one_item_from_array($registrations) ) ) {
1983
-			EE_Error::add_error( __('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1982
+		if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) {
1983
+			EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1984 1984
 			$this->_template_args['attendee_notice'] = EE_Error::get_notices();
1985 1985
 		} else {
1986 1986
 
1987 1987
 			$att_nmbr = 1;
1988
-			foreach ( $registrations as $registration ) {
1988
+			foreach ($registrations as $registration) {
1989 1989
 				/* @var $registration EE_Registration */
1990 1990
 				$attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object();
1991
-				$this->_template_args['attendees'][ $att_nmbr ]['STS_ID'] = $registration->status_ID();
1992
-				$this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1993
-				$this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1994
-				$this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1995
-				$this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->final_price();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1991
+				$this->_template_args['attendees'][$att_nmbr]['STS_ID'] = $registration->status_ID();
1992
+				$this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1993
+				$this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1994
+				$this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1995
+				$this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->final_price(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1996 1996
 
1997
-				$this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() );
1997
+				$this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array());
1998 1998
 
1999
-				$this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
2000
-				$this->_template_args['attendees'][ $att_nmbr ]['event_name'] = $registration->event_obj()->name();
1999
+				$this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
2000
+				$this->_template_args['attendees'][$att_nmbr]['event_name'] = $registration->event_obj()->name();
2001 2001
 
2002 2002
 				$att_nmbr++;
2003 2003
 			}
@@ -2007,8 +2007,8 @@  discard block
 block discarded – undo
2007 2007
 
2008 2008
 	//			$this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees'  ), REG_ADMIN_URL );
2009 2009
 		}
2010
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php';
2011
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2010
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php';
2011
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2012 2012
 
2013 2013
 	}
2014 2014
 
@@ -2029,14 +2029,14 @@  discard block
 block discarded – undo
2029 2029
 		$attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object();
2030 2030
 
2031 2031
 		//now let's determine if this is not the primary registration.  If it isn't then we set the primary_registration object for reference BUT ONLY if the Attendee object loaded is not the same as the primary registration object (that way we know if we need to show create button or not)
2032
-		if ( ! $this->_registration->is_primary_registrant() ) {
2032
+		if ( ! $this->_registration->is_primary_registrant()) {
2033 2033
 
2034 2034
 			$primary_registration = $this->_registration->get_primary_registration();
2035 2035
 			$primary_attendee = $primary_registration instanceof EE_Registration
2036 2036
 				? $primary_registration->attendee()
2037 2037
 				: null;
2038 2038
 
2039
-			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) {
2039
+			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) {
2040 2040
 				//in here?  This means the displayed registration is not the primary registrant but ALREADY HAS its own custom attendee object so let's not worry about the primary reg.
2041 2041
 				$primary_registration = NULL;
2042 2042
 			}
@@ -2045,27 +2045,27 @@  discard block
 block discarded – undo
2045 2045
 		}
2046 2046
 
2047 2047
 		$this->_template_args['ATT_ID'] = $attendee->ID();
2048
-		$this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname;
2049
-		$this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname;
2050
-		$this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email;
2048
+		$this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname;
2049
+		$this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname;
2050
+		$this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email;
2051 2051
 		$this->_template_args['phone'] = $attendee->phone();
2052 2052
 
2053
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $attendee );
2053
+		$this->_template_args['formatted_address'] = EEH_Address::format($attendee);
2054 2054
 
2055 2055
 
2056 2056
 		//edit link
2057
-		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
2057
+		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
2058 2058
 		$this->_template_args['att_edit_label'] = __('View/Edit Contact', 'event_espresso');
2059 2059
 
2060 2060
 		//create link
2061
-		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'duplicate_attendee',  '_REG_ID' => $this->_registration->ID() ), REG_ADMIN_URL ): '';
2061
+		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID()), REG_ADMIN_URL) : '';
2062 2062
 		$this->_template_args['create_label'] = __('Create Contact', 'event_espresso');
2063 2063
 
2064 2064
 		$this->_template_args['att_check'] = $att_check;
2065 2065
 
2066 2066
 
2067
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php';
2068
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2067
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php';
2068
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2069 2069
 	}
2070 2070
 
2071 2071
 
@@ -2078,7 +2078,7 @@  discard block
 block discarded – undo
2078 2078
 	 * @access protected
2079 2079
 	 * @return void
2080 2080
 	 */
2081
-	protected function _trash_or_restore_registrations( $trash = TRUE ) {
2081
+	protected function _trash_or_restore_registrations($trash = TRUE) {
2082 2082
 		$REGM = EEM_Registration::instance();
2083 2083
 
2084 2084
 		$success = 1;
@@ -2088,26 +2088,26 @@  discard block
 block discarded – undo
2088 2088
 		$dtts = array();
2089 2089
 
2090 2090
 		//if empty _REG_ID then get out because there's nothing to do
2091
-		if ( empty( $this->_req_data['_REG_ID'] ) ) {
2091
+		if (empty($this->_req_data['_REG_ID'])) {
2092 2092
 			$msg = $trash ? __('In order to trash registrations you must select which ones you wish to trash by clicking the checkboxes.', 'event_espresso') : __('In order to restore registrations you must select which ones you wish to restore by clicking the checkboxes.', 'event_espresso');
2093
-			EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ );
2094
-			$this->_redirect_after_action(FALSE, '', '', array(), TRUE );
2093
+			EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__);
2094
+			$this->_redirect_after_action(FALSE, '', '', array(), TRUE);
2095 2095
 		}
2096 2096
 
2097 2097
 		//Checkboxes
2098
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
2098
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
2099 2099
 			// if array has more than one element than success message should be plural
2100
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
2100
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
2101 2101
 			// cycle thru checkboxes
2102
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
2102
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
2103 2103
 				/** @var EE_Registration $REG */
2104
-				$REG = $REGM->get_one_by_ID( $REG_ID);
2104
+				$REG = $REGM->get_one_by_ID($REG_ID);
2105 2105
 				$payment_count = $REG->get_first_related('Transaction')->count_related('Payment');
2106
-				if ( $payment_count > 0 ) {
2107
-					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' );
2106
+				if ($payment_count > 0) {
2107
+					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __('Unknown Attendee', 'event_espresso');
2108 2108
 					$error = 1;
2109 2109
 					$success = 0;
2110
-					EE_Error::add_error( sprintf( __('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name ), __FILE__, __FUNCTION__, __LINE__ );
2110
+					EE_Error::add_error(sprintf(__('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name), __FILE__, __FUNCTION__, __LINE__);
2111 2111
 					continue; //can't trash this registration because it has payments.
2112 2112
 				}
2113 2113
 				$ticket = $REG->get_first_related('Ticket');
@@ -2116,7 +2116,7 @@  discard block
 block discarded – undo
2116 2116
 				$dtts = array_merge($dtts, $dtt);
2117 2117
 
2118 2118
 				$updated = $trash ? $REG->delete() : $REG->restore();
2119
-				if ( !$updated ) {
2119
+				if ( ! $updated) {
2120 2120
 					$success = 0;
2121 2121
 				} else {
2122 2122
 					$success = 2;
@@ -2131,7 +2131,7 @@  discard block
 block discarded – undo
2131 2131
 			$tickets[$ticket->ID()] = $ticket;
2132 2132
 			$dtts = $ticket->get_many_related('Datetime');
2133 2133
 			$updated = $trash ? $REG->delete() : $REG->restore();
2134
-			if ( ! $updated ) {
2134
+			if ( ! $updated) {
2135 2135
 				$success = 0;
2136 2136
 			}
2137 2137
 
@@ -2141,10 +2141,10 @@  discard block
 block discarded – undo
2141 2141
 		EEM_Ticket::instance()->update_tickets_sold($tickets);
2142 2142
 		EEM_Datetime::instance()->update_sold($dtts);
2143 2143
 
2144
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
2145
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
2144
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
2145
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
2146 2146
 		$overwrite_msgs = $error ? TRUE : FALSE;
2147
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs );
2147
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs);
2148 2148
 	}
2149 2149
 
2150 2150
 
@@ -2168,16 +2168,16 @@  discard block
 block discarded – undo
2168 2168
 		$success = 1;
2169 2169
 
2170 2170
 		//Checkboxes
2171
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
2171
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
2172 2172
 			// if array has more than one element than success message should be plural
2173
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
2173
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
2174 2174
 			// cycle thru checkboxes
2175
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
2175
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
2176 2176
 				$REG = $REG_MDL->get_one_by_ID($REG_ID);
2177
-				if ( ! $REG instanceof EE_Registration )
2177
+				if ( ! $REG instanceof EE_Registration)
2178 2178
 					continue;
2179 2179
 				$deleted = $this->_delete_registration($REG);
2180
-				if ( !$deleted ) {
2180
+				if ( ! $deleted) {
2181 2181
 					$success = 0;
2182 2182
 				}
2183 2183
 			}
@@ -2187,15 +2187,15 @@  discard block
 block discarded – undo
2187 2187
 			$REG_ID = $this->_req_data['_REG_ID'];
2188 2188
 			$REG = $REG_MDL->get_one_by_ID($REG_ID);
2189 2189
 			$deleted = $this->_delete_registration($REG);
2190
-			if ( ! $deleted ) {
2190
+			if ( ! $deleted) {
2191 2191
 				$success = 0;
2192 2192
 			}
2193 2193
 
2194 2194
 		}
2195 2195
 
2196
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
2197
-		$action_desc = __( 'permanently deleted.', 'event_espresso' );
2198
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE );
2196
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
2197
+		$action_desc = __('permanently deleted.', 'event_espresso');
2198
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE);
2199 2199
 	}
2200 2200
 
2201 2201
 
@@ -2207,31 +2207,31 @@  discard block
 block discarded – undo
2207 2207
 	 * @param  EE_Registration $REG registration to be deleted permenantly
2208 2208
 	 * @return boolean              true = successful deletion, false = fail.
2209 2209
 	 */
2210
-	protected function _delete_registration( EE_Registration $REG ) {
2210
+	protected function _delete_registration(EE_Registration $REG) {
2211 2211
 		//first we start with the transaction... ultimately, we WILL not delete permanently if there are any related registrations on the transaction that are NOT trashed.
2212 2212
 		$TXN = $REG->get_first_related('Transaction');
2213 2213
 		$REGS = $TXN->get_many_related('Registration');
2214 2214
 
2215 2215
 		$all_trashed = TRUE;
2216
-		foreach ( $REGS as $registration ) {
2217
-			if ( ! $registration->get('REG_deleted') )
2216
+		foreach ($REGS as $registration) {
2217
+			if ( ! $registration->get('REG_deleted'))
2218 2218
 				$all_trashed = FALSE;
2219 2219
 		}
2220 2220
 
2221
-		if ( ! $all_trashed ) {
2222
-			EE_Error::add_error( __('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2221
+		if ( ! $all_trashed) {
2222
+			EE_Error::add_error(__('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
2223 2223
 			return false;
2224 2224
 		}
2225 2225
 
2226 2226
 		//k made it here so that means we can delete all the related transactions and their answers (but let's do them separately from THIS one).
2227
-		foreach ( $REGS as $registration ) {
2227
+		foreach ($REGS as $registration) {
2228 2228
 
2229 2229
 			//delete related answers
2230 2230
 			$registration->delete_related_permanently('Answer');
2231 2231
 
2232 2232
 			//remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact)
2233 2233
 			$attendee = $registration->get_first_related('Attendee');
2234
-			if ( $attendee instanceof EE_Attendee ) {
2234
+			if ($attendee instanceof EE_Attendee) {
2235 2235
 				$registration->_remove_relation_to($attendee, 'Attendee');
2236 2236
 			}
2237 2237
 
@@ -2241,7 +2241,7 @@  discard block
 block discarded – undo
2241 2241
 			//now delete permanently the checkins related to this registration.
2242 2242
 			$registration->delete_related_permanently('Checkin');
2243 2243
 
2244
-			if ( $registration->ID() === $REG->ID() )
2244
+			if ($registration->ID() === $REG->ID())
2245 2245
 				continue; //we don't want to delete permanently the existing registration just yet.
2246 2246
 
2247 2247
 			//remove relation to transaction for these registrations if NOT the existing registrations
@@ -2278,35 +2278,35 @@  discard block
 block discarded – undo
2278 2278
 	 * @return void
2279 2279
 	 */
2280 2280
 	public function new_registration() {
2281
-		if ( ! $this->_set_reg_event() ) {
2282
-			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') );
2281
+		if ( ! $this->_set_reg_event()) {
2282
+			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso'));
2283 2283
 		}
2284
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2284
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2285 2285
 		// gotta start with a clean slate if we're not coming here via ajax
2286 2286
 		if (
2287
-			! defined('DOING_AJAX' )
2288
-			&& ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ) )
2287
+			! defined('DOING_AJAX')
2288
+			&& ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error']))
2289 2289
 		) {
2290
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2290
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2291 2291
 		}
2292 2292
 
2293
-		$this->_template_args['event_name'] = '' ;
2293
+		$this->_template_args['event_name'] = '';
2294 2294
 		// event name
2295
-		if ( $this->_reg_event ) {
2295
+		if ($this->_reg_event) {
2296 2296
 			$this->_template_args['event_name'] = $this->_reg_event->name();
2297
-			$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL );
2298
-			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
2299
-			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
2297
+			$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL);
2298
+			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>';
2299
+			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
2300 2300
 		}
2301 2301
 
2302 2302
 		$this->_template_args['step_content'] = $this->_get_registration_step_content();
2303 2303
 
2304
-		if ( defined('DOING_AJAX' ) ) {
2304
+		if (defined('DOING_AJAX')) {
2305 2305
 			$this->_return_json();
2306 2306
 		}
2307 2307
 		// grab header
2308
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php';
2309
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2308
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php';
2309
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2310 2310
 
2311 2311
 		//$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
2312 2312
 		// the details template wrapper
@@ -2323,7 +2323,7 @@  discard block
 block discarded – undo
2323 2323
 	 * @return string html
2324 2324
 	 */
2325 2325
 	protected function _get_registration_step_content() {
2326
-		if ( isset( $_COOKIE[ 'ee_registration_added' ] ) && $_COOKIE[ 'ee_registration_added' ] ) {
2326
+		if (isset($_COOKIE['ee_registration_added']) && $_COOKIE['ee_registration_added']) {
2327 2327
 			$warning_msg = sprintf(
2328 2328
 				__(
2329 2329
 					'%2$sWARNING!!!%3$s%1$sPlease do not use the back button to return to this page for the purpose of adding another registration.%1$sThis can result in lost and/or corrupted data.%1$sIf you wish to add another registration, then please click the%1$s%7$s"Add Another New Registration to Event"%8$s button%1$son the Transaction details page, after you are redirected.%1$s%1$s%4$s redirecting in %5$s seconds %6$s',
@@ -2339,7 +2339,7 @@  discard block
 block discarded – undo
2339 2339
 				'</b>'
2340 2340
 			);
2341 2341
 			return '
2342
-	<div id="ee-add-reg-back-button-dv"><p>' . $warning_msg . '</p></div>
2342
+	<div id="ee-add-reg-back-button-dv"><p>' . $warning_msg.'</p></div>
2343 2343
 	<script >
2344 2344
 		// WHOAH !!! it appears that someone is using the back button from the Transaction admin page
2345 2345
 		// after just adding a new registration... we gotta try to put a stop to that !!!
@@ -2374,16 +2374,16 @@  discard block
 block discarded – undo
2374 2374
 		$cart = EE_Registry::instance()->SSN->cart();
2375 2375
 		$step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions';
2376 2376
 
2377
-		switch ( $step ) {
2377
+		switch ($step) {
2378 2378
 			case 'ticket' :
2379 2379
 				$hidden_fields['processing_registration']['value'] = 1;
2380 2380
 				$template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso');
2381
-				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event );
2381
+				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event);
2382 2382
 				$template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso');
2383 2383
 				$template_args['show_notification_toggle'] = FALSE;
2384 2384
 				break;
2385 2385
 			case 'questions' :
2386
-				$hidden_fields[ 'processing_registration' ][ 'value' ] = 2;
2386
+				$hidden_fields['processing_registration']['value'] = 2;
2387 2387
 				$template_args['title'] = __('Step Two: Add Registrant Details for this Registration', 'event_espresso');
2388 2388
 				//in theory we should be able to run EED_SPCO at this point because the cart should have been setup properly by the first process_reg_step run.
2389 2389
 				$template_args['content'] = EED_Single_Page_Checkout::registration_checkout_for_admin();
@@ -2392,10 +2392,10 @@  discard block
 block discarded – undo
2392 2392
 				break;
2393 2393
 		}
2394 2394
 
2395
-		$this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route.
2395
+		$this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route.
2396 2396
 
2397 2397
 		return EEH_Template::display_template(
2398
-			REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE
2398
+			REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE
2399 2399
 		);
2400 2400
 	}
2401 2401
 
@@ -2410,11 +2410,11 @@  discard block
 block discarded – undo
2410 2410
 	*		@return boolean
2411 2411
 	*/
2412 2412
 	private function _set_reg_event() {
2413
-		if ( is_object( $this->_reg_event )) {
2413
+		if (is_object($this->_reg_event)) {
2414 2414
 			return TRUE;
2415 2415
 		}
2416
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
2417
-		if ( ! $EVT_ID ) {
2416
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
2417
+		if ( ! $EVT_ID) {
2418 2418
 			return FALSE;
2419 2419
 		}
2420 2420
 
@@ -2435,82 +2435,82 @@  discard block
 block discarded – undo
2435 2435
 	public function process_reg_step() {
2436 2436
 		EE_System::do_not_cache();
2437 2437
 		$this->_set_reg_event();
2438
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2438
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2439 2439
 
2440 2440
 		//what step are we on?
2441 2441
 		$cart = EE_Registry::instance()->SSN->cart();
2442 2442
 		$step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions';
2443 2443
 
2444 2444
 		//if doing ajax then we need to verify the nonce
2445
-		if ( defined( 'DOING_AJAX' ) ) {
2446
-			$nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : '';
2447
-			$this->_verify_nonce( $nonce, $this->_req_nonce );
2445
+		if (defined('DOING_AJAX')) {
2446
+			$nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : '';
2447
+			$this->_verify_nonce($nonce, $this->_req_nonce);
2448 2448
 		}
2449 2449
 
2450
-		switch ( $step ) {
2450
+		switch ($step) {
2451 2451
 
2452 2452
 			case 'ticket' :
2453 2453
 				//process ticket selection
2454 2454
 				$success = EED_Ticket_Selector::instance()->process_ticket_selections();
2455
-				if ( $success ) {
2456
-					EE_Error::add_success( __( 'Tickets Selected. Now complete the registration.', 'event_espresso' ) );
2455
+				if ($success) {
2456
+					EE_Error::add_success(__('Tickets Selected. Now complete the registration.', 'event_espresso'));
2457 2457
 				} else {
2458 2458
 					$query_args['step_error'] = $this->_req_data['step_error'] = TRUE;
2459 2459
 				}
2460
-				if ( defined('DOING_AJAX') ) {
2460
+				if (defined('DOING_AJAX')) {
2461 2461
 					$this->new_registration(); //display next step
2462 2462
 				} else {
2463 2463
 					$query_args['action'] = 'new_registration';
2464 2464
 					$query_args['processing_registration'] = 1;
2465 2465
 					$query_args['event_id'] = $this->_reg_event->ID();
2466
-					$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2466
+					$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2467 2467
 				}
2468 2468
 				break;
2469 2469
 
2470 2470
 			case 'questions' :
2471
-				if( ! isset( $this->_req_data[ 'txn_reg_status_change' ], $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] ) ) {
2472
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 );
2471
+				if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['send_notifications'])) {
2472
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15);
2473 2473
 				}
2474 2474
 				//process registration
2475 2475
 				$transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin();
2476
-				if ( $cart instanceof EE_Cart ) {
2476
+				if ($cart instanceof EE_Cart) {
2477 2477
 					$grand_total = $cart->get_cart_grand_total();
2478
-					if ( $grand_total instanceof EE_Line_Item ) {
2478
+					if ($grand_total instanceof EE_Line_Item) {
2479 2479
 						$grand_total->save_this_and_descendants_to_txn();
2480 2480
 					}
2481 2481
 				}
2482
-				if ( ! $transaction instanceof EE_Transaction ) {
2482
+				if ( ! $transaction instanceof EE_Transaction) {
2483 2483
 					$query_args = array(
2484 2484
 						'action' => 'new_registration',
2485 2485
 						'processing_registration' => 2,
2486 2486
 						'event_id' => $this->_reg_event->ID()
2487 2487
 					);
2488 2488
 
2489
-					if ( defined('DOING_AJAX' )) {
2489
+					if (defined('DOING_AJAX')) {
2490 2490
 						//display registration form again because there are errors (maybe validation?)
2491 2491
 						$this->new_registration();
2492 2492
 						return;
2493 2493
 					} else {
2494
-						$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2494
+						$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2495 2495
 						return;
2496 2496
 					}
2497 2497
 				}
2498 2498
 				/** @type EE_Transaction_Payments $transaction_payments */
2499
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
2499
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
2500 2500
 				// maybe update status, and make sure to save transaction if not done already
2501
-				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid( $transaction )) {
2501
+				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid($transaction)) {
2502 2502
 					$transaction->save();
2503 2503
 				}
2504
-				EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2504
+				EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2505 2505
 				$this->_req_data = array();
2506 2506
 				$query_args = array(
2507 2507
 					'action'        => 'redirect_to_txn',
2508 2508
 					'TXN_ID'        => $transaction->ID(),
2509 2509
 					'EVT_ID'        => $this->_reg_event->ID(),
2510
-					'event_name'    => urlencode( $this->_reg_event->name() ),
2510
+					'event_name'    => urlencode($this->_reg_event->name()),
2511 2511
 					'redirect_from' => 'new_registration'
2512 2512
 				);
2513
-				$this->_redirect_after_action( false, '', '', $query_args, true );
2513
+				$this->_redirect_after_action(false, '', '', $query_args, true);
2514 2514
 				break;
2515 2515
 		}
2516 2516
 
@@ -2527,21 +2527,21 @@  discard block
 block discarded – undo
2527 2527
 	 */
2528 2528
 	public function redirect_to_txn() {
2529 2529
 		EE_System::do_not_cache();
2530
-		EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2530
+		EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2531 2531
 		$query_args = array(
2532 2532
 			'action' => 'view_transaction',
2533
-			'TXN_ID' => isset( $this->_req_data['TXN_ID'] ) ? absint( $this->_req_data[ 'TXN_ID' ] )  : 0,
2533
+			'TXN_ID' => isset($this->_req_data['TXN_ID']) ? absint($this->_req_data['TXN_ID']) : 0,
2534 2534
 			'page'   => 'espresso_transactions'
2535 2535
 		);
2536
-		if ( isset( $this->_req_data[ 'EVT_ID' ], $this->_req_data[ 'redirect_from' ] ) ) {
2537
-			$query_args['EVT_ID'] = $this->_req_data[ 'EVT_ID' ];
2538
-			$query_args['event_name'] = urlencode( $this->_req_data[ 'event_name' ] );
2539
-			$query_args['redirect_from'] = $this->_req_data[ 'redirect_from' ];
2536
+		if (isset($this->_req_data['EVT_ID'], $this->_req_data['redirect_from'])) {
2537
+			$query_args['EVT_ID'] = $this->_req_data['EVT_ID'];
2538
+			$query_args['event_name'] = urlencode($this->_req_data['event_name']);
2539
+			$query_args['redirect_from'] = $this->_req_data['redirect_from'];
2540 2540
 		}
2541 2541
 		EE_Error::add_success(
2542
-			__( 'Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso' )
2542
+			__('Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso')
2543 2543
 		);
2544
-		$this->_redirect_after_action( false, '', '', $query_args, true );
2544
+		$this->_redirect_after_action(false, '', '', $query_args, true);
2545 2545
 	}
2546 2546
 
2547 2547
 
@@ -2552,7 +2552,7 @@  discard block
 block discarded – undo
2552 2552
 	*		@return void
2553 2553
 	*/
2554 2554
 	protected function _attendee_contact_list_table() {
2555
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2555
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2556 2556
 		$this->_search_btn_label = __('Contacts', 'event_espresso');
2557 2557
 		$this->display_admin_list_table_page_with_no_sidebar();
2558 2558
 	}
@@ -2567,10 +2567,10 @@  discard block
 block discarded – undo
2567 2567
 	*		@access public
2568 2568
 	*		@return array
2569 2569
 	*/
2570
-	public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) {
2570
+	public function get_attendees($per_page, $count = FALSE, $trash = FALSE) {
2571 2571
 
2572
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2573
-		require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' );
2572
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2573
+		require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php');
2574 2574
 		$ATT_MDL = EEM_Attendee::instance();
2575 2575
 
2576 2576
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
@@ -2598,47 +2598,47 @@  discard block
 block discarded – undo
2598 2598
 				$orderby = 'ATT_lname';
2599 2599
 		}
2600 2600
 
2601
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
2601
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
2602 2602
 
2603
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
2604
-		$per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10;
2605
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
2603
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
2604
+		$per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10;
2605
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
2606 2606
 
2607 2607
 		$_where = array();
2608 2608
 
2609
-		if ( ! empty( $this->_req_data['s'] ) ) {
2610
-			$sstr = '%' . $this->_req_data['s'] . '%';
2609
+		if ( ! empty($this->_req_data['s'])) {
2610
+			$sstr = '%'.$this->_req_data['s'].'%';
2611 2611
 			$_where['OR'] = array(
2612
-				'Registration.Event.EVT_name' => array( 'LIKE', $sstr),
2613
-				'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ),
2614
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
2615
-				'ATT_fname' => array( 'LIKE', $sstr ),
2616
-				'ATT_lname' => array( 'LIKE', $sstr ),
2617
-				'ATT_short_bio' => array( 'LIKE', $sstr ),
2618
-				'ATT_email' => array('LIKE', $sstr ),
2619
-				'ATT_address' => array( 'LIKE', $sstr ),
2620
-				'ATT_address2' => array( 'LIKE', $sstr ),
2621
-				'ATT_city' => array( 'LIKE', $sstr ),
2622
-				'Country.CNT_name' => array( 'LIKE', $sstr ),
2623
-				'State.STA_name' => array('LIKE', $sstr ),
2624
-				'ATT_phone' => array( 'LIKE', $sstr ),
2625
-				'Registration.REG_final_price' => array( 'LIKE', $sstr ),
2626
-				'Registration.REG_code' => array( 'LIKE', $sstr ),
2627
-				'Registration.REG_count' => array( 'LIKE' , $sstr ),
2628
-				'Registration.REG_group_size' => array( 'LIKE' , $sstr )
2612
+				'Registration.Event.EVT_name' => array('LIKE', $sstr),
2613
+				'Registration.Event.EVT_desc' => array('LIKE', $sstr),
2614
+				'Registration.Event.EVT_short_desc' => array('LIKE', $sstr),
2615
+				'ATT_fname' => array('LIKE', $sstr),
2616
+				'ATT_lname' => array('LIKE', $sstr),
2617
+				'ATT_short_bio' => array('LIKE', $sstr),
2618
+				'ATT_email' => array('LIKE', $sstr),
2619
+				'ATT_address' => array('LIKE', $sstr),
2620
+				'ATT_address2' => array('LIKE', $sstr),
2621
+				'ATT_city' => array('LIKE', $sstr),
2622
+				'Country.CNT_name' => array('LIKE', $sstr),
2623
+				'State.STA_name' => array('LIKE', $sstr),
2624
+				'ATT_phone' => array('LIKE', $sstr),
2625
+				'Registration.REG_final_price' => array('LIKE', $sstr),
2626
+				'Registration.REG_code' => array('LIKE', $sstr),
2627
+				'Registration.REG_count' => array('LIKE', $sstr),
2628
+				'Registration.REG_group_size' => array('LIKE', $sstr)
2629 2629
 				);
2630 2630
 		}
2631 2631
 
2632 2632
 
2633
-		$offset = ($current_page-1)*$per_page;
2634
-		$limit = $count ? NULL : array( $offset, $per_page );
2633
+		$offset = ($current_page - 1) * $per_page;
2634
+		$limit = $count ? NULL : array($offset, $per_page);
2635 2635
 
2636
-		if ( $trash ) {
2637
-			$_where['status'] = array( '!=', 'publish' );
2638
-			$all_attendees = $count ? $ATT_MDL->count( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit), 'ATT_ID', true ): $ATT_MDL->get_all( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2636
+		if ($trash) {
2637
+			$_where['status'] = array('!=', 'publish');
2638
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit), 'ATT_ID', true) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2639 2639
 		} else {
2640
-			$_where['status'] = array( 'IN', array( 'publish' ) );
2641
-			$all_attendees = $count ? $ATT_MDL->count( array($_where, 'order_by'=>array($orderby=>$sort),'limit'=>$limit ), 'ATT_ID' , true ) : $ATT_MDL->get_all( array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit) );
2640
+			$_where['status'] = array('IN', array('publish'));
2641
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit), 'ATT_ID', true) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2642 2642
 		}
2643 2643
 
2644 2644
 		return $all_attendees;
@@ -2655,10 +2655,10 @@  discard block
 block discarded – undo
2655 2655
 	 */
2656 2656
 	protected function _resend_registration() {
2657 2657
 		$this->_process_resend_registration();
2658
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array(
2658
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array(
2659 2659
 			'action' => 'default'
2660 2660
 		);
2661
-		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE );
2661
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2662 2662
 	}
2663 2663
 
2664 2664
 
@@ -2666,26 +2666,26 @@  discard block
 block discarded – undo
2666 2666
 
2667 2667
 
2668 2668
 
2669
-	public function _registrations_report(){
2670
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2671
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2669
+	public function _registrations_report() {
2670
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2671
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2672 2672
 				array(
2673 2673
 					'page' => 'espresso_batch',
2674 2674
 					'batch' => 'file',
2675
-					'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2676
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' ),
2677
-					'return_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2678
-				)) );
2675
+					'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2676
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\RegistrationsReport'),
2677
+					'return_url' => urlencode($this->_req_data['return_url']),
2678
+				)));
2679 2679
 		} else {
2680 2680
 			$new_request_args = array(
2681 2681
 				'export' => 'report',
2682 2682
 				'action' => 'registrations_report_for_event',
2683
-				'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2683
+				'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2684 2684
 			);
2685 2685
 			$this->_req_data = array_merge($this->_req_data, $new_request_args);
2686 2686
 
2687
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2688
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2687
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2688
+				require_once(EE_CLASSES.'EE_Export.class.php');
2689 2689
 				$EE_Export = EE_Export::instance($this->_req_data);
2690 2690
 				$EE_Export->export();
2691 2691
 			}
@@ -2694,26 +2694,26 @@  discard block
 block discarded – undo
2694 2694
 
2695 2695
 
2696 2696
 
2697
-	public function _contact_list_export(){
2698
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2699
-			require_once(EE_CLASSES . 'EE_Export.class.php');
2697
+	public function _contact_list_export() {
2698
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2699
+			require_once(EE_CLASSES.'EE_Export.class.php');
2700 2700
 			$EE_Export = EE_Export::instance($this->_req_data);
2701 2701
 			$EE_Export->export_attendees();
2702 2702
 		}
2703 2703
 	}
2704 2704
 
2705
-	public function _contact_list_report(){
2706
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2707
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2705
+	public function _contact_list_report() {
2706
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2707
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2708 2708
 				array(
2709 2709
 					'page' => 'espresso_batch',
2710 2710
 					'batch' => 'file',
2711
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\AttendeesReport' ),
2712
-					'return_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2713
-				)) );
2711
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\AttendeesReport'),
2712
+					'return_url' => urlencode($this->_req_data['return_url']),
2713
+				)));
2714 2714
 		} else {
2715
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2716
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2715
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2716
+				require_once(EE_CLASSES.'EE_Export.class.php');
2717 2717
 				$EE_Export = EE_Export::instance($this->_req_data);
2718 2718
 				$EE_Export->report_attendees();
2719 2719
 			}
@@ -2732,73 +2732,73 @@  discard block
 block discarded – undo
2732 2732
 	 * @return void
2733 2733
 	 */
2734 2734
 	protected function _duplicate_attendee() {
2735
-		$action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default';
2735
+		$action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default';
2736 2736
 		//verify we have necessary info
2737
-		if ( empty($this->_req_data['_REG_ID'] )  ) {
2738
-			EE_Error::add_error( __('Unable to create the contact for the registration because the required parameters are not present (_REG_ID )', 'event_espresso'),  __FILE__, __LINE__, __FUNCTION__ );
2739
-			$query_args = array( 'action' => $action );
2737
+		if (empty($this->_req_data['_REG_ID'])) {
2738
+			EE_Error::add_error(__('Unable to create the contact for the registration because the required parameters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
2739
+			$query_args = array('action' => $action);
2740 2740
 			$this->_redirect_after_action('', '', '', $query_args, TRUE);
2741 2741
 		}
2742 2742
 
2743 2743
 		//okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration.
2744
-		$registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] );
2744
+		$registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']);
2745 2745
 		$attendee = $registration->attendee();
2746 2746
 
2747 2747
 		//remove relation of existing attendee on registration
2748
-		$registration->_remove_relation_to($attendee, 'Attendee' );
2748
+		$registration->_remove_relation_to($attendee, 'Attendee');
2749 2749
 		//new attendee
2750 2750
 		$new_attendee = clone $attendee;
2751
-		$new_attendee->set( 'ATT_ID', 0 );
2751
+		$new_attendee->set('ATT_ID', 0);
2752 2752
 		$new_attendee->save();
2753 2753
 
2754 2754
 		//add new attendee to reg
2755
-		$registration->_add_relation_to( $new_attendee, 'Attendee');
2755
+		$registration->_add_relation_to($new_attendee, 'Attendee');
2756 2756
 
2757
-		EE_Error::add_success( __('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso') );
2757
+		EE_Error::add_success(__('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso'));
2758 2758
 
2759 2759
 		//redirect to edit page for attendee
2760
-		$query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' );
2760
+		$query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee');
2761 2761
 
2762
-		$this->_redirect_after_action( '', '', '', $query_args, TRUE );
2762
+		$this->_redirect_after_action('', '', '', $query_args, TRUE);
2763 2763
 	}
2764 2764
 
2765 2765
 
2766 2766
 	//related to cpt routes
2767 2767
 	protected function _insert_update_cpt_item($post_id, $post) {
2768 2768
 		$success = true;
2769
-		$attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id );
2769
+		$attendee = EEM_Attendee::instance()->get_one_by_ID($post_id);
2770 2770
 		//for attendee updates
2771
-		if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) {
2771
+		if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) {
2772 2772
 			//note we should only be UPDATING attendees at this point.
2773 2773
 			$updated_fields = array(
2774 2774
 				'ATT_fname' => $this->_req_data['ATT_fname'],
2775 2775
 				'ATT_lname' => $this->_req_data['ATT_lname'],
2776
-				'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'],
2776
+				'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'],
2777 2777
 				'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '',
2778 2778
 				'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '',
2779
-				'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '',
2780
-				'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '',
2781
-				'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '',
2782
-				'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '',
2783
-				'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '',
2784
-				'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : ''
2779
+				'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '',
2780
+				'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '',
2781
+				'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '',
2782
+				'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '',
2783
+				'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '',
2784
+				'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : ''
2785 2785
 				);
2786
-			foreach ( $updated_fields as $field => $value ) {
2786
+			foreach ($updated_fields as $field => $value) {
2787 2787
 				$attendee->set($field, $value);
2788 2788
 			}
2789 2789
 
2790 2790
 			$success = $attendee->save();
2791 2791
 
2792
-			$attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() );
2793
-			foreach ( $attendee_update_callbacks as $a_callback ) {
2794
-				if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) {
2795
-					throw new EE_Error( sprintf( __('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback ) );
2792
+			$attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array());
2793
+			foreach ($attendee_update_callbacks as $a_callback) {
2794
+				if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) {
2795
+					throw new EE_Error(sprintf(__('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback));
2796 2796
 				}
2797 2797
 			}
2798 2798
 		}
2799 2799
 
2800
-		if ( $success === FALSE )
2801
-			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2800
+		if ($success === FALSE)
2801
+			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
2802 2802
 
2803 2803
 	}
2804 2804
 
@@ -2818,17 +2818,17 @@  discard block
 block discarded – undo
2818 2818
 		remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2819 2819
 		remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2820 2820
 
2821
-		if ( post_type_supports( 'espresso_attendees', 'excerpt') ) {
2822
-			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' );
2821
+		if (post_type_supports('espresso_attendees', 'excerpt')) {
2822
+			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal');
2823 2823
 		}
2824 2824
 
2825
-		if ( post_type_supports( 'espresso_attendees', 'comments') ) {
2825
+		if (post_type_supports('espresso_attendees', 'comments')) {
2826 2826
 			add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2827 2827
 		}
2828 2828
 
2829
-		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' );
2830
-		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' );
2831
-		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array( $this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2829
+		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core');
2830
+		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2831
+		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array($this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2832 2832
 	}
2833 2833
 
2834 2834
 
@@ -2837,10 +2837,10 @@  discard block
 block discarded – undo
2837 2837
 	 * @param  WP_Post $post wp post object
2838 2838
 	 * @return string        attendee contact info ( and form )
2839 2839
 	 */
2840
-	public function attendee_contact_info( $post ) {
2840
+	public function attendee_contact_info($post) {
2841 2841
 		//get attendee object ( should already have it )
2842 2842
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2843
-		$template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php';
2843
+		$template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php';
2844 2844
 		EEH_Template::display_template($template, $this->_template_args);
2845 2845
 	}
2846 2846
 
@@ -2856,12 +2856,12 @@  discard block
 block discarded – undo
2856 2856
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2857 2857
 		$this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input(
2858 2858
 				new EE_Question_Form_Input(
2859
-				EE_Question::new_instance( array(
2859
+				EE_Question::new_instance(array(
2860 2860
 					'QST_ID' => 0,
2861 2861
 					'QST_display_text' => __('State/Province', 'event_espresso'),
2862 2862
 					'QST_system' => 'admin-state'
2863 2863
 					)),
2864
-				EE_Answer::new_instance( array(
2864
+				EE_Answer::new_instance(array(
2865 2865
 					'ANS_ID' => 0,
2866 2866
 					'ANS_value' => $this->_cpt_model_obj->state_ID()
2867 2867
 					)),
@@ -2874,12 +2874,12 @@  discard block
 block discarded – undo
2874 2874
 			));
2875 2875
 		$this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input(
2876 2876
 				new EE_Question_Form_Input(
2877
-				EE_Question::new_instance( array(
2877
+				EE_Question::new_instance(array(
2878 2878
 					'QST_ID' => 0,
2879 2879
 					'QST_display_text' => __('Country', 'event_espresso'),
2880 2880
 					'QST_system' => 'admin-country'
2881 2881
 					)),
2882
-				EE_Answer::new_instance( array(
2882
+				EE_Answer::new_instance(array(
2883 2883
 					'ANS_ID' => 0,
2884 2884
 					'ANS_value' => $this->_cpt_model_obj->country_ID()
2885 2885
 					)),
@@ -2890,8 +2890,8 @@  discard block
 block discarded – undo
2890 2890
 					'append_qstn_id' => FALSE
2891 2891
 					)
2892 2892
 				));
2893
-		$template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php';
2894
-		EEH_Template::display_template($template, $this->_template_args );
2893
+		$template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php';
2894
+		EEH_Template::display_template($template, $this->_template_args);
2895 2895
 
2896 2896
 	}
2897 2897
 
@@ -2901,11 +2901,11 @@  discard block
 block discarded – undo
2901 2901
 	*		@access protected
2902 2902
 	*		@return void
2903 2903
 	*/
2904
-	public function attendee_registrations_meta_box( $post ) {
2904
+	public function attendee_registrations_meta_box($post) {
2905 2905
 
2906 2906
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2907 2907
 		$this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration');
2908
-		$template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php';
2908
+		$template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php';
2909 2909
 		EEH_Template::display_template($template, $this->_template_args);
2910 2910
 
2911 2911
 	}
@@ -2919,8 +2919,8 @@  discard block
 block discarded – undo
2919 2919
 	 * @return string        html for new form.
2920 2920
 	 */
2921 2921
 	public function after_title_form_fields($post) {
2922
-		if ( $post->post_type == 'espresso_attendees' ) {
2923
-			$template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php';
2922
+		if ($post->post_type == 'espresso_attendees') {
2923
+			$template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php';
2924 2924
 			$template_args['attendee'] = $this->_cpt_model_obj;
2925 2925
 			EEH_Template::display_template($template, $template_args);
2926 2926
 		}
@@ -2937,21 +2937,21 @@  discard block
 block discarded – undo
2937 2937
 	*		@access protected
2938 2938
 	*		@return void
2939 2939
 	*/
2940
-	protected function _trash_or_restore_attendees( $trash = TRUE ) {
2940
+	protected function _trash_or_restore_attendees($trash = TRUE) {
2941 2941
 
2942
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2942
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2943 2943
 
2944 2944
 		$ATT_MDL = EEM_Attendee::instance();
2945 2945
 
2946 2946
 		$success = 1;
2947 2947
 		//Checkboxes
2948
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2948
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2949 2949
 			// if array has more than one element than success message should be plural
2950
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
2950
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
2951 2951
 			// cycle thru checkboxes
2952
-			while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) {
2953
-				$updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID);
2954
-				if ( !$updated ) {
2952
+			while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) {
2953
+				$updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID);
2954
+				if ( ! $updated) {
2955 2955
 					$success = 0;
2956 2956
 				}
2957 2957
 			}
@@ -2960,18 +2960,18 @@  discard block
 block discarded – undo
2960 2960
 			// grab single id and delete
2961 2961
 			$ATT_ID = absint($this->_req_data['ATT_ID']);
2962 2962
 			//get attendee
2963
-			$att = $ATT_MDL->get_one_by_ID( $ATT_ID );
2963
+			$att = $ATT_MDL->get_one_by_ID($ATT_ID);
2964 2964
 			$updated = $trash ? $att->set_status('trash') : $att->set_status('publish');
2965 2965
 			$updated = $att->save();
2966
-			if ( ! $updated ) {
2966
+			if ( ! $updated) {
2967 2967
 				$success = 0;
2968 2968
 			}
2969 2969
 
2970 2970
 		}
2971 2971
 
2972
-		$what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' );
2973
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
2974
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) );
2972
+		$what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso');
2973
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
2974
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list'));
2975 2975
 
2976 2976
 	}
2977 2977
 
Please login to merge, or discard this patch.
espresso.php 1 patch
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'ABSPATH' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('ABSPATH')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /*
5 5
   Plugin Name:		Event Espresso
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
  *
43 43
  */
44 44
 
45
-if ( function_exists( 'espresso_version' ) ) {
45
+if (function_exists('espresso_version')) {
46 46
 
47 47
 	/**
48 48
 	 *    espresso_duplicate_plugin_error
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
 	function espresso_duplicate_plugin_error() {
52 52
 		?>
53 53
 		<div class="error">
54
-			<p><?php _e( 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso' ); ?></p>
54
+			<p><?php _e('Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso'); ?></p>
55 55
 		</div>
56 56
 		<?php
57
-		espresso_deactivate_plugin( plugin_basename( __FILE__ ) );
57
+		espresso_deactivate_plugin(plugin_basename(__FILE__));
58 58
 	}
59
-	add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 );
59
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
60 60
 
61 61
 } else {
62 62
 
@@ -67,103 +67,103 @@  discard block
 block discarded – undo
67 67
 	 * @return string
68 68
 	 */
69 69
 	function espresso_version() {
70
-		return apply_filters( 'FHEE__espresso__espresso_version', '4.9.12.rc.002' );
70
+		return apply_filters('FHEE__espresso__espresso_version', '4.9.12.rc.002');
71 71
 	}
72 72
 
73 73
 	// define versions
74
-	define( 'EVENT_ESPRESSO_VERSION', espresso_version() );
75
-	define( 'EE_MIN_WP_VER_REQUIRED', '4.1' );
76
-	define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' );
77
-	define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' );
78
-	define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' );
79
-	define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION );
80
-	define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ );
74
+	define('EVENT_ESPRESSO_VERSION', espresso_version());
75
+	define('EE_MIN_WP_VER_REQUIRED', '4.1');
76
+	define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
77
+	define('EE_MIN_PHP_VER_REQUIRED', '5.3.0');
78
+	define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
79
+	define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION);
80
+	define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
81 81
 	//used to be DIRECTORY_SEPARATOR, but that caused issues on windows
82
-	if ( ! defined( 'DS' ) ) {
83
-		define( 'DS', '/' );
82
+	if ( ! defined('DS')) {
83
+		define('DS', '/');
84 84
 	}
85
-	if ( ! defined( 'PS' ) ) {
86
-		define( 'PS', PATH_SEPARATOR );
85
+	if ( ! defined('PS')) {
86
+		define('PS', PATH_SEPARATOR);
87 87
 	}
88
-	if ( ! defined( 'SP' ) ) {
89
-		define( 'SP', ' ' );
88
+	if ( ! defined('SP')) {
89
+		define('SP', ' ');
90 90
 	}
91
-	if ( ! defined( 'EENL' ) ) {
92
-		define( 'EENL', "\n" );
91
+	if ( ! defined('EENL')) {
92
+		define('EENL', "\n");
93 93
 	}
94
-	define( 'EE_SUPPORT_EMAIL', '[email protected]' );
94
+	define('EE_SUPPORT_EMAIL', '[email protected]');
95 95
 	// define the plugin directory and URL
96
-	define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) );
97
-	define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) );
98
-	define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) );
96
+	define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
97
+	define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
98
+	define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
99 99
 	// main root folder paths
100
-	define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS );
101
-	define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS );
102
-	define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS );
103
-	define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS );
104
-	define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS );
105
-	define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS );
106
-	define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS );
107
-	define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS );
100
+	define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS);
101
+	define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS);
102
+	define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS);
103
+	define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS);
104
+	define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS);
105
+	define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS);
106
+	define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS);
107
+	define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS);
108 108
 	// core system paths
109
-	define( 'EE_ADMIN', EE_CORE . 'admin' . DS );
110
-	define( 'EE_CPTS', EE_CORE . 'CPTs' . DS );
111
-	define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS );
112
-	define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS );
113
-	define( 'EE_BUSINESS', EE_CORE . 'business' . DS );
114
-	define( 'EE_MODELS', EE_CORE . 'db_models' . DS );
115
-	define( 'EE_HELPERS', EE_CORE . 'helpers' . DS );
116
-	define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS );
117
-	define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS );
118
-	define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS );
119
-	define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS );
120
-	define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS );
109
+	define('EE_ADMIN', EE_CORE.'admin'.DS);
110
+	define('EE_CPTS', EE_CORE.'CPTs'.DS);
111
+	define('EE_CLASSES', EE_CORE.'db_classes'.DS);
112
+	define('EE_INTERFACES', EE_CORE.'interfaces'.DS);
113
+	define('EE_BUSINESS', EE_CORE.'business'.DS);
114
+	define('EE_MODELS', EE_CORE.'db_models'.DS);
115
+	define('EE_HELPERS', EE_CORE.'helpers'.DS);
116
+	define('EE_LIBRARIES', EE_CORE.'libraries'.DS);
117
+	define('EE_TEMPLATES', EE_CORE.'templates'.DS);
118
+	define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS);
119
+	define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS);
120
+	define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS);
121 121
 	// gateways
122
-	define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS );
123
-	define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS );
122
+	define('EE_GATEWAYS', EE_MODULES.'gateways'.DS);
123
+	define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS);
124 124
 	// asset URL paths
125
-	define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS );
126
-	define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS );
127
-	define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS );
128
-	define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS );
129
-	define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' );
130
-	define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' );
125
+	define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS);
126
+	define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS);
127
+	define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS);
128
+	define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS);
129
+	define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/');
130
+	define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/');
131 131
 	// define upload paths
132 132
 	$uploads = wp_upload_dir();
133 133
 	// define the uploads directory and URL
134
-	define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS );
135
-	define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS );
134
+	define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS);
135
+	define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS);
136 136
 	// define the templates directory and URL
137
-	define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'templates' . DS );
138
-	define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'templates' . DS );
137
+	define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS);
138
+	define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS);
139 139
 	// define the gateway directory and URL
140
-	define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'gateways' . DS );
141
-	define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'gateways' . DS );
140
+	define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS);
141
+	define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS);
142 142
 	// languages folder/path
143
-	define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS );
144
-	define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS );
143
+	define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS);
144
+	define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS);
145 145
 	//check for dompdf fonts in uploads
146
-	if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) {
147
-		define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS );
146
+	if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) {
147
+		define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS);
148 148
 	}
149 149
 	//ajax constants
150
-	define( 'EE_FRONT_AJAX', isset( $_REQUEST[ 'ee_front_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_front_ajax' ] ) ? true : false );
151
-	define( 'EE_ADMIN_AJAX', isset( $_REQUEST[ 'ee_admin_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_admin_ajax' ] ) ? true : false );
150
+	define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false);
151
+	define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false);
152 152
 	//just a handy constant occasionally needed for finding values representing infinity in the DB
153 153
 	//you're better to use this than its straight value (currently -1) in case you ever
154 154
 	//want to change its default value! or find when -1 means infinity
155
-	define( 'EE_INF_IN_DB', -1 );
156
-	define( 'EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX );
157
-	define( 'EE_DEBUG', false );
155
+	define('EE_INF_IN_DB', -1);
156
+	define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX);
157
+	define('EE_DEBUG', false);
158 158
 
159 159
 	/**
160 160
 	 *    espresso_plugin_activation
161 161
 	 *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
162 162
 	 */
163 163
 	function espresso_plugin_activation() {
164
-		update_option( 'ee_espresso_activation', true );
164
+		update_option('ee_espresso_activation', true);
165 165
 	}
166
-	register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' );
166
+	register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
167 167
 
168 168
 
169 169
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		//	}
178 178
 		//
179 179
 	}
180
-	register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' );
180
+	register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation');
181 181
 
182 182
 
183 183
 
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	function espresso_load_error_handling() {
189 189
 		// load debugging tools
190
-		if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) {
191
-			require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' );
190
+		if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) {
191
+			require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php');
192 192
 			EEH_Debug_Tools::instance();
193 193
 		}
194 194
 		// load error handling
195
-		if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) {
196
-			require_once( EE_CORE . 'EE_Error.core.php' );
195
+		if (is_readable(EE_CORE.'EE_Error.core.php')) {
196
+			require_once(EE_CORE.'EE_Error.core.php');
197 197
 		} else {
198
-			wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ) );
198
+			wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso'));
199 199
 		}
200 200
 	}
201 201
 
@@ -209,25 +209,25 @@  discard block
 block discarded – undo
209 209
 	 * @param    string $full_path_to_file
210 210
 	 * @throws    EE_Error
211 211
 	 */
212
-	function espresso_load_required( $classname, $full_path_to_file ) {
212
+	function espresso_load_required($classname, $full_path_to_file) {
213 213
 		static $error_handling_loaded = false;
214
-		if ( ! $error_handling_loaded ) {
214
+		if ( ! $error_handling_loaded) {
215 215
 			espresso_load_error_handling();
216 216
 			$error_handling_loaded = true;
217 217
 		}
218
-		if ( is_readable( $full_path_to_file ) ) {
219
-			require_once( $full_path_to_file );
218
+		if (is_readable($full_path_to_file)) {
219
+			require_once($full_path_to_file);
220 220
 		} else {
221
-			throw new EE_Error ( sprintf(
222
-				__( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ),
221
+			throw new EE_Error(sprintf(
222
+				__('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'),
223 223
 				$classname
224
-			) );
224
+			));
225 225
 		}
226 226
 	}
227 227
 
228
-	espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' );
229
-	espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' );
230
-	espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' );
228
+	espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php');
229
+	espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php');
230
+	espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php');
231 231
 	new EE_Bootstrap();
232 232
 
233 233
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
 
238 238
 
239
-if ( ! function_exists( 'espresso_deactivate_plugin' ) ) {
239
+if ( ! function_exists('espresso_deactivate_plugin')) {
240 240
 	/**
241 241
 	*    deactivate_plugin
242 242
 	* usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
 	* @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
246 246
 	* @return    void
247 247
 	*/
248
-	function espresso_deactivate_plugin( $plugin_basename = '' ) {
249
-		if ( ! function_exists( 'deactivate_plugins' ) ) {
250
-			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
248
+	function espresso_deactivate_plugin($plugin_basename = '') {
249
+		if ( ! function_exists('deactivate_plugins')) {
250
+			require_once(ABSPATH.'wp-admin/includes/plugin.php');
251 251
 		}
252
-		unset( $_GET[ 'activate' ], $_REQUEST[ 'activate' ] );
253
-		deactivate_plugins( $plugin_basename );
252
+		unset($_GET['activate'], $_REQUEST['activate']);
253
+		deactivate_plugins($plugin_basename);
254 254
 	}
255 255
 }
Please login to merge, or discard this patch.