Completed
Branch FET-9576-iframes (f7d058)
by
unknown
190:35 queued 173:28
created
core/libraries/iframe_display/EventListIframeEmbedButton.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
 class EventListIframeEmbedButton extends IframeEmbedButton
16 16
 {
17 17
 
18
-    /**
19
-     * EventListIframeEmbedButton constructor.
20
-     */
21
-    public function __construct()
22
-    {
23
-        parent::__construct(
24
-            esc_html__( 'Event List', 'event_espresso' ),
25
-            'event_list'
26
-        );
27
-    }
18
+	/**
19
+	 * EventListIframeEmbedButton constructor.
20
+	 */
21
+	public function __construct()
22
+	{
23
+		parent::__construct(
24
+			esc_html__( 'Event List', 'event_espresso' ),
25
+			'event_list'
26
+		);
27
+	}
28 28
 
29 29
 
30 30
 
@@ -49,18 +49,18 @@  discard block
 block discarded – undo
49 49
 	 * @param array $after_list_table
50 50
 	 * @return array
51 51
 	 */
52
-    public function addEventListIframeEmbedButtonSection( array $after_list_table )
53
-    {
54
-	    return \EEH_Array::insert_into_array(
55
-    		$after_list_table,
56
-		    array(
57
-			    'iframe_embed_buttons' => $this->addIframeEmbedButtonsSection(
58
-				    array( 'event_list' => $this->embedButtonHtml() )
59
-			    )
60
-		    ),
61
-		    'legend'
62
-	    );
63
-    }
52
+	public function addEventListIframeEmbedButtonSection( array $after_list_table )
53
+	{
54
+		return \EEH_Array::insert_into_array(
55
+			$after_list_table,
56
+			array(
57
+				'iframe_embed_buttons' => $this->addIframeEmbedButtonsSection(
58
+					array( 'event_list' => $this->embedButtonHtml() )
59
+				)
60
+			),
61
+			'legend'
62
+		);
63
+	}
64 64
 
65 65
 
66 66
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\libraries\iframe_display;
3 3
 
4
-defined( 'ABSPATH' ) || exit;
4
+defined('ABSPATH') || exit;
5 5
 
6 6
 
7 7
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     public function __construct()
22 22
     {
23 23
         parent::__construct(
24
-            esc_html__( 'Event List', 'event_espresso' ),
24
+            esc_html__('Event List', 'event_espresso'),
25 25
             'event_list'
26 26
         );
27 27
     }
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 	public function addEmbedButton() {
32 32
 		add_filter(
33 33
 			'FHEE__EE_Admin_Page___display_admin_list_table_page__after_list_table__template_arg',
34
-			array( $this, 'addEventListIframeEmbedButtonSection' )
34
+			array($this, 'addEventListIframeEmbedButtonSection')
35 35
 		);
36 36
 		add_action(
37 37
 			'admin_enqueue_scripts',
38
-			array( $this, 'embedButtonAssets' ),
38
+			array($this, 'embedButtonAssets'),
39 39
 			10
40 40
 		);
41 41
 	}
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 	 * @param array $after_list_table
50 50
 	 * @return array
51 51
 	 */
52
-    public function addEventListIframeEmbedButtonSection( array $after_list_table )
52
+    public function addEventListIframeEmbedButtonSection(array $after_list_table)
53 53
     {
54 54
 	    return \EEH_Array::insert_into_array(
55 55
     		$after_list_table,
56 56
 		    array(
57 57
 			    'iframe_embed_buttons' => $this->addIframeEmbedButtonsSection(
58
-				    array( 'event_list' => $this->embedButtonHtml() )
58
+				    array('event_list' => $this->embedButtonHtml())
59 59
 			    )
60 60
 		    ),
61 61
 		    'legend'
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_Page.core.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -855,11 +855,11 @@  discard block
 block discarded – undo
855 855
 		if ( ! empty( $id ) ) {
856 856
 			$post = get_post( $id );
857 857
 			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
858
-			           . esc_html__( 'Shortcode', 'event_espresso' )
859
-			           . '</a> ';
858
+					   . esc_html__( 'Shortcode', 'event_espresso' )
859
+					   . '</a> ';
860 860
 			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
861
-			           . $post->ID
862
-			           . ']">';
861
+					   . $post->ID
862
+					   . ']">';
863 863
 		}
864 864
 		return $return;
865 865
 	}
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 	protected function _events_overview_list_table() {
878 878
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
879 879
 		$this->_template_args['after_list_table'] = ! empty( $this->_template_args['after_list_table'] )
880
-		    ? (array) $this->_template_args['after_list_table']
880
+			? (array) $this->_template_args['after_list_table']
881 881
 			: array();
882 882
 		$this->_template_args['after_list_table']['view_event_list_button'] = EEH_HTML::br()
883 883
 		. EEH_Template::get_button_or_link(
@@ -1084,8 +1084,8 @@  discard block
 block discarded – undo
1084 1084
 			//if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1085 1085
 			if ( ! empty( $dtt['DTT_ID'] ) ) {
1086 1086
 				$DTM = EE_Registry::instance()
1087
-				                  ->load_model( 'Datetime', array( $evtobj->get_timezone() ) )
1088
-				                  ->get_one_by_ID( $dtt['DTT_ID'] );
1087
+								  ->load_model( 'Datetime', array( $evtobj->get_timezone() ) )
1088
+								  ->get_one_by_ID( $dtt['DTT_ID'] );
1089 1089
 				$DTM->set_date_format( $incoming_date_formats[0] );
1090 1090
 				$DTM->set_time_format( $incoming_date_formats[1] );
1091 1091
 				foreach ( $datetime_values as $field => $value ) {
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
 					) > 0 ? true : false;
1184 1184
 					//let's just check the total price for the existing ticket and determine if it matches the new total price.  if they are different then we create a new ticket (if tkts sold) if they aren't different then we go ahead and modify existing ticket.
1185 1185
 					$create_new_TKT = $ticket_sold && $ticket_price != $TKT->get( 'TKT_price' )
1186
-					                  && ! $TKT->get(
1186
+									  && ! $TKT->get(
1187 1187
 						'TKT_deleted'
1188 1188
 					) ? true : false;
1189 1189
 					$TKT->set_date_format( $incoming_date_formats[0] );
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
 		$first_datetime = reset( $times );
1494 1494
 		//do we get related tickets?
1495 1495
 		if ( $first_datetime instanceof EE_Datetime
1496
-		     && $first_datetime->ID() !== 0
1496
+			 && $first_datetime->ID() !== 0
1497 1497
 		) {
1498 1498
 			$existing_datetime_ids[] = $first_datetime->get( 'DTT_ID' );
1499 1499
 			$template_args['time'] = $first_datetime;
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1569 1569
 			'TKT_sold'            => $skeleton ? 0 : $ticket->get( 'TKT_sold' ),
1570 1570
 			'trash_icon'          => ( $skeleton || ( ! empty( $ticket ) && ! $ticket->get( 'TKT_deleted' ) ) )
1571
-			                         && ( ! empty( $ticket ) && $ticket->get( 'TKT_sold' ) === 0 )
1571
+									 && ( ! empty( $ticket ) && $ticket->get( 'TKT_sold' ) === 0 )
1572 1572
 				? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1573 1573
 			'disabled'            => $skeleton || ( ! empty( $ticket ) && ! $ticket->get( 'TKT_deleted' ) ) ? ''
1574 1574
 				: ' disabled=disabled',
@@ -1734,8 +1734,8 @@  discard block
 block discarded – undo
1734 1734
 			$DateTime = new DateTime( $now, new DateTimeZone( EEM_Event::instance()->get_timezone() ) );
1735 1735
 			$start = $DateTime->setTime( 0, 0, 0 )->format( implode( ' ', $start_formats ) );
1736 1736
 			$end = $DateTime->setDate( date( 'Y' ), date( 'm' ), $DateTime->format( 't' ) )
1737
-			                ->setTime( 23, 59, 59 )
1738
-			                ->format( implode( ' ', $start_formats ) );
1737
+							->setTime( 23, 59, 59 )
1738
+							->format( implode( ' ', $start_formats ) );
1739 1739
 			$where['Datetime.DTT_EVT_start'] = array( 'BETWEEN', array( $start, $end ) );
1740 1740
 		}
1741 1741
 		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
@@ -1755,7 +1755,7 @@  discard block
 block discarded – undo
1755 1755
 		}
1756 1756
 		if ( isset( $this->_req_data['EVT_wp_user'] ) ) {
1757 1757
 			if ( $this->_req_data['EVT_wp_user'] != get_current_user_id()
1758
-			     && EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' )
1758
+				 && EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' )
1759 1759
 			) {
1760 1760
 				$where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1761 1761
 			}
@@ -2252,13 +2252,13 @@  discard block
 block discarded – undo
2252 2252
 	protected function _template_settings() {
2253 2253
 		$this->_admin_page_title = esc_html__( 'Template Settings (Preview)', 'event_espresso' );
2254 2254
 		$this->_template_args['preview_img'] = '<img src="'
2255
-		                                       . EVENTS_ASSETS_URL
2256
-		                                       . DS
2257
-		                                       . 'images'
2258
-		                                       . DS
2259
-		                                       . 'caffeinated_template_features.jpg" alt="'
2260
-		                                       . esc_attr__( 'Template Settings Preview screenshot', 'event_espresso' )
2261
-		                                       . '" />';
2255
+											   . EVENTS_ASSETS_URL
2256
+											   . DS
2257
+											   . 'images'
2258
+											   . DS
2259
+											   . 'caffeinated_template_features.jpg" alt="'
2260
+											   . esc_attr__( 'Template Settings Preview screenshot', 'event_espresso' )
2261
+											   . '" />';
2262 2262
 		$this->_template_args['preview_text'] = '<strong>' . esc_html__(
2263 2263
 				'Template Settings is a feature that is only available in the Caffeinated version of Event Espresso. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2264 2264
 				'event_espresso'
Please login to merge, or discard this patch.
Spacing   +594 added lines, -594 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'NO direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('NO direct script access allowed');
4 4
 }
5 5
 
6 6
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		);
64 64
 		add_action(
65 65
 			'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object',
66
-			array( $this, 'verify_event_edit' )
66
+			array($this, 'verify_event_edit')
67 67
 		);
68 68
 	}
69 69
 
@@ -79,22 +79,22 @@  discard block
 block discarded – undo
79 79
 		$this->_admin_page_title = EVENTS_LABEL;
80 80
 		$this->_labels = array(
81 81
 			'buttons'      => array(
82
-				'add'             => esc_html__( 'Add New Event', 'event_espresso' ),
83
-				'edit'            => esc_html__( 'Edit Event', 'event_espresso' ),
84
-				'delete'          => esc_html__( 'Delete Event', 'event_espresso' ),
85
-				'add_category'    => esc_html__( 'Add New Category', 'event_espresso' ),
86
-				'edit_category'   => esc_html__( 'Edit Category', 'event_espresso' ),
87
-				'delete_category' => esc_html__( 'Delete Category', 'event_espresso' ),
82
+				'add'             => esc_html__('Add New Event', 'event_espresso'),
83
+				'edit'            => esc_html__('Edit Event', 'event_espresso'),
84
+				'delete'          => esc_html__('Delete Event', 'event_espresso'),
85
+				'add_category'    => esc_html__('Add New Category', 'event_espresso'),
86
+				'edit_category'   => esc_html__('Edit Category', 'event_espresso'),
87
+				'delete_category' => esc_html__('Delete Category', 'event_espresso'),
88 88
 			),
89 89
 			'editor_title' => array(
90
-				'espresso_events' => esc_html__( 'Enter event title here', 'event_espresso' ),
90
+				'espresso_events' => esc_html__('Enter event title here', 'event_espresso'),
91 91
 			),
92 92
 			'publishbox'   => array(
93
-				'create_new'        => esc_html__( 'Save New Event', 'event_espresso' ),
94
-				'edit'              => esc_html__( 'Update Event', 'event_espresso' ),
95
-				'add_category'      => esc_html__( 'Save New Category', 'event_espresso' ),
96
-				'edit_category'     => esc_html__( 'Update Category', 'event_espresso' ),
97
-				'template_settings' => esc_html__( 'Update Settings', 'event_espresso' ),
93
+				'create_new'        => esc_html__('Save New Event', 'event_espresso'),
94
+				'edit'              => esc_html__('Update Event', 'event_espresso'),
95
+				'add_category'      => esc_html__('Save New Category', 'event_espresso'),
96
+				'edit_category'     => esc_html__('Update Category', 'event_espresso'),
97
+				'template_settings' => esc_html__('Update Settings', 'event_espresso'),
98 98
 			),
99 99
 		);
100 100
 	}
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 		//load formatter helper
106 106
 		//load field generator helper
107 107
 		//is there a evt_id in the request?
108
-		$evt_id = ! empty( $this->_req_data['EVT_ID'] ) && ! is_array( $this->_req_data['EVT_ID'] )
108
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID'])
109 109
 			? $this->_req_data['EVT_ID'] : 0;
110
-		$evt_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $evt_id;
110
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
111 111
 		$this->_page_routes = array(
112 112
 			'default'                       => array(
113 113
 				'func'       => '_events_overview_list_table',
@@ -130,27 +130,27 @@  discard block
 block discarded – undo
130 130
 			),
131 131
 			'trash_event'                   => array(
132 132
 				'func'       => '_trash_or_restore_event',
133
-				'args'       => array( 'event_status' => 'trash' ),
133
+				'args'       => array('event_status' => 'trash'),
134 134
 				'capability' => 'ee_delete_event',
135 135
 				'obj_id'     => $evt_id,
136 136
 				'noheader'   => true,
137 137
 			),
138 138
 			'trash_events'                  => array(
139 139
 				'func'       => '_trash_or_restore_events',
140
-				'args'       => array( 'event_status' => 'trash' ),
140
+				'args'       => array('event_status' => 'trash'),
141 141
 				'capability' => 'ee_delete_events',
142 142
 				'noheader'   => true,
143 143
 			),
144 144
 			'restore_event'                 => array(
145 145
 				'func'       => '_trash_or_restore_event',
146
-				'args'       => array( 'event_status' => 'draft' ),
146
+				'args'       => array('event_status' => 'draft'),
147 147
 				'capability' => 'ee_delete_event',
148 148
 				'obj_id'     => $evt_id,
149 149
 				'noheader'   => true,
150 150
 			),
151 151
 			'restore_events'                => array(
152 152
 				'func'       => '_trash_or_restore_events',
153
-				'args'       => array( 'event_status' => 'draft' ),
153
+				'args'       => array('event_status' => 'draft'),
154 154
 				'capability' => 'ee_delete_events',
155 155
 				'noheader'   => true,
156 156
 			),
@@ -186,12 +186,12 @@  discard block
 block discarded – undo
186 186
 			'add_category'                  => array(
187 187
 				'func'       => '_category_details',
188 188
 				'capability' => 'ee_edit_event_category',
189
-				'args'       => array( 'add' ),
189
+				'args'       => array('add'),
190 190
 			),
191 191
 			'edit_category'                 => array(
192 192
 				'func'       => '_category_details',
193 193
 				'capability' => 'ee_edit_event_category',
194
-				'args'       => array( 'edit' ),
194
+				'args'       => array('edit'),
195 195
 			),
196 196
 			'delete_categories'             => array(
197 197
 				'func'       => '_delete_categories',
@@ -205,13 +205,13 @@  discard block
 block discarded – undo
205 205
 			),
206 206
 			'insert_category' => array(
207 207
 				'func'       => '_insert_or_update_category',
208
-				'args'       => array( 'new_category' => true ),
208
+				'args'       => array('new_category' => true),
209 209
 				'capability' => 'ee_edit_event_category',
210 210
 				'noheader'   => true,
211 211
 			),
212 212
 			'update_category' => array(
213 213
 				'func'       => '_insert_or_update_category',
214
-				'args'       => array( 'new_category' => false ),
214
+				'args'       => array('new_category' => false),
215 215
 				'capability' => 'ee_edit_event_category',
216 216
 				'noheader'   => true,
217 217
 			),
@@ -228,29 +228,29 @@  discard block
 block discarded – undo
228 228
 		$this->_page_config = array(
229 229
 			'default'                => array(
230 230
 				'nav'           => array(
231
-					'label' => esc_html__( 'Overview', 'event_espresso' ),
231
+					'label' => esc_html__('Overview', 'event_espresso'),
232 232
 					'order' => 10,
233 233
 				),
234 234
 				'list_table'    => 'Events_Admin_List_Table',
235 235
 				'help_tabs'     => array(
236 236
 					'events_overview_help_tab'                       => array(
237
-						'title'    => esc_html__( 'Events Overview', 'event_espresso' ),
237
+						'title'    => esc_html__('Events Overview', 'event_espresso'),
238 238
 						'filename' => 'events_overview',
239 239
 					),
240 240
 					'events_overview_table_column_headings_help_tab' => array(
241
-						'title'    => esc_html__( 'Events Overview Table Column Headings', 'event_espresso' ),
241
+						'title'    => esc_html__('Events Overview Table Column Headings', 'event_espresso'),
242 242
 						'filename' => 'events_overview_table_column_headings',
243 243
 					),
244 244
 					'events_overview_filters_help_tab'               => array(
245
-						'title'    => esc_html__( 'Events Overview Filters', 'event_espresso' ),
245
+						'title'    => esc_html__('Events Overview Filters', 'event_espresso'),
246 246
 						'filename' => 'events_overview_filters',
247 247
 					),
248 248
 					'events_overview_view_help_tab'                  => array(
249
-						'title'    => esc_html__( 'Events Overview Views', 'event_espresso' ),
249
+						'title'    => esc_html__('Events Overview Views', 'event_espresso'),
250 250
 						'filename' => 'events_overview_views',
251 251
 					),
252 252
 					'events_overview_other_help_tab'                 => array(
253
-						'title'    => esc_html__( 'Events Overview Other', 'event_espresso' ),
253
+						'title'    => esc_html__('Events Overview Other', 'event_espresso'),
254 254
 						'filename' => 'events_overview_other',
255 255
 					),
256 256
 				),
@@ -265,218 +265,218 @@  discard block
 block discarded – undo
265 265
 			),
266 266
 			'create_new'             => array(
267 267
 				'nav'           => array(
268
-					'label'      => esc_html__( 'Add Event', 'event_espresso' ),
268
+					'label'      => esc_html__('Add Event', 'event_espresso'),
269 269
 					'order'      => 5,
270 270
 					'persistent' => false,
271 271
 				),
272
-				'metaboxes'     => array( '_register_event_editor_meta_boxes' ),
272
+				'metaboxes'     => array('_register_event_editor_meta_boxes'),
273 273
 				'help_tabs'     => array(
274 274
 					'event_editor_help_tab'                            => array(
275
-						'title'    => esc_html__( 'Event Editor', 'event_espresso' ),
275
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
276 276
 						'filename' => 'event_editor',
277 277
 					),
278 278
 					'event_editor_title_richtexteditor_help_tab'       => array(
279
-						'title'    => esc_html__( 'Event Title & Rich Text Editor', 'event_espresso' ),
279
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
280 280
 						'filename' => 'event_editor_title_richtexteditor',
281 281
 					),
282 282
 					'event_editor_venue_details_help_tab'              => array(
283
-						'title'    => esc_html__( 'Event Venue Details', 'event_espresso' ),
283
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
284 284
 						'filename' => 'event_editor_venue_details',
285 285
 					),
286 286
 					'event_editor_event_datetimes_help_tab'            => array(
287
-						'title'    => esc_html__( 'Event Datetimes', 'event_espresso' ),
287
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
288 288
 						'filename' => 'event_editor_event_datetimes',
289 289
 					),
290 290
 					'event_editor_event_tickets_help_tab'              => array(
291
-						'title'    => esc_html__( 'Event Tickets', 'event_espresso' ),
291
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
292 292
 						'filename' => 'event_editor_event_tickets',
293 293
 					),
294 294
 					'event_editor_event_registration_options_help_tab' => array(
295
-						'title'    => esc_html__( 'Event Registration Options', 'event_espresso' ),
295
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
296 296
 						'filename' => 'event_editor_event_registration_options',
297 297
 					),
298 298
 					'event_editor_tags_categories_help_tab'            => array(
299
-						'title'    => esc_html__( 'Event Tags & Categories', 'event_espresso' ),
299
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
300 300
 						'filename' => 'event_editor_tags_categories',
301 301
 					),
302 302
 					'event_editor_questions_registrants_help_tab'      => array(
303
-						'title'    => esc_html__( 'Questions for Registrants', 'event_espresso' ),
303
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
304 304
 						'filename' => 'event_editor_questions_registrants',
305 305
 					),
306 306
 					'event_editor_save_new_event_help_tab'             => array(
307
-						'title'    => esc_html__( 'Save New Event', 'event_espresso' ),
307
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
308 308
 						'filename' => 'event_editor_save_new_event',
309 309
 					),
310 310
 					'event_editor_other_help_tab'                      => array(
311
-						'title'    => esc_html__( 'Event Other', 'event_espresso' ),
311
+						'title'    => esc_html__('Event Other', 'event_espresso'),
312 312
 						'filename' => 'event_editor_other',
313 313
 					),
314 314
 				),
315 315
 				'help_tour'     => array(
316 316
 					'Event_Editor_Help_Tour',
317 317
 				),
318
-				'qtips'         => array( 'EE_Event_Editor_Decaf_Tips' ),
318
+				'qtips'         => array('EE_Event_Editor_Decaf_Tips'),
319 319
 				'require_nonce' => false,
320 320
 			),
321 321
 			'edit'                   => array(
322 322
 				'nav'           => array(
323
-					'label'      => esc_html__( 'Edit Event', 'event_espresso' ),
323
+					'label'      => esc_html__('Edit Event', 'event_espresso'),
324 324
 					'order'      => 5,
325 325
 					'persistent' => false,
326
-					'url'        => isset( $this->_req_data['post'] )
326
+					'url'        => isset($this->_req_data['post'])
327 327
 						? EE_Admin_Page::add_query_args_and_nonce(
328
-							array( 'post' => $this->_req_data['post'], 'action' => 'edit' ),
328
+							array('post' => $this->_req_data['post'], 'action' => 'edit'),
329 329
 							$this->_current_page_view_url
330 330
 						)
331 331
 						: $this->_admin_base_url,
332 332
 				),
333
-				'metaboxes'     => array( '_register_event_editor_meta_boxes' ),
333
+				'metaboxes'     => array('_register_event_editor_meta_boxes'),
334 334
 				'help_tabs'     => array(
335 335
 					'event_editor_help_tab'                            => array(
336
-						'title'    => esc_html__( 'Event Editor', 'event_espresso' ),
336
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
337 337
 						'filename' => 'event_editor',
338 338
 					),
339 339
 					'event_editor_title_richtexteditor_help_tab'       => array(
340
-						'title'    => esc_html__( 'Event Title & Rich Text Editor', 'event_espresso' ),
340
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
341 341
 						'filename' => 'event_editor_title_richtexteditor',
342 342
 					),
343 343
 					'event_editor_venue_details_help_tab'              => array(
344
-						'title'    => esc_html__( 'Event Venue Details', 'event_espresso' ),
344
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
345 345
 						'filename' => 'event_editor_venue_details',
346 346
 					),
347 347
 					'event_editor_event_datetimes_help_tab'            => array(
348
-						'title'    => esc_html__( 'Event Datetimes', 'event_espresso' ),
348
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
349 349
 						'filename' => 'event_editor_event_datetimes',
350 350
 					),
351 351
 					'event_editor_event_tickets_help_tab'              => array(
352
-						'title'    => esc_html__( 'Event Tickets', 'event_espresso' ),
352
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
353 353
 						'filename' => 'event_editor_event_tickets',
354 354
 					),
355 355
 					'event_editor_event_registration_options_help_tab' => array(
356
-						'title'    => esc_html__( 'Event Registration Options', 'event_espresso' ),
356
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
357 357
 						'filename' => 'event_editor_event_registration_options',
358 358
 					),
359 359
 					'event_editor_tags_categories_help_tab'            => array(
360
-						'title'    => esc_html__( 'Event Tags & Categories', 'event_espresso' ),
360
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
361 361
 						'filename' => 'event_editor_tags_categories',
362 362
 					),
363 363
 					'event_editor_questions_registrants_help_tab'      => array(
364
-						'title'    => esc_html__( 'Questions for Registrants', 'event_espresso' ),
364
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
365 365
 						'filename' => 'event_editor_questions_registrants',
366 366
 					),
367 367
 					'event_editor_save_new_event_help_tab'             => array(
368
-						'title'    => esc_html__( 'Save New Event', 'event_espresso' ),
368
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
369 369
 						'filename' => 'event_editor_save_new_event',
370 370
 					),
371 371
 					'event_editor_other_help_tab'                      => array(
372
-						'title'    => esc_html__( 'Event Other', 'event_espresso' ),
372
+						'title'    => esc_html__('Event Other', 'event_espresso'),
373 373
 						'filename' => 'event_editor_other',
374 374
 					),
375 375
 				),
376 376
 				/*'help_tour' => array(
377 377
 					'Event_Edit_Help_Tour'
378 378
 				),*/
379
-				'qtips'         => array( 'EE_Event_Editor_Decaf_Tips' ),
379
+				'qtips'         => array('EE_Event_Editor_Decaf_Tips'),
380 380
 				'require_nonce' => false,
381 381
 			),
382 382
 			'default_event_settings' => array(
383 383
 				'nav'           => array(
384
-					'label' => esc_html__( 'Default Settings', 'event_espresso' ),
384
+					'label' => esc_html__('Default Settings', 'event_espresso'),
385 385
 					'order' => 40,
386 386
 				),
387
-				'metaboxes'     => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
387
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
388 388
 				'labels'        => array(
389
-					'publishbox' => esc_html__( 'Update Settings', 'event_espresso' ),
389
+					'publishbox' => esc_html__('Update Settings', 'event_espresso'),
390 390
 				),
391 391
 				'help_tabs'     => array(
392 392
 					'default_settings_help_tab'        => array(
393
-						'title'    => esc_html__( 'Default Event Settings', 'event_espresso' ),
393
+						'title'    => esc_html__('Default Event Settings', 'event_espresso'),
394 394
 						'filename' => 'events_default_settings',
395 395
 					),
396 396
 					'default_settings_status_help_tab' => array(
397
-						'title'    => esc_html__( 'Default Registration Status', 'event_espresso' ),
397
+						'title'    => esc_html__('Default Registration Status', 'event_espresso'),
398 398
 						'filename' => 'events_default_settings_status',
399 399
 					),
400 400
 				),
401
-				'help_tour'     => array( 'Event_Default_Settings_Help_Tour' ),
401
+				'help_tour'     => array('Event_Default_Settings_Help_Tour'),
402 402
 				'require_nonce' => false,
403 403
 			),
404 404
 			//template settings
405 405
 			'template_settings'      => array(
406 406
 				'nav'           => array(
407
-					'label' => esc_html__( 'Templates', 'event_espresso' ),
407
+					'label' => esc_html__('Templates', 'event_espresso'),
408 408
 					'order' => 30,
409 409
 				),
410 410
 				'metaboxes'     => $this->_default_espresso_metaboxes,
411 411
 				'help_tabs'     => array(
412 412
 					'general_settings_templates_help_tab' => array(
413
-						'title'    => esc_html__( 'Templates', 'event_espresso' ),
413
+						'title'    => esc_html__('Templates', 'event_espresso'),
414 414
 						'filename' => 'general_settings_templates',
415 415
 					),
416 416
 				),
417
-				'help_tour'     => array( 'Templates_Help_Tour' ),
417
+				'help_tour'     => array('Templates_Help_Tour'),
418 418
 				'require_nonce' => false,
419 419
 			),
420 420
 			//event category stuff
421 421
 			'add_category'           => array(
422 422
 				'nav'           => array(
423
-					'label'      => esc_html__( 'Add Category', 'event_espresso' ),
423
+					'label'      => esc_html__('Add Category', 'event_espresso'),
424 424
 					'order'      => 15,
425 425
 					'persistent' => false,
426 426
 				),
427 427
 				'help_tabs'     => array(
428 428
 					'add_category_help_tab' => array(
429
-						'title'    => esc_html__( 'Add New Event Category', 'event_espresso' ),
429
+						'title'    => esc_html__('Add New Event Category', 'event_espresso'),
430 430
 						'filename' => 'events_add_category',
431 431
 					),
432 432
 				),
433
-				'help_tour'     => array( 'Event_Add_Category_Help_Tour' ),
434
-				'metaboxes'     => array( '_publish_post_box' ),
433
+				'help_tour'     => array('Event_Add_Category_Help_Tour'),
434
+				'metaboxes'     => array('_publish_post_box'),
435 435
 				'require_nonce' => false,
436 436
 			),
437 437
 			'edit_category'          => array(
438 438
 				'nav'           => array(
439
-					'label'      => esc_html__( 'Edit Category', 'event_espresso' ),
439
+					'label'      => esc_html__('Edit Category', 'event_espresso'),
440 440
 					'order'      => 15,
441 441
 					'persistent' => false,
442
-					'url'        => isset( $this->_req_data['EVT_CAT_ID'] )
442
+					'url'        => isset($this->_req_data['EVT_CAT_ID'])
443 443
 						? add_query_arg(
444
-							array( 'EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID'] ),
444
+							array('EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']),
445 445
 							$this->_current_page_view_url
446 446
 						)
447 447
 						: $this->_admin_base_url,
448 448
 				),
449 449
 				'help_tabs'     => array(
450 450
 					'edit_category_help_tab' => array(
451
-						'title'    => esc_html__( 'Edit Event Category', 'event_espresso' ),
451
+						'title'    => esc_html__('Edit Event Category', 'event_espresso'),
452 452
 						'filename' => 'events_edit_category',
453 453
 					),
454 454
 				),
455 455
 				/*'help_tour' => array('Event_Edit_Category_Help_Tour'),*/
456
-				'metaboxes'     => array( '_publish_post_box' ),
456
+				'metaboxes'     => array('_publish_post_box'),
457 457
 				'require_nonce' => false,
458 458
 			),
459 459
 			'category_list'          => array(
460 460
 				'nav'           => array(
461
-					'label' => esc_html__( 'Categories', 'event_espresso' ),
461
+					'label' => esc_html__('Categories', 'event_espresso'),
462 462
 					'order' => 20,
463 463
 				),
464 464
 				'list_table'    => 'Event_Categories_Admin_List_Table',
465 465
 				'help_tabs'     => array(
466 466
 					'events_categories_help_tab'                       => array(
467
-						'title'    => esc_html__( 'Event Categories', 'event_espresso' ),
467
+						'title'    => esc_html__('Event Categories', 'event_espresso'),
468 468
 						'filename' => 'events_categories',
469 469
 					),
470 470
 					'events_categories_table_column_headings_help_tab' => array(
471
-						'title'    => esc_html__( 'Event Categories Table Column Headings', 'event_espresso' ),
471
+						'title'    => esc_html__('Event Categories Table Column Headings', 'event_espresso'),
472 472
 						'filename' => 'events_categories_table_column_headings',
473 473
 					),
474 474
 					'events_categories_view_help_tab'                  => array(
475
-						'title'    => esc_html__( 'Event Categories Views', 'event_espresso' ),
475
+						'title'    => esc_html__('Event Categories Views', 'event_espresso'),
476 476
 						'filename' => 'events_categories_views',
477 477
 					),
478 478
 					'events_categories_other_help_tab'                 => array(
479
-						'title'    => esc_html__( 'Event Categories Other', 'event_espresso' ),
479
+						'title'    => esc_html__('Event Categories Other', 'event_espresso'),
480 480
 						'filename' => 'events_categories_other',
481 481
 					),
482 482
 				),
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 
506 506
 	protected function _add_screen_options_category_list() {
507 507
 		$page_title = $this->_admin_page_title;
508
-		$this->_admin_page_title = esc_html__( 'Categories', 'event_espresso' );
508
+		$this->_admin_page_title = esc_html__('Categories', 'event_espresso');
509 509
 		$this->_per_page_screen_option();
510 510
 		$this->_admin_page_title = $page_title;
511 511
 	}
@@ -521,20 +521,20 @@  discard block
 block discarded – undo
521 521
 	public function load_scripts_styles() {
522 522
 		wp_register_style(
523 523
 			'events-admin-css',
524
-			EVENTS_ASSETS_URL . 'events-admin-page.css',
524
+			EVENTS_ASSETS_URL.'events-admin-page.css',
525 525
 			array(),
526 526
 			EVENT_ESPRESSO_VERSION
527 527
 		);
528
-		wp_register_style( 'ee-cat-admin', EVENTS_ASSETS_URL . 'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION );
529
-		wp_enqueue_style( 'events-admin-css' );
530
-		wp_enqueue_style( 'ee-cat-admin' );
528
+		wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL.'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION);
529
+		wp_enqueue_style('events-admin-css');
530
+		wp_enqueue_style('ee-cat-admin');
531 531
 		//todo note: we also need to load_scripts_styles per view (i.e. default/view_report/event_details
532 532
 		//registers for all views
533 533
 		//scripts
534 534
 		wp_register_script(
535 535
 			'event_editor_js',
536
-			EVENTS_ASSETS_URL . 'event_editor.js',
537
-			array( 'ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon' ),
536
+			EVENTS_ASSETS_URL.'event_editor.js',
537
+			array('ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'),
538 538
 			EVENT_ESPRESSO_VERSION,
539 539
 			true
540 540
 		);
@@ -560,22 +560,22 @@  discard block
 block discarded – undo
560 560
 	 */
561 561
 	public function load_scripts_styles_edit() {
562 562
 		//styles
563
-		wp_enqueue_style( 'espresso-ui-theme' );
563
+		wp_enqueue_style('espresso-ui-theme');
564 564
 		wp_register_style(
565 565
 			'event-editor-css',
566
-			EVENTS_ASSETS_URL . 'event-editor.css',
567
-			array( 'ee-admin-css' ),
566
+			EVENTS_ASSETS_URL.'event-editor.css',
567
+			array('ee-admin-css'),
568 568
 			EVENT_ESPRESSO_VERSION
569 569
 		);
570
-		wp_enqueue_style( 'event-editor-css' );
570
+		wp_enqueue_style('event-editor-css');
571 571
 		//scripts
572 572
 		wp_register_script(
573 573
 			'event-datetime-metabox',
574
-			EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
575
-			array( 'event_editor_js', 'ee-datepicker' ),
574
+			EVENTS_ASSETS_URL.'event-datetime-metabox.js',
575
+			array('event_editor_js', 'ee-datepicker'),
576 576
 			EVENT_ESPRESSO_VERSION
577 577
 		);
578
-		wp_enqueue_script( 'event-datetime-metabox' );
578
+		wp_enqueue_script('event-datetime-metabox');
579 579
 	}
580 580
 
581 581
 
@@ -595,10 +595,10 @@  discard block
 block discarded – undo
595 595
 		$this->_views = array(
596 596
 			'all' => array(
597 597
 				'slug'        => 'all',
598
-				'label'       => esc_html__( 'All', 'event_espresso' ),
598
+				'label'       => esc_html__('All', 'event_espresso'),
599 599
 				'count'       => 0,
600 600
 				'bulk_action' => array(
601
-					'delete_categories' => esc_html__( 'Delete Permanently', 'event_espresso' ),
601
+					'delete_categories' => esc_html__('Delete Permanently', 'event_espresso'),
602 602
 				),
603 603
 			),
604 604
 		);
@@ -634,14 +634,14 @@  discard block
 block discarded – undo
634 634
 	 * @access public
635 635
 	 * @return void
636 636
 	 */
637
-	public function verify_event_edit( $event = null ) {
637
+	public function verify_event_edit($event = null) {
638 638
 		// no event?
639
-		if ( empty( $event ) ) {
639
+		if (empty($event)) {
640 640
 			// set event
641 641
 			$event = $this->_cpt_model_obj;
642 642
 		}
643 643
 		// STILL no event?
644
-		if ( empty ( $event ) ) {
644
+		if (empty ($event)) {
645 645
 			return;
646 646
 		}
647 647
 		$orig_status = $event->status();
@@ -655,32 +655,32 @@  discard block
 block discarded – undo
655 655
 			return;
656 656
 		}
657 657
 		//made it here so it IS active... next check that any of the tickets are sold.
658
-		if ( $event->is_sold_out( true ) ) {
659
-			if ( $orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status ) {
658
+		if ($event->is_sold_out(true)) {
659
+			if ($orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status) {
660 660
 				EE_Error::add_attention(
661 661
 					sprintf(
662 662
 						esc_html__(
663 663
 							'Please note that the Event Status has automatically been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You can change the status back to something else before updating if you wish.',
664 664
 							'event_espresso'
665 665
 						),
666
-						EEH_Template::pretty_status( EEM_Event::sold_out, false, 'sentence' )
666
+						EEH_Template::pretty_status(EEM_Event::sold_out, false, 'sentence')
667 667
 					)
668 668
 				);
669 669
 			}
670 670
 			return;
671
-		} else if ( $orig_status === EEM_Event::sold_out ) {
671
+		} else if ($orig_status === EEM_Event::sold_out) {
672 672
 			EE_Error::add_attention(
673 673
 				sprintf(
674 674
 					esc_html__(
675 675
 						'Please note that the Event Status has automatically been changed to %s because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets.  However, this change is not permanent until you update the event. If you wish, you can change the status back to something else before updating.',
676 676
 						'event_espresso'
677 677
 					),
678
-					EEH_Template::pretty_status( $event->status(), false, 'sentence' )
678
+					EEH_Template::pretty_status($event->status(), false, 'sentence')
679 679
 				)
680 680
 			);
681 681
 		}
682 682
 		//now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
683
-		if ( ! $event->tickets_on_sale() ) {
683
+		if ( ! $event->tickets_on_sale()) {
684 684
 			return;
685 685
 		}
686 686
 		//made it here so show warning
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 	 */
699 699
 	protected function _edit_event_warning() {
700 700
 		// we don't want to add warnings during these requests
701
-		if ( isset( $this->_req_data['action'] ) && $this->_req_data['action'] === 'editpost' ) {
701
+		if (isset($this->_req_data['action']) && $this->_req_data['action'] === 'editpost') {
702 702
 			return;
703 703
 		}
704 704
 		EE_Error::add_attention(
@@ -717,14 +717,14 @@  discard block
 block discarded – undo
717 717
 	 * @return string
718 718
 	 */
719 719
 	protected function _create_new_cpt_item() {
720
-		$gmt_offset = get_option( 'gmt_offset' );
720
+		$gmt_offset = get_option('gmt_offset');
721 721
 		//only nag them about setting their timezone if it's their first event, and they haven't already done it
722
-		if( $gmt_offset === '0' && ! EEM_Event::instance()->exists(array()) ) {
722
+		if ($gmt_offset === '0' && ! EEM_Event::instance()->exists(array())) {
723 723
 			EE_Error::add_attention(
724 724
 				sprintf(
725
-					__( 'Your website\'s timezone is currently set to UTC + 0. We recommend updating your timezone to a city
725
+					__('Your website\'s timezone is currently set to UTC + 0. We recommend updating your timezone to a city
726 726
 			        or region near you before you create an event. Your timezone can be updated through the %1$sGeneral Settings%2$s page.'),
727
-					'<a href="' . admin_url( 'options-general.php' ) . '">',
727
+					'<a href="'.admin_url('options-general.php').'">',
728 728
 					'</a>'
729 729
 				),
730 730
 				__FILE__,
@@ -741,29 +741,29 @@  discard block
 block discarded – undo
741 741
 		$this->_views = array(
742 742
 			'all'   => array(
743 743
 				'slug'        => 'all',
744
-				'label'       => esc_html__( 'View All Events', 'event_espresso' ),
744
+				'label'       => esc_html__('View All Events', 'event_espresso'),
745 745
 				'count'       => 0,
746 746
 				'bulk_action' => array(
747
-					'trash_events' => esc_html__( 'Move to Trash', 'event_espresso' ),
747
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
748 748
 				),
749 749
 			),
750 750
 			'draft' => array(
751 751
 				'slug'        => 'draft',
752
-				'label'       => esc_html__( 'Draft', 'event_espresso' ),
752
+				'label'       => esc_html__('Draft', 'event_espresso'),
753 753
 				'count'       => 0,
754 754
 				'bulk_action' => array(
755
-					'trash_events' => esc_html__( 'Move to Trash', 'event_espresso' ),
755
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
756 756
 				),
757 757
 			),
758 758
 		);
759
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
759
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
760 760
 			$this->_views['trash'] = array(
761 761
 				'slug'        => 'trash',
762
-				'label'       => esc_html__( 'Trash', 'event_espresso' ),
762
+				'label'       => esc_html__('Trash', 'event_espresso'),
763 763
 				'count'       => 0,
764 764
 				'bulk_action' => array(
765
-					'restore_events' => esc_html__( 'Restore From Trash', 'event_espresso' ),
766
-					'delete_events'  => esc_html__( 'Delete Permanently', 'event_espresso' ),
765
+					'restore_events' => esc_html__('Restore From Trash', 'event_espresso'),
766
+					'delete_events'  => esc_html__('Delete Permanently', 'event_espresso'),
767 767
 				),
768 768
 			);
769 769
 		}
@@ -778,50 +778,50 @@  discard block
 block discarded – undo
778 778
 		$items = array(
779 779
 			'view_details'   => array(
780 780
 				'class' => 'dashicons dashicons-search',
781
-				'desc'  => esc_html__( 'View Event', 'event_espresso' ),
781
+				'desc'  => esc_html__('View Event', 'event_espresso'),
782 782
 			),
783 783
 			'edit_event'     => array(
784 784
 				'class' => 'ee-icon ee-icon-calendar-edit',
785
-				'desc'  => esc_html__( 'Edit Event Details', 'event_espresso' ),
785
+				'desc'  => esc_html__('Edit Event Details', 'event_espresso'),
786 786
 			),
787 787
 			'view_attendees' => array(
788 788
 				'class' => 'dashicons dashicons-groups',
789
-				'desc'  => esc_html__( 'View Registrations for Event', 'event_espresso' ),
789
+				'desc'  => esc_html__('View Registrations for Event', 'event_espresso'),
790 790
 			),
791 791
 		);
792
-		$items = apply_filters( 'FHEE__Events_Admin_Page___event_legend_items__items', $items );
792
+		$items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
793 793
 		$statuses = array(
794 794
 			'sold_out_status'  => array(
795
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
796
-				'desc'  => EEH_Template::pretty_status( EE_Datetime::sold_out, false, 'sentence' ),
795
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::sold_out,
796
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
797 797
 			),
798 798
 			'active_status'    => array(
799
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
800
-				'desc'  => EEH_Template::pretty_status( EE_Datetime::active, false, 'sentence' ),
799
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::active,
800
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
801 801
 			),
802 802
 			'upcoming_status'  => array(
803
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
804
-				'desc'  => EEH_Template::pretty_status( EE_Datetime::upcoming, false, 'sentence' ),
803
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::upcoming,
804
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
805 805
 			),
806 806
 			'postponed_status' => array(
807
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
808
-				'desc'  => EEH_Template::pretty_status( EE_Datetime::postponed, false, 'sentence' ),
807
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::postponed,
808
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
809 809
 			),
810 810
 			'cancelled_status' => array(
811
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
812
-				'desc'  => EEH_Template::pretty_status( EE_Datetime::cancelled, false, 'sentence' ),
811
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::cancelled,
812
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
813 813
 			),
814 814
 			'expired_status'   => array(
815
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
816
-				'desc'  => EEH_Template::pretty_status( EE_Datetime::expired, false, 'sentence' ),
815
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::expired,
816
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
817 817
 			),
818 818
 			'inactive_status'  => array(
819
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
820
-				'desc'  => EEH_Template::pretty_status( EE_Datetime::inactive, false, 'sentence' ),
819
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::inactive,
820
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
821 821
 			),
822 822
 		);
823
-		$statuses = apply_filters( 'FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses );
824
-		return array_merge( $items, $statuses );
823
+		$statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
824
+		return array_merge($items, $statuses);
825 825
 	}
826 826
 
827 827
 
@@ -832,8 +832,8 @@  discard block
 block discarded – undo
832 832
 	 * @return EEM_Event
833 833
 	 */
834 834
 	private function _event_model() {
835
-		if ( ! $this->_event_model instanceof EEM_Event ) {
836
-			$this->_event_model = EE_Registry::instance()->load_model( 'Event' );
835
+		if ( ! $this->_event_model instanceof EEM_Event) {
836
+			$this->_event_model = EE_Registry::instance()->load_model('Event');
837 837
 		}
838 838
 		return $this->_event_model;
839 839
 	}
@@ -850,12 +850,12 @@  discard block
 block discarded – undo
850 850
 	 * @param  string $new_slug  what the slug is
851 851
 	 * @return string            The new html string for the permalink area
852 852
 	 */
853
-	public function extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ) {
853
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug) {
854 854
 		//make sure this is only when editing
855
-		if ( ! empty( $id ) ) {
856
-			$post = get_post( $id );
855
+		if ( ! empty($id)) {
856
+			$post = get_post($id);
857 857
 			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
858
-			           . esc_html__( 'Shortcode', 'event_espresso' )
858
+			           . esc_html__('Shortcode', 'event_espresso')
859 859
 			           . '</a> ';
860 860
 			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
861 861
 			           . $post->ID
@@ -875,8 +875,8 @@  discard block
 block discarded – undo
875 875
 	 * @throws \EE_Error
876 876
 	 */
877 877
 	protected function _events_overview_list_table() {
878
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
879
-		$this->_template_args['after_list_table'] = ! empty( $this->_template_args['after_list_table'] )
878
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
879
+		$this->_template_args['after_list_table'] = ! empty($this->_template_args['after_list_table'])
880 880
 		    ? (array) $this->_template_args['after_list_table']
881 881
 			: array();
882 882
 		$this->_template_args['after_list_table']['view_event_list_button'] = EEH_HTML::br()
@@ -885,8 +885,8 @@  discard block
 block discarded – undo
885 885
 			esc_html__("View Event Archive Page", "event_espresso"),
886 886
 			'button'
887 887
 		);
888
-		$this->_template_args['after_list_table']['legend'] = $this->_display_legend( $this->_event_legend_items() );
889
-		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
888
+		$this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
889
+		$this->_admin_page_title .= ' '.$this->get_action_link_or_button(
890 890
 				'create_new',
891 891
 				'add',
892 892
 				array(),
@@ -920,48 +920,48 @@  discard block
 block discarded – undo
920 920
 	 * @param  object $post    The post object of the cpt that was saved.
921 921
 	 * @return void
922 922
 	 */
923
-	protected function _insert_update_cpt_item( $post_id, $post ) {
924
-		if ( $post instanceof WP_Post && $post->post_type !== 'espresso_events' ) {
923
+	protected function _insert_update_cpt_item($post_id, $post) {
924
+		if ($post instanceof WP_Post && $post->post_type !== 'espresso_events') {
925 925
 			//get out we're not processing an event save.
926 926
 			return;
927 927
 		}
928 928
 		$event_values = array(
929
-			'EVT_display_desc'                => ! empty( $this->_req_data['display_desc'] ) ? 1 : 0,
930
-			'EVT_display_ticket_selector'     => ! empty( $this->_req_data['display_ticket_selector'] ) ? 1 : 0,
929
+			'EVT_display_desc'                => ! empty($this->_req_data['display_desc']) ? 1 : 0,
930
+			'EVT_display_ticket_selector'     => ! empty($this->_req_data['display_ticket_selector']) ? 1 : 0,
931 931
 			'EVT_additional_limit'            => min(
932
-				apply_filters( 'FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255 ),
933
-				! empty( $this->_req_data['additional_limit'] ) ? $this->_req_data['additional_limit'] : null
932
+				apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
933
+				! empty($this->_req_data['additional_limit']) ? $this->_req_data['additional_limit'] : null
934 934
 			),
935
-			'EVT_default_registration_status' => ! empty( $this->_req_data['EVT_default_registration_status'] )
935
+			'EVT_default_registration_status' => ! empty($this->_req_data['EVT_default_registration_status'])
936 936
 				? $this->_req_data['EVT_default_registration_status']
937 937
 				: EE_Registry::instance()->CFG->registration->default_STS_ID,
938
-			'EVT_member_only'                 => ! empty( $this->_req_data['member_only'] ) ? 1 : 0,
939
-			'EVT_allow_overflow'              => ! empty( $this->_req_data['EVT_allow_overflow'] ) ? 1 : 0,
940
-			'EVT_timezone_string'             => ! empty( $this->_req_data['timezone_string'] )
938
+			'EVT_member_only'                 => ! empty($this->_req_data['member_only']) ? 1 : 0,
939
+			'EVT_allow_overflow'              => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
940
+			'EVT_timezone_string'             => ! empty($this->_req_data['timezone_string'])
941 941
 				? $this->_req_data['timezone_string'] : null,
942
-			'EVT_external_URL'                => ! empty( $this->_req_data['externalURL'] )
942
+			'EVT_external_URL'                => ! empty($this->_req_data['externalURL'])
943 943
 				? $this->_req_data['externalURL'] : null,
944
-			'EVT_phone'                       => ! empty( $this->_req_data['event_phone'] )
944
+			'EVT_phone'                       => ! empty($this->_req_data['event_phone'])
945 945
 				? $this->_req_data['event_phone'] : null,
946 946
 		);
947 947
 		//update event
948
-		$success = $this->_event_model()->update_by_ID( $event_values, $post_id );
948
+		$success = $this->_event_model()->update_by_ID($event_values, $post_id);
949 949
 		//get event_object for other metaboxes... though it would seem to make sense to just use $this->_event_model()->get_one_by_ID( $post_id ).. i have to setup where conditions to override the filters in the model that filter out autodraft and inherit statuses so we GET the inherit id!
950
-		$get_one_where = array( $this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status );
951
-		$event = $this->_event_model()->get_one( array( $get_one_where ) );
950
+		$get_one_where = array($this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status);
951
+		$event = $this->_event_model()->get_one(array($get_one_where));
952 952
 		//the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
953 953
 		$event_update_callbacks = apply_filters(
954 954
 			'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
955
-			array( array( $this, '_default_venue_update' ), array( $this, '_default_tickets_update' ) )
955
+			array(array($this, '_default_venue_update'), array($this, '_default_tickets_update'))
956 956
 		);
957 957
 		$att_success = true;
958
-		foreach ( $event_update_callbacks as $e_callback ) {
959
-			$_succ = call_user_func_array( $e_callback, array( $event, $this->_req_data ) );
958
+		foreach ($event_update_callbacks as $e_callback) {
959
+			$_succ = call_user_func_array($e_callback, array($event, $this->_req_data));
960 960
 			$att_success = ! $att_success ? $att_success
961 961
 				: $_succ; //if ANY of these updates fail then we want the appropriate global error message
962 962
 		}
963 963
 		//any errors?
964
-		if ( $success && false === $att_success ) {
964
+		if ($success && false === $att_success) {
965 965
 			EE_Error::add_error(
966 966
 				esc_html__(
967 967
 					'Event Details saved successfully but something went wrong with saving attachments.',
@@ -971,9 +971,9 @@  discard block
 block discarded – undo
971 971
 				__FUNCTION__,
972 972
 				__LINE__
973 973
 			);
974
-		} else if ( $success === false ) {
974
+		} else if ($success === false) {
975 975
 			EE_Error::add_error(
976
-				esc_html__( 'Event Details did not save successfully.', 'event_espresso' ),
976
+				esc_html__('Event Details did not save successfully.', 'event_espresso'),
977 977
 				__FILE__,
978 978
 				__FUNCTION__,
979 979
 				__LINE__
@@ -988,14 +988,14 @@  discard block
 block discarded – undo
988 988
 	 * @param int $post_id
989 989
 	 * @param int $revision_id
990 990
 	 */
991
-	protected function _restore_cpt_item( $post_id, $revision_id ) {
991
+	protected function _restore_cpt_item($post_id, $revision_id) {
992 992
 		//copy existing event meta to new post
993
-		$post_evt = $this->_event_model()->get_one_by_ID( $post_id );
994
-		if ( $post_evt instanceof EE_Event ) {
993
+		$post_evt = $this->_event_model()->get_one_by_ID($post_id);
994
+		if ($post_evt instanceof EE_Event) {
995 995
 			//meta revision restore
996
-			$post_evt->restore_revision( $revision_id );
996
+			$post_evt->restore_revision($revision_id);
997 997
 			//related objs restore
998
-			$post_evt->restore_revision( $revision_id, array( 'Venue', 'Datetime', 'Price' ) );
998
+			$post_evt->restore_revision($revision_id, array('Venue', 'Datetime', 'Price'));
999 999
 		}
1000 1000
 	}
1001 1001
 
@@ -1008,49 +1008,49 @@  discard block
 block discarded – undo
1008 1008
 	 * @param  array     $data   The request data from the form
1009 1009
 	 * @return bool           Success or fail.
1010 1010
 	 */
1011
-	protected function _default_venue_update( \EE_Event $evtobj, $data ) {
1012
-		require_once( EE_MODELS . 'EEM_Venue.model.php' );
1013
-		$venue_model = EE_Registry::instance()->load_model( 'Venue' );
1011
+	protected function _default_venue_update(\EE_Event $evtobj, $data) {
1012
+		require_once(EE_MODELS.'EEM_Venue.model.php');
1013
+		$venue_model = EE_Registry::instance()->load_model('Venue');
1014 1014
 		$rows_affected = null;
1015
-		$venue_id = ! empty( $data['venue_id'] ) ? $data['venue_id'] : null;
1015
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
1016 1016
 		// very important.  If we don't have a venue name...
1017 1017
 		// then we'll get out because not necessary to create empty venue
1018
-		if ( empty( $data['venue_title'] ) ) {
1018
+		if (empty($data['venue_title'])) {
1019 1019
 			return false;
1020 1020
 		}
1021 1021
 		$venue_array = array(
1022
-			'VNU_wp_user'         => $evtobj->get( 'EVT_wp_user' ),
1023
-			'VNU_name'            => ! empty( $data['venue_title'] ) ? $data['venue_title'] : null,
1024
-			'VNU_desc'            => ! empty( $data['venue_description'] ) ? $data['venue_description'] : null,
1025
-			'VNU_identifier'      => ! empty( $data['venue_identifier'] ) ? $data['venue_identifier'] : null,
1026
-			'VNU_short_desc'      => ! empty( $data['venue_short_description'] ) ? $data['venue_short_description']
1022
+			'VNU_wp_user'         => $evtobj->get('EVT_wp_user'),
1023
+			'VNU_name'            => ! empty($data['venue_title']) ? $data['venue_title'] : null,
1024
+			'VNU_desc'            => ! empty($data['venue_description']) ? $data['venue_description'] : null,
1025
+			'VNU_identifier'      => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : null,
1026
+			'VNU_short_desc'      => ! empty($data['venue_short_description']) ? $data['venue_short_description']
1027 1027
 				: null,
1028
-			'VNU_address'         => ! empty( $data['address'] ) ? $data['address'] : null,
1029
-			'VNU_address2'        => ! empty( $data['address2'] ) ? $data['address2'] : null,
1030
-			'VNU_city'            => ! empty( $data['city'] ) ? $data['city'] : null,
1031
-			'STA_ID'              => ! empty( $data['state'] ) ? $data['state'] : null,
1032
-			'CNT_ISO'             => ! empty( $data['countries'] ) ? $data['countries'] : null,
1033
-			'VNU_zip'             => ! empty( $data['zip'] ) ? $data['zip'] : null,
1034
-			'VNU_phone'           => ! empty( $data['venue_phone'] ) ? $data['venue_phone'] : null,
1035
-			'VNU_capacity'        => ! empty( $data['venue_capacity'] ) ? $data['venue_capacity'] : null,
1036
-			'VNU_url'             => ! empty( $data['venue_url'] ) ? $data['venue_url'] : null,
1037
-			'VNU_virtual_phone'   => ! empty( $data['virtual_phone'] ) ? $data['virtual_phone'] : null,
1038
-			'VNU_virtual_url'     => ! empty( $data['virtual_url'] ) ? $data['virtual_url'] : null,
1039
-			'VNU_enable_for_gmap' => isset( $data['enable_for_gmap'] ) ? 1 : 0,
1028
+			'VNU_address'         => ! empty($data['address']) ? $data['address'] : null,
1029
+			'VNU_address2'        => ! empty($data['address2']) ? $data['address2'] : null,
1030
+			'VNU_city'            => ! empty($data['city']) ? $data['city'] : null,
1031
+			'STA_ID'              => ! empty($data['state']) ? $data['state'] : null,
1032
+			'CNT_ISO'             => ! empty($data['countries']) ? $data['countries'] : null,
1033
+			'VNU_zip'             => ! empty($data['zip']) ? $data['zip'] : null,
1034
+			'VNU_phone'           => ! empty($data['venue_phone']) ? $data['venue_phone'] : null,
1035
+			'VNU_capacity'        => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : null,
1036
+			'VNU_url'             => ! empty($data['venue_url']) ? $data['venue_url'] : null,
1037
+			'VNU_virtual_phone'   => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : null,
1038
+			'VNU_virtual_url'     => ! empty($data['virtual_url']) ? $data['virtual_url'] : null,
1039
+			'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
1040 1040
 			'status'              => 'publish',
1041 1041
 		);
1042 1042
 		//if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1043
-		if ( ! empty( $venue_id ) ) {
1044
-			$update_where = array( $venue_model->primary_key_name() => $venue_id );
1045
-			$rows_affected = $venue_model->update( $venue_array, array( $update_where ) );
1043
+		if ( ! empty($venue_id)) {
1044
+			$update_where = array($venue_model->primary_key_name() => $venue_id);
1045
+			$rows_affected = $venue_model->update($venue_array, array($update_where));
1046 1046
 			//we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
1047
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
1047
+			$evtobj->_add_relation_to($venue_id, 'Venue');
1048 1048
 			return $rows_affected > 0 ? true : false;
1049 1049
 		} else {
1050 1050
 			//we insert the venue
1051
-			$venue_id = $venue_model->insert( $venue_array );
1052
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
1053
-			return ! empty( $venue_id ) ? true : false;
1051
+			$venue_id = $venue_model->insert($venue_array);
1052
+			$evtobj->_add_relation_to($venue_id, 'Venue');
1053
+			return ! empty($venue_id) ? true : false;
1054 1054
 		}
1055 1055
 		//when we have the ancestor come in it's already been handled by the revision save.
1056 1056
 	}
@@ -1064,51 +1064,51 @@  discard block
 block discarded – undo
1064 1064
 	 * @param  array    $data   The request data from the form
1065 1065
 	 * @return array
1066 1066
 	 */
1067
-	protected function _default_tickets_update( EE_Event $evtobj, $data ) {
1067
+	protected function _default_tickets_update(EE_Event $evtobj, $data) {
1068 1068
 		$success = true;
1069 1069
 		$saved_dtt = null;
1070 1070
 		$saved_tickets = array();
1071
-		$incoming_date_formats = array( 'Y-m-d', 'h:i a' );
1072
-		foreach ( $data['edit_event_datetimes'] as $row => $dtt ) {
1071
+		$incoming_date_formats = array('Y-m-d', 'h:i a');
1072
+		foreach ($data['edit_event_datetimes'] as $row => $dtt) {
1073 1073
 			//trim all values to ensure any excess whitespace is removed.
1074
-			$dtt = array_map( 'trim', $dtt );
1075
-			$dtt['DTT_EVT_end'] = isset( $dtt['DTT_EVT_end'] ) && ! empty( $dtt['DTT_EVT_end'] ) ? $dtt['DTT_EVT_end']
1074
+			$dtt = array_map('trim', $dtt);
1075
+			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end']) ? $dtt['DTT_EVT_end']
1076 1076
 				: $dtt['DTT_EVT_start'];
1077 1077
 			$datetime_values = array(
1078
-				'DTT_ID'        => ! empty( $dtt['DTT_ID'] ) ? $dtt['DTT_ID'] : null,
1078
+				'DTT_ID'        => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : null,
1079 1079
 				'DTT_EVT_start' => $dtt['DTT_EVT_start'],
1080 1080
 				'DTT_EVT_end'   => $dtt['DTT_EVT_end'],
1081
-				'DTT_reg_limit' => empty( $dtt['DTT_reg_limit'] ) ? EE_INF : $dtt['DTT_reg_limit'],
1081
+				'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? EE_INF : $dtt['DTT_reg_limit'],
1082 1082
 				'DTT_order'     => $row,
1083 1083
 			);
1084 1084
 			//if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1085
-			if ( ! empty( $dtt['DTT_ID'] ) ) {
1085
+			if ( ! empty($dtt['DTT_ID'])) {
1086 1086
 				$DTM = EE_Registry::instance()
1087
-				                  ->load_model( 'Datetime', array( $evtobj->get_timezone() ) )
1088
-				                  ->get_one_by_ID( $dtt['DTT_ID'] );
1089
-				$DTM->set_date_format( $incoming_date_formats[0] );
1090
-				$DTM->set_time_format( $incoming_date_formats[1] );
1091
-				foreach ( $datetime_values as $field => $value ) {
1092
-					$DTM->set( $field, $value );
1087
+				                  ->load_model('Datetime', array($evtobj->get_timezone()))
1088
+				                  ->get_one_by_ID($dtt['DTT_ID']);
1089
+				$DTM->set_date_format($incoming_date_formats[0]);
1090
+				$DTM->set_time_format($incoming_date_formats[1]);
1091
+				foreach ($datetime_values as $field => $value) {
1092
+					$DTM->set($field, $value);
1093 1093
 				}
1094 1094
 				//make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1095
-				$saved_dtts[ $DTM->ID() ] = $DTM;
1095
+				$saved_dtts[$DTM->ID()] = $DTM;
1096 1096
 			} else {
1097
-				$DTM = EE_Registry::instance()->load_class( 'Datetime', array( $datetime_values ), false, false );
1098
-				$DTM->set_date_format( $incoming_date_formats[0] );
1099
-				$DTM->set_time_format( $incoming_date_formats[1] );
1100
-				$DTM->set_timezone( $evtobj->get_timezone() );
1101
-				foreach ( $datetime_values as $field => $value ) {
1102
-					$DTM->set( $field, $value );
1097
+				$DTM = EE_Registry::instance()->load_class('Datetime', array($datetime_values), false, false);
1098
+				$DTM->set_date_format($incoming_date_formats[0]);
1099
+				$DTM->set_time_format($incoming_date_formats[1]);
1100
+				$DTM->set_timezone($evtobj->get_timezone());
1101
+				foreach ($datetime_values as $field => $value) {
1102
+					$DTM->set($field, $value);
1103 1103
 				}
1104 1104
 			}
1105 1105
 			$DTM->save();
1106
-			$DTT = $evtobj->_add_relation_to( $DTM, 'Datetime' );
1106
+			$DTT = $evtobj->_add_relation_to($DTM, 'Datetime');
1107 1107
 			//load DTT helper
1108 1108
 			//before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1109
-			if ( $DTT->get_raw( 'DTT_EVT_start' ) > $DTT->get_raw( 'DTT_EVT_end' ) ) {
1110
-				$DTT->set( 'DTT_EVT_end', $DTT->get( 'DTT_EVT_start' ) );
1111
-				$DTT = EEH_DTT_Helper::date_time_add( $DTT, 'DTT_EVT_end', 'days' );
1109
+			if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) {
1110
+				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start'));
1111
+				$DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days');
1112 1112
 				$DTT->save();
1113 1113
 			}
1114 1114
 			//now we got to make sure we add the new DTT_ID to the $saved_dtts array  because it is possible there was a new one created for the autosave.
@@ -1119,20 +1119,20 @@  discard block
 block discarded – undo
1119 1119
 		}
1120 1120
 		//no dtts get deleted so we don't do any of that logic here.
1121 1121
 		//update tickets next
1122
-		$old_tickets = isset( $data['ticket_IDs'] ) ? explode( ',', $data['ticket_IDs'] ) : array();
1123
-		foreach ( $data['edit_tickets'] as $row => $tkt ) {
1124
-			$incoming_date_formats = array( 'Y-m-d', 'h:i a' );
1122
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : array();
1123
+		foreach ($data['edit_tickets'] as $row => $tkt) {
1124
+			$incoming_date_formats = array('Y-m-d', 'h:i a');
1125 1125
 			$update_prices = false;
1126
-			$ticket_price = isset( $data['edit_prices'][ $row ][1]['PRC_amount'] )
1127
-				? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1126
+			$ticket_price = isset($data['edit_prices'][$row][1]['PRC_amount'])
1127
+				? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
1128 1128
 			// trim inputs to ensure any excess whitespace is removed.
1129
-			$tkt = array_map( 'trim', $tkt );
1130
-			if ( empty( $tkt['TKT_start_date'] ) ) {
1129
+			$tkt = array_map('trim', $tkt);
1130
+			if (empty($tkt['TKT_start_date'])) {
1131 1131
 				//let's use now in the set timezone.
1132
-				$now = new DateTime( 'now', new DateTimeZone( $evtobj->get_timezone() ) );
1133
-				$tkt['TKT_start_date'] = $now->format( $incoming_date_formats[0] . ' ' . $incoming_date_formats[1] );
1132
+				$now = new DateTime('now', new DateTimeZone($evtobj->get_timezone()));
1133
+				$tkt['TKT_start_date'] = $now->format($incoming_date_formats[0].' '.$incoming_date_formats[1]);
1134 1134
 			}
1135
-			if ( empty( $tkt['TKT_end_date'] ) ) {
1135
+			if (empty($tkt['TKT_end_date'])) {
1136 1136
 				//use the start date of the first datetime
1137 1137
 				$dtt = $evtobj->first_datetime();
1138 1138
 				$tkt['TKT_end_date'] = $dtt->start_date_and_time(
@@ -1141,22 +1141,22 @@  discard block
 block discarded – undo
1141 1141
 				);
1142 1142
 			}
1143 1143
 			$TKT_values = array(
1144
-				'TKT_ID'          => ! empty( $tkt['TKT_ID'] ) ? $tkt['TKT_ID'] : null,
1145
-				'TTM_ID'          => ! empty( $tkt['TTM_ID'] ) ? $tkt['TTM_ID'] : 0,
1146
-				'TKT_name'        => ! empty( $tkt['TKT_name'] ) ? $tkt['TKT_name'] : '',
1147
-				'TKT_description' => ! empty( $tkt['TKT_description'] ) ? $tkt['TKT_description'] : '',
1144
+				'TKT_ID'          => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : null,
1145
+				'TTM_ID'          => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
1146
+				'TKT_name'        => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
1147
+				'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
1148 1148
 				'TKT_start_date'  => $tkt['TKT_start_date'],
1149 1149
 				'TKT_end_date'    => $tkt['TKT_end_date'],
1150
-				'TKT_qty'         => ! isset( $tkt['TKT_qty'] ) || $tkt['TKT_qty'] === '' ? EE_INF : $tkt['TKT_qty'],
1151
-				'TKT_uses'        => ! isset( $tkt['TKT_uses'] ) || $tkt['TKT_uses'] === '' ? EE_INF : $tkt['TKT_uses'],
1152
-				'TKT_min'         => empty( $tkt['TKT_min'] ) ? 0 : $tkt['TKT_min'],
1153
-				'TKT_max'         => empty( $tkt['TKT_max'] ) ? EE_INF : $tkt['TKT_max'],
1150
+				'TKT_qty'         => ! isset($tkt['TKT_qty']) || $tkt['TKT_qty'] === '' ? EE_INF : $tkt['TKT_qty'],
1151
+				'TKT_uses'        => ! isset($tkt['TKT_uses']) || $tkt['TKT_uses'] === '' ? EE_INF : $tkt['TKT_uses'],
1152
+				'TKT_min'         => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
1153
+				'TKT_max'         => empty($tkt['TKT_max']) ? EE_INF : $tkt['TKT_max'],
1154 1154
 				'TKT_row'         => $row,
1155
-				'TKT_order'       => isset( $tkt['TKT_order'] ) ? $tkt['TKT_order'] : $row,
1155
+				'TKT_order'       => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
1156 1156
 				'TKT_price'       => $ticket_price,
1157 1157
 			);
1158 1158
 			//if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
1159
-			if ( isset( $tkt['TKT_is_default'] ) && $tkt['TKT_is_default'] ) {
1159
+			if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
1160 1160
 				$TKT_values['TKT_ID'] = 0;
1161 1161
 				$TKT_values['TKT_is_default'] = 0;
1162 1162
 				$TKT_values['TKT_price'] = $ticket_price;
@@ -1165,110 +1165,110 @@  discard block
 block discarded – undo
1165 1165
 			//if we have a TKT_ID then we need to get that existing TKT_obj and update it
1166 1166
 			//we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1167 1167
 			//keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1168
-			if ( ! empty( $tkt['TKT_ID'] ) ) {
1168
+			if ( ! empty($tkt['TKT_ID'])) {
1169 1169
 				$TKT = EE_Registry::instance()
1170
-						->load_model( 'Ticket', array( $evtobj->get_timezone() ) )
1171
-						->get_one_by_ID( $tkt['TKT_ID'] );
1172
-				if ( $TKT instanceof EE_Ticket ) {
1170
+						->load_model('Ticket', array($evtobj->get_timezone()))
1171
+						->get_one_by_ID($tkt['TKT_ID']);
1172
+				if ($TKT instanceof EE_Ticket) {
1173 1173
 					$ticket_sold = $TKT->count_related(
1174 1174
 						'Registration',
1175 1175
 						array(
1176 1176
 							array(
1177 1177
 								'STS_ID' => array(
1178 1178
 									'NOT IN',
1179
-									array( EEM_Registration::status_id_incomplete ),
1179
+									array(EEM_Registration::status_id_incomplete),
1180 1180
 								),
1181 1181
 							),
1182 1182
 						)
1183 1183
 					) > 0 ? true : false;
1184 1184
 					//let's just check the total price for the existing ticket and determine if it matches the new total price.  if they are different then we create a new ticket (if tkts sold) if they aren't different then we go ahead and modify existing ticket.
1185
-					$create_new_TKT = $ticket_sold && $ticket_price != $TKT->get( 'TKT_price' )
1185
+					$create_new_TKT = $ticket_sold && $ticket_price != $TKT->get('TKT_price')
1186 1186
 					                  && ! $TKT->get(
1187 1187
 						'TKT_deleted'
1188 1188
 					) ? true : false;
1189
-					$TKT->set_date_format( $incoming_date_formats[0] );
1190
-					$TKT->set_time_format( $incoming_date_formats[1] );
1189
+					$TKT->set_date_format($incoming_date_formats[0]);
1190
+					$TKT->set_time_format($incoming_date_formats[1]);
1191 1191
 					//set new values
1192
-					foreach ( $TKT_values as $field => $value ) {
1193
-						if ( $field == 'TKT_qty' ) {
1194
-							$TKT->set_qty( $value );
1192
+					foreach ($TKT_values as $field => $value) {
1193
+						if ($field == 'TKT_qty') {
1194
+							$TKT->set_qty($value);
1195 1195
 						} else {
1196
-							$TKT->set( $field, $value );
1196
+							$TKT->set($field, $value);
1197 1197
 						}
1198 1198
 					}
1199 1199
 					//if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
1200
-					if ( $create_new_TKT ) {
1200
+					if ($create_new_TKT) {
1201 1201
 						//archive the old ticket first
1202
-						$TKT->set( 'TKT_deleted', 1 );
1202
+						$TKT->set('TKT_deleted', 1);
1203 1203
 						$TKT->save();
1204 1204
 						//make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1205
-						$saved_tickets[ $TKT->ID() ] = $TKT;
1205
+						$saved_tickets[$TKT->ID()] = $TKT;
1206 1206
 						//create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1207 1207
 						$TKT = clone $TKT;
1208
-						$TKT->set( 'TKT_ID', 0 );
1209
-						$TKT->set( 'TKT_deleted', 0 );
1210
-						$TKT->set( 'TKT_price', $ticket_price );
1211
-						$TKT->set( 'TKT_sold', 0 );
1208
+						$TKT->set('TKT_ID', 0);
1209
+						$TKT->set('TKT_deleted', 0);
1210
+						$TKT->set('TKT_price', $ticket_price);
1211
+						$TKT->set('TKT_sold', 0);
1212 1212
 						//now we need to make sure that $new prices are created as well and attached to new ticket.
1213 1213
 						$update_prices = true;
1214 1214
 					}
1215 1215
 					//make sure price is set if it hasn't been already
1216
-					$TKT->set( 'TKT_price', $ticket_price );
1216
+					$TKT->set('TKT_price', $ticket_price);
1217 1217
 				}
1218 1218
 			} else {
1219 1219
 				//no TKT_id so a new TKT
1220 1220
 				$TKT_values['TKT_price'] = $ticket_price;
1221
-				$TKT = EE_Registry::instance()->load_class( 'Ticket', array( $TKT_values ), false, false );
1222
-				if ( $TKT instanceof EE_Ticket ) {
1221
+				$TKT = EE_Registry::instance()->load_class('Ticket', array($TKT_values), false, false);
1222
+				if ($TKT instanceof EE_Ticket) {
1223 1223
 					//need to reset values to properly account for the date formats
1224
-					$TKT->set_date_format( $incoming_date_formats[0] );
1225
-					$TKT->set_time_format( $incoming_date_formats[1] );
1226
-					$TKT->set_timezone( $evtobj->get_timezone() );
1224
+					$TKT->set_date_format($incoming_date_formats[0]);
1225
+					$TKT->set_time_format($incoming_date_formats[1]);
1226
+					$TKT->set_timezone($evtobj->get_timezone());
1227 1227
 					//set new values
1228
-					foreach ( $TKT_values as $field => $value ) {
1229
-						if ( $field == 'TKT_qty' ) {
1230
-							$TKT->set_qty( $value );
1228
+					foreach ($TKT_values as $field => $value) {
1229
+						if ($field == 'TKT_qty') {
1230
+							$TKT->set_qty($value);
1231 1231
 						} else {
1232
-							$TKT->set( $field, $value );
1232
+							$TKT->set($field, $value);
1233 1233
 						}
1234 1234
 					}
1235 1235
 					$update_prices = true;
1236 1236
 				}
1237 1237
 			}
1238 1238
 			// cap ticket qty by datetime reg limits
1239
-			$TKT->set_qty( min( $TKT->qty(), $TKT->qty( 'reg_limit' ) ) );
1239
+			$TKT->set_qty(min($TKT->qty(), $TKT->qty('reg_limit')));
1240 1240
 			//update ticket.
1241 1241
 			$TKT->save();
1242 1242
 			//before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1243
-			if ( $TKT->get_raw( 'TKT_start_date' ) > $TKT->get_raw( 'TKT_end_date' ) ) {
1244
-				$TKT->set( 'TKT_end_date', $TKT->get( 'TKT_start_date' ) );
1245
-				$TKT = EEH_DTT_Helper::date_time_add( $TKT, 'TKT_end_date', 'days' );
1243
+			if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1244
+				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1245
+				$TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1246 1246
 				$TKT->save();
1247 1247
 			}
1248 1248
 			//initially let's add the ticket to the dtt
1249
-			$saved_dtt->_add_relation_to( $TKT, 'Ticket' );
1250
-			$saved_tickets[ $TKT->ID() ] = $TKT;
1249
+			$saved_dtt->_add_relation_to($TKT, 'Ticket');
1250
+			$saved_tickets[$TKT->ID()] = $TKT;
1251 1251
 			//add prices to ticket
1252
-			$this->_add_prices_to_ticket( $data['edit_prices'][ $row ], $TKT, $update_prices );
1252
+			$this->_add_prices_to_ticket($data['edit_prices'][$row], $TKT, $update_prices);
1253 1253
 		}
1254 1254
 		//however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1255
-		$old_tickets = isset( $old_tickets[0] ) && $old_tickets[0] == '' ? array() : $old_tickets;
1256
-		$tickets_removed = array_diff( $old_tickets, array_keys( $saved_tickets ) );
1257
-		foreach ( $tickets_removed as $id ) {
1258
-			$id = absint( $id );
1255
+		$old_tickets = isset($old_tickets[0]) && $old_tickets[0] == '' ? array() : $old_tickets;
1256
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1257
+		foreach ($tickets_removed as $id) {
1258
+			$id = absint($id);
1259 1259
 			//get the ticket for this id
1260
-			$tkt_to_remove = EE_Registry::instance()->load_model( 'Ticket' )->get_one_by_ID( $id );
1260
+			$tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
1261 1261
 			//need to get all the related datetimes on this ticket and remove from every single one of them (remember this process can ONLY kick off if there are NO tkts_sold)
1262
-			$dtts = $tkt_to_remove->get_many_related( 'Datetime' );
1263
-			foreach ( $dtts as $dtt ) {
1264
-				$tkt_to_remove->_remove_relation_to( $dtt, 'Datetime' );
1262
+			$dtts = $tkt_to_remove->get_many_related('Datetime');
1263
+			foreach ($dtts as $dtt) {
1264
+				$tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1265 1265
 			}
1266 1266
 			//need to do the same for prices (except these prices can also be deleted because again, tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
1267
-			$tkt_to_remove->delete_related_permanently( 'Price' );
1267
+			$tkt_to_remove->delete_related_permanently('Price');
1268 1268
 			//finally let's delete this ticket (which should not be blocked at this point b/c we've removed all our relationships)
1269 1269
 			$tkt_to_remove->delete_permanently();
1270 1270
 		}
1271
-		return array( $saved_dtt, $saved_tickets );
1271
+		return array($saved_dtt, $saved_tickets);
1272 1272
 	}
1273 1273
 
1274 1274
 
@@ -1285,29 +1285,29 @@  discard block
 block discarded – undo
1285 1285
 	 * @param bool      $new_prices Whether attach existing incoming prices or create new ones.
1286 1286
 	 * @return  void
1287 1287
 	 */
1288
-	private function _add_prices_to_ticket( $prices, EE_Ticket $ticket, $new_prices = false ) {
1289
-		foreach ( $prices as $row => $prc ) {
1288
+	private function _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = false) {
1289
+		foreach ($prices as $row => $prc) {
1290 1290
 			$PRC_values = array(
1291
-				'PRC_ID'         => ! empty( $prc['PRC_ID'] ) ? $prc['PRC_ID'] : null,
1292
-				'PRT_ID'         => ! empty( $prc['PRT_ID'] ) ? $prc['PRT_ID'] : null,
1293
-				'PRC_amount'     => ! empty( $prc['PRC_amount'] ) ? $prc['PRC_amount'] : 0,
1294
-				'PRC_name'       => ! empty( $prc['PRC_name'] ) ? $prc['PRC_name'] : '',
1295
-				'PRC_desc'       => ! empty( $prc['PRC_desc'] ) ? $prc['PRC_desc'] : '',
1291
+				'PRC_ID'         => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : null,
1292
+				'PRT_ID'         => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : null,
1293
+				'PRC_amount'     => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1294
+				'PRC_name'       => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1295
+				'PRC_desc'       => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1296 1296
 				'PRC_is_default' => 0, //make sure prices are NOT set as default from this context
1297 1297
 				'PRC_order'      => $row,
1298 1298
 			);
1299
-			if ( $new_prices || empty( $PRC_values['PRC_ID'] ) ) {
1299
+			if ($new_prices || empty($PRC_values['PRC_ID'])) {
1300 1300
 				$PRC_values['PRC_ID'] = 0;
1301
-				$PRC = EE_Registry::instance()->load_class( 'Price', array( $PRC_values ), false, false );
1301
+				$PRC = EE_Registry::instance()->load_class('Price', array($PRC_values), false, false);
1302 1302
 			} else {
1303
-				$PRC = EE_Registry::instance()->load_model( 'Price' )->get_one_by_ID( $prc['PRC_ID'] );
1303
+				$PRC = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
1304 1304
 				//update this price with new values
1305
-				foreach ( $PRC_values as $field => $newprc ) {
1306
-					$PRC->set( $field, $newprc );
1305
+				foreach ($PRC_values as $field => $newprc) {
1306
+					$PRC->set($field, $newprc);
1307 1307
 				}
1308 1308
 				$PRC->save();
1309 1309
 			}
1310
-			$ticket->_add_relation_to( $PRC, 'Price' );
1310
+			$ticket->_add_relation_to($PRC, 'Price');
1311 1311
 		}
1312 1312
 	}
1313 1313
 
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 	private function _generate_publish_box_extra_content() {
1340 1340
 		//load formatter helper
1341 1341
 		//args for getting related registrations
1342
-		$approved_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved ) );
1342
+		$approved_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved));
1343 1343
 		$not_approved_query_args = array(
1344 1344
 			array(
1345 1345
 				'REG_deleted' => 0,
@@ -1410,7 +1410,7 @@  discard block
 block discarded – undo
1410 1410
 		$publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1411 1411
 		// load template
1412 1412
 		EEH_Template::display_template(
1413
-			EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1413
+			EVENTS_TEMPLATE_PATH.'event_publish_box_extras.template.php',
1414 1414
 			$publish_box_extra_args
1415 1415
 		);
1416 1416
 	}
@@ -1444,16 +1444,16 @@  discard block
 block discarded – undo
1444 1444
 		$this->verify_cpt_object();
1445 1445
 		add_meta_box(
1446 1446
 			'espresso_event_editor_tickets',
1447
-			esc_html__( 'Event Datetime & Ticket', 'event_espresso' ),
1448
-			array( $this, 'ticket_metabox' ),
1447
+			esc_html__('Event Datetime & Ticket', 'event_espresso'),
1448
+			array($this, 'ticket_metabox'),
1449 1449
 			$this->page_slug,
1450 1450
 			'normal',
1451 1451
 			'high'
1452 1452
 		);
1453 1453
 		add_meta_box(
1454 1454
 			'espresso_event_editor_event_options',
1455
-			esc_html__( 'Event Registration Options', 'event_espresso' ),
1456
-			array( $this, 'registration_options_meta_box' ),
1455
+			esc_html__('Event Registration Options', 'event_espresso'),
1456
+			array($this, 'registration_options_meta_box'),
1457 1457
 			$this->page_slug,
1458 1458
 			'side',
1459 1459
 			'default'
@@ -1481,65 +1481,65 @@  discard block
 block discarded – undo
1481 1481
 			'trash_icon'               => 'ee-lock-icon',
1482 1482
 			'disabled'                 => '',
1483 1483
 		);
1484
-		$event_id = is_object( $this->_cpt_model_obj ) ? $this->_cpt_model_obj->ID() : null;
1485
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1484
+		$event_id = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : null;
1485
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1486 1486
 		/**
1487 1487
 		 * 1. Start with retrieving Datetimes
1488 1488
 		 * 2. Fore each datetime get related tickets
1489 1489
 		 * 3. For each ticket get related prices
1490 1490
 		 */
1491
-		$times = EE_Registry::instance()->load_model( 'Datetime' )->get_all_event_dates( $event_id );
1491
+		$times = EE_Registry::instance()->load_model('Datetime')->get_all_event_dates($event_id);
1492 1492
 		/** @type EE_Datetime $first_datetime */
1493
-		$first_datetime = reset( $times );
1493
+		$first_datetime = reset($times);
1494 1494
 		//do we get related tickets?
1495
-		if ( $first_datetime instanceof EE_Datetime
1495
+		if ($first_datetime instanceof EE_Datetime
1496 1496
 		     && $first_datetime->ID() !== 0
1497 1497
 		) {
1498
-			$existing_datetime_ids[] = $first_datetime->get( 'DTT_ID' );
1498
+			$existing_datetime_ids[] = $first_datetime->get('DTT_ID');
1499 1499
 			$template_args['time'] = $first_datetime;
1500 1500
 			$related_tickets = $first_datetime->tickets(
1501 1501
 				array(
1502
-					array( 'OR' => array( 'TKT_deleted' => 1, 'TKT_deleted*' => 0 ) ),
1502
+					array('OR' => array('TKT_deleted' => 1, 'TKT_deleted*' => 0)),
1503 1503
 					'default_where_conditions' => 'none',
1504 1504
 				)
1505 1505
 			);
1506
-			if ( ! empty( $related_tickets ) ) {
1507
-				$template_args['total_ticket_rows'] = count( $related_tickets );
1506
+			if ( ! empty($related_tickets)) {
1507
+				$template_args['total_ticket_rows'] = count($related_tickets);
1508 1508
 				$row = 0;
1509
-				foreach ( $related_tickets as $ticket ) {
1510
-					$existing_ticket_ids[] = $ticket->get( 'TKT_ID' );
1511
-					$template_args['ticket_rows'] .= $this->_get_ticket_row( $ticket, false, $row );
1509
+				foreach ($related_tickets as $ticket) {
1510
+					$existing_ticket_ids[] = $ticket->get('TKT_ID');
1511
+					$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, false, $row);
1512 1512
 					$row++;
1513 1513
 				}
1514 1514
 			} else {
1515 1515
 				$template_args['total_ticket_rows'] = 1;
1516 1516
 				/** @type EE_Ticket $ticket */
1517
-				$ticket = EE_Registry::instance()->load_model( 'Ticket' )->create_default_object();
1518
-				$template_args['ticket_rows'] .= $this->_get_ticket_row( $ticket );
1517
+				$ticket = EE_Registry::instance()->load_model('Ticket')->create_default_object();
1518
+				$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1519 1519
 			}
1520 1520
 		} else {
1521 1521
 			$template_args['time'] = $times[0];
1522 1522
 			/** @type EE_Ticket $ticket */
1523
-			$ticket = EE_Registry::instance()->load_model( 'Ticket' )->get_all_default_tickets();
1524
-			$template_args['ticket_rows'] .= $this->_get_ticket_row( $ticket[1] );
1523
+			$ticket = EE_Registry::instance()->load_model('Ticket')->get_all_default_tickets();
1524
+			$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket[1]);
1525 1525
 			// NOTE: we're just sending the first default row
1526 1526
 			// (decaf can't manage default tickets so this should be sufficient);
1527 1527
 		}
1528 1528
 		$template_args['event_datetime_help_link'] = $this->_get_help_tab_link(
1529 1529
 			'event_editor_event_datetimes_help_tab'
1530 1530
 		);
1531
-		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link( 'ticket_options_info' );
1532
-		$template_args['existing_datetime_ids'] = implode( ',', $existing_datetime_ids );
1533
-		$template_args['existing_ticket_ids'] = implode( ',', $existing_ticket_ids );
1531
+		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1532
+		$template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1533
+		$template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1534 1534
 		$template_args['ticket_js_structure'] = $this->_get_ticket_row(
1535
-			EE_Registry::instance()->load_model( 'Ticket' )->create_default_object(),
1535
+			EE_Registry::instance()->load_model('Ticket')->create_default_object(),
1536 1536
 			true
1537 1537
 		);
1538 1538
 		$template = apply_filters(
1539 1539
 			'FHEE__Events_Admin_Page__ticket_metabox__template',
1540
-			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1540
+			EVENTS_TEMPLATE_PATH.'event_tickets_metabox_main.template.php'
1541 1541
 		);
1542
-		EEH_Template::display_template( $template, $template_args );
1542
+		EEH_Template::display_template($template, $template_args);
1543 1543
 	}
1544 1544
 
1545 1545
 
@@ -1553,74 +1553,74 @@  discard block
 block discarded – undo
1553 1553
 	 * @param int        $row
1554 1554
 	 * @return string generated html for the ticket row.
1555 1555
 	 */
1556
-	private function _get_ticket_row( $ticket, $skeleton = false, $row = 0 ) {
1556
+	private function _get_ticket_row($ticket, $skeleton = false, $row = 0) {
1557 1557
 		$template_args = array(
1558
-			'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1558
+			'tkt_status_class'    => ' tkt-status-'.$ticket->ticket_status(),
1559 1559
 			'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1560 1560
 				: '',
1561 1561
 			'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
1562
-			'TKT_ID'              => $ticket->get( 'TKT_ID' ),
1563
-			'TKT_name'            => $ticket->get( 'TKT_name' ),
1564
-			'TKT_start_date'      => $skeleton ? '' : $ticket->get_date( 'TKT_start_date', 'Y-m-d h:i a' ),
1565
-			'TKT_end_date'        => $skeleton ? '' : $ticket->get_date( 'TKT_end_date', 'Y-m-d h:i a' ),
1566
-			'TKT_is_default'      => $ticket->get( 'TKT_is_default' ),
1567
-			'TKT_qty'             => $ticket->get_pretty( 'TKT_qty', 'input' ),
1562
+			'TKT_ID'              => $ticket->get('TKT_ID'),
1563
+			'TKT_name'            => $ticket->get('TKT_name'),
1564
+			'TKT_start_date'      => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1565
+			'TKT_end_date'        => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1566
+			'TKT_is_default'      => $ticket->get('TKT_is_default'),
1567
+			'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1568 1568
 			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1569
-			'TKT_sold'            => $skeleton ? 0 : $ticket->get( 'TKT_sold' ),
1570
-			'trash_icon'          => ( $skeleton || ( ! empty( $ticket ) && ! $ticket->get( 'TKT_deleted' ) ) )
1571
-			                         && ( ! empty( $ticket ) && $ticket->get( 'TKT_sold' ) === 0 )
1569
+			'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1570
+			'trash_icon'          => ($skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')))
1571
+			                         && ( ! empty($ticket) && $ticket->get('TKT_sold') === 0)
1572 1572
 				? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1573
-			'disabled'            => $skeleton || ( ! empty( $ticket ) && ! $ticket->get( 'TKT_deleted' ) ) ? ''
1573
+			'disabled'            => $skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1574 1574
 				: ' disabled=disabled',
1575 1575
 		);
1576 1576
 		$price = $ticket->ID() !== 0
1577
-			? $ticket->get_first_related( 'Price', array( 'default_where_conditions' => 'none' ) )
1578
-			: EE_Registry::instance()->load_model( 'Price' )->create_default_object();
1577
+			? $ticket->get_first_related('Price', array('default_where_conditions' => 'none'))
1578
+			: EE_Registry::instance()->load_model('Price')->create_default_object();
1579 1579
 		$price_args = array(
1580 1580
 			'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1581
-			'PRC_amount'            => $price->get( 'PRC_amount' ),
1582
-			'PRT_ID'                => $price->get( 'PRT_ID' ),
1583
-			'PRC_ID'                => $price->get( 'PRC_ID' ),
1584
-			'PRC_is_default'        => $price->get( 'PRC_is_default' ),
1581
+			'PRC_amount'            => $price->get('PRC_amount'),
1582
+			'PRT_ID'                => $price->get('PRT_ID'),
1583
+			'PRC_ID'                => $price->get('PRC_ID'),
1584
+			'PRC_is_default'        => $price->get('PRC_is_default'),
1585 1585
 		);
1586 1586
 		//make sure we have default start and end dates if skeleton
1587 1587
 		//handle rows that should NOT be empty
1588
-		if ( empty( $template_args['TKT_start_date'] ) ) {
1588
+		if (empty($template_args['TKT_start_date'])) {
1589 1589
 			//if empty then the start date will be now.
1590
-			$template_args['TKT_start_date'] = date( 'Y-m-d h:i a', current_time( 'timestamp' ) );
1590
+			$template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1591 1591
 		}
1592
-		if ( empty( $template_args['TKT_end_date'] ) ) {
1592
+		if (empty($template_args['TKT_end_date'])) {
1593 1593
 			//get the earliest datetime (if present);
1594 1594
 			$earliest_dtt = $this->_cpt_model_obj->ID() > 0
1595 1595
 				? $this->_cpt_model_obj->get_first_related(
1596 1596
 					'Datetime',
1597
-					array( 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) )
1597
+					array('order_by' => array('DTT_EVT_start' => 'ASC'))
1598 1598
 				)
1599 1599
 				: null;
1600
-			if ( ! empty( $earliest_dtt ) ) {
1601
-				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime( 'DTT_EVT_start', 'Y-m-d', 'h:i a' );
1600
+			if ( ! empty($earliest_dtt)) {
1601
+				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1602 1602
 			} else {
1603 1603
 				$template_args['TKT_end_date'] = date(
1604 1604
 					'Y-m-d h:i a',
1605
-					mktime( 0, 0, 0, date( "m" ), date( "d" ) + 7, date( "Y" ) )
1605
+					mktime(0, 0, 0, date("m"), date("d") + 7, date("Y"))
1606 1606
 				);
1607 1607
 			}
1608 1608
 		}
1609
-		$template_args = array_merge( $template_args, $price_args );
1609
+		$template_args = array_merge($template_args, $price_args);
1610 1610
 		$template = apply_filters(
1611 1611
 			'FHEE__Events_Admin_Page__get_ticket_row__template',
1612
-			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1612
+			EVENTS_TEMPLATE_PATH.'event_tickets_metabox_ticket_row.template.php',
1613 1613
 			$ticket
1614 1614
 		);
1615
-		return EEH_Template::display_template( $template, $template_args, true );
1615
+		return EEH_Template::display_template($template, $template_args, true);
1616 1616
 	}
1617 1617
 
1618 1618
 
1619 1619
 
1620 1620
 	public function registration_options_meta_box() {
1621 1621
 		$yes_no_values = array(
1622
-			array( 'id' => true, 'text' => esc_html__( 'Yes', 'event_espresso' ) ),
1623
-			array( 'id' => false, 'text' => esc_html__( 'No', 'event_espresso' ) ),
1622
+			array('id' => true, 'text' => esc_html__('Yes', 'event_espresso')),
1623
+			array('id' => false, 'text' => esc_html__('No', 'event_espresso')),
1624 1624
 		);
1625 1625
 		$default_reg_status_values = EEM_Registration::reg_status_array(
1626 1626
 			array(
@@ -1632,7 +1632,7 @@  discard block
 block discarded – undo
1632 1632
 		);
1633 1633
 		//$template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1634 1634
 		$template_args['_event'] = $this->_cpt_model_obj;
1635
-		$template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status( false );
1635
+		$template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(false);
1636 1636
 		$template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
1637 1637
 		$template_args['default_registration_status'] = EEH_Form_Fields::select_input(
1638 1638
 			'default_reg_status',
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
 			$default_reg_status_values
1661 1661
 		);
1662 1662
 		EEH_Template::display_template(
1663
-			EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1663
+			EVENTS_TEMPLATE_PATH.'event_registration_options.template.php',
1664 1664
 			$template_args
1665 1665
 		);
1666 1666
 	}
@@ -1679,97 +1679,97 @@  discard block
 block discarded – undo
1679 1679
 	 *                           that match the given _view and paging parameters.
1680 1680
 	 * @return array an array of event objects.
1681 1681
 	 */
1682
-	public function get_events( $per_page = 10, $current_page = 1, $count = false ) {
1682
+	public function get_events($per_page = 10, $current_page = 1, $count = false) {
1683 1683
 		$EEME = $this->_event_model();
1684
-		$offset = ( $current_page - 1 ) * $per_page;
1685
-		$limit = $count ? null : $offset . ',' . $per_page;
1686
-		$orderby = isset( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : 'EVT_ID';
1687
-		$order = isset( $this->_req_data['order'] ) ? $this->_req_data['order'] : "DESC";
1688
-		if ( isset( $this->_req_data['month_range'] ) ) {
1689
-			$pieces = explode( ' ', $this->_req_data['month_range'], 3 );
1690
-			$month_r = ! empty( $pieces[0] ) ? date( 'm', strtotime( $pieces[0] ) ) : '';
1691
-			$year_r = ! empty( $pieces[1] ) ? $pieces[1] : '';
1684
+		$offset = ($current_page - 1) * $per_page;
1685
+		$limit = $count ? null : $offset.','.$per_page;
1686
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1687
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : "DESC";
1688
+		if (isset($this->_req_data['month_range'])) {
1689
+			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1690
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
1691
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1692 1692
 		}
1693 1693
 		$where = array();
1694
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : null;
1694
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1695 1695
 		//determine what post_status our condition will have for the query.
1696
-		switch ( $status ) {
1696
+		switch ($status) {
1697 1697
 			case 'month' :
1698 1698
 			case 'today' :
1699 1699
 			case null :
1700 1700
 			case 'all' :
1701 1701
 				break;
1702 1702
 			case 'draft' :
1703
-				$where['status'] = array( 'IN', array( 'draft', 'auto-draft' ) );
1703
+				$where['status'] = array('IN', array('draft', 'auto-draft'));
1704 1704
 				break;
1705 1705
 			default :
1706 1706
 				$where['status'] = $status;
1707 1707
 		}
1708 1708
 		//categories?
1709
-		$category = isset( $this->_req_data['EVT_CAT'] ) && $this->_req_data['EVT_CAT'] > 0
1709
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1710 1710
 			? $this->_req_data['EVT_CAT'] : null;
1711
-		if ( ! empty ( $category ) ) {
1711
+		if ( ! empty ($category)) {
1712 1712
 			$where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories';
1713 1713
 			$where['Term_Taxonomy.term_id'] = $category;
1714 1714
 		}
1715 1715
 		//date where conditions
1716
-		$start_formats = EEM_Datetime::instance()->get_formats_for( 'DTT_EVT_start' );
1717
-		if ( isset( $this->_req_data['month_range'] ) && $this->_req_data['month_range'] != '' ) {
1716
+		$start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1717
+		if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] != '') {
1718 1718
 			$DateTime = new DateTime(
1719
-				$year_r . '-' . $month_r . '-01 00:00:00',
1720
-				new DateTimeZone( EEM_Datetime::instance()->get_timezone() )
1719
+				$year_r.'-'.$month_r.'-01 00:00:00',
1720
+				new DateTimeZone(EEM_Datetime::instance()->get_timezone())
1721 1721
 			);
1722
-			$start = $DateTime->format( implode( ' ', $start_formats ) );
1723
-			$end = $DateTime->setDate( $year_r, $month_r, $DateTime->format( 't' ) )->setTime( 23, 59, 59 )->format(
1724
-				implode( ' ', $start_formats )
1722
+			$start = $DateTime->format(implode(' ', $start_formats));
1723
+			$end = $DateTime->setDate($year_r, $month_r, $DateTime->format('t'))->setTime(23, 59, 59)->format(
1724
+				implode(' ', $start_formats)
1725 1725
 			);
1726
-			$where['Datetime.DTT_EVT_start'] = array( 'BETWEEN', array( $start, $end ) );
1727
-		} else if ( isset( $this->_req_data['status'] ) && $this->_req_data['status'] == 'today' ) {
1728
-			$DateTime = new DateTime( 'now', new DateTimeZone( EEM_Event::instance()->get_timezone() ) );
1729
-			$start = $DateTime->setTime( 0, 0, 0 )->format( implode( ' ', $start_formats ) );
1730
-			$end = $DateTime->setTime( 23, 59, 59 )->format( implode( ' ', $start_formats ) );
1731
-			$where['Datetime.DTT_EVT_start'] = array( 'BETWEEN', array( $start, $end ) );
1732
-		} else if ( isset( $this->_req_data['status'] ) && $this->_req_data['status'] == 'month' ) {
1733
-			$now = date( 'Y-m-01' );
1734
-			$DateTime = new DateTime( $now, new DateTimeZone( EEM_Event::instance()->get_timezone() ) );
1735
-			$start = $DateTime->setTime( 0, 0, 0 )->format( implode( ' ', $start_formats ) );
1736
-			$end = $DateTime->setDate( date( 'Y' ), date( 'm' ), $DateTime->format( 't' ) )
1737
-			                ->setTime( 23, 59, 59 )
1738
-			                ->format( implode( ' ', $start_formats ) );
1739
-			$where['Datetime.DTT_EVT_start'] = array( 'BETWEEN', array( $start, $end ) );
1726
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1727
+		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'today') {
1728
+			$DateTime = new DateTime('now', new DateTimeZone(EEM_Event::instance()->get_timezone()));
1729
+			$start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1730
+			$end = $DateTime->setTime(23, 59, 59)->format(implode(' ', $start_formats));
1731
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1732
+		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'month') {
1733
+			$now = date('Y-m-01');
1734
+			$DateTime = new DateTime($now, new DateTimeZone(EEM_Event::instance()->get_timezone()));
1735
+			$start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1736
+			$end = $DateTime->setDate(date('Y'), date('m'), $DateTime->format('t'))
1737
+			                ->setTime(23, 59, 59)
1738
+			                ->format(implode(' ', $start_formats));
1739
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1740 1740
 		}
1741
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1741
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1742 1742
 			$where['EVT_wp_user'] = get_current_user_id();
1743 1743
 		} else {
1744
-			if ( ! isset( $where['status'] ) ) {
1745
-				if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events' ) ) {
1744
+			if ( ! isset($where['status'])) {
1745
+				if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
1746 1746
 					$where['OR'] = array(
1747
-						'status*restrict_private' => array( '!=', 'private' ),
1747
+						'status*restrict_private' => array('!=', 'private'),
1748 1748
 						'AND'                     => array(
1749
-							'status*inclusive' => array( '=', 'private' ),
1749
+							'status*inclusive' => array('=', 'private'),
1750 1750
 							'EVT_wp_user'      => get_current_user_id(),
1751 1751
 						),
1752 1752
 					);
1753 1753
 				}
1754 1754
 			}
1755 1755
 		}
1756
-		if ( isset( $this->_req_data['EVT_wp_user'] ) ) {
1757
-			if ( $this->_req_data['EVT_wp_user'] != get_current_user_id()
1758
-			     && EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' )
1756
+		if (isset($this->_req_data['EVT_wp_user'])) {
1757
+			if ($this->_req_data['EVT_wp_user'] != get_current_user_id()
1758
+			     && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')
1759 1759
 			) {
1760 1760
 				$where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1761 1761
 			}
1762 1762
 		}
1763 1763
 		//search query handling
1764
-		if ( isset( $this->_req_data['s'] ) ) {
1765
-			$search_string = '%' . $this->_req_data['s'] . '%';
1764
+		if (isset($this->_req_data['s'])) {
1765
+			$search_string = '%'.$this->_req_data['s'].'%';
1766 1766
 			$where['OR'] = array(
1767
-				'EVT_name'       => array( 'LIKE', $search_string ),
1768
-				'EVT_desc'       => array( 'LIKE', $search_string ),
1769
-				'EVT_short_desc' => array( 'LIKE', $search_string ),
1767
+				'EVT_name'       => array('LIKE', $search_string),
1768
+				'EVT_desc'       => array('LIKE', $search_string),
1769
+				'EVT_short_desc' => array('LIKE', $search_string),
1770 1770
 			);
1771 1771
 		}
1772
-		$where = apply_filters( 'FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data );
1772
+		$where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
1773 1773
 		$query_params = apply_filters(
1774 1774
 			'FHEE__Events_Admin_Page__get_events__query_params',
1775 1775
 			array(
@@ -1782,23 +1782,23 @@  discard block
 block discarded – undo
1782 1782
 			$this->_req_data
1783 1783
 		);
1784 1784
 		//let's first check if we have special requests coming in.
1785
-		if ( isset( $this->_req_data['active_status'] ) ) {
1786
-			switch ( $this->_req_data['active_status'] ) {
1785
+		if (isset($this->_req_data['active_status'])) {
1786
+			switch ($this->_req_data['active_status']) {
1787 1787
 				case 'upcoming' :
1788
-					return $EEME->get_upcoming_events( $query_params, $count );
1788
+					return $EEME->get_upcoming_events($query_params, $count);
1789 1789
 					break;
1790 1790
 				case 'expired' :
1791
-					return $EEME->get_expired_events( $query_params, $count );
1791
+					return $EEME->get_expired_events($query_params, $count);
1792 1792
 					break;
1793 1793
 				case 'active' :
1794
-					return $EEME->get_active_events( $query_params, $count );
1794
+					return $EEME->get_active_events($query_params, $count);
1795 1795
 					break;
1796 1796
 				case 'inactive' :
1797
-					return $EEME->get_inactive_events( $query_params, $count );
1797
+					return $EEME->get_inactive_events($query_params, $count);
1798 1798
 					break;
1799 1799
 			}
1800 1800
 		}
1801
-		$events = $count ? $EEME->count( array( $where ), 'EVT_ID', true ) : $EEME->get_all( $query_params );
1801
+		$events = $count ? $EEME->count(array($where), 'EVT_ID', true) : $EEME->get_all($query_params);
1802 1802
 		return $events;
1803 1803
 	}
1804 1804
 
@@ -1809,9 +1809,9 @@  discard block
 block discarded – undo
1809 1809
 	 *
1810 1810
 	 * @param string $post_id
1811 1811
 	 */
1812
-	public function trash_cpt_item( $post_id ) {
1812
+	public function trash_cpt_item($post_id) {
1813 1813
 		$this->_req_data['EVT_ID'] = $post_id;
1814
-		$this->_trash_or_restore_event( 'trash', false );
1814
+		$this->_trash_or_restore_event('trash', false);
1815 1815
 	}
1816 1816
 
1817 1817
 
@@ -1819,9 +1819,9 @@  discard block
 block discarded – undo
1819 1819
 	/**
1820 1820
 	 * @param string $post_id
1821 1821
 	 */
1822
-	public function restore_cpt_item( $post_id ) {
1822
+	public function restore_cpt_item($post_id) {
1823 1823
 		$this->_req_data['EVT_ID'] = $post_id;
1824
-		$this->_trash_or_restore_event( 'draft', false );
1824
+		$this->_trash_or_restore_event('draft', false);
1825 1825
 	}
1826 1826
 
1827 1827
 
@@ -1829,9 +1829,9 @@  discard block
 block discarded – undo
1829 1829
 	/**
1830 1830
 	 * @param string $post_id
1831 1831
 	 */
1832
-	public function delete_cpt_item( $post_id ) {
1832
+	public function delete_cpt_item($post_id) {
1833 1833
 		$this->_req_data['EVT_ID'] = $post_id;
1834
-		$this->_delete_event( false );
1834
+		$this->_delete_event(false);
1835 1835
 	}
1836 1836
 
1837 1837
 
@@ -1843,23 +1843,23 @@  discard block
 block discarded – undo
1843 1843
 	 * @param  string $event_status
1844 1844
 	 * @param bool    $redirect_after
1845 1845
 	 */
1846
-	protected function _trash_or_restore_event( $event_status = 'trash', $redirect_after = true ) {
1846
+	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = true) {
1847 1847
 		//determine the event id and set to array.
1848
-		$EVT_ID = isset( $this->_req_data['EVT_ID'] ) ? absint( $this->_req_data['EVT_ID'] ) : false;
1848
+		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : false;
1849 1849
 		// loop thru events
1850
-		if ( $EVT_ID ) {
1850
+		if ($EVT_ID) {
1851 1851
 			// clean status
1852
-			$event_status = sanitize_key( $event_status );
1852
+			$event_status = sanitize_key($event_status);
1853 1853
 			// grab status
1854
-			if ( ! empty( $event_status ) ) {
1855
-				$success = $this->_change_event_status( $EVT_ID, $event_status );
1854
+			if ( ! empty($event_status)) {
1855
+				$success = $this->_change_event_status($EVT_ID, $event_status);
1856 1856
 			} else {
1857 1857
 				$success = false;
1858 1858
 				$msg = esc_html__(
1859 1859
 					'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
1860 1860
 					'event_espresso'
1861 1861
 				);
1862
-				EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1862
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1863 1863
 			}
1864 1864
 		} else {
1865 1865
 			$success = false;
@@ -1867,11 +1867,11 @@  discard block
 block discarded – undo
1867 1867
 				'An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.',
1868 1868
 				'event_espresso'
1869 1869
 			);
1870
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1870
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1871 1871
 		}
1872 1872
 		$action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash';
1873
-		if ( $redirect_after ) {
1874
-			$this->_redirect_after_action( $success, 'Event', $action, array( 'action' => 'default' ) );
1873
+		if ($redirect_after) {
1874
+			$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1875 1875
 		}
1876 1876
 	}
1877 1877
 
@@ -1884,18 +1884,18 @@  discard block
 block discarded – undo
1884 1884
 	 * @param  string $event_status
1885 1885
 	 * @return void
1886 1886
 	 */
1887
-	protected function _trash_or_restore_events( $event_status = 'trash' ) {
1887
+	protected function _trash_or_restore_events($event_status = 'trash') {
1888 1888
 		// clean status
1889
-		$event_status = sanitize_key( $event_status );
1889
+		$event_status = sanitize_key($event_status);
1890 1890
 		// grab status
1891
-		if ( ! empty( $event_status ) ) {
1891
+		if ( ! empty($event_status)) {
1892 1892
 			$success = true;
1893 1893
 			//determine the event id and set to array.
1894
-			$EVT_IDs = isset( $this->_req_data['EVT_IDs'] ) ? (array) $this->_req_data['EVT_IDs'] : array();
1894
+			$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
1895 1895
 			// loop thru events
1896
-			foreach ( $EVT_IDs as $EVT_ID ) {
1897
-				if ( $EVT_ID = absint( $EVT_ID ) ) {
1898
-					$results = $this->_change_event_status( $EVT_ID, $event_status );
1896
+			foreach ($EVT_IDs as $EVT_ID) {
1897
+				if ($EVT_ID = absint($EVT_ID)) {
1898
+					$results = $this->_change_event_status($EVT_ID, $event_status);
1899 1899
 					$success = $results !== false ? $success : false;
1900 1900
 				} else {
1901 1901
 					$msg = sprintf(
@@ -1905,7 +1905,7 @@  discard block
 block discarded – undo
1905 1905
 						),
1906 1906
 						$EVT_ID
1907 1907
 					);
1908
-					EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1908
+					EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1909 1909
 					$success = false;
1910 1910
 				}
1911 1911
 			}
@@ -1915,12 +1915,12 @@  discard block
 block discarded – undo
1915 1915
 				'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
1916 1916
 				'event_espresso'
1917 1917
 			);
1918
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1918
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1919 1919
 		}
1920 1920
 		// in order to force a pluralized result message we need to send back a success status greater than 1
1921 1921
 		$success = $success ? 2 : false;
1922 1922
 		$action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash';
1923
-		$this->_redirect_after_action( $success, 'Events', $action, array( 'action' => 'default' ) );
1923
+		$this->_redirect_after_action($success, 'Events', $action, array('action' => 'default'));
1924 1924
 	}
1925 1925
 
1926 1926
 
@@ -1933,30 +1933,30 @@  discard block
 block discarded – undo
1933 1933
 	 * @param  string $event_status
1934 1934
 	 * @return bool
1935 1935
 	 */
1936
-	private function _change_event_status( $EVT_ID = 0, $event_status = '' ) {
1936
+	private function _change_event_status($EVT_ID = 0, $event_status = '') {
1937 1937
 		// grab event id
1938
-		if ( ! $EVT_ID ) {
1938
+		if ( ! $EVT_ID) {
1939 1939
 			$msg = esc_html__(
1940 1940
 				'An error occurred. No Event ID or an invalid Event ID was received.',
1941 1941
 				'event_espresso'
1942 1942
 			);
1943
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1943
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1944 1944
 			return false;
1945 1945
 		}
1946
-		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
1946
+		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
1947 1947
 		// clean status
1948
-		$event_status = sanitize_key( $event_status );
1948
+		$event_status = sanitize_key($event_status);
1949 1949
 		// grab status
1950
-		if ( empty( $event_status ) ) {
1950
+		if (empty($event_status)) {
1951 1951
 			$msg = esc_html__(
1952 1952
 				'An error occurred. No Event Status or an invalid Event Status was received.',
1953 1953
 				'event_espresso'
1954 1954
 			);
1955
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1955
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1956 1956
 			return false;
1957 1957
 		}
1958 1958
 		// was event trashed or restored ?
1959
-		switch ( $event_status ) {
1959
+		switch ($event_status) {
1960 1960
 			case 'draft' :
1961 1961
 				$action = 'restored from the trash';
1962 1962
 				$hook = 'AHEE_event_restored_from_trash';
@@ -1970,15 +1970,15 @@  discard block
 block discarded – undo
1970 1970
 				$hook = false;
1971 1971
 		}
1972 1972
 		//use class to change status
1973
-		$this->_cpt_model_obj->set_status( $event_status );
1973
+		$this->_cpt_model_obj->set_status($event_status);
1974 1974
 		$success = $this->_cpt_model_obj->save();
1975
-		if ( $success === false ) {
1976
-			$msg = sprintf( esc_html__( 'An error occurred. The event could not be %s.', 'event_espresso' ), $action );
1977
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1975
+		if ($success === false) {
1976
+			$msg = sprintf(esc_html__('An error occurred. The event could not be %s.', 'event_espresso'), $action);
1977
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1978 1978
 			return false;
1979 1979
 		}
1980
-		if ( $hook ) {
1981
-			do_action( $hook );
1980
+		if ($hook) {
1981
+			do_action($hook);
1982 1982
 		}
1983 1983
 		return true;
1984 1984
 	}
@@ -1991,34 +1991,34 @@  discard block
 block discarded – undo
1991 1991
 	 * @access protected
1992 1992
 	 * @param bool $redirect_after
1993 1993
 	 */
1994
-	protected function _delete_event( $redirect_after = true ) {
1994
+	protected function _delete_event($redirect_after = true) {
1995 1995
 		//determine the event id and set to array.
1996
-		$EVT_ID = isset( $this->_req_data['EVT_ID'] ) ? absint( $this->_req_data['EVT_ID'] ) : null;
1997
-		$EVT_ID = isset( $this->_req_data['post'] ) ? absint( $this->_req_data['post'] ) : $EVT_ID;
1996
+		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : null;
1997
+		$EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
1998 1998
 		// loop thru events
1999
-		if ( $EVT_ID ) {
2000
-			$success = $this->_permanently_delete_event( $EVT_ID );
1999
+		if ($EVT_ID) {
2000
+			$success = $this->_permanently_delete_event($EVT_ID);
2001 2001
 			// get list of events with no prices
2002
-			$espresso_no_ticket_prices = get_option( 'ee_no_ticket_prices', array() );
2002
+			$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
2003 2003
 			// remove this event from the list of events with no prices
2004
-			if ( isset( $espresso_no_ticket_prices[ $EVT_ID ] ) ) {
2005
-				unset( $espresso_no_ticket_prices[ $EVT_ID ] );
2004
+			if (isset($espresso_no_ticket_prices[$EVT_ID])) {
2005
+				unset($espresso_no_ticket_prices[$EVT_ID]);
2006 2006
 			}
2007
-			update_option( 'ee_no_ticket_prices', $espresso_no_ticket_prices );
2007
+			update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2008 2008
 		} else {
2009 2009
 			$success = false;
2010 2010
 			$msg = esc_html__(
2011 2011
 				'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2012 2012
 				'event_espresso'
2013 2013
 			);
2014
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2014
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2015 2015
 		}
2016
-		if ( $redirect_after ) {
2016
+		if ($redirect_after) {
2017 2017
 			$this->_redirect_after_action(
2018 2018
 				$success,
2019 2019
 				'Event',
2020 2020
 				'deleted',
2021
-				array( 'action' => 'default', 'status' => 'trash' )
2021
+				array('action' => 'default', 'status' => 'trash')
2022 2022
 			);
2023 2023
 		}
2024 2024
 	}
@@ -2034,30 +2034,30 @@  discard block
 block discarded – undo
2034 2034
 	protected function _delete_events() {
2035 2035
 		$success = true;
2036 2036
 		// get list of events with no prices
2037
-		$espresso_no_ticket_prices = get_option( 'ee_no_ticket_prices', array() );
2037
+		$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
2038 2038
 		//determine the event id and set to array.
2039
-		$EVT_IDs = isset( $this->_req_data['EVT_IDs'] ) ? (array) $this->_req_data['EVT_IDs'] : array();
2039
+		$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
2040 2040
 		// loop thru events
2041
-		foreach ( $EVT_IDs as $EVT_ID ) {
2042
-			$EVT_ID = absint( $EVT_ID );
2043
-			if ( $EVT_ID ) {
2044
-				$results = $this->_permanently_delete_event( $EVT_ID );
2041
+		foreach ($EVT_IDs as $EVT_ID) {
2042
+			$EVT_ID = absint($EVT_ID);
2043
+			if ($EVT_ID) {
2044
+				$results = $this->_permanently_delete_event($EVT_ID);
2045 2045
 				$success = $results !== false ? $success : false;
2046 2046
 				// remove this event from the list of events with no prices
2047
-				unset( $espresso_no_ticket_prices[ $EVT_ID ] );
2047
+				unset($espresso_no_ticket_prices[$EVT_ID]);
2048 2048
 			} else {
2049 2049
 				$success = false;
2050 2050
 				$msg = esc_html__(
2051 2051
 					'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2052 2052
 					'event_espresso'
2053 2053
 				);
2054
-				EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2054
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2055 2055
 			}
2056 2056
 		}
2057
-		update_option( 'ee_no_ticket_prices', $espresso_no_ticket_prices );
2057
+		update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2058 2058
 		// in order to force a pluralized result message we need to send back a success status greater than 1
2059 2059
 		$success = $success ? 2 : false;
2060
-		$this->_redirect_after_action( $success, 'Events', 'deleted', array( 'action' => 'default' ) );
2060
+		$this->_redirect_after_action($success, 'Events', 'deleted', array('action' => 'default'));
2061 2061
 	}
2062 2062
 
2063 2063
 
@@ -2069,70 +2069,70 @@  discard block
 block discarded – undo
2069 2069
 	 * @param  int $EVT_ID
2070 2070
 	 * @return bool
2071 2071
 	 */
2072
-	private function _permanently_delete_event( $EVT_ID = 0 ) {
2072
+	private function _permanently_delete_event($EVT_ID = 0) {
2073 2073
 		// grab event id
2074
-		if ( ! $EVT_ID ) {
2074
+		if ( ! $EVT_ID) {
2075 2075
 			$msg = esc_html__(
2076 2076
 				'An error occurred. No Event ID or an invalid Event ID was received.',
2077 2077
 				'event_espresso'
2078 2078
 			);
2079
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2079
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2080 2080
 			return false;
2081 2081
 		}
2082 2082
 		if (
2083 2083
 			! $this->_cpt_model_obj instanceof EE_Event
2084 2084
 			|| $this->_cpt_model_obj->ID() !== $EVT_ID
2085 2085
 		) {
2086
-			$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
2086
+			$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2087 2087
 		}
2088
-		if ( ! $this->_cpt_model_obj instanceof EE_Event ) {
2088
+		if ( ! $this->_cpt_model_obj instanceof EE_Event) {
2089 2089
 			return false;
2090 2090
 		}
2091 2091
 		//need to delete related tickets and prices first.
2092
-		$datetimes = $this->_cpt_model_obj->get_many_related( 'Datetime' );
2093
-		foreach ( $datetimes as $datetime ) {
2094
-			$this->_cpt_model_obj->_remove_relation_to( $datetime, 'Datetime' );
2095
-			$tickets = $datetime->get_many_related( 'Ticket' );
2096
-			foreach ( $tickets as $ticket ) {
2097
-				$ticket->_remove_relation_to( $datetime, 'Datetime' );
2098
-				$ticket->delete_related_permanently( 'Price' );
2092
+		$datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
2093
+		foreach ($datetimes as $datetime) {
2094
+			$this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
2095
+			$tickets = $datetime->get_many_related('Ticket');
2096
+			foreach ($tickets as $ticket) {
2097
+				$ticket->_remove_relation_to($datetime, 'Datetime');
2098
+				$ticket->delete_related_permanently('Price');
2099 2099
 				$ticket->delete_permanently();
2100 2100
 			}
2101 2101
 			$datetime->delete();
2102 2102
 		}
2103 2103
 		//what about related venues or terms?
2104
-		$venues = $this->_cpt_model_obj->get_many_related( 'Venue' );
2105
-		foreach ( $venues as $venue ) {
2106
-			$this->_cpt_model_obj->_remove_relation_to( $venue, 'Venue' );
2104
+		$venues = $this->_cpt_model_obj->get_many_related('Venue');
2105
+		foreach ($venues as $venue) {
2106
+			$this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
2107 2107
 		}
2108 2108
 		//any attached question groups?
2109
-		$question_groups = $this->_cpt_model_obj->get_many_related( 'Question_Group' );
2110
-		if ( ! empty( $question_groups ) ) {
2111
-			foreach ( $question_groups as $question_group ) {
2112
-				$this->_cpt_model_obj->_remove_relation_to( $question_group, 'Question_Group' );
2109
+		$question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2110
+		if ( ! empty($question_groups)) {
2111
+			foreach ($question_groups as $question_group) {
2112
+				$this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2113 2113
 			}
2114 2114
 		}
2115 2115
 		//Message Template Groups
2116
-		$this->_cpt_model_obj->_remove_relations( 'Message_Template_Group' );
2116
+		$this->_cpt_model_obj->_remove_relations('Message_Template_Group');
2117 2117
 		/** @type EE_Term_Taxonomy[] $term_taxonomies */
2118 2118
 		$term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
2119
-		foreach ( $term_taxonomies as $term_taxonomy ) {
2120
-			$this->_cpt_model_obj->remove_relation_to_term_taxonomy( $term_taxonomy );
2119
+		foreach ($term_taxonomies as $term_taxonomy) {
2120
+			$this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
2121 2121
 		}
2122 2122
 		$success = $this->_cpt_model_obj->delete_permanently();
2123 2123
 		// did it all go as planned ?
2124
-		if ( $success ) {
2125
-			$msg = sprintf( esc_html__( 'Event ID # %d has been deleted.', 'event_espresso' ), $EVT_ID );
2126
-			EE_Error::add_success( $msg );
2124
+		if ($success) {
2125
+			$msg = sprintf(esc_html__('Event ID # %d has been deleted.', 'event_espresso'), $EVT_ID);
2126
+			EE_Error::add_success($msg);
2127 2127
 		} else {
2128 2128
 			$msg = sprintf(
2129
-				esc_html__( 'An error occurred. Event ID # %d could not be deleted.', 'event_espresso' ),
2129
+				esc_html__('An error occurred. Event ID # %d could not be deleted.', 'event_espresso'),
2130 2130
 				$EVT_ID
2131 2131
 			);
2132
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2132
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2133 2133
 			return false;
2134 2134
 		}
2135
-		do_action( 'AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $EVT_ID );
2135
+		do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $EVT_ID);
2136 2136
 		return true;
2137 2137
 	}
2138 2138
 
@@ -2145,7 +2145,7 @@  discard block
 block discarded – undo
2145 2145
 	 * @return int
2146 2146
 	 */
2147 2147
 	public function total_events() {
2148
-		$count = EEM_Event::instance()->count( array( 'caps' => 'read_admin' ), 'EVT_ID', true );
2148
+		$count = EEM_Event::instance()->count(array('caps' => 'read_admin'), 'EVT_ID', true);
2149 2149
 		return $count;
2150 2150
 	}
2151 2151
 
@@ -2159,9 +2159,9 @@  discard block
 block discarded – undo
2159 2159
 	 */
2160 2160
 	public function total_events_draft() {
2161 2161
 		$where = array(
2162
-			'status' => array( 'IN', array( 'draft', 'auto-draft' ) ),
2162
+			'status' => array('IN', array('draft', 'auto-draft')),
2163 2163
 		);
2164
-		$count = EEM_Event::instance()->count( array( $where, 'caps' => 'read_admin' ), 'EVT_ID', true );
2164
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
2165 2165
 		return $count;
2166 2166
 	}
2167 2167
 
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
 		$where = array(
2178 2178
 			'status' => 'trash',
2179 2179
 		);
2180
-		$count = EEM_Event::instance()->count( array( $where, 'caps' => 'read_admin' ), 'EVT_ID', true );
2180
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
2181 2181
 		return $count;
2182 2182
 	}
2183 2183
 
@@ -2208,12 +2208,12 @@  discard block
 block discarded – undo
2208 2208
 			EE_Registry::instance()->CFG->registration->default_STS_ID,
2209 2209
 			$this->_template_args['reg_status_array']
2210 2210
 		)
2211
-			? sanitize_text_field( EE_Registry::instance()->CFG->registration->default_STS_ID )
2211
+			? sanitize_text_field(EE_Registry::instance()->CFG->registration->default_STS_ID)
2212 2212
 			: EEM_Registration::status_id_pending_payment;
2213
-		$this->_set_add_edit_form_tags( 'update_default_event_settings' );
2214
-		$this->_set_publish_post_box_vars( null, false, false, null, false );
2213
+		$this->_set_add_edit_form_tags('update_default_event_settings');
2214
+		$this->_set_publish_post_box_vars(null, false, false, null, false);
2215 2215
 		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
2216
-			EVENTS_TEMPLATE_PATH . 'event_settings.template.php',
2216
+			EVENTS_TEMPLATE_PATH.'event_settings.template.php',
2217 2217
 			$this->_template_args,
2218 2218
 			true
2219 2219
 		);
@@ -2229,8 +2229,8 @@  discard block
 block discarded – undo
2229 2229
 	 * @return void
2230 2230
 	 */
2231 2231
 	protected function _update_default_event_settings() {
2232
-		EE_Config::instance()->registration->default_STS_ID = isset( $this->_req_data['default_reg_status'] )
2233
-			? sanitize_text_field( $this->_req_data['default_reg_status'] )
2232
+		EE_Config::instance()->registration->default_STS_ID = isset($this->_req_data['default_reg_status'])
2233
+			? sanitize_text_field($this->_req_data['default_reg_status'])
2234 2234
 			: EEM_Registration::status_id_pending_payment;
2235 2235
 		$what = 'Default Event Settings';
2236 2236
 		$success = $this->_update_espresso_configuration(
@@ -2240,7 +2240,7 @@  discard block
 block discarded – undo
2240 2240
 			__FUNCTION__,
2241 2241
 			__LINE__
2242 2242
 		);
2243
-		$this->_redirect_after_action( $success, $what, 'updated', array( 'action' => 'default_event_settings' ) );
2243
+		$this->_redirect_after_action($success, $what, 'updated', array('action' => 'default_event_settings'));
2244 2244
 	}
2245 2245
 
2246 2246
 
@@ -2250,20 +2250,20 @@  discard block
 block discarded – undo
2250 2250
 
2251 2251
 
2252 2252
 	protected function _template_settings() {
2253
-		$this->_admin_page_title = esc_html__( 'Template Settings (Preview)', 'event_espresso' );
2253
+		$this->_admin_page_title = esc_html__('Template Settings (Preview)', 'event_espresso');
2254 2254
 		$this->_template_args['preview_img'] = '<img src="'
2255 2255
 		                                       . EVENTS_ASSETS_URL
2256 2256
 		                                       . DS
2257 2257
 		                                       . 'images'
2258 2258
 		                                       . DS
2259 2259
 		                                       . 'caffeinated_template_features.jpg" alt="'
2260
-		                                       . esc_attr__( 'Template Settings Preview screenshot', 'event_espresso' )
2260
+		                                       . esc_attr__('Template Settings Preview screenshot', 'event_espresso')
2261 2261
 		                                       . '" />';
2262
-		$this->_template_args['preview_text'] = '<strong>' . esc_html__(
2262
+		$this->_template_args['preview_text'] = '<strong>'.esc_html__(
2263 2263
 				'Template Settings is a feature that is only available in the Caffeinated version of Event Espresso. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2264 2264
 				'event_espresso'
2265
-			) . '</strong>';
2266
-		$this->display_admin_caf_preview_page( 'template_settings_tab' );
2265
+			).'</strong>';
2266
+		$this->display_admin_caf_preview_page('template_settings_tab');
2267 2267
 	}
2268 2268
 
2269 2269
 
@@ -2275,18 +2275,18 @@  discard block
 block discarded – undo
2275 2275
 	 * @return void
2276 2276
 	 */
2277 2277
 	private function _set_category_object() {
2278
-		if ( isset( $this->_category->id ) && ! empty( $this->_category->id ) ) {
2278
+		if (isset($this->_category->id) && ! empty($this->_category->id)) {
2279 2279
 			return;
2280 2280
 		} //already have the category object so get out.
2281 2281
 		//set default category object
2282 2282
 		$this->_set_empty_category_object();
2283 2283
 		//only set if we've got an id
2284
-		if ( ! isset( $this->_req_data['EVT_CAT_ID'] ) ) {
2284
+		if ( ! isset($this->_req_data['EVT_CAT_ID'])) {
2285 2285
 			return;
2286 2286
 		}
2287
-		$category_id = absint( $this->_req_data['EVT_CAT_ID'] );
2288
-		$term = get_term( $category_id, 'espresso_event_categories' );
2289
-		if ( ! empty( $term ) ) {
2287
+		$category_id = absint($this->_req_data['EVT_CAT_ID']);
2288
+		$term = get_term($category_id, 'espresso_event_categories');
2289
+		if ( ! empty($term)) {
2290 2290
 			$this->_category->category_name = $term->name;
2291 2291
 			$this->_category->category_identifier = $term->slug;
2292 2292
 			$this->_category->category_desc = $term->description;
@@ -2306,9 +2306,9 @@  discard block
 block discarded – undo
2306 2306
 
2307 2307
 
2308 2308
 	protected function _category_list_table() {
2309
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2310
-		$this->_search_btn_label = esc_html__( 'Categories', 'event_espresso' );
2311
-		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2309
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2310
+		$this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2311
+		$this->_admin_page_title .= ' '.$this->get_action_link_or_button(
2312 2312
 				'add_category',
2313 2313
 				'add_category',
2314 2314
 				array(),
@@ -2322,20 +2322,20 @@  discard block
 block discarded – undo
2322 2322
 	/**
2323 2323
 	 * @param $view
2324 2324
 	 */
2325
-	protected function _category_details( $view ) {
2325
+	protected function _category_details($view) {
2326 2326
 		//load formatter helper
2327 2327
 		//load field generator helper
2328 2328
 		$route = $view == 'edit' ? 'update_category' : 'insert_category';
2329
-		$this->_set_add_edit_form_tags( $route );
2329
+		$this->_set_add_edit_form_tags($route);
2330 2330
 		$this->_set_category_object();
2331
-		$id = ! empty( $this->_category->id ) ? $this->_category->id : '';
2331
+		$id = ! empty($this->_category->id) ? $this->_category->id : '';
2332 2332
 		$delete_action = 'delete_category';
2333 2333
 		//custom redirect
2334 2334
 		$redirect = EE_Admin_Page::add_query_args_and_nonce(
2335
-			array( 'action' => 'category_list' ),
2335
+			array('action' => 'category_list'),
2336 2336
 			$this->_admin_base_url
2337 2337
 		);
2338
-		$this->_set_publish_post_box_vars( 'EVT_CAT_ID', $id, $delete_action, $redirect );
2338
+		$this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2339 2339
 		//take care of contents
2340 2340
 		$this->_template_args['admin_page_content'] = $this->_category_details_content();
2341 2341
 		$this->display_admin_page_with_sidebar();
@@ -2349,21 +2349,21 @@  discard block
 block discarded – undo
2349 2349
 	protected function _category_details_content() {
2350 2350
 		$editor_args['category_desc'] = array(
2351 2351
 			'type'          => 'wp_editor',
2352
-			'value'         => EEH_Formatter::admin_format_content( $this->_category->category_desc ),
2352
+			'value'         => EEH_Formatter::admin_format_content($this->_category->category_desc),
2353 2353
 			'class'         => 'my_editor_custom',
2354
-			'wpeditor_args' => array( 'media_buttons' => false ),
2354
+			'wpeditor_args' => array('media_buttons' => false),
2355 2355
 		);
2356
-		$_wp_editor = $this->_generate_admin_form_fields( $editor_args, 'array' );
2356
+		$_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2357 2357
 		$all_terms = get_terms(
2358
-			array( 'espresso_event_categories' ),
2359
-			array( 'hide_empty' => 0, 'exclude' => array( $this->_category->id ) )
2358
+			array('espresso_event_categories'),
2359
+			array('hide_empty' => 0, 'exclude' => array($this->_category->id))
2360 2360
 		);
2361 2361
 		//setup category select for term parents.
2362 2362
 		$category_select_values[] = array(
2363
-			'text' => esc_html__( 'No Parent', 'event_espresso' ),
2363
+			'text' => esc_html__('No Parent', 'event_espresso'),
2364 2364
 			'id'   => 0,
2365 2365
 		);
2366
-		foreach ( $all_terms as $term ) {
2366
+		foreach ($all_terms as $term) {
2367 2367
 			$category_select_values[] = array(
2368 2368
 				'text' => $term->name,
2369 2369
 				'id'   => $term->term_id,
@@ -2377,28 +2377,28 @@  discard block
 block discarded – undo
2377 2377
 		$template_args = array(
2378 2378
 			'category'                 => $this->_category,
2379 2379
 			'category_select'          => $category_select,
2380
-			'unique_id_info_help_link' => $this->_get_help_tab_link( 'unique_id_info' ),
2380
+			'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'),
2381 2381
 			'category_desc_editor'     => $_wp_editor['category_desc']['field'],
2382 2382
 			'disable'                  => '',
2383 2383
 			'disabled_message'         => false,
2384 2384
 		);
2385
-		$template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2386
-		return EEH_Template::display_template( $template, $template_args, true );
2385
+		$template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php';
2386
+		return EEH_Template::display_template($template, $template_args, true);
2387 2387
 	}
2388 2388
 
2389 2389
 
2390 2390
 
2391 2391
 	protected function _delete_categories() {
2392
-		$cat_ids = isset( $this->_req_data['EVT_CAT_ID'] ) ? (array) $this->_req_data['EVT_CAT_ID']
2392
+		$cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID']
2393 2393
 			: (array) $this->_req_data['category_id'];
2394
-		foreach ( $cat_ids as $cat_id ) {
2395
-			$this->_delete_category( $cat_id );
2394
+		foreach ($cat_ids as $cat_id) {
2395
+			$this->_delete_category($cat_id);
2396 2396
 		}
2397 2397
 		//doesn't matter what page we're coming from... we're going to the same place after delete.
2398 2398
 		$query_args = array(
2399 2399
 			'action' => 'category_list',
2400 2400
 		);
2401
-		$this->_redirect_after_action( 0, '', '', $query_args );
2401
+		$this->_redirect_after_action(0, '', '', $query_args);
2402 2402
 	}
2403 2403
 
2404 2404
 
@@ -2406,9 +2406,9 @@  discard block
 block discarded – undo
2406 2406
 	/**
2407 2407
 	 * @param $cat_id
2408 2408
 	 */
2409
-	protected function _delete_category( $cat_id ) {
2410
-		$cat_id = absint( $cat_id );
2411
-		wp_delete_term( $cat_id, 'espresso_event_categories' );
2409
+	protected function _delete_category($cat_id) {
2410
+		$cat_id = absint($cat_id);
2411
+		wp_delete_term($cat_id, 'espresso_event_categories');
2412 2412
 	}
2413 2413
 
2414 2414
 
@@ -2416,18 +2416,18 @@  discard block
 block discarded – undo
2416 2416
 	/**
2417 2417
 	 * @param $new_category
2418 2418
 	 */
2419
-	protected function _insert_or_update_category( $new_category ) {
2420
-		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category( true );
2419
+	protected function _insert_or_update_category($new_category) {
2420
+		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(true);
2421 2421
 		$success = 0; //we already have a success message so lets not send another.
2422
-		if ( $cat_id ) {
2422
+		if ($cat_id) {
2423 2423
 			$query_args = array(
2424 2424
 				'action'     => 'edit_category',
2425 2425
 				'EVT_CAT_ID' => $cat_id,
2426 2426
 			);
2427 2427
 		} else {
2428
-			$query_args = array( 'action' => 'add_category' );
2428
+			$query_args = array('action' => 'add_category');
2429 2429
 		}
2430
-		$this->_redirect_after_action( $success, '', '', $query_args, true );
2430
+		$this->_redirect_after_action($success, '', '', $query_args, true);
2431 2431
 	}
2432 2432
 
2433 2433
 
@@ -2436,14 +2436,14 @@  discard block
 block discarded – undo
2436 2436
 	 * @param bool $update
2437 2437
 	 * @return bool|mixed|string
2438 2438
 	 */
2439
-	private function _insert_category( $update = false ) {
2439
+	private function _insert_category($update = false) {
2440 2440
 		$cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2441
-		$category_name = isset( $this->_req_data['category_name'] ) ? $this->_req_data['category_name'] : '';
2442
-		$category_desc = isset( $this->_req_data['category_desc'] ) ? $this->_req_data['category_desc'] : '';
2443
-		$category_parent = isset( $this->_req_data['category_parent'] ) ? $this->_req_data['category_parent'] : 0;
2444
-		if ( empty( $category_name ) ) {
2445
-			$msg = esc_html__( 'You must add a name for the category.', 'event_espresso' );
2446
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2441
+		$category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2442
+		$category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2443
+		$category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2444
+		if (empty($category_name)) {
2445
+			$msg = esc_html__('You must add a name for the category.', 'event_espresso');
2446
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2447 2447
 			return false;
2448 2448
 		}
2449 2449
 		$term_args = array(
@@ -2452,22 +2452,22 @@  discard block
 block discarded – undo
2452 2452
 			'parent'      => $category_parent,
2453 2453
 		);
2454 2454
 		//was the category_identifier input disabled?
2455
-		if ( isset( $this->_req_data['category_identifier'] ) ) {
2455
+		if (isset($this->_req_data['category_identifier'])) {
2456 2456
 			$term_args['slug'] = $this->_req_data['category_identifier'];
2457 2457
 		}
2458 2458
 		$insert_ids = $update
2459
-			? wp_update_term( $cat_id, 'espresso_event_categories', $term_args )
2460
-			: wp_insert_term( $category_name, 'espresso_event_categories', $term_args );
2461
-		if ( ! is_array( $insert_ids ) ) {
2459
+			? wp_update_term($cat_id, 'espresso_event_categories', $term_args)
2460
+			: wp_insert_term($category_name, 'espresso_event_categories', $term_args);
2461
+		if ( ! is_array($insert_ids)) {
2462 2462
 			$msg = esc_html__(
2463 2463
 				'An error occurred and the category has not been saved to the database.',
2464 2464
 				'event_espresso'
2465 2465
 			);
2466
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2466
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2467 2467
 		} else {
2468 2468
 			$cat_id = $insert_ids['term_id'];
2469
-			$msg = sprintf( esc_html__( 'The category %s was successfully saved', 'event_espresso' ), $category_name );
2470
-			EE_Error::add_success( $msg );
2469
+			$msg = sprintf(esc_html__('The category %s was successfully saved', 'event_espresso'), $category_name);
2470
+			EE_Error::add_success($msg);
2471 2471
 		}
2472 2472
 		return $cat_id;
2473 2473
 	}
@@ -2480,28 +2480,28 @@  discard block
 block discarded – undo
2480 2480
 	 * @param bool $count
2481 2481
 	 * @return \EE_Base_Class[]|int
2482 2482
 	 */
2483
-	public function get_categories( $per_page = 10, $current_page = 1, $count = false ) {
2483
+	public function get_categories($per_page = 10, $current_page = 1, $count = false) {
2484 2484
 		//testing term stuff
2485
-		$orderby = isset( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : 'Term.term_id';
2486
-		$order = isset( $this->_req_data['order'] ) ? $this->_req_data['order'] : 'DESC';
2487
-		$limit = ( $current_page - 1 ) * $per_page;
2488
-		$where = array( 'taxonomy' => 'espresso_event_categories' );
2489
-		if ( isset( $this->_req_data['s'] ) ) {
2490
-			$sstr = '%' . $this->_req_data['s'] . '%';
2485
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2486
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2487
+		$limit = ($current_page - 1) * $per_page;
2488
+		$where = array('taxonomy' => 'espresso_event_categories');
2489
+		if (isset($this->_req_data['s'])) {
2490
+			$sstr = '%'.$this->_req_data['s'].'%';
2491 2491
 			$where['OR'] = array(
2492
-				'Term.name'   => array( 'LIKE', $sstr ),
2493
-				'description' => array( 'LIKE', $sstr ),
2492
+				'Term.name'   => array('LIKE', $sstr),
2493
+				'description' => array('LIKE', $sstr),
2494 2494
 			);
2495 2495
 		}
2496 2496
 		$query_params = array(
2497 2497
 			$where,
2498
-			'order_by'   => array( $orderby => $order ),
2499
-			'limit'      => $limit . ',' . $per_page,
2500
-			'force_join' => array( 'Term' ),
2498
+			'order_by'   => array($orderby => $order),
2499
+			'limit'      => $limit.','.$per_page,
2500
+			'force_join' => array('Term'),
2501 2501
 		);
2502 2502
 		$categories = $count
2503
-			? EEM_Term_Taxonomy::instance()->count( $query_params, 'term_id' )
2504
-			: EEM_Term_Taxonomy::instance()->get_all( $query_params );
2503
+			? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id')
2504
+			: EEM_Term_Taxonomy::instance()->get_all($query_params);
2505 2505
 		return $categories;
2506 2506
 	}
2507 2507
 
Please login to merge, or discard this patch.
espresso.php 1 patch
Spacing   +92 added lines, -92 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,102 +67,102 @@  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.17.rc.013' );
70
+		return apply_filters('FHEE__espresso__espresso_version', '4.9.17.rc.013');
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_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_MAIN_FILE', __FILE__);
80 80
 	//used to be DIRECTORY_SEPARATOR, but that caused issues on windows
81
-	if ( ! defined( 'DS' ) ) {
82
-		define( 'DS', '/' );
81
+	if ( ! defined('DS')) {
82
+		define('DS', '/');
83 83
 	}
84
-	if ( ! defined( 'PS' ) ) {
85
-		define( 'PS', PATH_SEPARATOR );
84
+	if ( ! defined('PS')) {
85
+		define('PS', PATH_SEPARATOR);
86 86
 	}
87
-	if ( ! defined( 'SP' ) ) {
88
-		define( 'SP', ' ' );
87
+	if ( ! defined('SP')) {
88
+		define('SP', ' ');
89 89
 	}
90
-	if ( ! defined( 'EENL' ) ) {
91
-		define( 'EENL', "\n" );
90
+	if ( ! defined('EENL')) {
91
+		define('EENL', "\n");
92 92
 	}
93
-	define( 'EE_SUPPORT_EMAIL', '[email protected]' );
93
+	define('EE_SUPPORT_EMAIL', '[email protected]');
94 94
 	// define the plugin directory and URL
95
-	define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) );
96
-	define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) );
97
-	define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) );
95
+	define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
96
+	define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
97
+	define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
98 98
 	// main root folder paths
99
-	define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS );
100
-	define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS );
101
-	define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS );
102
-	define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS );
103
-	define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS );
104
-	define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS );
105
-	define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS );
106
-	define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS );
99
+	define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS);
100
+	define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS);
101
+	define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS);
102
+	define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS);
103
+	define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS);
104
+	define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS);
105
+	define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS);
106
+	define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS);
107 107
 	// core system paths
108
-	define( 'EE_ADMIN', EE_CORE . 'admin' . DS );
109
-	define( 'EE_CPTS', EE_CORE . 'CPTs' . DS );
110
-	define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS );
111
-	define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS );
112
-	define( 'EE_BUSINESS', EE_CORE . 'business' . DS );
113
-	define( 'EE_MODELS', EE_CORE . 'db_models' . DS );
114
-	define( 'EE_HELPERS', EE_CORE . 'helpers' . DS );
115
-	define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS );
116
-	define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS );
117
-	define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS );
118
-	define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS );
119
-	define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS );
108
+	define('EE_ADMIN', EE_CORE.'admin'.DS);
109
+	define('EE_CPTS', EE_CORE.'CPTs'.DS);
110
+	define('EE_CLASSES', EE_CORE.'db_classes'.DS);
111
+	define('EE_INTERFACES', EE_CORE.'interfaces'.DS);
112
+	define('EE_BUSINESS', EE_CORE.'business'.DS);
113
+	define('EE_MODELS', EE_CORE.'db_models'.DS);
114
+	define('EE_HELPERS', EE_CORE.'helpers'.DS);
115
+	define('EE_LIBRARIES', EE_CORE.'libraries'.DS);
116
+	define('EE_TEMPLATES', EE_CORE.'templates'.DS);
117
+	define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS);
118
+	define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS);
119
+	define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS);
120 120
 	// gateways
121
-	define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS );
122
-	define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS );
121
+	define('EE_GATEWAYS', EE_MODULES.'gateways'.DS);
122
+	define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS);
123 123
 	// asset URL paths
124
-	define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS );
125
-	define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS );
126
-	define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS );
127
-	define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS );
128
-	define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' );
129
-	define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' );
124
+	define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS);
125
+	define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS);
126
+	define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS);
127
+	define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS);
128
+	define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/');
129
+	define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/');
130 130
 	// define upload paths
131 131
 	$uploads = wp_upload_dir();
132 132
 	// define the uploads directory and URL
133
-	define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS );
134
-	define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS );
133
+	define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS);
134
+	define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS);
135 135
 	// define the templates directory and URL
136
-	define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'templates' . DS );
137
-	define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'templates' . DS );
136
+	define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS);
137
+	define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS);
138 138
 	// define the gateway directory and URL
139
-	define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'gateways' . DS );
140
-	define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'gateways' . DS );
139
+	define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS);
140
+	define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS);
141 141
 	// languages folder/path
142
-	define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS );
143
-	define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS );
142
+	define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS);
143
+	define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS);
144 144
 	//check for dompdf fonts in uploads
145
-	if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) {
146
-		define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS );
145
+	if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) {
146
+		define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS);
147 147
 	}
148 148
 	//ajax constants
149
-	define( 'EE_FRONT_AJAX', isset( $_REQUEST[ 'ee_front_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_front_ajax' ] ) ? true : false );
150
-	define( 'EE_ADMIN_AJAX', isset( $_REQUEST[ 'ee_admin_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_admin_ajax' ] ) ? true : false );
149
+	define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false);
150
+	define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false);
151 151
 	//just a handy constant occasionally needed for finding values representing infinity in the DB
152 152
 	//you're better to use this than its straight value (currently -1) in case you ever
153 153
 	//want to change its default value! or find when -1 means infinity
154
-	define( 'EE_INF_IN_DB', -1 );
155
-	define( 'EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX );
156
-	define( 'EE_DEBUG', false );
154
+	define('EE_INF_IN_DB', -1);
155
+	define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX);
156
+	define('EE_DEBUG', false);
157 157
 
158 158
 	/**
159 159
 	 *    espresso_plugin_activation
160 160
 	 *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
161 161
 	 */
162 162
 	function espresso_plugin_activation() {
163
-		update_option( 'ee_espresso_activation', true );
163
+		update_option('ee_espresso_activation', true);
164 164
 	}
165
-	register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' );
165
+	register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
166 166
 
167 167
 
168 168
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		//	}
177 177
 		//
178 178
 	}
179
-	register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' );
179
+	register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation');
180 180
 
181 181
 
182 182
 
@@ -186,15 +186,15 @@  discard block
 block discarded – undo
186 186
 	 */
187 187
 	function espresso_load_error_handling() {
188 188
 		// load debugging tools
189
-		if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) {
190
-			require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' );
189
+		if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) {
190
+			require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php');
191 191
 			EEH_Debug_Tools::instance();
192 192
 		}
193 193
 		// load error handling
194
-		if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) {
195
-			require_once( EE_CORE . 'EE_Error.core.php' );
194
+		if (is_readable(EE_CORE.'EE_Error.core.php')) {
195
+			require_once(EE_CORE.'EE_Error.core.php');
196 196
 		} else {
197
-			wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ) );
197
+			wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso'));
198 198
 		}
199 199
 	}
200 200
 
@@ -208,25 +208,25 @@  discard block
 block discarded – undo
208 208
 	 * @param    string $full_path_to_file
209 209
 	 * @throws    EE_Error
210 210
 	 */
211
-	function espresso_load_required( $classname, $full_path_to_file ) {
211
+	function espresso_load_required($classname, $full_path_to_file) {
212 212
 		static $error_handling_loaded = false;
213
-		if ( ! $error_handling_loaded ) {
213
+		if ( ! $error_handling_loaded) {
214 214
 			espresso_load_error_handling();
215 215
 			$error_handling_loaded = true;
216 216
 		}
217
-		if ( is_readable( $full_path_to_file ) ) {
218
-			require_once( $full_path_to_file );
217
+		if (is_readable($full_path_to_file)) {
218
+			require_once($full_path_to_file);
219 219
 		} else {
220
-			throw new EE_Error ( sprintf(
221
-				__( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ),
220
+			throw new EE_Error(sprintf(
221
+				__('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'),
222 222
 				$classname
223
-			) );
223
+			));
224 224
 		}
225 225
 	}
226 226
 
227
-	espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' );
228
-	espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' );
229
-	espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' );
227
+	espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php');
228
+	espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php');
229
+	espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php');
230 230
 	new EE_Bootstrap();
231 231
 
232 232
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
 
237 237
 
238
-if ( ! function_exists( 'espresso_deactivate_plugin' ) ) {
238
+if ( ! function_exists('espresso_deactivate_plugin')) {
239 239
 	/**
240 240
 	*    deactivate_plugin
241 241
 	* usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
@@ -244,11 +244,11 @@  discard block
 block discarded – undo
244 244
 	* @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
245 245
 	* @return    void
246 246
 	*/
247
-	function espresso_deactivate_plugin( $plugin_basename = '' ) {
248
-		if ( ! function_exists( 'deactivate_plugins' ) ) {
249
-			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
247
+	function espresso_deactivate_plugin($plugin_basename = '') {
248
+		if ( ! function_exists('deactivate_plugins')) {
249
+			require_once(ABSPATH.'wp-admin/includes/plugin.php');
250 250
 		}
251
-		unset( $_GET[ 'activate' ], $_REQUEST[ 'activate' ] );
252
-		deactivate_plugins( $plugin_basename );
251
+		unset($_GET['activate'], $_REQUEST['activate']);
252
+		deactivate_plugins($plugin_basename);
253 253
 	}
254 254
 }
Please login to merge, or discard this patch.