Completed
Branch BUG-8698-ticket-sellouts (195489)
by
unknown
115:39 queued 98:19
created
core/libraries/rest_api/calculations/Datetime.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
  * @since		 	   $VID:$
16 16
  *
17 17
  */
18
-if( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
19
-	exit( 'No direct script access allowed' );
18
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
19
+	exit('No direct script access allowed');
20 20
 }
21 21
 
22 22
 class Datetime extends Calculations_Base {
@@ -32,20 +32,20 @@  discard block
 block discarded – undo
32 32
 	 * @return int
33 33
 	 * @throws \EE_Error
34 34
 	 */
35
-	public static function spaces_remaining_considering_tickets( $wpdb_row, $request, $controller ){
36
-		if( is_array( $wpdb_row ) && isset( $wpdb_row[ 'Datetime.DTT_ID' ] ) ) {
37
-			$dtt_obj = \EEM_Datetime::instance()->get_one_by_ID( $wpdb_row[ 'Datetime.DTT_ID' ] );
35
+	public static function spaces_remaining_considering_tickets($wpdb_row, $request, $controller) {
36
+		if (is_array($wpdb_row) && isset($wpdb_row['Datetime.DTT_ID'])) {
37
+			$dtt_obj = \EEM_Datetime::instance()->get_one_by_ID($wpdb_row['Datetime.DTT_ID']);
38 38
 		} else {
39 39
 			$dtt_obj = null;
40 40
 		}
41
-		if( $dtt_obj instanceof \EE_Datetime ) {
42
-			return $dtt_obj->spaces_remaining( true );
41
+		if ($dtt_obj instanceof \EE_Datetime) {
42
+			return $dtt_obj->spaces_remaining(true);
43 43
 		} else {
44 44
 			throw new \EE_Error(
45 45
 				sprintf(
46
-					__( 'Cannot calculate spaces_remaining_considering_tickets because the datetime with ID %1$s (from database row %2$s) was not found', 'event_espresso' ),
47
-					$wpdb_row[ 'Datetime.DTT_ID' ],
48
-					print_r( $wpdb_row, true )
46
+					__('Cannot calculate spaces_remaining_considering_tickets because the datetime with ID %1$s (from database row %2$s) was not found', 'event_espresso'),
47
+					$wpdb_row['Datetime.DTT_ID'],
48
+					print_r($wpdb_row, true)
49 49
 				)
50 50
 			);
51 51
 		}
@@ -63,17 +63,17 @@  discard block
 block discarded – undo
63 63
 	 * @throws \EE_Error
64 64
 	 * @throws \EventEspresso\core\libraries\rest_api\Rest_Exception
65 65
 	 */
66
-	public static function registrations_checked_in_count( $wpdb_row, $request, $controller ){
67
-		if( ! is_array( $wpdb_row ) || ! isset( $wpdb_row[ 'Datetime.DTT_ID' ] ) ) {
66
+	public static function registrations_checked_in_count($wpdb_row, $request, $controller) {
67
+		if ( ! is_array($wpdb_row) || ! isset($wpdb_row['Datetime.DTT_ID'])) {
68 68
 			throw new \EE_Error(
69 69
 				sprintf(
70
-					__( 'Cannot calculate registrations_checked_in_count because the database row %1$s does not have an entry for "Datetime.DTT_ID"', 'event_espresso' ),
71
-					print_r( $wpdb_row, true )
70
+					__('Cannot calculate registrations_checked_in_count because the database row %1$s does not have an entry for "Datetime.DTT_ID"', 'event_espresso'),
71
+					print_r($wpdb_row, true)
72 72
 				)
73 73
 			);
74 74
 		}
75
-		self::_verify_current_user_can( 'ee_read_checkins', 'registrations_checked_in_count' );
76
-		return \EEM_Registration::instance()->count_registrations_checked_into_datetime( $wpdb_row[ 'Datetime.DTT_ID' ], true );
75
+		self::_verify_current_user_can('ee_read_checkins', 'registrations_checked_in_count');
76
+		return \EEM_Registration::instance()->count_registrations_checked_into_datetime($wpdb_row['Datetime.DTT_ID'], true);
77 77
 	}
78 78
 
79 79
 
@@ -88,17 +88,17 @@  discard block
 block discarded – undo
88 88
 	 * @throws \EE_Error
89 89
 	 * @throws \EventEspresso\core\libraries\rest_api\Rest_Exception
90 90
 	 */
91
-	public static function registrations_checked_out_count( $wpdb_row, $request, $controller ){
92
-		if( ! is_array( $wpdb_row ) || ! isset( $wpdb_row[ 'Datetime.DTT_ID' ] ) ) {
91
+	public static function registrations_checked_out_count($wpdb_row, $request, $controller) {
92
+		if ( ! is_array($wpdb_row) || ! isset($wpdb_row['Datetime.DTT_ID'])) {
93 93
 			throw new \EE_Error(
94 94
 				sprintf(
95
-					__( 'Cannot calculate registrations_checked_out_count because the database row %1$s does not have an entry for "Datetime.DTT_ID"', 'event_espresso' ),
96
-					print_r( $wpdb_row, true )
95
+					__('Cannot calculate registrations_checked_out_count because the database row %1$s does not have an entry for "Datetime.DTT_ID"', 'event_espresso'),
96
+					print_r($wpdb_row, true)
97 97
 				)
98 98
 			);
99 99
 		}
100
-		self::_verify_current_user_can( 'ee_read_checkins', 'registrations_checked_out_count' );
101
-		return \EEM_Registration::instance()->count_registrations_checked_into_datetime( $wpdb_row[ 'Datetime.DTT_ID' ], false );
100
+		self::_verify_current_user_can('ee_read_checkins', 'registrations_checked_out_count');
101
+		return \EEM_Registration::instance()->count_registrations_checked_into_datetime($wpdb_row['Datetime.DTT_ID'], false);
102 102
 	}
103 103
 
104 104
 
@@ -114,20 +114,20 @@  discard block
 block discarded – undo
114 114
 	 * @throws \EE_Error
115 115
 	 * @throws \EventEspresso\core\libraries\rest_api\Rest_Exception
116 116
 	 */
117
-	public static function spots_taken_pending_payment( $wpdb_row, $request, $controller ){
118
-		if( ! is_array( $wpdb_row ) || ! isset( $wpdb_row[ 'Datetime.DTT_ID' ] ) ) {
117
+	public static function spots_taken_pending_payment($wpdb_row, $request, $controller) {
118
+		if ( ! is_array($wpdb_row) || ! isset($wpdb_row['Datetime.DTT_ID'])) {
119 119
 			throw new \EE_Error(
120 120
 				sprintf(
121
-					__( 'Cannot calculate spots_taken_pending_payment because the database row %1$s does not have an entry for "Datetime.DTT_ID"', 'event_espresso' ),
122
-					print_r( $wpdb_row, true )
121
+					__('Cannot calculate spots_taken_pending_payment because the database row %1$s does not have an entry for "Datetime.DTT_ID"', 'event_espresso'),
122
+					print_r($wpdb_row, true)
123 123
 				)
124 124
 			);
125 125
 		}
126
-		self::_verify_current_user_can( 'ee_read_registrations', 'spots_taken_pending_payment' );
126
+		self::_verify_current_user_can('ee_read_registrations', 'spots_taken_pending_payment');
127 127
 		return \EEM_Registration::instance()->count(
128 128
 			array(
129 129
 				array(
130
-					'Ticket.Datetime.DTT_ID' => $wpdb_row[ 'Datetime.DTT_ID' ],
130
+					'Ticket.Datetime.DTT_ID' => $wpdb_row['Datetime.DTT_ID'],
131 131
 					'STS_ID' => \EEM_Registration::status_id_pending_payment
132 132
 				)
133 133
 			),
Please login to merge, or discard this patch.
modules/core_rest_api/EED_Core_Rest_Api.module.php 1 patch
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 use EventEspresso\core\libraries\rest_api\Calculated_Model_Fields;
3
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
4
-	exit( 'No direct script access allowed' );
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4
+	exit('No direct script access allowed');
5 5
 }
6 6
 
7 7
 /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public static function instance() {
36 36
 		self::$_field_calculator = new Calculated_Model_Fields();
37
-		return parent::get_instance( __CLASS__ );
37
+		return parent::get_instance(__CLASS__);
38 38
 	}
39 39
 
40 40
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
 
65 65
 
66 66
 	public static function set_hooks_both() {
67
-		add_action( 'rest_api_init', array( 'EED_Core_Rest_Api', 'register_routes' ), 10 );
68
-		add_action( 'rest_api_init', array( 'EED_Core_Rest_Api', 'set_hooks_rest_api' ), 5 );
69
-		add_filter( 'rest_route_data', array( 'EED_Core_Rest_Api', 'hide_old_endpoints' ), 10, 2 );
70
-		add_filter( 'rest_index', array( 'EventEspresso\core\libraries\rest_api\controllers\model\Meta', 'filter_ee_metadata_into_index' ) );
67
+		add_action('rest_api_init', array('EED_Core_Rest_Api', 'register_routes'), 10);
68
+		add_action('rest_api_init', array('EED_Core_Rest_Api', 'set_hooks_rest_api'), 5);
69
+		add_filter('rest_route_data', array('EED_Core_Rest_Api', 'hide_old_endpoints'), 10, 2);
70
+		add_filter('rest_index', array('EventEspresso\core\libraries\rest_api\controllers\model\Meta', 'filter_ee_metadata_into_index'));
71 71
 		EED_Core_Rest_Api::invalidate_cached_route_data_on_version_change();
72 72
 	}
73 73
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * Loads all the hooks which make requests to old versions of the API
86 86
 	 * appear the same as they always did
87 87
 	 */
88
-	public static function set_hooks_for_changes(){
88
+	public static function set_hooks_for_changes() {
89 89
 		self::_set_hooks_for_changes();
90 90
 	}
91 91
 	/**
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
 	 * appear the same as they always did
94 94
 	 */
95 95
 	protected static function _set_hooks_for_changes() {
96
-		$folder_contents = EEH_File::get_contents_of_folders( array( EE_LIBRARIES . 'rest_api' . DS . 'changes' ), false );
97
-		foreach( $folder_contents as $classname_in_namespace => $filepath ) {
96
+		$folder_contents = EEH_File::get_contents_of_folders(array(EE_LIBRARIES.'rest_api'.DS.'changes'), false);
97
+		foreach ($folder_contents as $classname_in_namespace => $filepath) {
98 98
 			//ignore the base parent class
99
-			if( $classname_in_namespace === 'Changes_In_Base' ) {
99
+			if ($classname_in_namespace === 'Changes_In_Base') {
100 100
 				continue;
101 101
 			}
102
-			$full_classname = 'EventEspresso\core\libraries\rest_api\changes\\' . $classname_in_namespace;
103
-			if ( class_exists( $full_classname )) {
102
+			$full_classname = 'EventEspresso\core\libraries\rest_api\changes\\'.$classname_in_namespace;
103
+			if (class_exists($full_classname)) {
104 104
 				$instance_of_class = new $full_classname;
105
-				if ( $instance_of_class instanceof EventEspresso\core\libraries\rest_api\changes\Changes_In_Base ) {
105
+				if ($instance_of_class instanceof EventEspresso\core\libraries\rest_api\changes\Changes_In_Base) {
106 106
 					$instance_of_class->set_hooks();
107 107
 				}
108 108
 			}
@@ -115,16 +115,16 @@  discard block
 block discarded – undo
115 115
 	 * so we actually prefer to only do it when an EE plugin is activated or upgraded
116 116
 	 */
117 117
 	public static function register_routes() {
118
-		foreach( EED_Core_Rest_Api::get_ee_route_data() as $namespace => $relative_urls ) {
119
-			foreach( $relative_urls as $endpoint => $routes ) {
120
-				foreach( $routes as $route ) {
118
+		foreach (EED_Core_Rest_Api::get_ee_route_data() as $namespace => $relative_urls) {
119
+			foreach ($relative_urls as $endpoint => $routes) {
120
+				foreach ($routes as $route) {
121 121
 					register_rest_route(
122 122
 						$namespace,
123 123
 						$endpoint,
124 124
 						array(
125
-							'callback' => $route[ 'callback' ],
126
-							'methods' => $route[ 'methods' ],
127
-							'args' => isset( $route[ 'args' ] ) ? $route[ 'args' ] : array(),
125
+							'callback' => $route['callback'],
126
+							'methods' => $route['methods'],
127
+							'args' => isset($route['args']) ? $route['args'] : array(),
128 128
 						)
129 129
 					);
130 130
 				}
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
 	 * next time the WP API is used
139 139
 	 */
140 140
 	public static function invalidate_cached_route_data_on_version_change() {
141
-		if( EE_System::instance()->detect_req_type() != EE_System::req_type_normal ) {
141
+		if (EE_System::instance()->detect_req_type() != EE_System::req_type_normal) {
142 142
 			EED_Core_Rest_Api::invalidate_cached_route_data();
143 143
 		}
144
-		foreach( EE_Registry::instance()->addons as $addon ){
145
-			if( $addon instanceof EE_Addon && $addon->detect_req_type() != EE_System::req_type_normal ) {
144
+		foreach (EE_Registry::instance()->addons as $addon) {
145
+			if ($addon instanceof EE_Addon && $addon->detect_req_type() != EE_System::req_type_normal) {
146 146
 				EED_Core_Rest_Api::invalidate_cached_route_data();
147 147
 			}
148 148
 		}
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	public static function invalidate_cached_route_data() {
155 155
 		//delete the saved EE REST API routes
156
-		delete_option( EED_Core_Rest_Api::saved_routes_option_names );
156
+		delete_option(EED_Core_Rest_Api::saved_routes_option_names);
157 157
 	}
158 158
 
159 159
 	/**
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
 	 * }
166 166
 	 */
167 167
 	public static function get_ee_route_data() {
168
-		$ee_routes = get_option( self::saved_routes_option_names, null );
169
-		if( ! $ee_routes || ( defined('EE_REST_API_DEBUG_MODE') && EE_REST_API_DEBUG_MODE )){
168
+		$ee_routes = get_option(self::saved_routes_option_names, null);
169
+		if ( ! $ee_routes || (defined('EE_REST_API_DEBUG_MODE') && EE_REST_API_DEBUG_MODE)) {
170 170
 			self::save_ee_routes();
171
-			$ee_routes = get_option( self::saved_routes_option_names, array() );
171
+			$ee_routes = get_option(self::saved_routes_option_names, array());
172 172
 		}
173 173
 		return $ee_routes;
174 174
 	}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * @return void
180 180
 	 */
181 181
 	public static function save_ee_routes() {
182
-		if( EE_Maintenance_Mode::instance()->models_can_query() ){
182
+		if (EE_Maintenance_Mode::instance()->models_can_query()) {
183 183
 			$instance = self::instance();
184 184
 			$routes = apply_filters(
185 185
 				'EED_Core_Rest_Api__save_ee_routes__routes',
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 					$instance->_register_rpc_routes()
191 191
 				)
192 192
 			);
193
-			update_option( self::saved_routes_option_names, $routes, true );
193
+			update_option(self::saved_routes_option_names, $routes, true);
194 194
 		}
195 195
 	}
196 196
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 * @return array @see get_ee_route_data
200 200
 	 */
201 201
 	protected function _register_model_routes() {
202
-		EE_Registry::instance()->load_helper( 'Inflector' );
202
+		EE_Registry::instance()->load_helper('Inflector');
203 203
 		$models_to_register = apply_filters(
204 204
 			'FHEE__EED_Core_REST_API___register_model_routes',
205 205
 			EE_Registry::instance()->non_abstract_db_models
@@ -208,24 +208,24 @@  discard block
 block discarded – undo
208 208
 		unset($models_to_register['Extra_Meta']);
209 209
 		unset($models_to_register['Extra_Join']);
210 210
 		$model_routes = array( );
211
-		foreach( self::versions_served() as $version => $hidden_endpoint ) {
211
+		foreach (self::versions_served() as $version => $hidden_endpoint) {
212 212
 
213
-			foreach ( $models_to_register as $model_name => $model_classname ) {
214
-				$model = \EE_Registry::instance()->load_model( $model_name );
213
+			foreach ($models_to_register as $model_name => $model_classname) {
214
+				$model = \EE_Registry::instance()->load_model($model_name);
215 215
 				//yes we could just register one route for ALL models, but then they wouldn't show up in the index
216
-				$ee_namespace = self::ee_api_namespace . $version;
217
-				$plural_model_route = EEH_Inflector::pluralize_and_lower( $model_name );
218
-				$singular_model_route = $plural_model_route . '/(?P<id>\d+)' ;
219
-				$model_routes[ $ee_namespace ][ $plural_model_route ] = array(
216
+				$ee_namespace = self::ee_api_namespace.$version;
217
+				$plural_model_route = EEH_Inflector::pluralize_and_lower($model_name);
218
+				$singular_model_route = $plural_model_route.'/(?P<id>\d+)';
219
+				$model_routes[$ee_namespace][$plural_model_route] = array(
220 220
 						array(
221 221
 							'callback' => array(
222 222
 								'EventEspresso\core\libraries\rest_api\controllers\model\Read',
223 223
 								'handle_request_get_all' ),
224 224
 							'methods' => WP_REST_Server::READABLE,
225 225
 							'hidden_endpoint' => $hidden_endpoint,
226
-							'args' => $this->_get_read_query_params( $model, $version ),
226
+							'args' => $this->_get_read_query_params($model, $version),
227 227
 							'_links' => array(
228
-								'self' => rest_url( $ee_namespace . $singular_model_route ),
228
+								'self' => rest_url($ee_namespace.$singular_model_route),
229 229
 							)
230 230
 						),
231 231
 //						array(
@@ -236,14 +236,14 @@  discard block
 block discarded – undo
236 236
 //							'hidden_endpoint' => $hidden_endpoint
237 237
 //						)
238 238
 					);
239
-				$model_routes[ $ee_namespace ][ $singular_model_route ] = array(
239
+				$model_routes[$ee_namespace][$singular_model_route] = array(
240 240
 						array(
241 241
 							'callback' => array(
242 242
 								'EventEspresso\core\libraries\rest_api\controllers\model\Read',
243 243
 								'handle_request_get_one' ),
244 244
 							'methods' => WP_REST_Server::READABLE,
245 245
 							'hidden_endpoint' => $hidden_endpoint,
246
-							'args' => $this->_get_response_selection_query_params( $model, $version)
246
+							'args' => $this->_get_response_selection_query_params($model, $version)
247 247
 						),
248 248
 //						array(
249 249
 //							'callback' => array(
@@ -254,19 +254,19 @@  discard block
 block discarded – undo
254 254
 //							),
255 255
 				);
256 256
 				//@todo: also handle  DELETE for a single item
257
-				foreach ( $model->relation_settings() as $relation_name => $relation_obj ) {
257
+				foreach ($model->relation_settings() as $relation_name => $relation_obj) {
258 258
 					$related_model_name_endpoint_part = EventEspresso\core\libraries\rest_api\controllers\model\Read::get_related_entity_name(
259 259
 						$relation_name,
260 260
 						$relation_obj
261 261
 					);
262
-					$model_routes[ $ee_namespace ][ $singular_model_route . '/' . $related_model_name_endpoint_part ] = array(
262
+					$model_routes[$ee_namespace][$singular_model_route.'/'.$related_model_name_endpoint_part] = array(
263 263
 							array(
264 264
 								'callback' => array(
265 265
 									'EventEspresso\core\libraries\rest_api\controllers\model\Read',
266 266
 									'handle_request_get_related' ),
267 267
 								'methods' => WP_REST_Server::READABLE,
268 268
 								'hidden_endpoint' => $hidden_endpoint,
269
-								'args' => $this->_get_read_query_params( $relation_obj->get_other_model(), $version ),
269
+								'args' => $this->_get_read_query_params($relation_obj->get_other_model(), $version),
270 270
 							),
271 271
 //							array(
272 272
 //								'callback' => array(
@@ -290,11 +290,11 @@  discard block
 block discarded – undo
290 290
 	 */
291 291
 	protected function _register_rpc_routes() {
292 292
 		$routes = array();
293
-		foreach( self::versions_served() as $version => $hidden_endpoint ) {
294
-			$ee_namespace = self::ee_api_namespace . $version;
293
+		foreach (self::versions_served() as $version => $hidden_endpoint) {
294
+			$ee_namespace = self::ee_api_namespace.$version;
295 295
 			$this_versions_routes = array();
296 296
 			//checkin endpoint
297
-			$this_versions_routes[ 'registrations/(?P<REG_ID>\d+)/toggle_checkin_for_datetime/(?P<DTT_ID>\d+)' ] = array(
297
+			$this_versions_routes['registrations/(?P<REG_ID>\d+)/toggle_checkin_for_datetime/(?P<DTT_ID>\d+)'] = array(
298 298
 				array(
299 299
 					'callback' => array(
300 300
 						'EventEspresso\core\libraries\rest_api\controllers\rpc\Checkin',
@@ -305,12 +305,12 @@  discard block
 block discarded – undo
305 305
 						'force' => array(
306 306
 							'required' => false,
307 307
 							'default' => false,
308
-							'description' => __( 'Whether to force toggle checkin, or to verify the registration status and allowed ticket uses', 'event_espresso' )
308
+							'description' => __('Whether to force toggle checkin, or to verify the registration status and allowed ticket uses', 'event_espresso')
309 309
 						)
310 310
 					)
311 311
 				)
312 312
 			);
313
-			$routes[ $ee_namespace ] = apply_filters(
313
+			$routes[$ee_namespace] = apply_filters(
314 314
 				'FHEE__EED_Core_Rest_Api___register_rpc_routes__this_versions_routes',
315 315
 				$this_versions_routes,
316 316
 				$version,
@@ -326,19 +326,19 @@  discard block
 block discarded – undo
326 326
 	 * @param string $version
327 327
 	 * @return array
328 328
 	 */
329
-	protected function _get_response_selection_query_params( \EEM_Base $model, $version ) {
329
+	protected function _get_response_selection_query_params(\EEM_Base $model, $version) {
330 330
 		return apply_filters(
331 331
 			'FHEE__EED_Core_Rest_Api___get_response_selection_query_params',
332 332
 			array(
333 333
 				'include' => array(
334 334
 					'required' => false,
335 335
 					'default' => '*',
336
-					'description' => __( 'See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#Including_Specific_Fields_and_Related_Entities_in_Results for documentation', 'event_espresso' ),
336
+					'description' => __('See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#Including_Specific_Fields_and_Related_Entities_in_Results for documentation', 'event_espresso'),
337 337
 				),
338 338
 				'calculate' => array(
339 339
 					'required' => false,
340 340
 					'default' => '',
341
-					'enum' => self::$_field_calculator->retrieve_calculated_fields_for_model( $model )
341
+					'enum' => self::$_field_calculator->retrieve_calculated_fields_for_model($model)
342 342
 				)
343 343
 			),
344 344
 			$model,
@@ -356,43 +356,43 @@  discard block
 block discarded – undo
356 356
 	 * @return array    describing the args acceptable when querying this model
357 357
 	 * @throws \EE_Error
358 358
 	 */
359
-	protected function _get_read_query_params( \EEM_Base $model, $version ) {
359
+	protected function _get_read_query_params(\EEM_Base $model, $version) {
360 360
 		$default_orderby = array();
361
-		foreach( $model->get_combined_primary_key_fields() as $key_field ) {
362
-			$default_orderby[ $key_field->get_name() ] = 'ASC';
361
+		foreach ($model->get_combined_primary_key_fields() as $key_field) {
362
+			$default_orderby[$key_field->get_name()] = 'ASC';
363 363
 		}
364 364
 		return array_merge(
365
-			$this->_get_response_selection_query_params( $model, $version ),
365
+			$this->_get_response_selection_query_params($model, $version),
366 366
 			array(
367 367
 				'where' => array(
368 368
 					'required' => false,
369 369
 					'default' => array(),
370
-					'description' => __( 'See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#where for documentation', 'event_espresso' ),
370
+					'description' => __('See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#where for documentation', 'event_espresso'),
371 371
 					),
372 372
 				'limit' => array(
373 373
 					'required' => false,
374 374
 					'default' => EED_Core_Rest_Api::get_default_query_limit(),
375
-					'description' => __( 'See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#limit for documentation', 'event_espresso' )
375
+					'description' => __('See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#limit for documentation', 'event_espresso')
376 376
 				),
377 377
 				'order_by' => array(
378 378
 					'required' => false,
379 379
 					'default' => $default_orderby,
380
-					'description' => __( 'See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#order_by for documentation', 'event_espresso' )
380
+					'description' => __('See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#order_by for documentation', 'event_espresso')
381 381
 				),
382 382
 				'group_by' => array(
383 383
 					'required' => false,
384 384
 					'default' => null,
385
-					'description' => __( 'See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#group_by for documentation', 'event_espresso' )
385
+					'description' => __('See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#group_by for documentation', 'event_espresso')
386 386
 				),
387 387
 				'having' => array(
388 388
 					'required' => false,
389 389
 					'default' => null,
390
-					'description' => __( 'See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#having for documentation', 'event_espresso' )
390
+					'description' => __('See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#having for documentation', 'event_espresso')
391 391
 				),
392 392
 				'caps' => array(
393 393
 					'required' => false,
394 394
 					'default' => EEM_Base::caps_read,
395
-					'description' => __( 'See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#caps for documentation', 'event_espresso' )
395
+					'description' => __('See http://developer.eventespresso.com/docs/ee4-rest-api-reading/#caps for documentation', 'event_espresso')
396 396
 				),
397 397
 			)
398 398
 		);
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
 	 */
405 405
 	protected function _register_config_routes() {
406 406
 		$config_routes = array();
407
-		foreach( self::versions_served() as $version => $hidden_endpoint ) {
408
-			$config_routes[ self::ee_api_namespace . $version ][ 'config' ] = array(
407
+		foreach (self::versions_served() as $version => $hidden_endpoint) {
408
+			$config_routes[self::ee_api_namespace.$version]['config'] = array(
409 409
 					array(
410 410
 						'callback' => array(
411 411
 							'EventEspresso\core\libraries\rest_api\controllers\config\Read',
@@ -424,8 +424,8 @@  discard block
 block discarded – undo
424 424
 	 */
425 425
 	protected function _register_meta_routes() {
426 426
 		$meta_routes = array();
427
-		foreach( self::versions_served() as $version => $hidden_endpoint ) {
428
-			$meta_routes[ self::ee_api_namespace . $version ][ '/resources' ] = array(
427
+		foreach (self::versions_served() as $version => $hidden_endpoint) {
428
+			$meta_routes[self::ee_api_namespace.$version]['/resources'] = array(
429 429
 				array(
430 430
 					'callback' => array(
431 431
 						'EventEspresso\core\libraries\rest_api\controllers\model\Meta',
@@ -446,13 +446,13 @@  discard block
 block discarded – undo
446 446
 	 * @param array $route_data
447 447
 	 * @return array
448 448
 	 */
449
-	public static function hide_old_endpoints( $route_data ) {
450
-		foreach( EED_Core_Rest_Api::get_ee_route_data() as $namespace => $relative_urls ) {
451
-			foreach( $relative_urls as $endpoint => $routes ) {
452
-				foreach( $routes as $route ) {
453
-					if( $route[ 'hidden_endpoint' ] ) {
454
-						$full_route = '/' . ltrim( $namespace, '/' ) . '/' . ltrim( $endpoint, '/' );
455
-						unset( $route_data[ $full_route ] );
449
+	public static function hide_old_endpoints($route_data) {
450
+		foreach (EED_Core_Rest_Api::get_ee_route_data() as $namespace => $relative_urls) {
451
+			foreach ($relative_urls as $endpoint => $routes) {
452
+				foreach ($routes as $route) {
453
+					if ($route['hidden_endpoint']) {
454
+						$full_route = '/'.ltrim($namespace, '/').'/'.ltrim($endpoint, '/');
455
+						unset($route_data[$full_route]);
456 456
 					}
457 457
 				}
458 458
 			}
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 	 */
492 492
 	public static function latest_rest_api_version() {
493 493
 		$versions_served = \EED_Core_Rest_Api::versions_served();
494
-		return end( array_keys( $versions_served ) );
494
+		return end(array_keys($versions_served));
495 495
 	}
496 496
 
497 497
 	/**
@@ -505,32 +505,32 @@  discard block
 block discarded – undo
505 505
 	public static function versions_served() {
506 506
 		$versions_served = array();
507 507
 		$possibly_served_versions = EED_Core_Rest_Api::version_compatibilities();
508
-		$lowest_compatible_version = end( $possibly_served_versions);
509
-		reset( $possibly_served_versions );
510
-		$versions_served_historically = array_keys( $possibly_served_versions );
511
-		$latest_version = end( $versions_served_historically );
512
-		reset( $versions_served_historically );
508
+		$lowest_compatible_version = end($possibly_served_versions);
509
+		reset($possibly_served_versions);
510
+		$versions_served_historically = array_keys($possibly_served_versions);
511
+		$latest_version = end($versions_served_historically);
512
+		reset($versions_served_historically);
513 513
 		//for each version of core we have ever served:
514
-		foreach ( $versions_served_historically as $key_versioned_endpoint ) {
514
+		foreach ($versions_served_historically as $key_versioned_endpoint) {
515 515
 			//if it's not above the current core version, and it's compatible with the current version of core
516
-			if( $key_versioned_endpoint == $latest_version ) {
516
+			if ($key_versioned_endpoint == $latest_version) {
517 517
 				//don't hide the latest version in the index
518
-				$versions_served[ $key_versioned_endpoint ] = false;
519
-			} else if(
518
+				$versions_served[$key_versioned_endpoint] = false;
519
+			} else if (
520 520
 				$key_versioned_endpoint < EED_Core_Rest_Api::core_version()
521 521
 				&& $key_versioned_endpoint >= $lowest_compatible_version
522 522
 			) {
523 523
 				//include, but hide, previous versions which are still supported
524
-				$versions_served[ $key_versioned_endpoint ] = true;
525
-			} elseif(
524
+				$versions_served[$key_versioned_endpoint] = true;
525
+			} elseif (
526 526
 				apply_filters(
527 527
 					'FHEE__EED_Core_Rest_Api__versions_served__include_incompatible_versions',
528 528
 					false,
529 529
 					$possibly_served_versions
530 530
 				)
531
-			){
531
+			) {
532 532
 				//if a version is no longer supported, don't include it in index or list of versions served
533
-				$versions_served[ $key_versioned_endpoint ] = true;
533
+				$versions_served[$key_versioned_endpoint] = true;
534 534
 			}
535 535
 		}
536 536
 		return $versions_served;
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	 * @return string
544 544
 	 */
545 545
 	public static function core_version() {
546
-		return apply_filters( 'FHEE__EED_Core_REST_API__core_version', implode('.', array_slice( explode( '.', espresso_version() ), 0, 3 ) ) );
546
+		return apply_filters('FHEE__EED_Core_REST_API__core_version', implode('.', array_slice(explode('.', espresso_version()), 0, 3)));
547 547
 	}
548 548
 
549 549
 	/**
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 	 * @param  WP $WP
569 569
 	 * @return    void
570 570
 	 */
571
-	public function run( $WP ) {
571
+	public function run($WP) {
572 572
 
573 573
 	}
574 574
 
Please login to merge, or discard this patch.
core/libraries/rest_api/changes/Changes_In_4_8_36.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -15,28 +15,28 @@  discard block
 block discarded – undo
15 15
 		//set a hook to remove the "calculate" query param
16 16
 		add_filter(
17 17
 			'FHEE__EED_Core_Rest_Api___get_response_selection_query_params',
18
-			array( $this, 'remove_calculate_query_param' ),
18
+			array($this, 'remove_calculate_query_param'),
19 19
 			10,
20 20
 			3
21 21
 		);
22 22
 		//don't add the _calculated_fields either
23 23
 		add_filter(
24 24
 			'FHEE__Read__create_entity_from_wpdb_results__entity_before_inaccessible_field_removal',
25
-			array( $this, 'remove_calculated_fields_from_response' ),
25
+			array($this, 'remove_calculated_fields_from_response'),
26 26
 			10,
27 27
 			5
28 28
 		);
29 29
 		//and also don't add the count headers
30 30
 		add_filter(
31 31
 			'FHEE__EventEspresso\core\libraries\rest_api\controllers\Base___get_response_headers',
32
-			array( $this, 'remove_headers_new_in_this_version' ),
32
+			array($this, 'remove_headers_new_in_this_version'),
33 33
 			10,
34 34
 			3
35 35
 		);
36 36
 		//remove the old featured_image part of the response...
37 37
 		add_filter(
38 38
 			'FHEE__Read__create_entity_from_wpdb_results__entity_before_inaccessible_field_removal',
39
-			array( $this, 'remove_old_featured_image_part_of_cpt_entities' ),
39
+			array($this, 'remove_old_featured_image_part_of_cpt_entities'),
40 40
 			10,
41 41
 			5
42 42
 		);
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		//before this, infinity was -1, now it's null
47 47
 		add_filter(
48 48
 			'FHEE__EventEspresso\core\libraries\rest_api\Model_Data_Translator__prepare_field_for_rest_api',
49
-			array( $this, 'use_negative_one_for_infinity_before_this_version' ),
49
+			array($this, 'use_negative_one_for_infinity_before_this_version'),
50 50
 			10,
51 51
 			4
52 52
 		);
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 	 * @param string $version
60 60
 	 * @return array
61 61
 	 */
62
-	public function remove_calculate_query_param( $query_params, \EEM_Base $model, $version ) {
63
-		if( $this->applies_to_version( $version ) ) {
64
-			unset( $query_params[ 'calculate' ] );
62
+	public function remove_calculate_query_param($query_params, \EEM_Base $model, $version) {
63
+		if ($this->applies_to_version($version)) {
64
+			unset($query_params['calculate']);
65 65
 		}
66 66
 		return $query_params;
67 67
 	}
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 		\WP_REST_Request $request,
83 83
 		Read $controller
84 84
 	) {
85
-		if( $this->applies_to_version( $controller->get_model_version_info()->requested_version() ) ) {
86
-			unset( $entity_response_array[ '_calculated_fields' ] );
85
+		if ($this->applies_to_version($controller->get_model_version_info()->requested_version())) {
86
+			unset($entity_response_array['_calculated_fields']);
87 87
 		}
88 88
 		return $entity_response_array;
89 89
 	}
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 		Base $controller,
102 102
 		$version
103 103
 	) {
104
-		if( $this->applies_to_version( $version ) ) {
104
+		if ($this->applies_to_version($version)) {
105 105
 			$headers = array_diff_key(
106 106
 				$headers,
107 107
 				array_flip(
108 108
 					array(
109
-						Base::header_prefix_for_wp . 'Total',
110
-						Base::header_prefix_for_wp . 'TotalPages',
111
-						Base::header_prefix_for_wp . 'PageSize'
109
+						Base::header_prefix_for_wp.'Total',
110
+						Base::header_prefix_for_wp.'TotalPages',
111
+						Base::header_prefix_for_wp.'PageSize'
112 112
 					)));
113 113
 		}
114 114
 		return $headers;
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
 		\WP_REST_Request $request,
131 131
 		Read $controller
132 132
 	) {
133
-		if( $this->applies_to_version( $controller->get_model_version_info()->requested_version() )
133
+		if ($this->applies_to_version($controller->get_model_version_info()->requested_version())
134 134
 			&& $model instanceof \EEM_CPT_Base
135 135
 		) {
136 136
 			$attachment = wp_get_attachment_image_src(
137
-				get_post_thumbnail_id( $entity_response_array[ $model->primary_key_name() ] ),
137
+				get_post_thumbnail_id($entity_response_array[$model->primary_key_name()]),
138 138
 				'full'
139 139
 			);
140
-			$entity_response_array[ 'featured_image_url' ] = !empty( $attachment ) ? $attachment[ 0 ] : null;
140
+			$entity_response_array['featured_image_url'] = ! empty($attachment) ? $attachment[0] : null;
141 141
 		}
142 142
 		return $entity_response_array;
143 143
 	}
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
 	 * @param string $requested_value
153 153
 	 * @return mixed
154 154
 	 */
155
-	public function use_negative_one_for_infinity_before_this_version( $new_value, $field_obj, $original_value, $requested_value ) {
156
-		if( $this->applies_to_version( $requested_value )
157
-			&& $original_value === EE_INF ) {
155
+	public function use_negative_one_for_infinity_before_this_version($new_value, $field_obj, $original_value, $requested_value) {
156
+		if ($this->applies_to_version($requested_value)
157
+			&& $original_value === EE_INF) {
158 158
 			//return the old representation of infinity in the JSON
159 159
 			return -1;
160 160
 		}
Please login to merge, or discard this patch.
core/EE_Config.core.php 1 patch
Spacing   +397 added lines, -397 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 */
129 129
 	public static function instance() {
130 130
 		// check if class object is instantiated, and instantiated properly
131
-		if ( ! self::$_instance instanceof EE_Config ) {
131
+		if ( ! self::$_instance instanceof EE_Config) {
132 132
 			self::$_instance = new self();
133 133
 		}
134 134
 		return self::$_instance;
@@ -145,22 +145,22 @@  discard block
 block discarded – undo
145 145
 	 * not be ready to instantiate EE_Config currently (eg if the site was put into maintenance mode)
146 146
 	 * @return EE_Config
147 147
 	 */
148
-	public static function reset( $hard_reset = FALSE, $reinstantiate = TRUE ){
149
-		if ( $hard_reset ) {
148
+	public static function reset($hard_reset = FALSE, $reinstantiate = TRUE) {
149
+		if ($hard_reset) {
150 150
 			self::$_instance->_config_option_names = array();
151 151
 			self::$_instance->_initialize_config();
152 152
 			self::$_instance->update_espresso_config();
153 153
 		}
154
-		if( self::$_instance instanceof EE_Config ){
154
+		if (self::$_instance instanceof EE_Config) {
155 155
 			self::$_instance->shutdown();
156 156
 		}
157 157
 		self::$_instance = NULL;
158 158
 		//we don't need to reset the static properties imo because those should
159 159
 		//only change when a module is added or removed. Currently we don't
160 160
 		//support removing a module during a request when it previously existed
161
-		if( $reinstantiate ){
161
+		if ($reinstantiate) {
162 162
 			return self::instance();
163
-		}else{
163
+		} else {
164 164
 			return NULL;
165 165
 		}
166 166
 	}
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 	 * @return \EE_Config
175 175
 	 */
176 176
 	private function __construct() {
177
-		do_action( 'AHEE__EE_Config__construct__begin',$this );
178
-		$this->_config_option_names = get_option( 'ee_config_option_names', array() );
177
+		do_action('AHEE__EE_Config__construct__begin', $this);
178
+		$this->_config_option_names = get_option('ee_config_option_names', array());
179 179
 		// setup empty config classes
180 180
 		$this->_initialize_config();
181 181
 		// load existing EE site settings
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
 		// confirm everything loaded correctly and set filtered defaults if not
184 184
 		$this->_verify_config();
185 185
 		//  register shortcodes and modules
186
-		add_action( 'AHEE__EE_System__register_shortcodes_modules_and_widgets', array( $this, 'register_shortcodes_and_modules' ), 999 );
186
+		add_action('AHEE__EE_System__register_shortcodes_modules_and_widgets', array($this, 'register_shortcodes_and_modules'), 999);
187 187
 		//  initialize shortcodes and modules
188
-		add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'initialize_shortcodes_and_modules' ));
188
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'initialize_shortcodes_and_modules'));
189 189
 		// register widgets
190
-		add_action( 'widgets_init', array( $this, 'widgets_init' ), 10 );
190
+		add_action('widgets_init', array($this, 'widgets_init'), 10);
191 191
 		// shutdown
192
-		add_action( 'shutdown', array( $this, 'shutdown' ), 10 );
192
+		add_action('shutdown', array($this, 'shutdown'), 10);
193 193
 		// construct__end hook
194
-		do_action( 'AHEE__EE_Config__construct__end',$this );
194
+		do_action('AHEE__EE_Config__construct__end', $this);
195 195
 		// hardcoded hack
196 196
 		$this->template_settings->current_espresso_theme = 'Espresso_Arabica_2014';
197 197
 	}
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 * @return string current theme set.
205 205
 	 */
206 206
 	public static function get_current_theme() {
207
-		return isset( self::$_instance->template_settings->current_espresso_theme ) ? self::$_instance->template_settings->current_espresso_theme : 'Espresso_Arabica_2014';
207
+		return isset(self::$_instance->template_settings->current_espresso_theme) ? self::$_instance->template_settings->current_espresso_theme : 'Espresso_Arabica_2014';
208 208
 	}
209 209
 
210 210
 
@@ -238,27 +238,27 @@  discard block
 block discarded – undo
238 238
 	 */
239 239
 	private function _load_core_config() {
240 240
 		// load_core_config__start hook
241
-		do_action( 'AHEE__EE_Config___load_core_config__start', $this );
241
+		do_action('AHEE__EE_Config___load_core_config__start', $this);
242 242
 		$espresso_config = $this->get_espresso_config();
243
-		foreach ( $espresso_config as $config => $settings ) {
243
+		foreach ($espresso_config as $config => $settings) {
244 244
 			// load_core_config__start hook
245
-			$settings = apply_filters( 'FHEE__EE_Config___load_core_config__config_settings', $settings, $config, $this );
246
-			if ( is_object( $settings ) && property_exists( $this, $config ) ) {
247
-				$this->{$config} = apply_filters( 'FHEE__EE_Config___load_core_config__' . $config, $settings );
245
+			$settings = apply_filters('FHEE__EE_Config___load_core_config__config_settings', $settings, $config, $this);
246
+			if (is_object($settings) && property_exists($this, $config)) {
247
+				$this->{$config} = apply_filters('FHEE__EE_Config___load_core_config__'.$config, $settings);
248 248
 				//call configs populate method to ensure any defaults are set for empty values.
249
-				if ( method_exists( $settings, 'populate' ) ) {
249
+				if (method_exists($settings, 'populate')) {
250 250
 					$this->{$config}->populate();
251 251
 				}
252
-				if ( method_exists( $settings, 'do_hooks' ) ) {
252
+				if (method_exists($settings, 'do_hooks')) {
253 253
 					$this->{$config}->do_hooks();
254 254
 				}
255 255
 			}
256 256
 		}
257
-		if ( apply_filters( 'FHEE__EE_Config___load_core_config__update_espresso_config', FALSE ) ) {
257
+		if (apply_filters('FHEE__EE_Config___load_core_config__update_espresso_config', FALSE)) {
258 258
 			$this->update_espresso_config();
259 259
 		}
260 260
 		// load_core_config__end hook
261
-		do_action( 'AHEE__EE_Config___load_core_config__end', $this );
261
+		do_action('AHEE__EE_Config___load_core_config__end', $this);
262 262
 	}
263 263
 
264 264
 
@@ -272,40 +272,40 @@  discard block
 block discarded – undo
272 272
 	protected function _verify_config() {
273 273
 
274 274
 		$this->core = $this->core instanceof EE_Core_Config
275
-			? $this->core  : new EE_Core_Config();
276
-		$this->core = apply_filters( 'FHEE__EE_Config___initialize_config__core', $this->core );
275
+			? $this->core : new EE_Core_Config();
276
+		$this->core = apply_filters('FHEE__EE_Config___initialize_config__core', $this->core);
277 277
 
278 278
 		$this->organization = $this->organization instanceof EE_Organization_Config
279
-			? $this->organization  : new EE_Organization_Config();
280
-		$this->organization = apply_filters( 'FHEE__EE_Config___initialize_config__organization', $this->organization );
279
+			? $this->organization : new EE_Organization_Config();
280
+		$this->organization = apply_filters('FHEE__EE_Config___initialize_config__organization', $this->organization);
281 281
 
282 282
 		$this->currency = $this->currency instanceof EE_Currency_Config
283 283
 			? $this->currency : new EE_Currency_Config();
284
-		$this->currency = apply_filters( 'FHEE__EE_Config___initialize_config__currency', $this->currency );
284
+		$this->currency = apply_filters('FHEE__EE_Config___initialize_config__currency', $this->currency);
285 285
 
286 286
 		$this->registration = $this->registration instanceof EE_Registration_Config
287 287
 			? $this->registration : new EE_Registration_Config();
288
-		$this->registration = apply_filters( 'FHEE__EE_Config___initialize_config__registration', $this->registration );
288
+		$this->registration = apply_filters('FHEE__EE_Config___initialize_config__registration', $this->registration);
289 289
 
290 290
 		$this->admin = $this->admin instanceof EE_Admin_Config
291 291
 			? $this->admin : new EE_Admin_Config();
292
-		$this->admin = apply_filters( 'FHEE__EE_Config___initialize_config__admin', $this->admin );
292
+		$this->admin = apply_filters('FHEE__EE_Config___initialize_config__admin', $this->admin);
293 293
 
294 294
 		$this->template_settings = $this->template_settings instanceof EE_Template_Config
295 295
 			? $this->template_settings : new EE_Template_Config();
296
-		$this->template_settings = apply_filters( 'FHEE__EE_Config___initialize_config__template_settings', $this->template_settings );
296
+		$this->template_settings = apply_filters('FHEE__EE_Config___initialize_config__template_settings', $this->template_settings);
297 297
 
298 298
 		$this->map_settings = $this->map_settings instanceof EE_Map_Config
299 299
 			? $this->map_settings : new EE_Map_Config();
300
-		$this->map_settings = apply_filters( 'FHEE__EE_Config___initialize_config__map_settings', $this->map_settings );
300
+		$this->map_settings = apply_filters('FHEE__EE_Config___initialize_config__map_settings', $this->map_settings);
301 301
 
302 302
 		$this->environment = $this->environment instanceof EE_Environment_Config
303 303
 			? $this->environment : new EE_Environment_Config();
304
-		$this->environment = apply_filters( 'FHEE__EE_Config___initialize_config__environment', $this->environment );
304
+		$this->environment = apply_filters('FHEE__EE_Config___initialize_config__environment', $this->environment);
305 305
 
306 306
 		$this->gateway = $this->gateway instanceof EE_Gateway_Config
307 307
 			? $this->gateway : new EE_Gateway_Config();
308
-		$this->gateway = apply_filters( 'FHEE__EE_Config___initialize_config__gateway', $this->gateway );
308
+		$this->gateway = apply_filters('FHEE__EE_Config___initialize_config__gateway', $this->gateway);
309 309
 
310 310
 	}
311 311
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 */
320 320
 	public function get_espresso_config() {
321 321
 		// grab espresso configuration
322
-		return apply_filters( 'FHEE__EE_Config__get_espresso_config__CFG', get_option( 'ee_config', array() ));
322
+		return apply_filters('FHEE__EE_Config__get_espresso_config__CFG', get_option('ee_config', array()));
323 323
 	}
324 324
 
325 325
 
@@ -332,12 +332,12 @@  discard block
 block discarded – undo
332 332
 	 * @param        $old_value
333 333
 	 * @param        $value
334 334
 	 */
335
-	public function double_check_config_comparison( $option = '', $old_value, $value ) {
335
+	public function double_check_config_comparison($option = '', $old_value, $value) {
336 336
 		// make sure we're checking the ee config
337
-		if ( $option == 'ee_config' ) {
337
+		if ($option == 'ee_config') {
338 338
 			// run a loose comparison of the old value against the new value for type and properties,
339 339
 			// but NOT exact instance like WP update_option does
340
-			if ( $value != $old_value ) {
340
+			if ($value != $old_value) {
341 341
 				// if they are NOT the same, then remove the hook,
342 342
 				// which means the subsequent update results will be based solely on the update query results
343 343
 				// the reason we do this is because, as stated above,
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 				// the string it sees in the db looks the same as the new one it has been passed!!!
353 353
 				// This results in the query returning an "affected rows" value of ZERO,
354 354
 				// which gets returned immediately by WP update_option and looks like an error.
355
-				remove_action( 'update_option', array( $this, 'check_config_updated' ));
355
+				remove_action('update_option', array($this, 'check_config_updated'));
356 356
 			}
357 357
 		}
358 358
 	}
@@ -367,11 +367,11 @@  discard block
 block discarded – undo
367 367
 	 */
368 368
 	protected function  _reset_espresso_addon_config() {
369 369
 		$this->_config_option_names = array();
370
-		foreach( $this->addons as $addon_name => $addon_config_obj ) {
371
-			$addon_config_obj = maybe_unserialize( $addon_config_obj );
372
-			$config_class = get_class( $addon_config_obj );
373
-			if ( $addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class ) {
374
-				$this->update_config( 'addons', $addon_name, $addon_config_obj, FALSE );
370
+		foreach ($this->addons as $addon_name => $addon_config_obj) {
371
+			$addon_config_obj = maybe_unserialize($addon_config_obj);
372
+			$config_class = get_class($addon_config_obj);
373
+			if ($addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class) {
374
+				$this->update_config('addons', $addon_name, $addon_config_obj, FALSE);
375 375
 			}
376 376
 			$this->addons->{$addon_name} = NULL;
377 377
 		}
@@ -387,17 +387,17 @@  discard block
 block discarded – undo
387 387
 	 * @param   bool $add_error
388 388
 	 * @return   bool
389 389
 	 */
390
-	public function  update_espresso_config( $add_success = FALSE, $add_error = TRUE ) {
390
+	public function  update_espresso_config($add_success = FALSE, $add_error = TRUE) {
391 391
 		// commented out the following re: https://events.codebasehq.com/projects/event-espresso/tickets/8197
392 392
 		//$clone = clone( self::$_instance );
393 393
 		//self::$_instance = NULL;
394
-		do_action( 'AHEE__EE_Config__update_espresso_config__begin',$this );
394
+		do_action('AHEE__EE_Config__update_espresso_config__begin', $this);
395 395
 		$this->_reset_espresso_addon_config();
396 396
 		// hook into update_option because that happens AFTER the ( $value === $old_value ) conditional
397 397
 		// but BEFORE the actual update occurs
398
-		add_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1, 3 );
398
+		add_action('update_option', array($this, 'double_check_config_comparison'), 1, 3);
399 399
 		// now update "ee_config"
400
-		$saved = update_option( 'ee_config', $this );
400
+		$saved = update_option('ee_config', $this);
401 401
 		// if not saved... check if the hook we just added still exists;
402 402
 		// if it does, it means one of two things:
403 403
 		// 		that update_option bailed at the ( $value === $old_value ) conditional,
@@ -408,25 +408,25 @@  discard block
 block discarded – undo
408 408
 		// but just means no update occurred, so don't display an error to the user.
409 409
 		// BUT... if update_option returns FALSE, AND the hook is missing,
410 410
 		// then it means that something truly went wrong
411
-		$saved = ! $saved ? has_action( 'update_option', array( $this, 'double_check_config_comparison' )) : $saved;
411
+		$saved = ! $saved ? has_action('update_option', array($this, 'double_check_config_comparison')) : $saved;
412 412
 		// remove our action since we don't want it in the system anymore
413
-		remove_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1 );
414
-		do_action( 'AHEE__EE_Config__update_espresso_config__end', $this, $saved );
413
+		remove_action('update_option', array($this, 'double_check_config_comparison'), 1);
414
+		do_action('AHEE__EE_Config__update_espresso_config__end', $this, $saved);
415 415
 		//self::$_instance = $clone;
416 416
 		//unset( $clone );
417 417
 		// if config remains the same or was updated successfully
418
-		if ( $saved ) {
419
-			if ( $add_success ) {
418
+		if ($saved) {
419
+			if ($add_success) {
420 420
 				EE_Error::add_success(
421
-					__( 'The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso' ),
421
+					__('The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso'),
422 422
 					__FILE__, __FUNCTION__, __LINE__
423 423
 				);
424 424
 			}
425 425
 			return TRUE;
426 426
 		} else {
427
-			if ( $add_error ) {
427
+			if ($add_error) {
428 428
 				EE_Error::add_error(
429
-					__( 'The Event Espresso Configuration Settings were not updated.', 'event_espresso' ),
429
+					__('The Event Espresso Configuration Settings were not updated.', 'event_espresso'),
430 430
 					__FILE__, __FUNCTION__, __LINE__
431 431
 				);
432 432
 			}
@@ -452,20 +452,20 @@  discard block
 block discarded – undo
452 452
 		$name = '',
453 453
 		$config_class = '',
454 454
 		$config_obj = NULL,
455
-		$tests_to_run = array( 1, 2, 3, 4, 5, 6, 7, 8 ),
455
+		$tests_to_run = array(1, 2, 3, 4, 5, 6, 7, 8),
456 456
 		$display_errors = TRUE
457 457
 	) {
458 458
 		try {
459
-			foreach ( $tests_to_run as $test ) {
460
-				switch ( $test ) {
459
+			foreach ($tests_to_run as $test) {
460
+				switch ($test) {
461 461
 
462 462
 					// TEST #1 : check that section was set
463 463
 					case 1 :
464
-						if ( empty( $section ) ) {
465
-							if ( $display_errors ) {
464
+						if (empty($section)) {
465
+							if ($display_errors) {
466 466
 								throw new EE_Error(
467 467
 									sprintf(
468
-										__( 'No configuration section has been provided while attempting to save "%s".', 'event_espresso' ),
468
+										__('No configuration section has been provided while attempting to save "%s".', 'event_espresso'),
469 469
 										$config_class
470 470
 									)
471 471
 								);
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
 
477 477
 					// TEST #2 : check that settings section exists
478 478
 					case 2 :
479
-						if ( ! isset( $this->{$section} ) ) {
480
-							if ( $display_errors ) {
479
+						if ( ! isset($this->{$section} )) {
480
+							if ($display_errors) {
481 481
 								throw new EE_Error(
482
-									sprintf( __( 'The "%s" configuration section does not exist.', 'event_espresso' ),
483
-											 $section )
482
+									sprintf(__('The "%s" configuration section does not exist.', 'event_espresso'),
483
+											 $section)
484 484
 								);
485 485
 							}
486 486
 							return false;
@@ -490,12 +490,12 @@  discard block
 block discarded – undo
490 490
 					// TEST #3 : check that section is the proper format
491 491
 					case 3 :
492 492
 						if (
493
-							! ( $this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass )
493
+							! ($this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass)
494 494
 						) {
495
-							if ( $display_errors ) {
495
+							if ($display_errors) {
496 496
 								throw new EE_Error(
497 497
 									sprintf(
498
-										__( 'The "%s" configuration settings have not been formatted correctly.', 'event_espresso' ),
498
+										__('The "%s" configuration settings have not been formatted correctly.', 'event_espresso'),
499 499
 										$section
500 500
 									)
501 501
 								);
@@ -506,10 +506,10 @@  discard block
 block discarded – undo
506 506
 
507 507
 					// TEST #4 : check that config section name has been set
508 508
 					case 4 :
509
-						if ( empty( $name ) ) {
510
-							if ( $display_errors ) {
509
+						if (empty($name)) {
510
+							if ($display_errors) {
511 511
 								throw new EE_Error(
512
-									__( 'No name has been provided for the specific configuration section.', 'event_espresso' )
512
+									__('No name has been provided for the specific configuration section.', 'event_espresso')
513 513
 								);
514 514
 							}
515 515
 							return false;
@@ -518,10 +518,10 @@  discard block
 block discarded – undo
518 518
 
519 519
 					// TEST #5 : check that a config class name has been set
520 520
 					case 5 :
521
-						if ( empty( $config_class ) ) {
522
-							if ( $display_errors ) {
521
+						if (empty($config_class)) {
522
+							if ($display_errors) {
523 523
 								throw new EE_Error(
524
-									__( 'No class name has been provided for the specific configuration section.', 'event_espresso' )
524
+									__('No class name has been provided for the specific configuration section.', 'event_espresso')
525 525
 								);
526 526
 							}
527 527
 							return false;
@@ -530,11 +530,11 @@  discard block
 block discarded – undo
530 530
 
531 531
 					// TEST #6 : verify config class is accessible
532 532
 					case 6 :
533
-						if ( ! class_exists( $config_class ) ) {
534
-							if ( $display_errors ) {
533
+						if ( ! class_exists($config_class)) {
534
+							if ($display_errors) {
535 535
 								throw new EE_Error(
536 536
 									sprintf(
537
-										__( 'The "%s" class does not exist. Please ensure that an autoloader has been set for it.', 'event_espresso' ),
537
+										__('The "%s" class does not exist. Please ensure that an autoloader has been set for it.', 'event_espresso'),
538 538
 										$config_class
539 539
 									)
540 540
 								);
@@ -545,11 +545,11 @@  discard block
 block discarded – undo
545 545
 
546 546
 					// TEST #7 : check that config has even been set
547 547
 					case 7 :
548
-						if ( ! isset( $this->{$section}->{$name} ) ) {
549
-							if ( $display_errors ) {
548
+						if ( ! isset($this->{$section}->{$name} )) {
549
+							if ($display_errors) {
550 550
 								throw new EE_Error(
551 551
 									sprintf(
552
-										__( 'No configuration has been set for "%1$s->%2$s".', 'event_espresso' ),
552
+										__('No configuration has been set for "%1$s->%2$s".', 'event_espresso'),
553 553
 										$section,
554 554
 										$name
555 555
 									)
@@ -558,17 +558,17 @@  discard block
 block discarded – undo
558 558
 							return false;
559 559
 						} else {
560 560
 							// and make sure it's not serialized
561
-							$this->{$section}->{$name} = maybe_unserialize( $this->{$section}->{$name} );
561
+							$this->{$section}->{$name} = maybe_unserialize($this->{$section}->{$name} );
562 562
 						}
563 563
 						break;
564 564
 
565 565
 					// TEST #8 : check that config is the requested type
566 566
 					case 8 :
567
-						if ( ! $this->{$section}->{$name} instanceof $config_class ) {
568
-							if ( $display_errors ) {
567
+						if ( ! $this->{$section}->{$name} instanceof $config_class) {
568
+							if ($display_errors) {
569 569
 								throw new EE_Error(
570 570
 									sprintf(
571
-										__( 'The configuration for "%1$s->%2$s" is not of the "%3$s" class.', 'event_espresso' ),
571
+										__('The configuration for "%1$s->%2$s" is not of the "%3$s" class.', 'event_espresso'),
572 572
 										$section,
573 573
 										$name,
574 574
 										$config_class
@@ -581,12 +581,12 @@  discard block
 block discarded – undo
581 581
 
582 582
 					// TEST #9 : verify config object
583 583
 					case 9 :
584
-						if ( ! $config_obj instanceof EE_Config_Base ) {
585
-							if ( $display_errors ) {
584
+						if ( ! $config_obj instanceof EE_Config_Base) {
585
+							if ($display_errors) {
586 586
 								throw new EE_Error(
587 587
 									sprintf(
588
-										__( 'The "%s" class is not an instance of EE_Config_Base.', 'event_espresso' ),
589
-										print_r( $config_obj, true )
588
+										__('The "%s" class is not an instance of EE_Config_Base.', 'event_espresso'),
589
+										print_r($config_obj, true)
590 590
 									)
591 591
 								);
592 592
 							}
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 				}
598 598
 			}
599 599
 
600
-		} catch( EE_Error $e ) {
600
+		} catch (EE_Error $e) {
601 601
 			$e->get_error();
602 602
 		}
603 603
 		// you have successfully run the gauntlet
@@ -614,8 +614,8 @@  discard block
 block discarded – undo
614 614
 	 * @param        string          $name
615 615
 	 * @return        string
616 616
 	 */
617
-	private function _generate_config_option_name( $section = '', $name = '' ) {
618
-		return 'ee_config-' . strtolower( $section . '-' . str_replace( array( 'EE_', 'EED_' ), '', $name ) );
617
+	private function _generate_config_option_name($section = '', $name = '') {
618
+		return 'ee_config-'.strtolower($section.'-'.str_replace(array('EE_', 'EED_'), '', $name));
619 619
 	}
620 620
 
621 621
 
@@ -629,10 +629,10 @@  discard block
 block discarded – undo
629 629
 	 * @param 	string $name
630 630
 	 * @return 	string
631 631
 	 */
632
-	private function _set_config_class( $config_class = '', $name = '' ) {
633
-		return ! empty( $config_class )
632
+	private function _set_config_class($config_class = '', $name = '') {
633
+		return ! empty($config_class)
634 634
 			? $config_class
635
-			: str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $name ) ) ) . '_Config';
635
+			: str_replace(' ', '_', ucwords(str_replace('_', ' ', $name))).'_Config';
636 636
 	}
637 637
 
638 638
 
@@ -646,34 +646,34 @@  discard block
 block discarded – undo
646 646
 	 * @param 	EE_Config_Base $config_obj
647 647
 	 * @return 	EE_Config_Base
648 648
 	 */
649
-	public function set_config( $section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null ) {
649
+	public function set_config($section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null) {
650 650
 		// ensure config class is set to something
651
-		$config_class = $this->_set_config_class( $config_class, $name );
651
+		$config_class = $this->_set_config_class($config_class, $name);
652 652
 		// run tests 1-4, 6, and 7 to verify all config params are set and valid
653
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, null, array( 1, 2, 3, 4, 5, 6 ))) {
653
+		if ( ! $this->_verify_config_params($section, $name, $config_class, null, array(1, 2, 3, 4, 5, 6))) {
654 654
 			return null;
655 655
 		}
656
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
656
+		$config_option_name = $this->_generate_config_option_name($section, $name);
657 657
 		// if the config option name hasn't been added yet to the list of option names we're tracking, then do so now
658
-		if ( ! isset( $this->_config_option_names[ $config_option_name ] )) {
659
-			$this->_config_option_names[ $config_option_name ] = $config_class;
658
+		if ( ! isset($this->_config_option_names[$config_option_name])) {
659
+			$this->_config_option_names[$config_option_name] = $config_class;
660 660
 		}
661 661
 		// verify the incoming config object but suppress errors
662
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), false )) {
662
+		if ( ! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), false)) {
663 663
 			$config_obj = new $config_class();
664 664
 		}
665
-		if ( get_option( $config_option_name ) ) {
666
-			update_option( $config_option_name, $config_obj );
665
+		if (get_option($config_option_name)) {
666
+			update_option($config_option_name, $config_obj);
667 667
 			$this->{$section}->{$name} = $config_obj;
668 668
 			return $this->{$section}->{$name};
669 669
 		} else {
670 670
 			// create a wp-option for this config
671
-			if ( add_option( $config_option_name, $config_obj, '', 'no' )) {
672
-				$this->{$section}->{$name} = maybe_unserialize( $config_obj );
671
+			if (add_option($config_option_name, $config_obj, '', 'no')) {
672
+				$this->{$section}->{$name} = maybe_unserialize($config_obj);
673 673
 				return $this->{$section}->{$name};
674 674
 			} else {
675 675
 				EE_Error::add_error(
676
-					sprintf( __( 'The "%s" could not be saved to the database.', 'event_espresso' ), $config_class ),
676
+					sprintf(__('The "%s" could not be saved to the database.', 'event_espresso'), $config_class),
677 677
 					__FILE__, __FUNCTION__, __LINE__
678 678
 				);
679 679
 				return null;
@@ -694,37 +694,37 @@  discard block
 block discarded – undo
694 694
 	 * @param 	bool 					$throw_errors
695 695
 	 * @return 	bool
696 696
 	 */
697
-	public function update_config( $section = '', $name = '', $config_obj = '', $throw_errors = true ) {
698
-		$config_obj = maybe_unserialize( $config_obj );
697
+	public function update_config($section = '', $name = '', $config_obj = '', $throw_errors = true) {
698
+		$config_obj = maybe_unserialize($config_obj);
699 699
 		// get class name of the incoming object
700
-		$config_class = get_class( $config_obj );
700
+		$config_class = get_class($config_obj);
701 701
 		// run tests 1-5 and 9 to verify config
702
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 1, 2, 3, 4, 7, 9 ))) {
702
+		if ( ! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(1, 2, 3, 4, 7, 9))) {
703 703
 			return false;
704 704
 		}
705
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
705
+		$config_option_name = $this->_generate_config_option_name($section, $name);
706 706
 		// check if config object has been added to db by seeing if config option name is in $this->_config_option_names array
707
-		if ( ! isset( $this->_config_option_names[ $config_option_name ] )) {
707
+		if ( ! isset($this->_config_option_names[$config_option_name])) {
708 708
 			// save new config to db
709
-			return $this->set_config( $section, $name, $config_class, $config_obj );
709
+			return $this->set_config($section, $name, $config_class, $config_obj);
710 710
 		} else {
711 711
 			// first check if the record already exists
712
-			$existing_config = get_option( $config_option_name );
713
-			$config_obj = serialize( $config_obj );
712
+			$existing_config = get_option($config_option_name);
713
+			$config_obj = serialize($config_obj);
714 714
 			// just return if db record is already up to date
715
-			if ( $existing_config == $config_obj ) {
715
+			if ($existing_config == $config_obj) {
716 716
 				$this->{$section}->{$name} = $config_obj;
717 717
 				return true;
718
-			} else if ( update_option( $config_option_name, $config_obj )) {
718
+			} else if (update_option($config_option_name, $config_obj)) {
719 719
 				// update wp-option for this config class
720 720
 				$this->{$section}->{$name} = $config_obj;
721 721
 				return true;
722
-			} elseif ( $throw_errors ) {
722
+			} elseif ($throw_errors) {
723 723
 				EE_Error::add_error(
724 724
 					sprintf(
725
-						__( 'The "%1$s" object stored at"%2$s" was not successfully updated in the database.', 'event_espresso' ),
725
+						__('The "%1$s" object stored at"%2$s" was not successfully updated in the database.', 'event_espresso'),
726 726
 						$config_class,
727
-						'EE_Config->' . $section . '->' . $name
727
+						'EE_Config->'.$section.'->'.$name
728 728
 					),
729 729
 					__FILE__, __FUNCTION__, __LINE__
730 730
 				);
@@ -744,34 +744,34 @@  discard block
 block discarded – undo
744 744
 	 * @param 	string 	$config_class
745 745
 	 * @return 	mixed EE_Config_Base | NULL
746 746
 	 */
747
-	public function get_config( $section = '', $name = '', $config_class = '' ) {
747
+	public function get_config($section = '', $name = '', $config_class = '') {
748 748
 		// ensure config class is set to something
749
-		$config_class = $this->_set_config_class( $config_class, $name );
749
+		$config_class = $this->_set_config_class($config_class, $name);
750 750
 		// run tests 1-4, 6 and 7 to verify that all params have been set
751
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, NULL, array( 1, 2, 3, 4, 5, 6 ))) {
751
+		if ( ! $this->_verify_config_params($section, $name, $config_class, NULL, array(1, 2, 3, 4, 5, 6))) {
752 752
 			return NULL;
753 753
 		}
754 754
 		// now test if the requested config object exists, but suppress errors
755
-		if ( $this->_verify_config_params( $section, $name, $config_class, NULL, array( 7, 8 ), FALSE )) {
755
+		if ($this->_verify_config_params($section, $name, $config_class, NULL, array(7, 8), FALSE)) {
756 756
 			// config already exists, so pass it back
757 757
 			return $this->{$section}->{$name};
758 758
 		}
759 759
 		// load config option from db if it exists
760
-		$config_obj = $this->get_config_option( $this->_generate_config_option_name( $section, $name ));
760
+		$config_obj = $this->get_config_option($this->_generate_config_option_name($section, $name));
761 761
 		// verify the newly retrieved config object, but suppress errors
762
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), FALSE )) {
762
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), FALSE)) {
763 763
 			// config is good, so set it and pass it back
764 764
 			$this->{$section}->{$name} = $config_obj;
765 765
 			return $this->{$section}->{$name};
766 766
 		}
767 767
 		// oops! $config_obj is not already set and does not exist in the db, so create a new one
768
-		$config_obj =$this->set_config( $section, $name, $config_class );
768
+		$config_obj = $this->set_config($section, $name, $config_class);
769 769
 		// verify the newly created config object
770
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ))) {
770
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9))) {
771 771
 			return $this->{$section}->{$name};
772 772
 		} else {
773 773
 			EE_Error::add_error(
774
-				sprintf( __( 'The "%s" could not be retrieved from the database.', 'event_espresso' ), $config_class ),
774
+				sprintf(__('The "%s" could not be retrieved from the database.', 'event_espresso'), $config_class),
775 775
 				__FILE__, __FUNCTION__, __LINE__
776 776
 			);
777 777
 		}
@@ -786,9 +786,9 @@  discard block
 block discarded – undo
786 786
 	 * @param 	string 	$config_option_name
787 787
 	 * @return 	mixed EE_Config_Base | FALSE
788 788
 	 */
789
-	public function get_config_option( $config_option_name = '' ) {
789
+	public function get_config_option($config_option_name = '') {
790 790
 		// retrieve the wp-option for this config class.
791
-		return maybe_unserialize( get_option( $config_option_name ));
791
+		return maybe_unserialize(get_option($config_option_name));
792 792
 	}
793 793
 
794 794
 
@@ -801,45 +801,45 @@  discard block
 block discarded – undo
801 801
 	 * @param $page_for_posts
802 802
 	 * @return    void
803 803
 	 */
804
-	public function update_post_shortcodes( $page_for_posts = '' ) {
804
+	public function update_post_shortcodes($page_for_posts = '') {
805 805
 		// make sure page_for_posts is set
806
-		$page_for_posts = ! empty( $page_for_posts ) ? $page_for_posts : EE_Config::get_page_for_posts();
806
+		$page_for_posts = ! empty($page_for_posts) ? $page_for_posts : EE_Config::get_page_for_posts();
807 807
 		// critical page shortcodes that we do NOT want added to the Posts page (blog)
808 808
 		$critical_shortcodes = $this->core->get_critical_pages_shortcodes_array();
809 809
 		// allow others to mess stuff up :D
810
-		do_action( 'AHEE__EE_Config__update_post_shortcodes', $this->core->post_shortcodes, $page_for_posts );
810
+		do_action('AHEE__EE_Config__update_post_shortcodes', $this->core->post_shortcodes, $page_for_posts);
811 811
 		// verify that post_shortcodes is set
812
-		$this->core->post_shortcodes = isset( $this->core->post_shortcodes ) && is_array( $this->core->post_shortcodes ) ? $this->core->post_shortcodes : array();
812
+		$this->core->post_shortcodes = isset($this->core->post_shortcodes) && is_array($this->core->post_shortcodes) ? $this->core->post_shortcodes : array();
813 813
 		// cycle thru post_shortcodes
814
-		foreach( $this->core->post_shortcodes as $post_name => $shortcodes ){
814
+		foreach ($this->core->post_shortcodes as $post_name => $shortcodes) {
815 815
 			// are there any shortcodes to track ?
816
-			if ( ! empty( $shortcodes )) {
816
+			if ( ! empty($shortcodes)) {
817 817
 				// loop thru list of tracked shortcodes
818
-				foreach( $shortcodes as $shortcode => $post_id ) {
818
+				foreach ($shortcodes as $shortcode => $post_id) {
819 819
 					// if shortcode is for a critical page, BUT this is NOT the corresponding critical page for that shortcode
820
-					if ( isset( $critical_shortcodes[ $post_id ] ) && $post_name == $page_for_posts ) {
820
+					if (isset($critical_shortcodes[$post_id]) && $post_name == $page_for_posts) {
821 821
 						// then remove this shortcode, because we don't want critical page shortcodes like ESPRESSO_TXN_PAGE running on the "Posts Page" (blog)
822
-						unset( $this->core->post_shortcodes[ $post_name ][ $shortcode ] );
822
+						unset($this->core->post_shortcodes[$post_name][$shortcode]);
823 823
 					}
824 824
 					// skip the posts page, because we want all shortcodes registered for it
825
-					if ( $post_name == $page_for_posts ) {
825
+					if ($post_name == $page_for_posts) {
826 826
 						continue;
827 827
 					}
828 828
 					// make sure post still exists
829
-					$post = get_post( $post_id );
830
-					if ( $post ) {
829
+					$post = get_post($post_id);
830
+					if ($post) {
831 831
 						// check that the post name matches what we have saved
832
-						if ( $post->post_name == $post_name ) {
832
+						if ($post->post_name == $post_name) {
833 833
 							// if so, then break before hitting the unset below
834 834
 							continue;
835 835
 						}
836 836
 					}
837 837
 					// we don't like missing posts around here >:(
838
-					unset( $this->core->post_shortcodes[ $post_name ] );
838
+					unset($this->core->post_shortcodes[$post_name]);
839 839
 				}
840 840
 			} else {
841 841
 				// you got no shortcodes to keep track of !
842
-				unset( $this->core->post_shortcodes[ $post_name ] );
842
+				unset($this->core->post_shortcodes[$post_name]);
843 843
 			}
844 844
 		}
845 845
 		//only show errors
@@ -858,14 +858,14 @@  discard block
 block discarded – undo
858 858
 	 *  @return 	string
859 859
 	 */
860 860
 	public static function get_page_for_posts() {
861
-		$page_for_posts = get_option( 'page_for_posts' );
862
-		if ( ! $page_for_posts ) {
861
+		$page_for_posts = get_option('page_for_posts');
862
+		if ( ! $page_for_posts) {
863 863
 			return 'posts';
864 864
 		}
865 865
 		/** @type WPDB $wpdb */
866 866
 		global $wpdb;
867 867
 		$SQL = "SELECT post_name from $wpdb->posts WHERE post_type='posts' OR post_type='page' AND post_status='publish' AND ID=%d";
868
-		return $wpdb->get_var( $wpdb->prepare( $SQL, $page_for_posts ));
868
+		return $wpdb->get_var($wpdb->prepare($SQL, $page_for_posts));
869 869
 	}
870 870
 
871 871
 
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
 	 */
883 883
 	public function register_shortcodes_and_modules() {
884 884
 		// allow shortcodes to register with WP and to set hooks for the rest of the system
885
-		EE_Registry::instance()->shortcodes =$this->_register_shortcodes();
885
+		EE_Registry::instance()->shortcodes = $this->_register_shortcodes();
886 886
 		// allow modules to set hooks for the rest of the system
887 887
 		EE_Registry::instance()->modules = $this->_register_modules();
888 888
 	}
@@ -914,21 +914,21 @@  discard block
 block discarded – undo
914 914
 	public function widgets_init() {
915 915
 		//only init widgets on admin pages when not in complete maintenance, and
916 916
 		//on frontend when not in any maintenance mode
917
-		if (( is_admin() && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance)  || ! EE_Maintenance_Mode::instance()->level() ) {
917
+		if ((is_admin() && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) || ! EE_Maintenance_Mode::instance()->level()) {
918 918
 			// grab list of installed widgets
919
-			$widgets_to_register = glob( EE_WIDGETS . '*', GLOB_ONLYDIR );
919
+			$widgets_to_register = glob(EE_WIDGETS.'*', GLOB_ONLYDIR);
920 920
 			// filter list of modules to register
921
-			$widgets_to_register = apply_filters( 'FHEE__EE_Config__register_widgets__widgets_to_register', $widgets_to_register );
921
+			$widgets_to_register = apply_filters('FHEE__EE_Config__register_widgets__widgets_to_register', $widgets_to_register);
922 922
 
923
-			if ( ! empty( $widgets_to_register ) ) {
923
+			if ( ! empty($widgets_to_register)) {
924 924
 				// cycle thru widget folders
925
-				foreach ( $widgets_to_register as $widget_path ) {
925
+				foreach ($widgets_to_register as $widget_path) {
926 926
 					// add to list of installed widget modules
927
-					EE_Config::register_ee_widget( $widget_path );
927
+					EE_Config::register_ee_widget($widget_path);
928 928
 				}
929 929
 			}
930 930
 			// filter list of installed modules
931
-			EE_Registry::instance()->widgets = apply_filters( 'FHEE__EE_Config__register_widgets__installed_widgets', EE_Registry::instance()->widgets );
931
+			EE_Registry::instance()->widgets = apply_filters('FHEE__EE_Config__register_widgets__installed_widgets', EE_Registry::instance()->widgets);
932 932
 		}
933 933
 	}
934 934
 
@@ -941,54 +941,54 @@  discard block
 block discarded – undo
941 941
 	 *  @param 	string 	$widget_path - full path up to and including widget folder
942 942
 	 *  @return 	void
943 943
 	 */
944
-	public static function register_ee_widget( $widget_path = NULL ) {
945
-		do_action( 'AHEE__EE_Config__register_widget__begin', $widget_path );
944
+	public static function register_ee_widget($widget_path = NULL) {
945
+		do_action('AHEE__EE_Config__register_widget__begin', $widget_path);
946 946
 		$widget_ext = '.widget.php';
947 947
 		// make all separators match
948
-		$widget_path = rtrim( str_replace( '/\\', DS, $widget_path ), DS );
948
+		$widget_path = rtrim(str_replace('/\\', DS, $widget_path), DS);
949 949
 		// does the file path INCLUDE the actual file name as part of the path ?
950
-		if ( strpos( $widget_path, $widget_ext ) !== FALSE ) {
950
+		if (strpos($widget_path, $widget_ext) !== FALSE) {
951 951
 			// grab and shortcode file name from directory name and break apart at dots
952
-			$file_name = explode( '.', basename( $widget_path ));
952
+			$file_name = explode('.', basename($widget_path));
953 953
 			// take first segment from file name pieces and remove class prefix if it exists
954
-			$widget = strpos( $file_name[0], 'EEW_' ) === 0 ? substr( $file_name[0], 4 ) : $file_name[0];
954
+			$widget = strpos($file_name[0], 'EEW_') === 0 ? substr($file_name[0], 4) : $file_name[0];
955 955
 			// sanitize shortcode directory name
956
-			$widget = sanitize_key( $widget );
956
+			$widget = sanitize_key($widget);
957 957
 			// now we need to rebuild the shortcode path
958
-			$widget_path = explode( DS, $widget_path );
958
+			$widget_path = explode(DS, $widget_path);
959 959
 			// remove last segment
960
-			array_pop( $widget_path );
960
+			array_pop($widget_path);
961 961
 			// glue it back together
962
-			$widget_path = implode( DS, $widget_path );
962
+			$widget_path = implode(DS, $widget_path);
963 963
 		} else {
964 964
 			// grab and sanitize widget directory name
965
-			$widget = sanitize_key( basename( $widget_path ));
965
+			$widget = sanitize_key(basename($widget_path));
966 966
 		}
967 967
 		// create classname from widget directory name
968
-		$widget = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $widget )));
968
+		$widget = str_replace(' ', '_', ucwords(str_replace('_', ' ', $widget)));
969 969
 		// add class prefix
970
-		$widget_class = 'EEW_' . $widget;
970
+		$widget_class = 'EEW_'.$widget;
971 971
 		// does the widget exist ?
972
-		if ( ! is_readable( $widget_path . DS . $widget_class . $widget_ext )) {
972
+		if ( ! is_readable($widget_path.DS.$widget_class.$widget_ext)) {
973 973
 			$msg = sprintf(
974
-				__( 'The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s', 'event_espresso' ),
974
+				__('The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s', 'event_espresso'),
975 975
 				$widget_class,
976
-				$widget_path . DS . $widget_class . $widget_ext
976
+				$widget_path.DS.$widget_class.$widget_ext
977 977
 			);
978
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
978
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
979 979
 			return;
980 980
 		}
981 981
 		// load the widget class file
982
-		require_once( $widget_path . DS . $widget_class . $widget_ext );
982
+		require_once($widget_path.DS.$widget_class.$widget_ext);
983 983
 		// verify that class exists
984
-		if ( ! class_exists( $widget_class )) {
985
-			$msg = sprintf( __( 'The requested %s widget class does not exist.', 'event_espresso' ), $widget_class );
986
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
984
+		if ( ! class_exists($widget_class)) {
985
+			$msg = sprintf(__('The requested %s widget class does not exist.', 'event_espresso'), $widget_class);
986
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
987 987
 			return;
988 988
 		}
989
-		register_widget( $widget_class );
989
+		register_widget($widget_class);
990 990
 		// add to array of registered widgets
991
-		EE_Registry::instance()->widgets->{$widget_class} = $widget_path . DS . $widget_class . $widget_ext;
991
+		EE_Registry::instance()->widgets->{$widget_class} = $widget_path.DS.$widget_class.$widget_ext;
992 992
 	}
993 993
 
994 994
 
@@ -1001,18 +1001,18 @@  discard block
 block discarded – undo
1001 1001
 	 */
1002 1002
 	private function _register_shortcodes() {
1003 1003
 		// grab list of installed shortcodes
1004
-		$shortcodes_to_register = glob( EE_SHORTCODES . '*', GLOB_ONLYDIR );
1004
+		$shortcodes_to_register = glob(EE_SHORTCODES.'*', GLOB_ONLYDIR);
1005 1005
 		// filter list of modules to register
1006
-		$shortcodes_to_register = apply_filters( 'FHEE__EE_Config__register_shortcodes__shortcodes_to_register', $shortcodes_to_register );
1007
-		if ( ! empty( $shortcodes_to_register ) ) {
1006
+		$shortcodes_to_register = apply_filters('FHEE__EE_Config__register_shortcodes__shortcodes_to_register', $shortcodes_to_register);
1007
+		if ( ! empty($shortcodes_to_register)) {
1008 1008
 			// cycle thru shortcode folders
1009
-			foreach ( $shortcodes_to_register as $shortcode_path ) {
1009
+			foreach ($shortcodes_to_register as $shortcode_path) {
1010 1010
 				// add to list of installed shortcode modules
1011
-				EE_Config::register_shortcode( $shortcode_path );
1011
+				EE_Config::register_shortcode($shortcode_path);
1012 1012
 			}
1013 1013
 		}
1014 1014
 		// filter list of installed modules
1015
-		return apply_filters( 'FHEE__EE_Config___register_shortcodes__installed_shortcodes', EE_Registry::instance()->shortcodes );
1015
+		return apply_filters('FHEE__EE_Config___register_shortcodes__installed_shortcodes', EE_Registry::instance()->shortcodes);
1016 1016
 	}
1017 1017
 
1018 1018
 
@@ -1024,56 +1024,56 @@  discard block
 block discarded – undo
1024 1024
 	 *  @param 	string 		$shortcode_path - full path up to and including shortcode folder
1025 1025
 	 *  @return 	bool
1026 1026
 	 */
1027
-	public static function register_shortcode( $shortcode_path = NULL ) {
1028
-		do_action( 'AHEE__EE_Config__register_shortcode__begin',$shortcode_path );
1027
+	public static function register_shortcode($shortcode_path = NULL) {
1028
+		do_action('AHEE__EE_Config__register_shortcode__begin', $shortcode_path);
1029 1029
 		$shortcode_ext = '.shortcode.php';
1030 1030
 		// make all separators match
1031
-		$shortcode_path = str_replace( array( '\\', '/' ), DS, $shortcode_path );
1031
+		$shortcode_path = str_replace(array('\\', '/'), DS, $shortcode_path);
1032 1032
 		// does the file path INCLUDE the actual file name as part of the path ?
1033
-		if ( strpos( $shortcode_path, $shortcode_ext ) !== FALSE ) {
1033
+		if (strpos($shortcode_path, $shortcode_ext) !== FALSE) {
1034 1034
 			// grab shortcode file name from directory name and break apart at dots
1035
-			$shortcode_file = explode( '.', basename( $shortcode_path ));
1035
+			$shortcode_file = explode('.', basename($shortcode_path));
1036 1036
 			// take first segment from file name pieces and remove class prefix if it exists
1037
-			$shortcode = strpos( $shortcode_file[0], 'EES_' ) === 0 ? substr( $shortcode_file[0], 4 ) : $shortcode_file[0];
1037
+			$shortcode = strpos($shortcode_file[0], 'EES_') === 0 ? substr($shortcode_file[0], 4) : $shortcode_file[0];
1038 1038
 			// sanitize shortcode directory name
1039
-			$shortcode = sanitize_key( $shortcode );
1039
+			$shortcode = sanitize_key($shortcode);
1040 1040
 			// now we need to rebuild the shortcode path
1041
-			$shortcode_path = explode( DS, $shortcode_path );
1041
+			$shortcode_path = explode(DS, $shortcode_path);
1042 1042
 			// remove last segment
1043
-			array_pop( $shortcode_path );
1043
+			array_pop($shortcode_path);
1044 1044
 			// glue it back together
1045
-			$shortcode_path = implode( DS, $shortcode_path ) . DS;
1045
+			$shortcode_path = implode(DS, $shortcode_path).DS;
1046 1046
 		} else {
1047 1047
 			// we need to generate the filename based off of the folder name
1048 1048
 			// grab and sanitize shortcode directory name
1049
-			$shortcode = sanitize_key( basename( $shortcode_path ));
1050
-			$shortcode_path = rtrim( $shortcode_path, DS ) . DS;
1049
+			$shortcode = sanitize_key(basename($shortcode_path));
1050
+			$shortcode_path = rtrim($shortcode_path, DS).DS;
1051 1051
 		}
1052 1052
 		// create classname from shortcode directory or file name
1053
-		$shortcode = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $shortcode )));
1053
+		$shortcode = str_replace(' ', '_', ucwords(str_replace('_', ' ', $shortcode)));
1054 1054
 		// add class prefix
1055
-		$shortcode_class = 'EES_' . $shortcode;
1055
+		$shortcode_class = 'EES_'.$shortcode;
1056 1056
 		// does the shortcode exist ?
1057
-		if ( ! is_readable( $shortcode_path . DS . $shortcode_class . $shortcode_ext )) {
1057
+		if ( ! is_readable($shortcode_path.DS.$shortcode_class.$shortcode_ext)) {
1058 1058
 			$msg = sprintf(
1059
-				__( 'The requested %s shortcode file could not be found or is not readable due to file permissions. It should be in %s', 'event_espresso' ),
1059
+				__('The requested %s shortcode file could not be found or is not readable due to file permissions. It should be in %s', 'event_espresso'),
1060 1060
 				$shortcode_class,
1061
-				$shortcode_path . DS . $shortcode_class . $shortcode_ext
1061
+				$shortcode_path.DS.$shortcode_class.$shortcode_ext
1062 1062
 			);
1063
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1063
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1064 1064
 			return FALSE;
1065 1065
 		}
1066 1066
 		// load the shortcode class file
1067
-		require_once( $shortcode_path . $shortcode_class . $shortcode_ext );
1067
+		require_once($shortcode_path.$shortcode_class.$shortcode_ext);
1068 1068
 		// verify that class exists
1069
-		if ( ! class_exists( $shortcode_class )) {
1070
-			$msg = sprintf( __( 'The requested %s shortcode class does not exist.', 'event_espresso' ), $shortcode_class );
1071
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1069
+		if ( ! class_exists($shortcode_class)) {
1070
+			$msg = sprintf(__('The requested %s shortcode class does not exist.', 'event_espresso'), $shortcode_class);
1071
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1072 1072
 			return FALSE;
1073 1073
 		}
1074
-		$shortcode = strtoupper( $shortcode );
1074
+		$shortcode = strtoupper($shortcode);
1075 1075
 		// add to array of registered shortcodes
1076
-		EE_Registry::instance()->shortcodes->{$shortcode} = $shortcode_path . $shortcode_class . $shortcode_ext;
1076
+		EE_Registry::instance()->shortcodes->{$shortcode} = $shortcode_path.$shortcode_class.$shortcode_ext;
1077 1077
 		return TRUE;
1078 1078
 	}
1079 1079
 
@@ -1088,23 +1088,23 @@  discard block
 block discarded – undo
1088 1088
 	 */
1089 1089
 	private function _register_modules() {
1090 1090
 		// grab list of installed modules
1091
-		$modules_to_register = glob( EE_MODULES . '*', GLOB_ONLYDIR );
1091
+		$modules_to_register = glob(EE_MODULES.'*', GLOB_ONLYDIR);
1092 1092
 		// filter list of modules to register
1093
-		$modules_to_register = apply_filters( 'FHEE__EE_Config__register_modules__modules_to_register', $modules_to_register );
1093
+		$modules_to_register = apply_filters('FHEE__EE_Config__register_modules__modules_to_register', $modules_to_register);
1094 1094
 
1095 1095
 
1096
-		if ( ! empty( $modules_to_register ) ) {
1096
+		if ( ! empty($modules_to_register)) {
1097 1097
 			// loop through folders
1098
-			foreach ( $modules_to_register as $module_path ) {
1098
+			foreach ($modules_to_register as $module_path) {
1099 1099
 				/**TEMPORARILY EXCLUDE gateways from modules for time being**/
1100
-				if ( $module_path != EE_MODULES . 'zzz-copy-this-module-template' && $module_path != EE_MODULES . 'gateways' ) {
1100
+				if ($module_path != EE_MODULES.'zzz-copy-this-module-template' && $module_path != EE_MODULES.'gateways') {
1101 1101
 					// add to list of installed modules
1102
-					EE_Config::register_module( $module_path );
1102
+					EE_Config::register_module($module_path);
1103 1103
 				}
1104 1104
 			}
1105 1105
 		}
1106 1106
 		// filter list of installed modules
1107
-		return apply_filters( 'FHEE__EE_Config___register_modules__installed_modules', EE_Registry::instance()->modules );
1107
+		return apply_filters('FHEE__EE_Config___register_modules__installed_modules', EE_Registry::instance()->modules);
1108 1108
 	}
1109 1109
 
1110 1110
 
@@ -1117,54 +1117,54 @@  discard block
 block discarded – undo
1117 1117
 	 *  @param 	string 		$module_path - full path up to and including module folder
1118 1118
 	 *  @return 	bool
1119 1119
 	 */
1120
-	public static function register_module( $module_path = NULL ) {
1121
-		do_action( 'AHEE__EE_Config__register_module__begin', $module_path );
1120
+	public static function register_module($module_path = NULL) {
1121
+		do_action('AHEE__EE_Config__register_module__begin', $module_path);
1122 1122
 		$module_ext = '.module.php';
1123 1123
 		// make all separators match
1124
-		$module_path = str_replace( array( '\\', '/' ), DS, $module_path );
1124
+		$module_path = str_replace(array('\\', '/'), DS, $module_path);
1125 1125
 		// does the file path INCLUDE the actual file name as part of the path ?
1126
-		if ( strpos( $module_path, $module_ext ) !== FALSE ) {
1126
+		if (strpos($module_path, $module_ext) !== FALSE) {
1127 1127
 			// grab and shortcode file name from directory name and break apart at dots
1128
-			$module_file = explode( '.', basename( $module_path ));
1128
+			$module_file = explode('.', basename($module_path));
1129 1129
 			// now we need to rebuild the shortcode path
1130
-			$module_path = explode( DS, $module_path );
1130
+			$module_path = explode(DS, $module_path);
1131 1131
 			// remove last segment
1132
-			array_pop( $module_path );
1132
+			array_pop($module_path);
1133 1133
 			// glue it back together
1134
-			$module_path = implode( DS, $module_path ) . DS;
1134
+			$module_path = implode(DS, $module_path).DS;
1135 1135
 			// take first segment from file name pieces and sanitize it
1136
-			$module = preg_replace( '/[^a-zA-Z0-9_\-]/', '', $module_file[0] );
1136
+			$module = preg_replace('/[^a-zA-Z0-9_\-]/', '', $module_file[0]);
1137 1137
 			// ensure class prefix is added
1138
-			$module_class = strpos( $module, 'EED_' ) !== 0 ? 'EED_' . $module : $module;
1138
+			$module_class = strpos($module, 'EED_') !== 0 ? 'EED_'.$module : $module;
1139 1139
 		} else {
1140 1140
 			// we need to generate the filename based off of the folder name
1141 1141
 			// grab and sanitize module name
1142
-			$module = strtolower( basename( $module_path ));
1143
-			$module = preg_replace( '/[^a-z0-9_\-]/', '', $module);
1142
+			$module = strtolower(basename($module_path));
1143
+			$module = preg_replace('/[^a-z0-9_\-]/', '', $module);
1144 1144
 			// like trailingslashit()
1145
-			$module_path = rtrim( $module_path, DS ) . DS;
1145
+			$module_path = rtrim($module_path, DS).DS;
1146 1146
 			// create classname from module directory name
1147
-			$module = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $module )));
1147
+			$module = str_replace(' ', '_', ucwords(str_replace('_', ' ', $module)));
1148 1148
 			// add class prefix
1149
-			$module_class = 'EED_' . $module;
1149
+			$module_class = 'EED_'.$module;
1150 1150
 		}
1151 1151
 		// does the module exist ?
1152
-		if ( ! is_readable( $module_path . DS . $module_class . $module_ext )) {
1153
-			$msg = sprintf( __( 'The requested %s module file could not be found or is not readable due to file permissions.', 'event_espresso' ), $module );
1154
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1152
+		if ( ! is_readable($module_path.DS.$module_class.$module_ext)) {
1153
+			$msg = sprintf(__('The requested %s module file could not be found or is not readable due to file permissions.', 'event_espresso'), $module);
1154
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1155 1155
 			return FALSE;
1156 1156
 		}
1157 1157
 		// load the module class file
1158
-		require_once( $module_path . $module_class . $module_ext );
1158
+		require_once($module_path.$module_class.$module_ext);
1159 1159
 		// verify that class exists
1160
-		if ( ! class_exists( $module_class )) {
1161
-			$msg = sprintf( __( 'The requested %s module class does not exist.', 'event_espresso' ), $module_class );
1162
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1160
+		if ( ! class_exists($module_class)) {
1161
+			$msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class);
1162
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1163 1163
 			return FALSE;
1164 1164
 		}
1165 1165
 		// add to array of registered modules
1166
-		EE_Registry::instance()->modules->{$module_class} = $module_path . $module_class . $module_ext;
1167
-		do_action( 'AHEE__EE_Config__register_module__complete', $module_class, EE_Registry::instance()->modules->{$module_class} );
1166
+		EE_Registry::instance()->modules->{$module_class} = $module_path.$module_class.$module_ext;
1167
+		do_action('AHEE__EE_Config__register_module__complete', $module_class, EE_Registry::instance()->modules->{$module_class} );
1168 1168
 		return TRUE;
1169 1169
 	}
1170 1170
 
@@ -1178,23 +1178,23 @@  discard block
 block discarded – undo
1178 1178
 	 */
1179 1179
 	private function _initialize_shortcodes() {
1180 1180
 		// cycle thru shortcode folders
1181
-		foreach ( EE_Registry::instance()->shortcodes as $shortcode => $shortcode_path ) {
1181
+		foreach (EE_Registry::instance()->shortcodes as $shortcode => $shortcode_path) {
1182 1182
 			// add class prefix
1183
-			$shortcode_class = 'EES_' . $shortcode;
1183
+			$shortcode_class = 'EES_'.$shortcode;
1184 1184
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1185 1185
 			// which set hooks ?
1186
-			if ( is_admin() ) {
1186
+			if (is_admin()) {
1187 1187
 				// fire immediately
1188
-				call_user_func( array( $shortcode_class, 'set_hooks_admin' ));
1188
+				call_user_func(array($shortcode_class, 'set_hooks_admin'));
1189 1189
 			} else {
1190 1190
 				// delay until other systems are online
1191
-				add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array( $shortcode_class,'set_hooks' ));
1191
+				add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array($shortcode_class, 'set_hooks'));
1192 1192
 				// convert classname to UPPERCASE and create WP shortcode.
1193
-				$shortcode_tag = strtoupper( $shortcode );
1193
+				$shortcode_tag = strtoupper($shortcode);
1194 1194
 				// but first check if the shortcode has already been added before assigning 'fallback_shortcode_processor'
1195
-				if ( ! shortcode_exists( $shortcode_tag )) {
1195
+				if ( ! shortcode_exists($shortcode_tag)) {
1196 1196
 					// NOTE: this shortcode declaration will get overridden if the shortcode is successfully detected in the post content in EE_Front_Controller->_initialize_shortcodes()
1197
-					add_shortcode( $shortcode_tag, array( $shortcode_class, 'fallback_shortcode_processor' ));
1197
+					add_shortcode($shortcode_tag, array($shortcode_class, 'fallback_shortcode_processor'));
1198 1198
 				}
1199 1199
 			}
1200 1200
 		}
@@ -1211,15 +1211,15 @@  discard block
 block discarded – undo
1211 1211
 	 */
1212 1212
 	private function _initialize_modules() {
1213 1213
 		// cycle thru shortcode folders
1214
-		foreach ( EE_Registry::instance()->modules as $module_class => $module_path ) {
1214
+		foreach (EE_Registry::instance()->modules as $module_class => $module_path) {
1215 1215
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1216 1216
 			// which set hooks ?
1217
-			if ( is_admin() ) {
1217
+			if (is_admin()) {
1218 1218
 				// fire immediately
1219
-				call_user_func( array( $module_class, 'set_hooks_admin' ));
1219
+				call_user_func(array($module_class, 'set_hooks_admin'));
1220 1220
 			} else {
1221 1221
 				// delay until other systems are online
1222
-				add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array( $module_class,'set_hooks' ));
1222
+				add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array($module_class, 'set_hooks'));
1223 1223
 			}
1224 1224
 		}
1225 1225
 	}
@@ -1237,26 +1237,26 @@  discard block
 block discarded – undo
1237 1237
 	 *  @param 	string 		$key - url param key indicating a route is being called
1238 1238
 	 *  @return 	bool
1239 1239
 	 */
1240
-	public static function register_route( $route = NULL, $module = NULL, $method_name = NULL, $key = 'ee' ) {
1241
-		do_action( 'AHEE__EE_Config__register_route__begin', $route, $module, $method_name );
1242
-		$module = str_replace( 'EED_', '', $module );
1243
-		$module_class = 'EED_' . $module;
1244
-		if ( ! isset( EE_Registry::instance()->modules->{$module_class} )) {
1245
-			$msg = sprintf( __( 'The module %s has not been registered.', 'event_espresso' ), $module );
1246
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1240
+	public static function register_route($route = NULL, $module = NULL, $method_name = NULL, $key = 'ee') {
1241
+		do_action('AHEE__EE_Config__register_route__begin', $route, $module, $method_name);
1242
+		$module = str_replace('EED_', '', $module);
1243
+		$module_class = 'EED_'.$module;
1244
+		if ( ! isset(EE_Registry::instance()->modules->{$module_class} )) {
1245
+			$msg = sprintf(__('The module %s has not been registered.', 'event_espresso'), $module);
1246
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1247 1247
 			return FALSE;
1248 1248
 		}
1249
-		if ( empty( $route )) {
1250
-			$msg = sprintf( __( 'No route has been supplied.', 'event_espresso' ), $route );
1251
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1249
+		if (empty($route)) {
1250
+			$msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1251
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1252 1252
 			return FALSE;
1253 1253
 		}
1254
-		if ( ! method_exists ( 'EED_' . $module, $method_name )) {
1255
-			$msg = sprintf( __( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ), $route );
1256
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1254
+		if ( ! method_exists('EED_'.$module, $method_name)) {
1255
+			$msg = sprintf(__('A valid class method for the %s route has not been supplied.', 'event_espresso'), $route);
1256
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1257 1257
 			return FALSE;
1258 1258
 		}
1259
-		EE_Config::$_module_route_map[ $key ][ $route ] = array( 'EED_' . $module, $method_name );
1259
+		EE_Config::$_module_route_map[$key][$route] = array('EED_'.$module, $method_name);
1260 1260
 		return TRUE;
1261 1261
 	}
1262 1262
 
@@ -1270,11 +1270,11 @@  discard block
 block discarded – undo
1270 1270
 	 *  @param 	string 		$key - url param key indicating a route is being called
1271 1271
 	 *  @return 	string
1272 1272
 	 */
1273
-	public static function get_route( $route = NULL, $key = 'ee' ) {
1274
-		do_action( 'AHEE__EE_Config__get_route__begin',$route );
1275
-		$route = apply_filters( 'FHEE__EE_Config__get_route',$route );
1276
-		if ( isset( EE_Config::$_module_route_map[ $key ][ $route ] )) {
1277
-			return EE_Config::$_module_route_map[ $key ][ $route ];
1273
+	public static function get_route($route = NULL, $key = 'ee') {
1274
+		do_action('AHEE__EE_Config__get_route__begin', $route);
1275
+		$route = apply_filters('FHEE__EE_Config__get_route', $route);
1276
+		if (isset(EE_Config::$_module_route_map[$key][$route])) {
1277
+			return EE_Config::$_module_route_map[$key][$route];
1278 1278
 		}
1279 1279
 		return NULL;
1280 1280
 	}
@@ -1303,35 +1303,35 @@  discard block
 block discarded – undo
1303 1303
 	 * @param    string 		$key - url param key indicating a route is being called
1304 1304
 	 * @return    bool
1305 1305
 	 */
1306
-	public static function register_forward( $route = NULL, $status = 0, $forward = NULL, $key = 'ee' ) {
1307
-		do_action( 'AHEE__EE_Config__register_forward',$route,$status,$forward );
1308
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) ||  empty( $route )) {
1309
-			$msg = sprintf( __( 'The module route %s for this forward has not been registered.', 'event_espresso' ), $route );
1310
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1306
+	public static function register_forward($route = NULL, $status = 0, $forward = NULL, $key = 'ee') {
1307
+		do_action('AHEE__EE_Config__register_forward', $route, $status, $forward);
1308
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1309
+			$msg = sprintf(__('The module route %s for this forward has not been registered.', 'event_espresso'), $route);
1310
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1311 1311
 			return FALSE;
1312 1312
 		}
1313
-		if ( empty( $forward )) {
1314
-			$msg = sprintf( __( 'No forwarding route has been supplied.', 'event_espresso' ), $route );
1315
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1313
+		if (empty($forward)) {
1314
+			$msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1315
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1316 1316
 			return FALSE;
1317 1317
 		}
1318
-		if ( is_array( $forward )) {
1319
-			if ( ! isset( $forward[1] )) {
1320
-				$msg = sprintf( __( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ), $route );
1321
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1318
+		if (is_array($forward)) {
1319
+			if ( ! isset($forward[1])) {
1320
+				$msg = sprintf(__('A class method for the %s forwarding route has not been supplied.', 'event_espresso'), $route);
1321
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1322 1322
 				return FALSE;
1323 1323
 			}
1324
-			if ( ! method_exists( $forward[0], $forward[1] )) {
1325
-				$msg = sprintf( __( 'The class method %s for the %s forwarding route is in invalid.', 'event_espresso' ), $forward[1], $route );
1326
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1324
+			if ( ! method_exists($forward[0], $forward[1])) {
1325
+				$msg = sprintf(__('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'), $forward[1], $route);
1326
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1327 1327
 				return FALSE;
1328 1328
 			}
1329
-		} else if ( ! function_exists( $forward )) {
1330
-			$msg = sprintf( __( 'The function %s for the %s forwarding route is in invalid.', 'event_espresso' ), $forward, $route );
1331
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1329
+		} else if ( ! function_exists($forward)) {
1330
+			$msg = sprintf(__('The function %s for the %s forwarding route is in invalid.', 'event_espresso'), $forward, $route);
1331
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1332 1332
 			return FALSE;
1333 1333
 		}
1334
-		EE_Config::$_module_forward_map[ $key ][ $route ][ absint( $status ) ] = $forward;
1334
+		EE_Config::$_module_forward_map[$key][$route][absint($status)] = $forward;
1335 1335
 		return TRUE;
1336 1336
 	}
1337 1337
 
@@ -1346,10 +1346,10 @@  discard block
 block discarded – undo
1346 1346
 	 *  @param    string 		$key - url param key indicating a route is being called
1347 1347
 	 *  @return 	string
1348 1348
 	 */
1349
-	public static function get_forward( $route = NULL, $status = 0, $key = 'ee' ) {
1350
-		do_action( 'AHEE__EE_Config__get_forward__begin',$route,$status );
1351
-		if ( isset( EE_Config::$_module_forward_map[ $key ][ $route ][ $status ] )) {
1352
-			return apply_filters( 'FHEE__EE_Config__get_forward', EE_Config::$_module_forward_map[ $key ][ $route ][ $status ], $route,$status );
1349
+	public static function get_forward($route = NULL, $status = 0, $key = 'ee') {
1350
+		do_action('AHEE__EE_Config__get_forward__begin', $route, $status);
1351
+		if (isset(EE_Config::$_module_forward_map[$key][$route][$status])) {
1352
+			return apply_filters('FHEE__EE_Config__get_forward', EE_Config::$_module_forward_map[$key][$route][$status], $route, $status);
1353 1353
 		}
1354 1354
 		return NULL;
1355 1355
 	}
@@ -1366,19 +1366,19 @@  discard block
 block discarded – undo
1366 1366
 	 * @param    string 		$key - url param key indicating a route is being called
1367 1367
 	 * @return    bool
1368 1368
 	 */
1369
-	public static function register_view( $route = NULL, $status = 0, $view = NULL, $key = 'ee' ) {
1370
-		do_action( 'AHEE__EE_Config__register_view__begin',$route,$status,$view );
1371
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) ||  empty( $route )) {
1372
-			$msg = sprintf( __( 'The module route %s for this view has not been registered.', 'event_espresso' ), $route );
1373
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1369
+	public static function register_view($route = NULL, $status = 0, $view = NULL, $key = 'ee') {
1370
+		do_action('AHEE__EE_Config__register_view__begin', $route, $status, $view);
1371
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1372
+			$msg = sprintf(__('The module route %s for this view has not been registered.', 'event_espresso'), $route);
1373
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1374 1374
 			return FALSE;
1375 1375
 		}
1376
-		if ( ! is_readable( $view )) {
1377
-			$msg = sprintf( __( 'The %s view file could not be found or is not readable due to file permissions.', 'event_espresso' ), $view );
1378
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1376
+		if ( ! is_readable($view)) {
1377
+			$msg = sprintf(__('The %s view file could not be found or is not readable due to file permissions.', 'event_espresso'), $view);
1378
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1379 1379
 			return FALSE;
1380 1380
 		}
1381
-		EE_Config::$_module_view_map[ $key ][ $route ][ absint( $status ) ] = $view;
1381
+		EE_Config::$_module_view_map[$key][$route][absint($status)] = $view;
1382 1382
 		return TRUE;
1383 1383
 	}
1384 1384
 
@@ -1395,10 +1395,10 @@  discard block
 block discarded – undo
1395 1395
 	 *  @param    string 		$key - url param key indicating a route is being called
1396 1396
 	 *  @return 	string
1397 1397
 	 */
1398
-	public static function get_view( $route = NULL, $status = 0, $key = 'ee' ) {
1399
-		do_action( 'AHEE__EE_Config__get_view__begin',$route,$status );
1400
-		if ( isset( EE_Config::$_module_view_map[ $key ][ $route ][ $status ] )) {
1401
-			return apply_filters( 'FHEE__EE_Config__get_view', EE_Config::$_module_view_map[ $key ][ $route ][ $status ], $route,$status );
1398
+	public static function get_view($route = NULL, $status = 0, $key = 'ee') {
1399
+		do_action('AHEE__EE_Config__get_view__begin', $route, $status);
1400
+		if (isset(EE_Config::$_module_view_map[$key][$route][$status])) {
1401
+			return apply_filters('FHEE__EE_Config__get_view', EE_Config::$_module_view_map[$key][$route][$status], $route, $status);
1402 1402
 		}
1403 1403
 		return NULL;
1404 1404
 	}
@@ -1406,7 +1406,7 @@  discard block
 block discarded – undo
1406 1406
 
1407 1407
 
1408 1408
 	public function shutdown() {
1409
-		update_option( 'ee_config_option_names', $this->_config_option_names );
1409
+		update_option('ee_config_option_names', $this->_config_option_names);
1410 1410
 	}
1411 1411
 
1412 1412
 
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
  * magic functions in use, except we'll allow them to magically set and get stuff...
1423 1423
  * basically, they should just be well-defined stdClasses
1424 1424
  */
1425
-class EE_Config_Base{
1425
+class EE_Config_Base {
1426 1426
 
1427 1427
 	/**
1428 1428
 	 * Utility function for escaping the value of a property and returning.
@@ -1431,13 +1431,13 @@  discard block
 block discarded – undo
1431 1431
 	 * @return mixed if a detected type found return the escaped value, otherwise just the raw value is returned.
1432 1432
 	 * @throws \EE_Error
1433 1433
 	 */
1434
-	public function get_pretty( $property ) {
1435
-		if ( ! property_exists( $this, $property ) ) {
1436
-			throw new EE_Error( sprintf( __('%1$s::get_pretty() has been called with the property %2$s which does not exist on the %1$s config class.', 'event_espresso' ), get_class( $this ), $property ) );
1434
+	public function get_pretty($property) {
1435
+		if ( ! property_exists($this, $property)) {
1436
+			throw new EE_Error(sprintf(__('%1$s::get_pretty() has been called with the property %2$s which does not exist on the %1$s config class.', 'event_espresso'), get_class($this), $property));
1437 1437
 		}
1438 1438
 		//just handling escaping of strings for now.
1439
-		if ( is_string( $this->{$property} ) ) {
1440
-			return stripslashes( $this->{$property} );
1439
+		if (is_string($this->{$property} )) {
1440
+			return stripslashes($this->{$property} );
1441 1441
 		}
1442 1442
 		return $this->{$property};
1443 1443
 	}
@@ -1446,19 +1446,19 @@  discard block
 block discarded – undo
1446 1446
 
1447 1447
 	public function populate() {
1448 1448
 		//grab defaults via a new instance of this class.
1449
-		$class_name = get_class( $this );
1449
+		$class_name = get_class($this);
1450 1450
 		$defaults = new $class_name;
1451 1451
 
1452 1452
 		//loop through the properties for this class and see if they are set.  If they are NOT, then grab the
1453 1453
 		//default from our $defaults object.
1454
-		foreach ( get_object_vars( $defaults ) as $property => $value ) {
1455
-			if ( is_null( $this->{$property} ) ) {
1454
+		foreach (get_object_vars($defaults) as $property => $value) {
1455
+			if (is_null($this->{$property} )) {
1456 1456
 				$this->{$property} = $value;
1457 1457
 			}
1458 1458
 		}
1459 1459
 
1460 1460
 		//cleanup
1461
-		unset( $defaults );
1461
+		unset($defaults);
1462 1462
 	}
1463 1463
 
1464 1464
 
@@ -1550,12 +1550,12 @@  discard block
 block discarded – undo
1550 1550
 	 */
1551 1551
 	public function __construct() {
1552 1552
 		$current_network_main_site = is_multisite() ? get_current_site() : NULL;
1553
-		$current_main_site_id = !empty( $current_network_main_site ) ? $current_network_main_site->blog_id : 1;
1553
+		$current_main_site_id = ! empty($current_network_main_site) ? $current_network_main_site->blog_id : 1;
1554 1554
 		// set default organization settings
1555 1555
 		$this->current_blog_id = get_current_blog_id();
1556 1556
 		$this->current_blog_id = $this->current_blog_id === NULL ? 1 : $this->current_blog_id;
1557
-		$this->ee_ueip_optin = is_main_site() ? get_option( 'ee_ueip_optin', TRUE ) : get_blog_option( $current_main_site_id, 'ee_ueip_optin', TRUE );
1558
-		$this->ee_ueip_has_notified = is_main_site() ? get_option( 'ee_ueip_has_notified', FALSE ) : TRUE;
1557
+		$this->ee_ueip_optin = is_main_site() ? get_option('ee_ueip_optin', TRUE) : get_blog_option($current_main_site_id, 'ee_ueip_optin', TRUE);
1558
+		$this->ee_ueip_has_notified = is_main_site() ? get_option('ee_ueip_has_notified', FALSE) : TRUE;
1559 1559
 		$this->post_shortcodes = array();
1560 1560
 		$this->module_route_map = array();
1561 1561
 		$this->module_forward_map = array();
@@ -1574,7 +1574,7 @@  discard block
 block discarded – undo
1574 1574
 		$this->event_cpt_slug = __('events', 'event_espresso');
1575 1575
 
1576 1576
 		//ueip constant check
1577
-		if ( defined( 'EE_DISABLE_UXIP' ) && EE_DISABLE_UXIP ) {
1577
+		if (defined('EE_DISABLE_UXIP') && EE_DISABLE_UXIP) {
1578 1578
 			$this->ee_ueip_optin = FALSE;
1579 1579
 			$this->ee_ueip_has_notified = TRUE;
1580 1580
 		}
@@ -1614,8 +1614,8 @@  discard block
 block discarded – undo
1614 1614
 	 *  @return 	string
1615 1615
 	 */
1616 1616
 	public function reg_page_url() {
1617
-		if ( ! $this->reg_page_url ) {
1618
-			$this->reg_page_url = get_permalink( $this->reg_page_id ) . '#checkout';
1617
+		if ( ! $this->reg_page_url) {
1618
+			$this->reg_page_url = get_permalink($this->reg_page_id).'#checkout';
1619 1619
 		}
1620 1620
 		return $this->reg_page_url;
1621 1621
 	}
@@ -1628,12 +1628,12 @@  discard block
 block discarded – undo
1628 1628
 	 *  @return 	string
1629 1629
 	 */
1630 1630
 	public function txn_page_url($query_args = array()) {
1631
-		if ( ! $this->txn_page_url ) {
1632
-			$this->txn_page_url = get_permalink( $this->txn_page_id );
1631
+		if ( ! $this->txn_page_url) {
1632
+			$this->txn_page_url = get_permalink($this->txn_page_id);
1633 1633
 		}
1634
-		if($query_args){
1635
-			return add_query_arg($query_args,$this->txn_page_url);
1636
-		}else{
1634
+		if ($query_args) {
1635
+			return add_query_arg($query_args, $this->txn_page_url);
1636
+		} else {
1637 1637
 			return $this->txn_page_url;
1638 1638
 		}
1639 1639
 	}
@@ -1645,12 +1645,12 @@  discard block
 block discarded – undo
1645 1645
 	 *  @return 	string
1646 1646
 	 */
1647 1647
 	public function thank_you_page_url($query_args = array()) {
1648
-		if ( ! $this->thank_you_page_url ) {
1649
-			$this->thank_you_page_url = get_permalink( $this->thank_you_page_id );
1648
+		if ( ! $this->thank_you_page_url) {
1649
+			$this->thank_you_page_url = get_permalink($this->thank_you_page_id);
1650 1650
 		}
1651
-		if($query_args){
1652
-			return add_query_arg($query_args,$this->thank_you_page_url);
1653
-		}else{
1651
+		if ($query_args) {
1652
+			return add_query_arg($query_args, $this->thank_you_page_url);
1653
+		} else {
1654 1654
 			return $this->thank_you_page_url;
1655 1655
 		}
1656 1656
 	}
@@ -1661,8 +1661,8 @@  discard block
 block discarded – undo
1661 1661
 	 *  @return 	string
1662 1662
 	 */
1663 1663
 	public function cancel_page_url() {
1664
-		if ( ! $this->cancel_page_url ) {
1665
-			$this->cancel_page_url = get_permalink( $this->cancel_page_id );
1664
+		if ( ! $this->cancel_page_url) {
1665
+			$this->cancel_page_url = get_permalink($this->cancel_page_id);
1666 1666
 		}
1667 1667
 		return $this->cancel_page_url;
1668 1668
 	}
@@ -1690,7 +1690,7 @@  discard block
 block discarded – undo
1690 1690
 		//reset all url properties
1691 1691
 		$this->_reset_urls();
1692 1692
 		//return what to save to db
1693
-		return array_keys( get_object_vars( $this ) );
1693
+		return array_keys(get_object_vars($this));
1694 1694
 	}
1695 1695
 
1696 1696
 }
@@ -1922,39 +1922,39 @@  discard block
 block discarded – undo
1922 1922
 	 * @param null $CNT_ISO
1923 1923
 	 * @return \EE_Currency_Config
1924 1924
 	 */
1925
-	public function __construct( $CNT_ISO = NULL ) {
1925
+	public function __construct($CNT_ISO = NULL) {
1926 1926
 
1927 1927
 		// get country code from organization settings or use default
1928
-		$ORG_CNT = isset( EE_Registry::instance()->CFG->organization ) && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ? EE_Registry::instance()->CFG->organization->CNT_ISO : NULL;
1928
+		$ORG_CNT = isset(EE_Registry::instance()->CFG->organization) && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ? EE_Registry::instance()->CFG->organization->CNT_ISO : NULL;
1929 1929
 		// but override if requested
1930
-		$CNT_ISO = ! empty( $CNT_ISO ) ? $CNT_ISO : $ORG_CNT;
1931
-		EE_Registry::instance()->load_helper( 'Activation' );
1930
+		$CNT_ISO = ! empty($CNT_ISO) ? $CNT_ISO : $ORG_CNT;
1931
+		EE_Registry::instance()->load_helper('Activation');
1932 1932
 		// so if that all went well, and we are not in M-Mode (cuz you can't query the db in M-Mode) and double-check the countries table exists
1933
-		if ( ! empty( $CNT_ISO ) && EE_Maintenance_Mode::instance()->models_can_query() && EEH_Activation::table_exists( EE_Registry::instance()->load_model( 'Country' )->table() ) ) {
1933
+		if ( ! empty($CNT_ISO) && EE_Maintenance_Mode::instance()->models_can_query() && EEH_Activation::table_exists(EE_Registry::instance()->load_model('Country')->table())) {
1934 1934
 			// retrieve the country settings from the db, just in case they have been customized
1935
-			$country = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $CNT_ISO );
1936
-			if ( $country instanceof EE_Country ) {
1937
-				$this->code = $country->currency_code(); 	// currency code: USD, CAD, EUR
1938
-				$this->name = $country->currency_name_single();	// Dollar
1939
-				$this->plural = $country->currency_name_plural(); 	// Dollars
1940
-				$this->sign =  $country->currency_sign(); 			// currency sign: $
1941
-				$this->sign_b4 = $country->currency_sign_before(); 		// currency sign before or after: $TRUE  or  FALSE$
1942
-				$this->dec_plc = $country->currency_decimal_places();	// decimal places: 2 = 0.00  3 = 0.000
1943
-				$this->dec_mrk = $country->currency_decimal_mark();	// decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1944
-				$this->thsnds = $country->currency_thousands_separator();	// thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1935
+			$country = EE_Registry::instance()->load_model('Country')->get_one_by_ID($CNT_ISO);
1936
+			if ($country instanceof EE_Country) {
1937
+				$this->code = $country->currency_code(); // currency code: USD, CAD, EUR
1938
+				$this->name = $country->currency_name_single(); // Dollar
1939
+				$this->plural = $country->currency_name_plural(); // Dollars
1940
+				$this->sign = $country->currency_sign(); // currency sign: $
1941
+				$this->sign_b4 = $country->currency_sign_before(); // currency sign before or after: $TRUE  or  FALSE$
1942
+				$this->dec_plc = $country->currency_decimal_places(); // decimal places: 2 = 0.00  3 = 0.000
1943
+				$this->dec_mrk = $country->currency_decimal_mark(); // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1944
+				$this->thsnds = $country->currency_thousands_separator(); // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1945 1945
 			}
1946 1946
 		}
1947 1947
 		// fallback to hardcoded defaults, in case the above failed
1948
-		if ( empty( $this->code )) {
1948
+		if (empty($this->code)) {
1949 1949
 			// set default currency settings
1950
-			$this->code = 'USD'; 	// currency code: USD, CAD, EUR
1951
-			$this->name = __( 'Dollar', 'event_espresso' ); 	// Dollar
1952
-			$this->plural = __( 'Dollars', 'event_espresso' ); 	// Dollars
1953
-			$this->sign =  '$'; 	// currency sign: $
1954
-			$this->sign_b4 = TRUE; 	// currency sign before or after: $TRUE  or  FALSE$
1955
-			$this->dec_plc = 2; 	// decimal places: 2 = 0.00  3 = 0.000
1956
-			$this->dec_mrk = '.'; 	// decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1957
-			$this->thsnds = ','; 	// thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1950
+			$this->code = 'USD'; // currency code: USD, CAD, EUR
1951
+			$this->name = __('Dollar', 'event_espresso'); // Dollar
1952
+			$this->plural = __('Dollars', 'event_espresso'); // Dollars
1953
+			$this->sign = '$'; // currency sign: $
1954
+			$this->sign_b4 = TRUE; // currency sign before or after: $TRUE  or  FALSE$
1955
+			$this->dec_plc = 2; // decimal places: 2 = 0.00  3 = 0.000
1956
+			$this->dec_mrk = '.'; // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1957
+			$this->thsnds = ','; // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1958 1958
 		}
1959 1959
 	}
1960 1960
 }
@@ -2094,7 +2094,7 @@  discard block
 block discarded – undo
2094 2094
 	 * @since 4.8.8.rc.019
2095 2095
 	 */
2096 2096
 	public function do_hooks() {
2097
-		add_action( 'AHEE__EE_Config___load_core_config__end', array( $this, 'set_default_reg_status_on_EEM_Event' ));
2097
+		add_action('AHEE__EE_Config___load_core_config__end', array($this, 'set_default_reg_status_on_EEM_Event'));
2098 2098
 	}
2099 2099
 
2100 2100
 
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
 	 * @return void
2103 2103
 	 */
2104 2104
 	public function set_default_reg_status_on_EEM_Event() {
2105
-		EEM_Event::set_default_reg_status( $this->default_STS_ID );
2105
+		EEM_Event::set_default_reg_status($this->default_STS_ID);
2106 2106
 	}
2107 2107
 
2108 2108
 
@@ -2207,10 +2207,10 @@  discard block
 block discarded – undo
2207 2207
 	 * @param bool $reset
2208 2208
 	 * @return string
2209 2209
 	 */
2210
-	public function log_file_name( $reset = FALSE ) {
2211
-		if ( empty( $this->log_file_name ) || $reset ) {
2212
-			$this->log_file_name = sanitize_key( 'espresso_log_' . md5( uniqid( '', TRUE ))) . '.txt';
2213
-			EE_Config::instance()->update_espresso_config( FALSE, FALSE );
2210
+	public function log_file_name($reset = FALSE) {
2211
+		if (empty($this->log_file_name) || $reset) {
2212
+			$this->log_file_name = sanitize_key('espresso_log_'.md5(uniqid('', TRUE))).'.txt';
2213
+			EE_Config::instance()->update_espresso_config(FALSE, FALSE);
2214 2214
 		}
2215 2215
 		return $this->log_file_name;
2216 2216
 	}
@@ -2222,10 +2222,10 @@  discard block
 block discarded – undo
2222 2222
 	 * @param bool $reset
2223 2223
 	 * @return string
2224 2224
 	 */
2225
-	public function debug_file_name( $reset = FALSE ) {
2226
-		if ( empty( $this->debug_file_name ) || $reset ) {
2227
-			$this->debug_file_name = sanitize_key( 'espresso_debug_' . md5( uniqid( '', TRUE ))) . '.txt';
2228
-			EE_Config::instance()->update_espresso_config( FALSE, FALSE );
2225
+	public function debug_file_name($reset = FALSE) {
2226
+		if (empty($this->debug_file_name) || $reset) {
2227
+			$this->debug_file_name = sanitize_key('espresso_debug_'.md5(uniqid('', TRUE))).'.txt';
2228
+			EE_Config::instance()->update_espresso_config(FALSE, FALSE);
2229 2229
 		}
2230 2230
 		return $this->debug_file_name;
2231 2231
 	}
@@ -2398,21 +2398,21 @@  discard block
 block discarded – undo
2398 2398
 		// set default map settings
2399 2399
 		$this->use_google_maps = TRUE;
2400 2400
 		// for event details pages (reg page)
2401
-		$this->event_details_map_width = 585; 			// ee_map_width_single
2402
-		$this->event_details_map_height = 362; 			// ee_map_height_single
2403
-		$this->event_details_map_zoom = 14; 			// ee_map_zoom_single
2404
-		$this->event_details_display_nav = TRUE; 			// ee_map_nav_display_single
2405
-		$this->event_details_nav_size = FALSE; 			// ee_map_nav_size_single
2406
-		$this->event_details_control_type = 'default'; 		// ee_map_type_control_single
2407
-		$this->event_details_map_align = 'center'; 			// ee_map_align_single
2401
+		$this->event_details_map_width = 585; // ee_map_width_single
2402
+		$this->event_details_map_height = 362; // ee_map_height_single
2403
+		$this->event_details_map_zoom = 14; // ee_map_zoom_single
2404
+		$this->event_details_display_nav = TRUE; // ee_map_nav_display_single
2405
+		$this->event_details_nav_size = FALSE; // ee_map_nav_size_single
2406
+		$this->event_details_control_type = 'default'; // ee_map_type_control_single
2407
+		$this->event_details_map_align = 'center'; // ee_map_align_single
2408 2408
 		// for event list pages
2409
-		$this->event_list_map_width = 300; 			// ee_map_width
2410
-		$this->event_list_map_height = 185; 		// ee_map_height
2411
-		$this->event_list_map_zoom = 12; 			// ee_map_zoom
2412
-		$this->event_list_display_nav = FALSE; 		// ee_map_nav_display
2413
-		$this->event_list_nav_size = TRUE; 			// ee_map_nav_size
2414
-		$this->event_list_control_type = 'dropdown'; 		// ee_map_type_control
2415
-		$this->event_list_map_align = 'center'; 			// ee_map_align
2409
+		$this->event_list_map_width = 300; // ee_map_width
2410
+		$this->event_list_map_height = 185; // ee_map_height
2411
+		$this->event_list_map_zoom = 12; // ee_map_zoom
2412
+		$this->event_list_display_nav = FALSE; // ee_map_nav_display
2413
+		$this->event_list_nav_size = TRUE; // ee_map_nav_size
2414
+		$this->event_list_control_type = 'dropdown'; // ee_map_type_control
2415
+		$this->event_list_map_align = 'center'; // ee_map_align
2416 2416
 	}
2417 2417
 
2418 2418
 }
@@ -2423,7 +2423,7 @@  discard block
 block discarded – undo
2423 2423
 /**
2424 2424
  * stores Events_Archive settings
2425 2425
  */
2426
-class EE_Events_Archive_Config extends EE_Config_Base{
2426
+class EE_Events_Archive_Config extends EE_Config_Base {
2427 2427
 
2428 2428
 	public $display_status_banner;
2429 2429
 	public $display_description;
@@ -2442,7 +2442,7 @@  discard block
 block discarded – undo
2442 2442
 	/**
2443 2443
 	 *	class constructor
2444 2444
 	 */
2445
-	public function __construct(){
2445
+	public function __construct() {
2446 2446
 		$this->display_status_banner = 0;
2447 2447
 		$this->display_description = 1;
2448 2448
 		$this->display_ticket_selector = 0;
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 /**
2463 2463
  * Stores Event_Single_Config settings
2464 2464
  */
2465
-class EE_Event_Single_Config extends EE_Config_Base{
2465
+class EE_Event_Single_Config extends EE_Config_Base {
2466 2466
 
2467 2467
 	public $display_status_banner_single;
2468 2468
 	public $display_venue;
@@ -2491,7 +2491,7 @@  discard block
 block discarded – undo
2491 2491
 /**
2492 2492
  * Stores Ticket_Selector_Config settings
2493 2493
  */
2494
-class EE_Ticket_Selector_Config extends EE_Config_Base{
2494
+class EE_Ticket_Selector_Config extends EE_Config_Base {
2495 2495
 	public $show_ticket_sale_columns;
2496 2496
 	public $show_ticket_details;
2497 2497
 	public $show_expired_tickets;
@@ -2545,7 +2545,7 @@  discard block
 block discarded – undo
2545 2545
 	 * @return void
2546 2546
 	 */
2547 2547
 	protected function _set_php_values() {
2548
-		$this->php->max_input_vars = ini_get( 'max_input_vars' );
2548
+		$this->php->max_input_vars = ini_get('max_input_vars');
2549 2549
 		$this->php->version = phpversion();
2550 2550
 	}
2551 2551
 
@@ -2564,8 +2564,8 @@  discard block
 block discarded – undo
2564 2564
 	 *         @type string $msg 		Any message to be displayed.
2565 2565
 	 * }
2566 2566
 	 */
2567
-	public function max_input_vars_limit_check( $input_count = 0 ) {
2568
-		if ( ( $input_count >= $this->php->max_input_vars ) && ( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >=9 ) ) {
2567
+	public function max_input_vars_limit_check($input_count = 0) {
2568
+		if (($input_count >= $this->php->max_input_vars) && (PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >= 9)) {
2569 2569
 			return  __('The number of inputs on this page has been exceeded.  You cannot add anymore items (i.e. tickets, datetimes, custom fields) on this page because of your servers PHP "max_input_vars" setting.', 'event_espresso');
2570 2570
 		} else {
2571 2571
 			return '';
@@ -2601,7 +2601,7 @@  discard block
 block discarded – undo
2601 2601
  * stores payment gateway info
2602 2602
  * @deprecated
2603 2603
  */
2604
-class EE_Gateway_Config extends EE_Config_Base{
2604
+class EE_Gateway_Config extends EE_Config_Base {
2605 2605
 
2606 2606
 	/**
2607 2607
 	 * Array with keys that are payment gateways slugs, and values are arrays
@@ -2623,9 +2623,9 @@  discard block
 block discarded – undo
2623 2623
 	 *	class constructor
2624 2624
 	 * @deprecated
2625 2625
 	 */
2626
-	public function __construct(){
2626
+	public function __construct() {
2627 2627
 		$this->payment_settings = array();
2628
-		$this->active_gateways = array( 'Invoice' => FALSE );
2628
+		$this->active_gateways = array('Invoice' => FALSE);
2629 2629
 	}
2630 2630
 }
2631 2631
 
Please login to merge, or discard this patch.
core/CPTs/EE_CPT_Strategy.core.php 1 patch
Spacing   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public static function instance() {
80 80
 		// check if class object is instantiated
81
-		if ( ! self::$_instance instanceof EE_CPT_Strategy ) {
81
+		if ( ! self::$_instance instanceof EE_CPT_Strategy) {
82 82
 			self::$_instance = new self();
83 83
 		}
84 84
 		return self::$_instance;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 //		d( $this->_CPT_endpoints );
102 102
 //		d( $this->_CPT_taxonomies );
103 103
 
104
-		add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ), 5 );
104
+		add_action('pre_get_posts', array($this, 'pre_get_posts'), 5);
105 105
 	}
106 106
 
107 107
 
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	private function _set_CPT_endpoints() {
116 116
 		$_CPT_endpoints = array();
117
-		if ( is_array( $this->_CPTs )) {
118
-			foreach ( $this->_CPTs as $CPT_type => $CPT ) {
119
-				$_CPT_endpoints [ $CPT['plural_slug'] ] = $CPT_type;
117
+		if (is_array($this->_CPTs)) {
118
+			foreach ($this->_CPTs as $CPT_type => $CPT) {
119
+				$_CPT_endpoints [$CPT['plural_slug']] = $CPT_type;
120 120
 			}
121 121
 		}
122 122
 		return $_CPT_endpoints;
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 * @param WP_Query $WP_Query
132 132
 	 * @return void
133 133
 	 */
134
-	private function _set_EE_tags_on_WP_Query( WP_Query $WP_Query) {
134
+	private function _set_EE_tags_on_WP_Query(WP_Query $WP_Query) {
135 135
 		$WP_Query->is_espresso_event_single = FALSE;
136 136
 		$WP_Query->is_espresso_event_archive = FALSE;
137 137
 		$WP_Query->is_espresso_event_taxonomy = FALSE;
@@ -158,16 +158,16 @@  discard block
 block discarded – undo
158 158
 	 */
159 159
 	private function _set_CPT_taxonomies() {
160 160
 		// check if taxonomies have already been set
161
-		if ( empty( $this->_CPT_taxonomies )) {
161
+		if (empty($this->_CPT_taxonomies)) {
162 162
 			// and that this CPT has taxonomies registered for it
163
-			if ( isset( $this->CPT['args'] ) && isset( $this->CPT['args']['taxonomies'] )) {
163
+			if (isset($this->CPT['args']) && isset($this->CPT['args']['taxonomies'])) {
164 164
 				// if so then grab them, but we want the taxonomy name as the key
165
-				$taxonomies = array_flip( $this->CPT['args']['taxonomies'] );
165
+				$taxonomies = array_flip($this->CPT['args']['taxonomies']);
166 166
 				// then grab the list of ALL taxonomies
167 167
 				$all_taxonomies = EE_Register_CPTs::get_taxonomies();
168
-				foreach ( $taxonomies as $taxonomy => $details ) {
168
+				foreach ($taxonomies as $taxonomy => $details) {
169 169
 					// add details to our taxonomies if they exist
170
-					$taxonomies[ $taxonomy ] = isset( $all_taxonomies[ $taxonomy ] ) ? $all_taxonomies[ $taxonomy ] : NULL;
170
+					$taxonomies[$taxonomy] = isset($all_taxonomies[$taxonomy]) ? $all_taxonomies[$taxonomy] : NULL;
171 171
 				}
172 172
 				$this->_CPT_taxonomies = $taxonomies;
173 173
 			}
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
 	 * @return void
193 193
 	 */
194 194
 	private function _set_CPT_terms() {
195
-		if ( empty( $this->_CPT_terms )) {
195
+		if (empty($this->_CPT_terms)) {
196 196
 			$terms = EEM_Term::instance()->get_all_CPT_post_tags();
197
-			foreach ( $terms as $term ) {
198
-				if ( $term instanceof EE_Term ) {
199
-					$this->_CPT_terms[ $term->slug() ] = $term;
197
+			foreach ($terms as $term) {
198
+				if ($term instanceof EE_Term) {
199
+					$this->_CPT_terms[$term->slug()] = $term;
200 200
 				}
201 201
 			}
202 202
 		}
@@ -211,24 +211,24 @@  discard block
 block discarded – undo
211 211
 	 * @param $WP_Query
212 212
 	 * @return void
213 213
 	 */
214
-	private function _set_post_type_for_terms( WP_Query $WP_Query ) {
214
+	private function _set_post_type_for_terms(WP_Query $WP_Query) {
215 215
 		// is a tag set ?
216
-		if ( isset( $WP_Query->query['tag'] )) {
216
+		if (isset($WP_Query->query['tag'])) {
217 217
 			// set post_tags
218 218
 			$this->_set_CPT_terms();
219 219
 			// is this tag archive term in the list of terms used by our CPTs ?
220
-			$term = isset ( $this->_CPT_terms[ $WP_Query->query['tag'] ] ) ? $this->_CPT_terms[ $WP_Query->query['tag'] ] : NULL;
220
+			$term = isset ($this->_CPT_terms[$WP_Query->query['tag']]) ? $this->_CPT_terms[$WP_Query->query['tag']] : NULL;
221 221
 			// verify the term
222
-			if ( $term instanceof EE_Term ) {
223
-				$term->post_type  = array_merge( array( 'post', 'page' ), (array)$term->post_type );
224
-				$term->post_type = apply_filters( 'FHEE__EE_CPT_Strategy___set_post_type_for_terms__term_post_type', $term->post_type, $term );
222
+			if ($term instanceof EE_Term) {
223
+				$term->post_type = array_merge(array('post', 'page'), (array) $term->post_type);
224
+				$term->post_type = apply_filters('FHEE__EE_CPT_Strategy___set_post_type_for_terms__term_post_type', $term->post_type, $term);
225 225
 				// if a post type is already set
226
-				if ( isset( $WP_Query->query_vars['post_type'] )) {
226
+				if (isset($WP_Query->query_vars['post_type'])) {
227 227
 						// add to existing array
228
-						$term->post_type = array_merge ( (array)$WP_Query->query_vars['post_type'], $term->post_type );
228
+						$term->post_type = array_merge((array) $WP_Query->query_vars['post_type'], $term->post_type);
229 229
 				}
230 230
 				// just set post_type to our CPT
231
-				$WP_Query->set( 'post_type', $term->post_type );
231
+				$WP_Query->set('post_type', $term->post_type);
232 232
 			}
233 233
 		}
234 234
 	}
@@ -243,17 +243,17 @@  discard block
 block discarded – undo
243 243
 	 * in order for is_archive() and is_single() methods to work properly.
244 244
 	 * @return void
245 245
 	 */
246
-	public function _possibly_set_ee_request_var(){
246
+	public function _possibly_set_ee_request_var() {
247 247
 		// check if ee action var has been set
248
-		if ( ! EE_Registry::instance()->REQ->is_set( 'ee' )) {
248
+		if ( ! EE_Registry::instance()->REQ->is_set('ee')) {
249 249
 			// check that route exists for CPT archive slug
250
-			if ( is_archive() && EE_Config::get_route( $this->CPT['plural_slug'] )) {
250
+			if (is_archive() && EE_Config::get_route($this->CPT['plural_slug'])) {
251 251
 				// ie: set "ee" to "events"
252
-				EE_Registry::instance()->REQ->set( 'ee', $this->CPT['plural_slug'] );
252
+				EE_Registry::instance()->REQ->set('ee', $this->CPT['plural_slug']);
253 253
 			// or does it match a single page CPT like /event/
254
-			} else if ( is_single() && EE_Config::get_route( $this->CPT['singular_slug'] )) {
254
+			} else if (is_single() && EE_Config::get_route($this->CPT['singular_slug'])) {
255 255
 				// ie: set "ee" to "event"
256
-				EE_Registry::instance()->REQ->set( 'ee', $this->CPT['singular_slug'] );
256
+				EE_Registry::instance()->REQ->set('ee', $this->CPT['singular_slug']);
257 257
 			}
258 258
 		}
259 259
 	}
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
 	 * @param WP_Query $WP_Query
268 268
 	 * @return void
269 269
 	 */
270
-	public function _set_paging( $WP_Query ) {
271
-		if ( $WP_Query->is_main_query() && apply_filters( 'FHEE__EE_CPT_Strategy___set_paging', TRUE )) {
272
-			$page = ( get_query_var('page') ) ? get_query_var('page') : NULL;
273
-			$paged = ( get_query_var('paged') ) ? get_query_var('paged') : $page;
274
-			$WP_Query->set( 'paged', $paged );
270
+	public function _set_paging($WP_Query) {
271
+		if ($WP_Query->is_main_query() && apply_filters('FHEE__EE_CPT_Strategy___set_paging', TRUE)) {
272
+			$page = (get_query_var('page')) ? get_query_var('page') : NULL;
273
+			$paged = (get_query_var('paged')) ? get_query_var('paged') : $page;
274
+			$WP_Query->set('paged', $paged);
275 275
 		}
276 276
 	}
277 277
 
@@ -288,35 +288,35 @@  discard block
 block discarded – undo
288 288
 	 * @param WP_Query $WP_Query
289 289
 	 * @return void
290 290
 	 */
291
-	public function pre_get_posts( $WP_Query ) {
291
+	public function pre_get_posts($WP_Query) {
292 292
 		// check that post-type is set
293
-		if ( ! $WP_Query instanceof WP_Query ) {
293
+		if ( ! $WP_Query instanceof WP_Query) {
294 294
 			return;
295 295
 		}
296 296
 
297 297
 		// add our conditionals
298
-		$this->_set_EE_tags_on_WP_Query( $WP_Query );
298
+		$this->_set_EE_tags_on_WP_Query($WP_Query);
299 299
 		// check for terms
300
-		$this->_set_post_type_for_terms( $WP_Query );
300
+		$this->_set_post_type_for_terms($WP_Query);
301 301
 		// make sure paging is always set
302
-		$this->_set_paging( $WP_Query );
302
+		$this->_set_paging($WP_Query);
303 303
 
304 304
 		// is a taxonomy set ?
305
-		if ( $WP_Query->is_tax ) {
305
+		if ($WP_Query->is_tax) {
306 306
 			// loop thru our taxonomies
307
-			foreach ( $this->_CPT_taxonomies as $CPT_taxonomy => $CPT_taxonomy_details ) {
307
+			foreach ($this->_CPT_taxonomies as $CPT_taxonomy => $CPT_taxonomy_details) {
308 308
 				// check if one of our taxonomies is set as a query var
309
-				if ( isset( $WP_Query->query[ $CPT_taxonomy ] )) {
309
+				if (isset($WP_Query->query[$CPT_taxonomy])) {
310 310
 					// but which CPT does that correspond to??? hmmm... guess we gotta go looping
311
-					foreach ( $this->_CPTs as $post_type => $CPT ) {
311
+					foreach ($this->_CPTs as $post_type => $CPT) {
312 312
 						// verify our CPT has args, is public and has taxonomies set
313
-						if ( isset( $CPT['args'] ) && $CPT['args']['public'] && ! empty( $CPT['args']['taxonomies'] )) {
313
+						if (isset($CPT['args']) && $CPT['args']['public'] && ! empty($CPT['args']['taxonomies'])) {
314 314
 							// does the captured taxonomy belong to this CPT ?
315
-							if ( in_array( $CPT_taxonomy, $CPT['args']['taxonomies'] )) {
315
+							if (in_array($CPT_taxonomy, $CPT['args']['taxonomies'])) {
316 316
 								// if so, then add this CPT post_type to the current query's array of post_types'
317
-								$WP_Query->query_vars['post_type'] = isset( $WP_Query->query_vars['post_type'] ) ? (array)$WP_Query->query_vars['post_type'] : array();
317
+								$WP_Query->query_vars['post_type'] = isset($WP_Query->query_vars['post_type']) ? (array) $WP_Query->query_vars['post_type'] : array();
318 318
 								$WP_Query->query_vars['post_type'][] = $post_type;
319
-								switch( $post_type ) {
319
+								switch ($post_type) {
320 320
 									case 'espresso_events' :
321 321
 										$WP_Query->is_espresso_event_taxonomy = TRUE;
322 322
 										break;
@@ -337,27 +337,27 @@  discard block
 block discarded – undo
337 337
 //		d( $CPT_taxonomy );
338 338
 //		d( $WP_Query );
339 339
 
340
-		if ( isset( $WP_Query->query_vars['post_type'] )) {
340
+		if (isset($WP_Query->query_vars['post_type'])) {
341 341
 			// loop thru post_types as array
342
-			foreach ( (array)$WP_Query->query_vars['post_type'] as $post_type ) {
342
+			foreach ((array) $WP_Query->query_vars['post_type'] as $post_type) {
343 343
 
344 344
 				// is current query for an EE CPT ?
345
-				if ( isset( $this->_CPTs[ $post_type ] )) {
345
+				if (isset($this->_CPTs[$post_type])) {
346 346
 					// is EE on or off ?
347
-					if ( EE_Maintenance_Mode::instance()->level() ) {
347
+					if (EE_Maintenance_Mode::instance()->level()) {
348 348
 						// reroute CPT template view to maintenance_mode.template.php
349
-						if( ! has_filter( 'template_include',array( 'EE_Maintenance_Mode', 'template_include' ))){
350
-							add_filter( 'template_include', array( 'EE_Maintenance_Mode', 'template_include' ), 99999 );
349
+						if ( ! has_filter('template_include', array('EE_Maintenance_Mode', 'template_include'))) {
350
+							add_filter('template_include', array('EE_Maintenance_Mode', 'template_include'), 99999);
351 351
 						}
352
-						if( has_filter( 'the_content',array( EE_Maintenance_Mode::instance(), 'the_content' ) ) ) {
353
-							add_filter( 'the_content', array( $this, 'inject_EE_shortcode_placeholder' ), 1 );
352
+						if (has_filter('the_content', array(EE_Maintenance_Mode::instance(), 'the_content'))) {
353
+							add_filter('the_content', array($this, 'inject_EE_shortcode_placeholder'), 1);
354 354
 						}
355 355
 						return;
356 356
 					}
357 357
 					// load EE_Request_Handler (this was added as a result of https://events.codebasehq.com/projects/event-espresso/tickets/9037
358
-					EE_Registry::instance()->load_core( 'Request_Handler' );
358
+					EE_Registry::instance()->load_core('Request_Handler');
359 359
 					// grab details for the CPT the current query is for
360
-					$this->CPT = $this->_CPTs[ $post_type ];
360
+					$this->CPT = $this->_CPTs[$post_type];
361 361
 					// set post type
362 362
 					$this->CPT['post_type'] = $post_type;
363 363
 					// set taxonomies
@@ -365,27 +365,27 @@  discard block
 block discarded – undo
365 365
 					// the post or category or term that is triggering EE
366 366
 					$this->CPT['espresso_page'] = EE_Registry::instance()->REQ->is_espresso_page();
367 367
 					// requested post name
368
-					$this->CPT['post_name'] = EE_Registry::instance()->REQ->get( 'post_name' );
368
+					$this->CPT['post_name'] = EE_Registry::instance()->REQ->get('post_name');
369 369
 					//d( $this->CPT );
370 370
 					// add support for viewing 'private', 'draft', or 'pending' posts
371
-					if ( is_user_logged_in() && isset( $WP_Query->query_vars['p'] ) && $WP_Query->query_vars['p'] != 0 && current_user_can( 'edit_post', $WP_Query->query_vars['p'] )) {
371
+					if (is_user_logged_in() && isset($WP_Query->query_vars['p']) && $WP_Query->query_vars['p'] != 0 && current_user_can('edit_post', $WP_Query->query_vars['p'])) {
372 372
 						// we can just inject directly into the WP_Query object
373
-						$WP_Query->query['post_status'] = array( 'publish', 'private', 'draft', 'pending' );
373
+						$WP_Query->query['post_status'] = array('publish', 'private', 'draft', 'pending');
374 374
 						// now set the main 'ee' request var so that the appropriate module can load the appropriate template(s)
375
-						EE_Registry::instance()->REQ->set( 'ee', $this->CPT['singular_slug'] );
375
+						EE_Registry::instance()->REQ->set('ee', $this->CPT['singular_slug']);
376 376
 					}
377 377
 					$this->_possibly_set_ee_request_var();
378 378
 					// convert post_type to model name
379
-					$model_name = str_replace( 'EE_', '', $this->CPT['class_name'] );
379
+					$model_name = str_replace('EE_', '', $this->CPT['class_name']);
380 380
 					// get CPT table data via CPT Model
381
-					$this->CPT_model = EE_Registry::instance()->load_model( $model_name );
381
+					$this->CPT_model = EE_Registry::instance()->load_model($model_name);
382 382
 					$this->CPT['tables'] = $this->CPT_model->get_tables();
383 383
 					// is there a Meta Table for this CPT?
384
-					$this->CPT['meta_table'] = isset( $this->CPT['tables'][ $model_name . '_Meta' ] ) ? $this->CPT['tables'][ $model_name . '_Meta' ] : FALSE;
384
+					$this->CPT['meta_table'] = isset($this->CPT['tables'][$model_name.'_Meta']) ? $this->CPT['tables'][$model_name.'_Meta'] : FALSE;
385 385
 					// creates classname like:  CPT_Event_Strategy
386
-					$CPT_Strategy_class_name = 'CPT_' . $model_name . '_Strategy';
386
+					$CPT_Strategy_class_name = 'CPT_'.$model_name.'_Strategy';
387 387
 					// load and instantiate
388
-					 $CPT_Strategy = EE_Registry::instance()->load_core ( $CPT_Strategy_class_name, array( 'WP_Query' => $WP_Query, 'CPT' => $this->CPT ));
388
+					 $CPT_Strategy = EE_Registry::instance()->load_core($CPT_Strategy_class_name, array('WP_Query' => $WP_Query, 'CPT' => $this->CPT));
389 389
 
390 390
 					// !!!!!!!!!!  IMPORTANT !!!!!!!!!!!!
391 391
 					// here's the list of available filters in the WP_Query object
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
 					// 'post_limits'
398 398
 					// 'posts_fields'
399 399
 					// 'posts_join'
400
-					add_filter( 'posts_fields', array( $this, 'posts_fields' ));
401
-					add_filter( 'posts_join',	array( $this, 'posts_join' ));
402
-					add_filter( 'get_' . $this->CPT['post_type'] . '_metadata', array( $CPT_Strategy, 'get_EE_post_type_metadata' ), 1, 4 );
403
-					add_filter( 'the_posts',	array( $this, 'the_posts' ), 1, 1 );
404
-					add_filter( 'get_edit_post_link', array( $this, 'get_edit_post_link' ), 10, 2 );
400
+					add_filter('posts_fields', array($this, 'posts_fields'));
401
+					add_filter('posts_join', array($this, 'posts_join'));
402
+					add_filter('get_'.$this->CPT['post_type'].'_metadata', array($CPT_Strategy, 'get_EE_post_type_metadata'), 1, 4);
403
+					add_filter('the_posts', array($this, 'the_posts'), 1, 1);
404
+					add_filter('get_edit_post_link', array($this, 'get_edit_post_link'), 10, 2);
405 405
 
406
-					$this->_do_template_filters( $WP_Query );
406
+					$this->_do_template_filters($WP_Query);
407 407
 				}
408 408
 			}
409 409
 		}
@@ -418,13 +418,13 @@  discard block
 block discarded – undo
418 418
 	 * @param $SQL
419 419
 	 * @return    string
420 420
 	 */
421
-	public function posts_fields( $SQL ) {
421
+	public function posts_fields($SQL) {
422 422
 		// does this CPT have a meta table ?
423
-		if ( ! empty( $this->CPT['meta_table'] )) {
423
+		if ( ! empty($this->CPT['meta_table'])) {
424 424
 			// adds something like ", wp_esp_event_meta.* " to WP Query SELECT statement
425
-			$SQL .= ', ' . $this->CPT['meta_table']->get_table_name() . '.* ' ;
425
+			$SQL .= ', '.$this->CPT['meta_table']->get_table_name().'.* ';
426 426
 		}
427
-		remove_filter( 'posts_fields', array( $this, 'posts_fields' ));
427
+		remove_filter('posts_fields', array($this, 'posts_fields'));
428 428
 		return $SQL;
429 429
 	}
430 430
 
@@ -452,14 +452,14 @@  discard block
 block discarded – undo
452 452
 	 * @param $SQL
453 453
 	 * @return    string
454 454
 	 */
455
-	public function posts_join( $SQL ) {
455
+	public function posts_join($SQL) {
456 456
 		// does this CPT have a meta table ?
457
-		if ( ! empty( $this->CPT['meta_table'] )) {
457
+		if ( ! empty($this->CPT['meta_table'])) {
458 458
 			global $wpdb;
459 459
 			// adds something like " LEFT JOIN wp_esp_event_meta ON ( wp_esp_event_meta.EVT_ID = wp_posts.ID ) " to WP Query JOIN statement
460
-			$SQL .= ' LEFT JOIN ' . $this->CPT['meta_table']->get_table_name() . ' ON ( ' . $this->CPT['meta_table']->get_table_name() . '.' . $this->CPT['meta_table']->get_fk_on_table() . ' = ' . $wpdb->posts . '.ID ) ';
460
+			$SQL .= ' LEFT JOIN '.$this->CPT['meta_table']->get_table_name().' ON ( '.$this->CPT['meta_table']->get_table_name().'.'.$this->CPT['meta_table']->get_fk_on_table().' = '.$wpdb->posts.'.ID ) ';
461 461
 		}
462
-		remove_filter( 'posts_join',	array( $this, 'posts_join' ));
462
+		remove_filter('posts_join', array($this, 'posts_join'));
463 463
 		return $SQL;
464 464
 	}
465 465
 
@@ -472,18 +472,18 @@  discard block
 block discarded – undo
472 472
 	 * @param 	\WP_Post[] 	$posts
473 473
 	 * @return 	\WP_Post[]
474 474
 	 */
475
-	public function the_posts( $posts ) {
475
+	public function the_posts($posts) {
476 476
 //		d( $posts );
477 477
 		$CPT_class = $this->CPT['class_name'];
478 478
 		// loop thru posts
479
-		if ( is_array( $posts )) {
480
-			foreach( $posts as $key => $post ) {
481
-				if ( isset( $this->_CPTs[ $post->post_type ] )) {
482
-					$post->{$CPT_class} = $this->CPT_model->instantiate_class_from_post_object( $post );
479
+		if (is_array($posts)) {
480
+			foreach ($posts as $key => $post) {
481
+				if (isset($this->_CPTs[$post->post_type])) {
482
+					$post->{$CPT_class} = $this->CPT_model->instantiate_class_from_post_object($post);
483 483
 				}
484 484
 			}
485 485
 		}
486
-		remove_filter( 'the_posts',	array( $this, 'the_posts' ), 1 );
486
+		remove_filter('the_posts', array($this, 'the_posts'), 1);
487 487
 		return $posts;
488 488
 	}
489 489
 
@@ -494,17 +494,17 @@  discard block
 block discarded – undo
494 494
 	 * @param $ID
495 495
 	 * @return string
496 496
 	 */
497
-	function get_edit_post_link( $url, $ID ) {
497
+	function get_edit_post_link($url, $ID) {
498 498
 		//need to make sure we only edit links if our cpt
499 499
 		global $post;
500
-		if ( ! isset( $this->_CPTs[ $post->post_type ] )) {
500
+		if ( ! isset($this->_CPTs[$post->post_type])) {
501 501
 			return $url;
502 502
 		}
503 503
 		//k made it here so all is good.
504 504
 		$scheme = is_ssl() ? 'https' : 'http';
505
-		$url = get_admin_url( EE_Config::instance()->core->current_blog_id, 'admin.php', $scheme );
505
+		$url = get_admin_url(EE_Config::instance()->core->current_blog_id, 'admin.php', $scheme);
506 506
 		// http://example.com/wp-admin/admin.php?page=espresso_events&action=edit&post=205&edit_nonce=0d403530d6
507
-		return wp_nonce_url( add_query_arg( array( 'page' => $this->CPT['post_type'], 'post' =>$ID, 'action' =>'edit' ), $url ), 'edit', 'edit_nonce' );
507
+		return wp_nonce_url(add_query_arg(array('page' => $this->CPT['post_type'], 'post' =>$ID, 'action' =>'edit'), $url), 'edit', 'edit_nonce');
508 508
 	}
509 509
 
510 510
 
@@ -518,11 +518,11 @@  discard block
 block discarded – undo
518 518
 	 * @param WP_Query $WP_Query
519 519
 	 * @return void
520 520
 	 */
521
-	protected function _do_template_filters( WP_Query $WP_Query ) {
521
+	protected function _do_template_filters(WP_Query $WP_Query) {
522 522
 		// if it's the main query  and requested cpt supports page_templates,
523
-		if ( $WP_Query->is_main_query() && ! empty( $this->CPT['args']['page_templates'] ) ) {
523
+		if ($WP_Query->is_main_query() && ! empty($this->CPT['args']['page_templates'])) {
524 524
 			// then let's hook into the appropriate query_template hook
525
-			add_filter( 'single_template', array( $this, 'single_cpt_template' ) );
525
+			add_filter('single_template', array($this, 'single_cpt_template'));
526 526
 		}
527 527
 	}
528 528
 
@@ -536,17 +536,17 @@  discard block
 block discarded – undo
536 536
 	 * @param string $current_template Existing default template path derived for this page call.
537 537
 	 * @return string the path to the full template file.
538 538
 	 */
539
-	public function single_cpt_template( $current_template ) {
539
+	public function single_cpt_template($current_template) {
540 540
 		$object = get_queried_object();
541 541
 		//does this called object HAVE a page template set that is something other than the default.
542
-		$template = get_post_meta( $object->ID, '_wp_page_template', true );
542
+		$template = get_post_meta($object->ID, '_wp_page_template', true);
543 543
 
544 544
 		//exit early if default or not set or invalid path (accounts for theme changes)
545
-		if ( $template == 'default' || empty( $template ) || ! is_readable( get_stylesheet_directory() . '/' . $template ) ) {
545
+		if ($template == 'default' || empty($template) || ! is_readable(get_stylesheet_directory().'/'.$template)) {
546 546
 			return $current_template;
547 547
 		}
548 548
 		//made it here so we SHOULD be able to just locate the template and then return it.
549
-		$template = locate_template( array($template)  );
549
+		$template = locate_template(array($template));
550 550
 
551 551
 		return $template;
552 552
 	}
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
 	 * @param 	array 	$arguments
595 595
 	 * @return 	\EE_CPT_Default_Strategy
596 596
 	 */
597
-	public function __construct( $arguments = array() ) {
598
-		$this->CPT = isset( $arguments['CPT'] ) ? $arguments['CPT'] : NULL;
599
-		$WP_Query = isset( $arguments['WP_Query'] ) ? $arguments['WP_Query'] : NULL;
597
+	public function __construct($arguments = array()) {
598
+		$this->CPT = isset($arguments['CPT']) ? $arguments['CPT'] : NULL;
599
+		$WP_Query = isset($arguments['WP_Query']) ? $arguments['WP_Query'] : NULL;
600 600
 		//EEH_Debug_Tools::printr( $this->CPT, '$this->CPT  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
601 601
 //		add_filter( 'pre_get_posts', array( $this, 'pre_get_posts' ), 999 );
602 602
 //		add_filter( 'the_posts', array( $this, 'the_posts' ), 1, 2 );
@@ -611,9 +611,9 @@  discard block
 block discarded – undo
611 611
 	 * @param 	\WP_Query $WP_Query
612 612
 	 * @return 	\WP_Query
613 613
 	 */
614
-	public function pre_get_posts(  WP_Query $WP_Query  ) {
614
+	public function pre_get_posts(WP_Query $WP_Query) {
615 615
 		//EEH_Debug_Tools::printr( $WP_Query, '$WP_Query  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
616
-		if ( ! $WP_Query->is_main_query() && ! $WP_Query->is_archive() ) {
616
+		if ( ! $WP_Query->is_main_query() && ! $WP_Query->is_archive()) {
617 617
 			return $WP_Query;
618 618
 		}
619 619
 //		$WP_Query->set( 'post_type', array( $this->CPT['post_type'] ));
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 	 * @param 	\WP_Query $WP_Query
632 632
 	 * @return 	\WP_Post[]
633 633
 	 */
634
-	public function the_posts(  $posts, WP_Query $WP_Query ) {
634
+	public function the_posts($posts, WP_Query $WP_Query) {
635 635
 		return $posts;
636 636
 	}
637 637
 
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
 	 * @param 	string 	$single
648 648
 	 * @return 	mixed
649 649
 	 */
650
-	public function get_EE_post_type_metadata( $meta_value = NULL, $post_id, $meta_key, $single ) {
650
+	public function get_EE_post_type_metadata($meta_value = NULL, $post_id, $meta_key, $single) {
651 651
 		return $meta_value;
652 652
 	}
653 653
 
Please login to merge, or discard this patch.
core/EES_Shortcode.shortcode.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * @param WP $WP
43 43
 	 * @return    void
44 44
 	 */
45
-	public abstract function run( WP $WP );
45
+	public abstract function run(WP $WP);
46 46
 
47 47
 
48 48
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 *  @param		array 	$attributes
55 55
 	 *  @return 	mixed
56 56
 	 */
57
-	public abstract function process_shortcode( $attributes = array() );
57
+	public abstract function process_shortcode($attributes = array());
58 58
 
59 59
 
60 60
 
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
 	 * @param 	string $shortcode_class
66 66
 	 * @return 	\EES_Shortcode
67 67
 	 */
68
-	final public static function instance( $shortcode_class = NULL ) {
69
-		$shortcode_class = ! empty( $shortcode_class ) ? $shortcode_class : get_called_class();
70
-		if ( $shortcode_class == 'EES_Shortcode' || empty( $shortcode_class )) {
68
+	final public static function instance($shortcode_class = NULL) {
69
+		$shortcode_class = ! empty($shortcode_class) ? $shortcode_class : get_called_class();
70
+		if ($shortcode_class == 'EES_Shortcode' || empty($shortcode_class)) {
71 71
 			return NULL;
72 72
 		}
73
-		$shortcode = str_replace( 'EES_', '', strtoupper( $shortcode_class ));
74
-		$shortcode_obj = isset( EE_Registry::instance()->shortcodes->{$shortcode} ) ? EE_Registry::instance()->shortcodes->{$shortcode} : NULL;
73
+		$shortcode = str_replace('EES_', '', strtoupper($shortcode_class));
74
+		$shortcode_obj = isset(EE_Registry::instance()->shortcodes->{$shortcode} ) ? EE_Registry::instance()->shortcodes->{$shortcode} : NULL;
75 75
 		return $shortcode_obj instanceof $shortcode_class || $shortcode_class == 'self' ? $shortcode_obj : new $shortcode_class();
76 76
 	}
77 77
 
@@ -86,23 +86,23 @@  discard block
 block discarded – undo
86 86
 	 * @param 	$attributes
87 87
 	 * @return 	mixed
88 88
 	 */
89
-	final public static function fallback_shortcode_processor( $attributes ) {
90
-		if ( EE_Maintenance_Mode::disable_frontend_for_maintenance() ) {
89
+	final public static function fallback_shortcode_processor($attributes) {
90
+		if (EE_Maintenance_Mode::disable_frontend_for_maintenance()) {
91 91
 			return null;
92 92
 		}
93 93
 		// what shortcode was actually parsed ?
94 94
 		$shortcode_class = get_called_class();
95 95
 		// notify rest of system that fallback processor was triggered
96
-		add_filter( 'FHEE__fallback_shortcode_processor__' . $shortcode_class, '__return_true' );
96
+		add_filter('FHEE__fallback_shortcode_processor__'.$shortcode_class, '__return_true');
97 97
 		// get instance of actual shortcode
98
-		$shortcode_obj = self::instance( $shortcode_class );
98
+		$shortcode_obj = self::instance($shortcode_class);
99 99
 		// verify class
100
-		if ( $shortcode_obj instanceof EES_Shortcode ) {
100
+		if ($shortcode_obj instanceof EES_Shortcode) {
101 101
 			global $wp;
102
-			$shortcode_obj->run( $wp );
102
+			$shortcode_obj->run($wp);
103 103
 			// set attributes and run the shortcode
104
-			$shortcode_obj->_attributes = (array)$attributes;
105
-			return $shortcode_obj->process_shortcode( $shortcode_obj->_attributes );
104
+			$shortcode_obj->_attributes = (array) $attributes;
105
+			return $shortcode_obj->process_shortcode($shortcode_obj->_attributes);
106 106
 		} else {
107 107
 			return NULL;
108 108
 		}
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 * @param 	$attributes
119 119
 	 * @return 	string
120 120
 	 */
121
-	final public static function invalid_shortcode_processor( $attributes ) {
121
+	final public static function invalid_shortcode_processor($attributes) {
122 122
 		return '';
123 123
 	}
124 124
 
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
 	 */
133 133
 	final public function __construct() {
134 134
 		// get classname, remove EES_prefix, and convert to UPPERCASE
135
-		$shortcode = strtoupper( str_replace( 'EES_', '', get_class( $this )));
135
+		$shortcode = strtoupper(str_replace('EES_', '', get_class($this)));
136 136
 		// assign shortcode to the preferred callback, which overwrites the "fallback shortcode processor" assigned earlier
137
-		add_shortcode( $shortcode, array( $this, 'process_shortcode' ));
137
+		add_shortcode($shortcode, array($this, 'process_shortcode'));
138 138
 		// make sure system knows this is an EE page
139
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
139
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
140 140
 	}
141 141
 
142 142
 
Please login to merge, or discard this patch.
core/EE_Maintenance_Mode.core.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public static function instance() {
75 75
 		// check if class object is instantiated
76
-		if ( self::$_instance === NULL  or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Maintenance_Mode )) {
76
+		if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Maintenance_Mode)) {
77 77
 			self::$_instance = new self();
78 78
 		}
79 79
 		return self::$_instance;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * Resets maintenance mode (mostly just re-checks whether or not we should be in maintenance mode)
84 84
 	 * @return EE_Maintenance_Mode
85 85
 	 */
86
-	public static function reset(){
86
+	public static function reset() {
87 87
 		self::instance()->set_maintenance_mode_if_db_old();
88 88
 		return self::instance();
89 89
 	}
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	private function __construct() {
100 100
 		// if M-Mode level 2 is engaged, we still need basic assets loaded
101
-		add_action( 'wp_enqueue_scripts', array( $this, 'load_assets_required_for_m_mode' ));
101
+		add_action('wp_enqueue_scripts', array($this, 'load_assets_required_for_m_mode'));
102 102
 		// shut 'er down down for maintenance ?
103
-		add_filter( 'the_content', array( $this, 'the_content' ), 2 );
103
+		add_filter('the_content', array($this, 'the_content'), 2);
104 104
 		// add powered by EE msg
105
-		add_action( 'shutdown', array( $this, 'display_maintenance_mode_notice' ), 10 );
105
+		add_action('shutdown', array($this, 'display_maintenance_mode_notice'), 10);
106 106
 	}
107 107
 
108 108
 
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	 * retrieves the maintenance mode option value from the db
113 113
 	 * @return int
114 114
 	 */
115
-	public function real_level(){
116
-		return get_option( self::option_name_maintenance_mode, EE_Maintenance_Mode::level_0_not_in_maintenance );
115
+	public function real_level() {
116
+		return get_option(self::option_name_maintenance_mode, EE_Maintenance_Mode::level_0_not_in_maintenance);
117 117
 	}
118 118
 
119 119
 	/**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 * thinks their tables are present and up-to-date).
122 122
 	 * @return boolean
123 123
 	 */
124
-	public function models_can_query(){
124
+	public function models_can_query() {
125 125
 		return $this->real_level() != EE_Maintenance_Mode::level_2_complete_maintenance;
126 126
 	}
127 127
 
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
 	 * EE_Maintenance_Mode::level_2_complete_maintenance => frontend and backend maintenance mode
135 135
 	 * @return int
136 136
 	 */
137
-	public function level(){
137
+	public function level() {
138 138
 		$real_maintenance_mode_level = $this->real_level();
139 139
 		//if this is an admin request, we'll be honest... except if it's ajax, because that might be from the frontend
140
-		if( ( ! is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) && //only on frontend or ajax requests
140
+		if (( ! is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) && //only on frontend or ajax requests
141 141
 			current_user_can('administrator') && //when the user is an admin
142
-			$real_maintenance_mode_level == EE_Maintenance_Mode::level_1_frontend_only_maintenance){//and we're in level 1
142
+			$real_maintenance_mode_level == EE_Maintenance_Mode::level_1_frontend_only_maintenance) {//and we're in level 1
143 143
 			$maintenance_mode_level = EE_Maintenance_Mode::level_0_not_in_maintenance;
144
-		}else{
144
+		} else {
145 145
 			$maintenance_mode_level = $real_maintenance_mode_level;
146 146
 		}
147 147
 		return $maintenance_mode_level;
@@ -151,17 +151,17 @@  discard block
 block discarded – undo
151 151
 	 * Determines if we need to put EE in maintenance mode because the database needs updating
152 152
 	 * @return boolean true if DB is old and maintenance mode was triggered; false otherwise
153 153
 	 */
154
-	public function set_maintenance_mode_if_db_old(){
155
-		EE_Registry::instance()->load_core( 'Data_Migration_Manager' );
156
-		if( EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts()){
154
+	public function set_maintenance_mode_if_db_old() {
155
+		EE_Registry::instance()->load_core('Data_Migration_Manager');
156
+		if (EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts()) {
157 157
 			update_option(self::option_name_maintenance_mode, self::level_2_complete_maintenance);
158 158
 			return true;
159
-		}elseif( $this->level() == self::level_2_complete_maintenance ){
159
+		}elseif ($this->level() == self::level_2_complete_maintenance) {
160 160
 			//we also want to handle the opposite: if the site is mm2, but there aren't any migrations to run
161 161
 			//then we shouldn't be in mm2. (Maybe an addon got deactivated?)
162
-			update_option( self::option_name_maintenance_mode, self::level_0_not_in_maintenance );
162
+			update_option(self::option_name_maintenance_mode, self::level_0_not_in_maintenance);
163 163
 			return false;
164
-		}else{
164
+		} else {
165 165
 			return false;
166 166
 		}
167 167
 	}
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
 	 * @param int $level
172 172
 	 * @return void
173 173
 	 */
174
-	public function set_maintenance_level($level){
175
-		do_action( 'AHEE__EE_Maintenance_Mode__set_maintenance_level', $level );
174
+	public function set_maintenance_level($level) {
175
+		do_action('AHEE__EE_Maintenance_Mode__set_maintenance_level', $level);
176 176
 		update_option(self::option_name_maintenance_mode, intval($level));
177 177
 	}
178 178
 
@@ -199,11 +199,11 @@  discard block
 block discarded – undo
199 199
 	 *  @return 	string
200 200
 	 */
201 201
 	public function load_assets_required_for_m_mode() {
202
-		if ( $this->real_level() == EE_Maintenance_Mode::level_2_complete_maintenance && ! wp_script_is( 'espresso_core', 'enqueued' )) {
203
-			wp_register_style( 'espresso_default', EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css', array( 'dashicons' ), EVENT_ESPRESSO_VERSION );
202
+		if ($this->real_level() == EE_Maintenance_Mode::level_2_complete_maintenance && ! wp_script_is('espresso_core', 'enqueued')) {
203
+			wp_register_style('espresso_default', EE_GLOBAL_ASSETS_URL.'css/espresso_default.css', array('dashicons'), EVENT_ESPRESSO_VERSION);
204 204
 			wp_enqueue_style('espresso_default');
205
-			wp_register_script( 'espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
206
-			wp_enqueue_script( 'espresso_core' );
205
+			wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
206
+			wp_enqueue_script('espresso_core');
207 207
 		}
208 208
 	}
209 209
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 */
222 222
 	public static function template_include() {
223 223
 		// shut 'er down down for maintenance ? then don't use any of our templates for our endpoints
224
-		return get_template_directory() . '/index.php';
224
+		return get_template_directory().'/index.php';
225 225
 	}
226 226
 
227 227
 
@@ -235,12 +235,12 @@  discard block
 block discarded – undo
235 235
 	 * @param    string $the_content
236 236
 	 * @return    string
237 237
 	 */
238
-	public function the_content( $the_content ) {
238
+	public function the_content($the_content) {
239 239
 		// check if M-mode is engaged and for EE shortcode
240
-		if ( $this->level() && strpos( $the_content, '[ESPRESSO_' ) !== false ) {
240
+		if ($this->level() && strpos($the_content, '[ESPRESSO_') !== false) {
241 241
 			// this can eventually be moved to a template, or edited via admin. But for now...
242 242
 			$the_content = sprintf(
243
-				__( '%sMaintenance Mode%sEvent Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.%s', 'event_espresso' ),
243
+				__('%sMaintenance Mode%sEvent Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.%s', 'event_espresso'),
244 244
 				'<h3>',
245 245
 				'</h3><p>',
246 246
 				'</p>'
@@ -264,16 +264,16 @@  discard block
 block discarded – undo
264 264
 		// check if M-mode is engaged and for EE shortcode
265 265
 		if (
266 266
 			$this->real_level() &&
267
-			current_user_can( 'administrator' ) &&
267
+			current_user_can('administrator') &&
268 268
 			! is_admin() &&
269
-			! ( defined( 'DOING_AJAX' ) && DOING_AJAX )
269
+			! (defined('DOING_AJAX') && DOING_AJAX)
270 270
 			&& EE_Registry::instance()->REQ->is_espresso_page()
271 271
 		) {
272 272
 			printf(
273
-				__( '%sclose%sEvent Registration is currently disabled because Event Espresso has been placed into Maintenance Mode. To change Maintenance Mode settings, click here %sEE Maintenance Mode Admin Page%s', 'event_espresso' ),
273
+				__('%sclose%sEvent Registration is currently disabled because Event Espresso has been placed into Maintenance Mode. To change Maintenance Mode settings, click here %sEE Maintenance Mode Admin Page%s', 'event_espresso'),
274 274
 				'<div id="ee-m-mode-admin-notice-dv" class="ee-really-important-notice-dv"><a class="close-espresso-notice" title="',
275 275
 				'">&times;</a><p>',
276
-				' &raquo; <a href="' . add_query_arg( array( 'page' => 'espresso_maintenance_settings' ), admin_url( 'admin.php' )) . '">',
276
+				' &raquo; <a href="'.add_query_arg(array('page' => 'espresso_maintenance_settings'), admin_url('admin.php')).'">',
277 277
 				'</a></p></div>'
278 278
 			);
279 279
 		}
@@ -291,9 +291,9 @@  discard block
 block discarded – undo
291 291
 	 *		@ return void
292 292
 	 */
293 293
 	final function __destruct() {}
294
-	final function __call($a,$b) {}
294
+	final function __call($a, $b) {}
295 295
 	final function __get($a) {}
296
-	final function __set($a,$b) {}
296
+	final function __set($a, $b) {}
297 297
 	final function __isset($a) {}
298 298
 	final function __unset($a) {}
299 299
 	final function __sleep() {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 	final function __invoke() {}
305 305
 	final function __set_state() {}
306 306
 	final function __clone() {}
307
-	final static function __callStatic($a,$b) {}
307
+	final static function __callStatic($a, $b) {}
308 308
 
309 309
 }
310 310
 // End of file EE_Maintenance_Mode.core.php
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
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  *
42 42
  */
43 43
 
44
-if ( function_exists( 'espresso_version' ) ) {
44
+if (function_exists('espresso_version')) {
45 45
 
46 46
 	/**
47 47
 	 *    espresso_duplicate_plugin_error
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 	function espresso_duplicate_plugin_error() {
51 51
 		?>
52 52
 		<div class="error">
53
-			<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>
53
+			<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 54
 		</div>
55 55
 		<?php
56
-		espresso_deactivate_plugin( plugin_basename( __FILE__ ) );
56
+		espresso_deactivate_plugin(plugin_basename(__FILE__));
57 57
 	}
58
-	add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 );
58
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
59 59
 
60 60
 } else {
61 61
 
@@ -70,98 +70,98 @@  discard block
 block discarded – undo
70 70
 	}
71 71
 
72 72
 	// define versions
73
-	define( 'EVENT_ESPRESSO_VERSION', espresso_version() );
74
-	define( 'EE_MIN_WP_VER_REQUIRED', '4.1' );
75
-	define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' );
76
-	define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' );
77
-	define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' );
78
-	define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION );
79
-	define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ );
73
+	define('EVENT_ESPRESSO_VERSION', espresso_version());
74
+	define('EE_MIN_WP_VER_REQUIRED', '4.1');
75
+	define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
76
+	define('EE_MIN_PHP_VER_REQUIRED', '5.3.0');
77
+	define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
78
+	define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION);
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 );
154
+	define('EE_INF_IN_DB', -1);
155
+	define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX);
156 156
 
157 157
 	/**
158 158
 	 *    espresso_plugin_activation
159 159
 	 *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
160 160
 	 */
161 161
 	function espresso_plugin_activation() {
162
-		update_option( 'ee_espresso_activation', true );
162
+		update_option('ee_espresso_activation', true);
163 163
 	}
164
-	register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' );
164
+	register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
165 165
 
166 166
 
167 167
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		//	}
176 176
 		//
177 177
 	}
178
-	register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' );
178
+	register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation');
179 179
 
180 180
 
181 181
 
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
 	 */
186 186
 	function espresso_load_error_handling() {
187 187
 		// load debugging tools
188
-		if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) {
189
-			require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' );
188
+		if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) {
189
+			require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php');
190 190
 			EEH_Debug_Tools::instance();
191 191
 		}
192 192
 		// load error handling
193
-		if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) {
194
-			require_once( EE_CORE . 'EE_Error.core.php' );
193
+		if (is_readable(EE_CORE.'EE_Error.core.php')) {
194
+			require_once(EE_CORE.'EE_Error.core.php');
195 195
 		} else {
196
-			wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ) );
196
+			wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso'));
197 197
 		}
198 198
 	}
199 199
 
@@ -207,25 +207,25 @@  discard block
 block discarded – undo
207 207
 	 * @param    string $full_path_to_file
208 208
 	 * @throws    EE_Error
209 209
 	 */
210
-	function espresso_load_required( $classname, $full_path_to_file ) {
210
+	function espresso_load_required($classname, $full_path_to_file) {
211 211
 		static $error_handling_loaded = false;
212
-		if ( ! $error_handling_loaded ) {
212
+		if ( ! $error_handling_loaded) {
213 213
 			espresso_load_error_handling();
214 214
 			$error_handling_loaded = true;
215 215
 		}
216
-		if ( is_readable( $full_path_to_file ) ) {
217
-			require_once( $full_path_to_file );
216
+		if (is_readable($full_path_to_file)) {
217
+			require_once($full_path_to_file);
218 218
 		} else {
219
-			throw new EE_Error ( sprintf(
220
-				__( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ),
219
+			throw new EE_Error(sprintf(
220
+				__('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'),
221 221
 				$classname
222
-			) );
222
+			));
223 223
 		}
224 224
 	}
225 225
 
226
-	espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' );
227
-	espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' );
228
-	espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' );
226
+	espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php');
227
+	espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php');
228
+	espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php');
229 229
 	new EE_Bootstrap();
230 230
 
231 231
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 
235 235
 
236 236
 
237
-if ( ! function_exists( 'espresso_deactivate_plugin' ) ) {
237
+if ( ! function_exists('espresso_deactivate_plugin')) {
238 238
 	/**
239 239
 	*    deactivate_plugin
240 240
 	* usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
@@ -243,12 +243,12 @@  discard block
 block discarded – undo
243 243
 	* @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
244 244
 	* @return    void
245 245
 	*/
246
-	function espresso_deactivate_plugin( $plugin_basename = '' ) {
247
-		if ( ! function_exists( 'deactivate_plugins' ) ) {
248
-			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
246
+	function espresso_deactivate_plugin($plugin_basename = '') {
247
+		if ( ! function_exists('deactivate_plugins')) {
248
+			require_once(ABSPATH.'wp-admin/includes/plugin.php');
249 249
 		}
250
-		unset( $_GET[ 'activate' ] );
251
-		unset( $_REQUEST[ 'activate' ] );
252
-		deactivate_plugins( $plugin_basename );
250
+		unset($_GET['activate']);
251
+		unset($_REQUEST['activate']);
252
+		deactivate_plugins($plugin_basename);
253 253
 	}
254 254
 }
Please login to merge, or discard this patch.
core/db_models/EEM_Transaction.model.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
2
+require_once (EE_MODELS.'EEM_Base.model.php');
3 3
 /**
4 4
  *
5 5
  * Transaction Model
@@ -68,36 +68,36 @@  discard block
 block discarded – undo
68 68
 	 * 		Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
69 69
 	 *	@return EEM_Transaction
70 70
 	 */
71
-	protected function __construct( $timezone ) {
72
-		$this->singular_item = __('Transaction','event_espresso');
73
-		$this->plural_item = __('Transactions','event_espresso');
71
+	protected function __construct($timezone) {
72
+		$this->singular_item = __('Transaction', 'event_espresso');
73
+		$this->plural_item = __('Transactions', 'event_espresso');
74 74
 
75 75
 		$this->_tables = array(
76
-			'Transaction'=>new EE_Primary_Table('esp_transaction','TXN_ID')
76
+			'Transaction'=>new EE_Primary_Table('esp_transaction', 'TXN_ID')
77 77
 		);
78 78
 		$this->_fields = array(
79 79
 			'Transaction'=>array(
80
-				'TXN_ID'=>new EE_Primary_Key_Int_Field('TXN_ID', __('Transaction ID','event_espresso')),
81
-				'TXN_timestamp'=>new EE_Datetime_Field('TXN_timestamp', __('date when transaction was created','event_espresso'), false, time(), $timezone ),
82
-				'TXN_total'=>new EE_Money_Field('TXN_total', __('Total value of Transaction','event_espresso'), false, 0),
83
-				'TXN_paid'=>new EE_Money_Field('TXN_paid', __('Amount paid towards transaction to date','event_espresso'), false, 0),
84
-				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID','event_espresso'), false, EEM_Transaction::failed_status_code, 'Status'),
85
-				'TXN_session_data'=>new EE_Serialized_Text_Field('TXN_session_data', __('Serialized session data','event_espresso'), true, ''),
86
-				'TXN_hash_salt'=>new EE_Plain_Text_Field('TXN_hash_salt', __('Transaction Hash Salt','event_espresso'), true, ''),
80
+				'TXN_ID'=>new EE_Primary_Key_Int_Field('TXN_ID', __('Transaction ID', 'event_espresso')),
81
+				'TXN_timestamp'=>new EE_Datetime_Field('TXN_timestamp', __('date when transaction was created', 'event_espresso'), false, time(), $timezone),
82
+				'TXN_total'=>new EE_Money_Field('TXN_total', __('Total value of Transaction', 'event_espresso'), false, 0),
83
+				'TXN_paid'=>new EE_Money_Field('TXN_paid', __('Amount paid towards transaction to date', 'event_espresso'), false, 0),
84
+				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID', 'event_espresso'), false, EEM_Transaction::failed_status_code, 'Status'),
85
+				'TXN_session_data'=>new EE_Serialized_Text_Field('TXN_session_data', __('Serialized session data', 'event_espresso'), true, ''),
86
+				'TXN_hash_salt'=>new EE_Plain_Text_Field('TXN_hash_salt', __('Transaction Hash Salt', 'event_espresso'), true, ''),
87 87
 				'PMD_ID'=>new EE_Foreign_Key_Int_Field('PMD_ID', __("Last Used Payment Method", 'event_espresso'), true, NULL, 'Payment_Method'),
88
-				'TXN_reg_steps' => new EE_Serialized_Text_Field( 'TXN_reg_steps', __( 'Registration Steps', 'event_espresso' ), FALSE, array() ),
88
+				'TXN_reg_steps' => new EE_Serialized_Text_Field('TXN_reg_steps', __('Registration Steps', 'event_espresso'), FALSE, array()),
89 89
 			)
90 90
 		);
91 91
 		$this->_model_relations = array(
92 92
 			'Registration'=>new EE_Has_Many_Relation(),
93 93
 			'Payment'=>new EE_Has_Many_Relation(),
94 94
 			'Status'=>new EE_Belongs_To_Relation(),
95
-			'Line_Item'=>new EE_Has_Many_Relation(false),//you can delete a transaction without needing to delete its line items
95
+			'Line_Item'=>new EE_Has_Many_Relation(false), //you can delete a transaction without needing to delete its line items
96 96
 			'Payment_Method'=>new EE_Belongs_To_Relation(),
97 97
 			'Message' => new EE_Has_Many_Relation()
98 98
 		);
99 99
 		$this->_model_chain_to_wp_user = 'Registration.Event';
100
-		parent::__construct( $timezone );
100
+		parent::__construct($timezone);
101 101
 
102 102
 	}
103 103
 
@@ -108,23 +108,23 @@  discard block
 block discarded – undo
108 108
 	 * @param string $period
109 109
 	 * @return \stdClass[]
110 110
 	 */
111
-	public function get_revenue_per_day_report( $period = '-1 month' ) {
112
-		$sql_date = $this->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', strtotime( $period ) ), 'Y-m-d H:i:s', 'UTC' );
111
+	public function get_revenue_per_day_report($period = '-1 month') {
112
+		$sql_date = $this->convert_datetime_for_query('TXN_timestamp', date('Y-m-d H:i:s', strtotime($period)), 'Y-m-d H:i:s', 'UTC');
113 113
 
114
-		EE_Registry::instance()->load_helper( 'DTT_Helper' );
115
-		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset( $this->get_timezone(), 'TXN_timestamp' );
114
+		EE_Registry::instance()->load_helper('DTT_Helper');
115
+		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset($this->get_timezone(), 'TXN_timestamp');
116 116
 
117 117
 		$results = $this->_get_all_wpdb_results(
118 118
 			array(
119 119
 				array(
120
-				'TXN_timestamp' => array( '>=', $sql_date ) ),
120
+				'TXN_timestamp' => array('>=', $sql_date) ),
121 121
 				'group_by' => 'txnDate',
122
-				'order_by' => array( 'TXN_timestamp' => 'ASC' )
122
+				'order_by' => array('TXN_timestamp' => 'ASC')
123 123
 			),
124 124
 			OBJECT,
125 125
 			array(
126
-				'txnDate' => array( 'DATE(' . $query_interval . ')', '%s' ),
127
-				'revenue' => array( 'SUM(Transaction.TXN_paid)', '%d' )
126
+				'txnDate' => array('DATE('.$query_interval.')', '%s'),
127
+				'revenue' => array('SUM(Transaction.TXN_paid)', '%d')
128 128
 			)
129 129
 		);
130 130
 		return $results;
@@ -140,17 +140,17 @@  discard block
 block discarded – undo
140 140
 	 * @throws \EE_Error
141 141
 	 * @return mixed
142 142
 	 */
143
-	public function get_revenue_per_event_report( $period = '-1 month' ) {
143
+	public function get_revenue_per_event_report($period = '-1 month') {
144 144
 		global $wpdb;
145
-		$transaction_table = $wpdb->prefix . 'esp_transaction';
146
-		$registration_table = $wpdb->prefix . 'esp_registration';
145
+		$transaction_table = $wpdb->prefix.'esp_transaction';
146
+		$registration_table = $wpdb->prefix.'esp_registration';
147 147
 		$event_table = $wpdb->posts;
148
-		$payment_table = $wpdb->prefix . 'esp_payment';
149
-		$sql_date = date( 'Y-m-d H:i:s', strtotime( $period ) );
148
+		$payment_table = $wpdb->prefix.'esp_payment';
149
+		$sql_date = date('Y-m-d H:i:s', strtotime($period));
150 150
 		$extra_event_on_join = '';
151 151
 		//exclude events not authored by user if permissions in effect
152
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
153
-			$extra_event_on_join = ' AND Event.post_author = ' . get_current_user_id();
152
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
153
+			$extra_event_on_join = ' AND Event.post_author = '.get_current_user_id();
154 154
 		}
155 155
 
156 156
 		$approved_payment_status = EEM_Payment::status_id_approved;
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
 	 * @param string $reg_url_link
197 197
 	 * @return EE_Transaction
198 198
 	 */
199
-	public function get_transaction_from_reg_url_link( $reg_url_link = '' ){
200
-		return $this->get_one( array(
199
+	public function get_transaction_from_reg_url_link($reg_url_link = '') {
200
+		return $this->get_one(array(
201 201
 			array(
202
-				'Registration.REG_url_link' => ! empty( $reg_url_link ) ? $reg_url_link : EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' )
202
+				'Registration.REG_url_link' => ! empty($reg_url_link) ? $reg_url_link : EE_Registry::instance()->REQ->get('e_reg_url_link', '')
203 203
 			)
204 204
 		));
205 205
 	}
@@ -219,15 +219,15 @@  discard block
 block discarded – undo
219 219
 	 * @param boolean $save_txn whether or not to save the transaction during this function call
220 220
 	 * @return boolean
221 221
 	 */
222
-	public function update_based_on_payments( $transaction_obj_or_id, $save_txn = TRUE ){
222
+	public function update_based_on_payments($transaction_obj_or_id, $save_txn = TRUE) {
223 223
 		EE_Error::doing_it_wrong(
224
-			__CLASS__ . '::' . __FUNCTION__,
225
-			sprintf( __( 'This method is deprecated. Please use "%s" instead', 'event_espresso' ), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()' ),
224
+			__CLASS__.'::'.__FUNCTION__,
225
+			sprintf(__('This method is deprecated. Please use "%s" instead', 'event_espresso'), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()'),
226 226
 			'4.6.0'
227 227
 		);
228 228
 		/** @type EE_Transaction_Processor $transaction_processor */
229
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
230
-		return  $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment( $this->ensure_is_obj( $transaction_obj_or_id ));
229
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
230
+		return  $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment($this->ensure_is_obj($transaction_obj_or_id));
231 231
 	}
232 232
 
233 233
 	/**
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			array(
259 259
 				0 => array(
260 260
 					'STS_ID' => EEM_Transaction::failed_status_code,
261
-					'TXN_timestamp' => array( '<', time() - $time_to_leave_alone )
261
+					'TXN_timestamp' => array('<', time() - $time_to_leave_alone)
262 262
 				)
263 263
 			),
264 264
 			$time_to_leave_alone
@@ -271,26 +271,26 @@  discard block
 block discarded – undo
271 271
 		 */
272 272
 		$txn_ids = apply_filters(
273 273
 			'FHEE__EEM_Transaction__delete_junk_transactions__transaction_ids_to_delete',
274
-			EEM_Transaction::instance()->get_col( $ids_query, 'TXN_ID' ),
274
+			EEM_Transaction::instance()->get_col($ids_query, 'TXN_ID'),
275 275
 			$time_to_leave_alone
276 276
 		);
277 277
 
278 278
 		//now that we have the ids to delete, let's get deletin'
279 279
 		//Why no wpdb->prepare?  Because the data is trusted.  We got the ids from the original query to get them FROM
280 280
 		//the db (which is sanitized) so no need to prepare them again.
281
-		if ( $txn_ids ) {
282
-			$query   = '
281
+		if ($txn_ids) {
282
+			$query = '
283 283
 				DELETE
284
-				FROM ' . $this->table() . '
284
+				FROM ' . $this->table().'
285 285
 				WHERE
286
-					TXN_ID IN ( ' . implode( ",", $txn_ids ) . ')';
287
-			$deleted = $wpdb->query( $query );
286
+					TXN_ID IN ( ' . implode(",", $txn_ids).')';
287
+			$deleted = $wpdb->query($query);
288 288
 		}
289
-		if ( $deleted ) {
289
+		if ($deleted) {
290 290
 			/**
291 291
 			 * Allows code to do something after the transactions have been deleted.
292 292
 			 */
293
-			do_action( 'AHEE__EEM_Transaction__delete_junk_transactions__successful_deletion', $txn_ids );
293
+			do_action('AHEE__EEM_Transaction__delete_junk_transactions__successful_deletion', $txn_ids);
294 294
 		}
295 295
 		return $deleted;
296 296
 	}
Please login to merge, or discard this patch.