Completed
Branch BUG-8698-ticket-sellouts (195489)
by
unknown
87:51 queued 71:03
created
core/EE_Bootstrap.core.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function __construct() {
44 44
 		// construct request stack and run middleware apps as soon as all WP plugins are loaded
45
-		add_action( 'plugins_loaded', array( $this, 'run_request_stack' ), 0 );
45
+		add_action('plugins_loaded', array($this, 'run_request_stack'), 0);
46 46
 		// set framework for the rest of EE to hook into when loading
47
-		add_action( 'plugins_loaded', array( 'EE_Bootstrap', 'load_espresso_addons' ), 1 );
48
-		add_action( 'plugins_loaded', array( 'EE_Bootstrap', 'detect_activations_or_upgrades' ), 3 );
49
-		add_action( 'plugins_loaded', array( 'EE_Bootstrap', 'load_core_configuration' ), 5 );
50
-		add_action( 'plugins_loaded', array( 'EE_Bootstrap', 'register_shortcodes_modules_and_widgets' ), 7 );
51
-		add_action( 'plugins_loaded', array( 'EE_Bootstrap', 'brew_espresso' ), 9 );
47
+		add_action('plugins_loaded', array('EE_Bootstrap', 'load_espresso_addons'), 1);
48
+		add_action('plugins_loaded', array('EE_Bootstrap', 'detect_activations_or_upgrades'), 3);
49
+		add_action('plugins_loaded', array('EE_Bootstrap', 'load_core_configuration'), 5);
50
+		add_action('plugins_loaded', array('EE_Bootstrap', 'register_shortcodes_modules_and_widgets'), 7);
51
+		add_action('plugins_loaded', array('EE_Bootstrap', 'brew_espresso'), 9);
52 52
 	}
53 53
 
54 54
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			new EE_Load_Espresso_Core()
66 66
 		);
67 67
 		$this->_request_stack->handle_request(
68
-			new EE_Request( $_GET, $_POST, $_COOKIE ),
68
+			new EE_Request($_GET, $_POST, $_COOKIE),
69 69
 			new EE_Response()
70 70
 		);
71 71
 		$this->_request_stack->handle_response();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	protected function load_autoloader() {
80 80
 		// load interfaces
81
-		espresso_load_required( 'EEH_Autoloader', EE_CORE . 'helpers' . DS . 'EEH_Autoloader.helper.php' );
81
+		espresso_load_required('EEH_Autoloader', EE_CORE.'helpers'.DS.'EEH_Autoloader.helper.php');
82 82
 		EEH_Autoloader::instance();
83 83
 	}
84 84
 
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	protected function set_autoloaders_for_required_files() {
91 91
 		// load interfaces
92
-		espresso_load_required( 'EEI_Interfaces', EE_CORE . 'interfaces' . DS . 'EEI_Interfaces.php' );
92
+		espresso_load_required('EEI_Interfaces', EE_CORE.'interfaces'.DS.'EEI_Interfaces.php');
93 93
 		// load helpers
94
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( EE_HELPERS );
94
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_HELPERS);
95 95
 		// load request stack
96
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( EE_CORE . 'request_stack' . DS );
96
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE.'request_stack'.DS);
97 97
 		// load middleware
98
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( EE_CORE . 'middleware' . DS );
98
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE.'middleware'.DS);
99 99
 	}
100 100
 
101 101
 
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 			)
119 119
 		);
120 120
 		// load middleware onto stack : FILO (First In Last Out)
121
-		foreach ( (array)$stack_apps as $stack_app ) {
121
+		foreach ((array) $stack_apps as $stack_app) {
122 122
 			//$request_stack_builder->push( $stack_app );
123
-			$request_stack_builder->unshift( $stack_app );
123
+			$request_stack_builder->unshift($stack_app);
124 124
 		}
125 125
 		return apply_filters(
126 126
 			'FHEE__EE_Bootstrap__build_request_stack__request_stack_builder',
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * no other logic should be performed at this point
138 138
 	 */
139 139
 	public static function load_espresso_addons() {
140
-		do_action( 'AHEE__EE_Bootstrap__load_espresso_addons' );
140
+		do_action('AHEE__EE_Bootstrap__load_espresso_addons');
141 141
 	}
142 142
 
143 143
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 * we can determine if anything needs activating or upgrading
150 150
 	 */
151 151
 	public static function detect_activations_or_upgrades() {
152
-		do_action( 'AHEE__EE_Bootstrap__detect_activations_or_upgrades' );
152
+		do_action('AHEE__EE_Bootstrap__detect_activations_or_upgrades');
153 153
 	}
154 154
 
155 155
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 * we can load and set all of the system configurations
162 162
 	 */
163 163
 	public static function load_core_configuration() {
164
-		do_action( 'AHEE__EE_Bootstrap__load_core_configuration' );
164
+		do_action('AHEE__EE_Bootstrap__load_core_configuration');
165 165
 	}
166 166
 
167 167
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 * so that they are ready to be used throughout the system
174 174
 	 */
175 175
 	public static function register_shortcodes_modules_and_widgets() {
176
-		do_action( 'AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets' );
176
+		do_action('AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets');
177 177
 	}
178 178
 
179 179
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	 * so let the fun begin...
186 186
 	 */
187 187
 	public static function brew_espresso() {
188
-		do_action( 'AHEE__EE_Bootstrap__brew_espresso' );
188
+		do_action('AHEE__EE_Bootstrap__brew_espresso');
189 189
 	}
190 190
 
191 191
 
Please login to merge, or discard this patch.
core/request_stack/EE_Request.core.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -60,15 +60,15 @@  discard block
 block discarded – undo
60 60
 	 * @param array $post
61 61
 	 * @param array $cookie
62 62
 	 */
63
-	public function __construct( $get, $post, $cookie ) {
63
+	public function __construct($get, $post, $cookie) {
64 64
 		// grab request vars
65 65
 		$this->_get    = $get;
66 66
 		$this->_post   = $post;
67 67
 		$this->_cookie = $cookie;
68
-		$this->_params = array_merge( $get, $post );
68
+		$this->_params = array_merge($get, $post);
69 69
 		// AJAX ???
70
-		$this->ajax       = defined( 'DOING_AJAX' ) ? true : false;
71
-		$this->front_ajax = $this->is_set( 'ee_front_ajax' ) && $this->get( 'ee_front_ajax' ) == 1 ? true : false;
70
+		$this->ajax       = defined('DOING_AJAX') ? true : false;
71
+		$this->front_ajax = $this->is_set('ee_front_ajax') && $this->get('ee_front_ajax') == 1 ? true : false;
72 72
 	}
73 73
 
74 74
 
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 	 * @param bool $override_ee
120 120
 	 * @return    void
121 121
 	 */
122
-	public function set( $key, $value, $override_ee = FALSE ) {
122
+	public function set($key, $value, $override_ee = FALSE) {
123 123
 		// don't allow "ee" to be overwritten unless explicitly instructed to do so
124
-		if ( $key != 'ee' || ( $key == 'ee' && empty( $this->_params['ee'] )) || ( $key == 'ee' && ! empty( $this->_params['ee'] ) && $override_ee )) {
125
-			$this->_params[ $key ] = $value;
124
+		if ($key != 'ee' || ($key == 'ee' && empty($this->_params['ee'])) || ($key == 'ee' && ! empty($this->_params['ee']) && $override_ee)) {
125
+			$this->_params[$key] = $value;
126 126
 		}
127 127
 	}
128 128
 
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 	 * @param null $default
137 137
 	 * @return    mixed
138 138
 	 */
139
-	public function get( $key, $default = NULL ) {
140
-		return isset( $this->_params[ $key ] ) ? $this->_params[ $key ] : $default;
139
+	public function get($key, $default = NULL) {
140
+		return isset($this->_params[$key]) ? $this->_params[$key] : $default;
141 141
 	}
142 142
 
143 143
 
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 	 * @param $key
150 150
 	 * @return    boolean
151 151
 	 */
152
-	public function is_set( $key ) {
153
-		return isset( $this->_params[ $key ] ) ? TRUE : FALSE;
152
+	public function is_set($key) {
153
+		return isset($this->_params[$key]) ? TRUE : FALSE;
154 154
 	}
155 155
 
156 156
 
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 	 * @param $key
163 163
 	 * @param bool $unset_from_global_too
164 164
 	 */
165
-	public function un_set( $key, $unset_from_global_too = false ) {
166
-		unset( $this->_params[ $key ] );
167
-		if ( $unset_from_global_too ) {
168
-			unset( $_REQUEST[ $key ] );
165
+	public function un_set($key, $unset_from_global_too = false) {
166
+		unset($this->_params[$key]);
167
+		if ($unset_from_global_too) {
168
+			unset($_REQUEST[$key]);
169 169
 		}
170 170
 	}
171 171
 
Please login to merge, or discard this patch.
core/EE_Request_Handler.core.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 	 * @param WP $wp
66 66
 	 * @return \EE_Request_Handler
67 67
 	 */
68
-	public function __construct( $wp = null ) {
68
+	public function __construct($wp = null) {
69 69
 		// grab request vars
70 70
 		// NOTE: WHEN MERGING TO 4.9 PLZ FAVOUR THE CHANGES IN 4.9 OVER THE FOLLOWING LINE
71
-		$this->_params = array_merge( $_GET, $_POST );
71
+		$this->_params = array_merge($_GET, $_POST);
72 72
 		// AJAX ???
73
-		$this->ajax = defined( 'DOING_AJAX' ) ? true : false;
74
-		$this->front_ajax = $this->is_set( 'ee_front_ajax' ) && $this->get( 'ee_front_ajax' ) == 1 ? true : false;
75
-		do_action( 'AHEE__EE_Request_Handler__construct__complete' );
73
+		$this->ajax = defined('DOING_AJAX') ? true : false;
74
+		$this->front_ajax = $this->is_set('ee_front_ajax') && $this->get('ee_front_ajax') == 1 ? true : false;
75
+		do_action('AHEE__EE_Request_Handler__construct__complete');
76 76
 	}
77 77
 
78 78
 
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
 	 * @param WP $wp
85 85
 	 * @return void
86 86
 	 */
87
-	public function parse_request( $wp = null ) {
87
+	public function parse_request($wp = null) {
88 88
 		//if somebody forgot to provide us with WP, that's ok because its global
89
-		if ( ! $wp instanceof WP ) {
89
+		if ( ! $wp instanceof WP) {
90 90
 			global $wp;
91 91
 		}
92
-		$this->set_request_vars( $wp );
92
+		$this->set_request_vars($wp);
93 93
 	}
94 94
 
95 95
 
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 	 * @param WP $wp
102 102
 	 * @return void
103 103
 	 */
104
-	public function set_request_vars( $wp = null ) {
105
-		if ( ! is_admin() ) {
104
+	public function set_request_vars($wp = null) {
105
+		if ( ! is_admin()) {
106 106
 			// set request post_id
107
-			$this->set( 'post_id', $this->get_post_id_from_request( $wp ));
107
+			$this->set('post_id', $this->get_post_id_from_request($wp));
108 108
 			// set request post name
109
-			$this->set( 'post_name', $this->get_post_name_from_request( $wp ));
109
+			$this->set('post_name', $this->get_post_name_from_request($wp));
110 110
 			// set request post_type
111
-			$this->set( 'post_type', $this->get_post_type_from_request( $wp ));
111
+			$this->set('post_type', $this->get_post_type_from_request($wp));
112 112
 			// true or false ? is this page being used by EE ?
113 113
 			$this->set_espresso_page();
114 114
 		}
@@ -123,20 +123,20 @@  discard block
 block discarded – undo
123 123
 	 * @param WP $wp
124 124
 	 * @return int
125 125
 	 */
126
-	public function get_post_id_from_request( $wp = null ) {
127
-		if ( ! $wp instanceof WP ){
126
+	public function get_post_id_from_request($wp = null) {
127
+		if ( ! $wp instanceof WP) {
128 128
 			global $wp;
129 129
 		}
130 130
 		$post_id = null;
131
-		if ( isset( $wp->query_vars['p'] )) {
131
+		if (isset($wp->query_vars['p'])) {
132 132
 			$post_id = $wp->query_vars['p'];
133 133
 		}
134
-		if ( ! $post_id && isset( $wp->query_vars['page_id'] )) {
134
+		if ( ! $post_id && isset($wp->query_vars['page_id'])) {
135 135
 			$post_id = $wp->query_vars['page_id'];
136 136
 		}
137
-		if ( ! $post_id && isset( $wp->request )) {
138
-			if ( is_numeric( basename( $wp->request ))) {
139
-				$post_id = basename( $wp->request );
137
+		if ( ! $post_id && isset($wp->request)) {
138
+			if (is_numeric(basename($wp->request))) {
139
+				$post_id = basename($wp->request);
140 140
 			}
141 141
 		}
142 142
 		return $post_id;
@@ -151,35 +151,35 @@  discard block
 block discarded – undo
151 151
 	 * @param WP $wp
152 152
 	 * @return string
153 153
 	 */
154
-	public function get_post_name_from_request( $wp = null ) {
155
-		if ( ! $wp instanceof WP ){
154
+	public function get_post_name_from_request($wp = null) {
155
+		if ( ! $wp instanceof WP) {
156 156
 			global $wp;
157 157
 		}
158 158
 		$post_name = null;
159
-		if ( isset( $wp->query_vars['name'] ) && ! empty( $wp->query_vars['name'] )) {
159
+		if (isset($wp->query_vars['name']) && ! empty($wp->query_vars['name'])) {
160 160
 			$post_name = $wp->query_vars['name'];
161 161
 		}
162
-		if ( ! $post_name && isset( $wp->query_vars['pagename'] ) && ! empty( $wp->query_vars['pagename'] )) {
162
+		if ( ! $post_name && isset($wp->query_vars['pagename']) && ! empty($wp->query_vars['pagename'])) {
163 163
 			$post_name = $wp->query_vars['pagename'];
164 164
 		}
165
-		if ( ! $post_name && isset( $wp->request ) && ! empty( $wp->request )) {
166
-			$possible_post_name = basename( $wp->request );
167
-			if ( ! is_numeric( $possible_post_name )) {
165
+		if ( ! $post_name && isset($wp->request) && ! empty($wp->request)) {
166
+			$possible_post_name = basename($wp->request);
167
+			if ( ! is_numeric($possible_post_name)) {
168 168
 				/** @type WPDB $wpdb */
169 169
 				global $wpdb;
170 170
 				$SQL = "SELECT ID from $wpdb->posts WHERE post_status='publish' AND post_name=%s";
171
-				$possible_post_name = $wpdb->get_var( $wpdb->prepare( $SQL, $possible_post_name ));
172
-				if ( $possible_post_name ) {
171
+				$possible_post_name = $wpdb->get_var($wpdb->prepare($SQL, $possible_post_name));
172
+				if ($possible_post_name) {
173 173
 					$post_name = $possible_post_name;
174 174
 				}
175 175
 			}
176 176
 		}
177
-		if ( ! $post_name && $this->get( 'post_id' )) {
177
+		if ( ! $post_name && $this->get('post_id')) {
178 178
 			/** @type WPDB $wpdb */
179 179
 			global $wpdb;
180 180
 			$SQL = "SELECT post_name from $wpdb->posts WHERE post_status='publish' AND ID=%d";
181
-			$possible_post_name = $wpdb->get_var( $wpdb->prepare( $SQL, $this->get( 'post_id' )));
182
-			if( $possible_post_name ) {
181
+			$possible_post_name = $wpdb->get_var($wpdb->prepare($SQL, $this->get('post_id')));
182
+			if ($possible_post_name) {
183 183
 				$post_name = $possible_post_name;
184 184
 			}
185 185
 		}
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 	 * @param WP $wp
196 196
 	 * @return mixed
197 197
 	 */
198
-	public function get_post_type_from_request( $wp = null ) {
199
-		if ( ! $wp instanceof WP ){
198
+	public function get_post_type_from_request($wp = null) {
199
+		if ( ! $wp instanceof WP) {
200 200
 			global $wp;
201 201
 		}
202
-		return isset( $wp->query_vars['post_type'] ) ? $wp->query_vars['post_type'] : null;
202
+		return isset($wp->query_vars['post_type']) ? $wp->query_vars['post_type'] : null;
203 203
 	}
204 204
 
205 205
 
@@ -209,18 +209,18 @@  discard block
 block discarded – undo
209 209
 	 * @param  WP $wp
210 210
 	 * @return bool|string|void
211 211
 	 */
212
-	public function get_current_page_permalink( $wp = null ) {
213
-		$post_id = $this->get_post_id_from_request( $wp );
214
-		if ( $post_id ) {
215
-			$current_page_permalink = get_permalink( $post_id );
212
+	public function get_current_page_permalink($wp = null) {
213
+		$post_id = $this->get_post_id_from_request($wp);
214
+		if ($post_id) {
215
+			$current_page_permalink = get_permalink($post_id);
216 216
 		} else {
217
-			if ( ! $wp instanceof WP ) {
217
+			if ( ! $wp instanceof WP) {
218 218
 				global $wp;
219 219
 			}
220
-			if ( $wp->request ) {
221
-				$current_page_permalink = site_url( $wp->request );
220
+			if ($wp->request) {
221
+				$current_page_permalink = site_url($wp->request);
222 222
 			} else {
223
-				$current_page_permalink = esc_url( site_url( $_SERVER[ 'REQUEST_URI' ] ) );
223
+				$current_page_permalink = esc_url(site_url($_SERVER['REQUEST_URI']));
224 224
 			}
225 225
 		}
226 226
 		return $current_page_permalink;
@@ -237,41 +237,41 @@  discard block
 block discarded – undo
237 237
 	public function test_for_espresso_page() {
238 238
 		global $wp;
239 239
 		/** @type EE_CPT_Strategy $EE_CPT_Strategy */
240
-		$EE_CPT_Strategy = EE_Registry::instance()->load_core( 'CPT_Strategy' );
240
+		$EE_CPT_Strategy = EE_Registry::instance()->load_core('CPT_Strategy');
241 241
 		$espresso_CPT_taxonomies = $EE_CPT_Strategy->get_CPT_taxonomies();
242
-		if ( is_array( $espresso_CPT_taxonomies ) ) {
243
-			foreach ( $espresso_CPT_taxonomies as $espresso_CPT_taxonomy =>$details ) {
244
-				if ( isset( $wp->query_vars, $wp->query_vars[ $espresso_CPT_taxonomy ] ) ) {
242
+		if (is_array($espresso_CPT_taxonomies)) {
243
+			foreach ($espresso_CPT_taxonomies as $espresso_CPT_taxonomy =>$details) {
244
+				if (isset($wp->query_vars, $wp->query_vars[$espresso_CPT_taxonomy])) {
245 245
 					return true;
246 246
 				}
247 247
 			}
248 248
 		}
249 249
 		// load espresso CPT endpoints
250 250
 		$espresso_CPT_endpoints = $EE_CPT_Strategy->get_CPT_endpoints();
251
-		$post_type_CPT_endpoints = array_flip( $espresso_CPT_endpoints );
252
-		$post_types = (array)$this->get( 'post_type' );
253
-		foreach ( $post_types as $post_type ) {
251
+		$post_type_CPT_endpoints = array_flip($espresso_CPT_endpoints);
252
+		$post_types = (array) $this->get('post_type');
253
+		foreach ($post_types as $post_type) {
254 254
 			// was a post name passed ?
255
-			if ( isset( $post_type_CPT_endpoints[ $post_type ] ) ) {
255
+			if (isset($post_type_CPT_endpoints[$post_type])) {
256 256
 				// kk we know this is an espresso page, but is it a specific post ?
257
-				if ( ! $this->get( 'post_name' ) ) {
257
+				if ( ! $this->get('post_name')) {
258 258
 					// there's no specific post name set, so maybe it's one of our endpoints like www.domain.com/events
259
-					$post_name = isset( $post_type_CPT_endpoints[ $this->get( 'post_type' ) ] ) ? $post_type_CPT_endpoints[ $this->get( 'post_type' ) ] : null;
259
+					$post_name = isset($post_type_CPT_endpoints[$this->get('post_type')]) ? $post_type_CPT_endpoints[$this->get('post_type')] : null;
260 260
 					// if the post type matches on of our then set the endpoint
261
-					if ( $post_name ) {
262
-						$this->set( 'post_name', $post_name );
261
+					if ($post_name) {
262
+						$this->set('post_name', $post_name);
263 263
 					}
264 264
 				}
265 265
 				return true;
266 266
 			}
267 267
 		}
268
-		if ( $this->get( 'post_name' )) {
268
+		if ($this->get('post_name')) {
269 269
 			// load all pages using espresso shortcodes
270
-			$post_shortcodes = isset( EE_Registry::instance()->CFG->core->post_shortcodes ) ? EE_Registry::instance()->CFG->core->post_shortcodes : array();
270
+			$post_shortcodes = isset(EE_Registry::instance()->CFG->core->post_shortcodes) ? EE_Registry::instance()->CFG->core->post_shortcodes : array();
271 271
 			// make sure core pages are included
272
-			$espresso_pages = array_merge( $espresso_CPT_endpoints, $post_shortcodes );
272
+			$espresso_pages = array_merge($espresso_CPT_endpoints, $post_shortcodes);
273 273
 			// was a post name passed ?
274
-			if (  isset( $espresso_pages[ $this->get( 'post_name' ) ] )) {
274
+			if (isset($espresso_pages[$this->get('post_name')])) {
275 275
 				 return true;
276 276
 			}
277 277
 		}
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	 * @param null $value
288 288
 	 * @return    mixed
289 289
 	 */
290
-	public function set_espresso_page( $value = null ) {
290
+	public function set_espresso_page($value = null) {
291 291
 		$value = $value ? $value : $this->test_for_espresso_page();
292 292
 		$this->_params['is_espresso_page'] = $value;
293 293
 	}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	 *  @return 	mixed
302 302
 	 */
303 303
 	public function is_espresso_page() {
304
-		return isset( $this->_params['is_espresso_page'] ) ? $this->_params['is_espresso_page'] : false;
304
+		return isset($this->_params['is_espresso_page']) ? $this->_params['is_espresso_page'] : false;
305 305
 	}
306 306
 
307 307
 
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
 	 * @param bool $override_ee
326 326
 	 * @return    void
327 327
 	 */
328
-	public function set( $key, $value, $override_ee = false ) {
328
+	public function set($key, $value, $override_ee = false) {
329 329
 		// don't allow "ee" to be overwritten unless explicitly instructed to do so
330
-		if ( $key != 'ee' || ( $key == 'ee' && empty( $this->_params['ee'] )) || ( $key == 'ee' && ! empty( $this->_params['ee'] ) && $override_ee )) {
331
-			$this->_params[ $key ] = $value;
330
+		if ($key != 'ee' || ($key == 'ee' && empty($this->_params['ee'])) || ($key == 'ee' && ! empty($this->_params['ee']) && $override_ee)) {
331
+			$this->_params[$key] = $value;
332 332
 		}
333 333
 	}
334 334
 
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
 	 * @param null $default
343 343
 	 * @return    mixed
344 344
 	 */
345
-	public function get( $key, $default = null ) {
346
-		return isset( $this->_params[ $key ] ) ? $this->_params[ $key ] : $default;
345
+	public function get($key, $default = null) {
346
+		return isset($this->_params[$key]) ? $this->_params[$key] : $default;
347 347
 	}
348 348
 
349 349
 
@@ -355,8 +355,8 @@  discard block
 block discarded – undo
355 355
 	 * @param $key
356 356
 	 * @return    boolean
357 357
 	 */
358
-	public function is_set( $key ) {
359
-		return isset( $this->_params[ $key ] ) ? true : false;
358
+	public function is_set($key) {
359
+		return isset($this->_params[$key]) ? true : false;
360 360
 	}
361 361
 
362 362
 
@@ -368,8 +368,8 @@  discard block
 block discarded – undo
368 368
 	 * @param $key
369 369
 	 * @return    void
370 370
 	 */
371
-	public function un_set( $key ) {
372
-		unset( $this->_params[ $key ] );
371
+	public function un_set($key) {
372
+		unset($this->_params[$key]);
373 373
 	}
374 374
 
375 375
 
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
 	 * @param $value
383 383
 	 * @return    void
384 384
 	 */
385
-	public function set_notice( $key, $value ) {
386
-		$this->_notice[ $key ] = $value;
385
+	public function set_notice($key, $value) {
386
+		$this->_notice[$key] = $value;
387 387
 	}
388 388
 
389 389
 
@@ -395,8 +395,8 @@  discard block
 block discarded – undo
395 395
 	 * @param $key
396 396
 	 * @return    mixed
397 397
 	 */
398
-	public function get_notice( $key ) {
399
-		return isset( $this->_notice[ $key ] ) ? $this->_notice[ $key ] : null;
398
+	public function get_notice($key) {
399
+		return isset($this->_notice[$key]) ? $this->_notice[$key] : null;
400 400
 	}
401 401
 
402 402
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 	 * @param $string
409 409
 	 * @return    void
410 410
 	 */
411
-	public function add_output( $string ) {
411
+	public function add_output($string) {
412 412
 		$this->_output .= $string;
413 413
 	}
414 414
 
@@ -430,8 +430,8 @@  discard block
 block discarded – undo
430 430
 	 * @param $item
431 431
 	 * @param $key
432 432
 	 */
433
-	function sanitize_text_field_for_array_walk( &$item, &$key ) {
434
-		$item = strpos( $item, 'email' ) !== false ? sanitize_email( $item ) : sanitize_text_field( $item );
433
+	function sanitize_text_field_for_array_walk(&$item, &$key) {
434
+		$item = strpos($item, 'email') !== false ? sanitize_email($item) : sanitize_text_field($item);
435 435
 	}
436 436
 
437 437
 
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 	 * @param $b
442 442
 	 * @return bool
443 443
 	 */
444
-	public function __set($a,$b) { return false; }
444
+	public function __set($a, $b) { return false; }
445 445
 
446 446
 
447 447
 
Please login to merge, or discard this patch.
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/db_models/EEM_Registration.model.php 1 patch
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  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_Soft_Delete_Base.model.php' );
3
-require_once ( EE_CLASSES . 'EE_Registration.class.php' );
2
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
3
+require_once (EE_CLASSES.'EE_Registration.class.php');
4 4
 /**
5 5
  *
6 6
  * Registration Model
@@ -92,31 +92,31 @@  discard block
 block discarded – undo
92 92
 	 *    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)
93 93
 	 * @return \EEM_Registration
94 94
 	 */
95
-	protected function __construct( $timezone ) {
96
-		$this->singular_item = __('Registration','event_espresso');
97
-		$this->plural_item = __('Registrations','event_espresso');
95
+	protected function __construct($timezone) {
96
+		$this->singular_item = __('Registration', 'event_espresso');
97
+		$this->plural_item = __('Registrations', 'event_espresso');
98 98
 
99 99
 		$this->_tables = array(
100
-			'Registration'=>new EE_Primary_Table('esp_registration','REG_ID')
100
+			'Registration'=>new EE_Primary_Table('esp_registration', 'REG_ID')
101 101
 		);
102 102
 		$this->_fields = array(
103 103
 			'Registration'=>array(
104
-				'REG_ID'=>new EE_Primary_Key_Int_Field('REG_ID', __('Registration ID','event_espresso')),
105
-				'EVT_ID'=>new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID','event_espresso'), false, 0, 'Event'),
106
-				'ATT_ID'=>new EE_Foreign_Key_Int_Field('ATT_ID', __('Attendee ID','event_espresso'), false, 0, 'Attendee'),
107
-				'TXN_ID'=>new EE_Foreign_Key_Int_Field('TXN_ID', __('Transaction ID','event_espresso'), false, 0, 'Transaction'),
108
-				'TKT_ID'=>new EE_Foreign_Key_Int_Field('TKT_ID', __('Ticket ID','event_espresso'), false, 0, 'Ticket'),
109
-				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID','event_espresso'), false, EEM_Registration::status_id_incomplete, 'Status'),
110
-				'REG_date'=>new EE_Datetime_Field('REG_date', __('Time registration occurred','event_espresso'), false, time(), $timezone ),
111
-				'REG_final_price'=>new EE_Money_Field('REG_final_price', __('Registration\'s share of the transaction total','event_espresso'), false, 0),
112
-				'REG_paid'=>new EE_Money_Field('REG_paid', __('Amount paid to date towards registration','event_espresso'), false, 0),
113
-				'REG_session'=>new EE_Plain_Text_Field('REG_session', __('Session ID of registration','event_espresso'), false, ''),
114
-				'REG_code'=>new EE_Plain_Text_Field('REG_code', __('Unique Code for this registration','event_espresso'), false, ''),
115
-				'REG_url_link'=>new EE_Plain_Text_Field('REG_url_link', __('String to be used in URL for identifying registration','event_espresso'), false, ''),
116
-				'REG_count'=>new EE_Integer_Field('REG_count', __('Count of this registration in the group registration ','event_espresso'), true, 1),
117
-				'REG_group_size'=>new EE_Integer_Field('REG_group_size', __('Number of registrations on this group','event_espresso'), false, 1),
118
-				'REG_att_is_going'=>new EE_Boolean_Field('REG_att_is_going', __('Flag indicating the registrant plans on attending','event_espresso'), false, false),
119
-				'REG_deleted' => new EE_Trashed_Flag_Field('REG_deleted', __('Flag indicating if registration has been archived or not.', 'event_espresso'), false, false )
104
+				'REG_ID'=>new EE_Primary_Key_Int_Field('REG_ID', __('Registration ID', 'event_espresso')),
105
+				'EVT_ID'=>new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID', 'event_espresso'), false, 0, 'Event'),
106
+				'ATT_ID'=>new EE_Foreign_Key_Int_Field('ATT_ID', __('Attendee ID', 'event_espresso'), false, 0, 'Attendee'),
107
+				'TXN_ID'=>new EE_Foreign_Key_Int_Field('TXN_ID', __('Transaction ID', 'event_espresso'), false, 0, 'Transaction'),
108
+				'TKT_ID'=>new EE_Foreign_Key_Int_Field('TKT_ID', __('Ticket ID', 'event_espresso'), false, 0, 'Ticket'),
109
+				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID', 'event_espresso'), false, EEM_Registration::status_id_incomplete, 'Status'),
110
+				'REG_date'=>new EE_Datetime_Field('REG_date', __('Time registration occurred', 'event_espresso'), false, time(), $timezone),
111
+				'REG_final_price'=>new EE_Money_Field('REG_final_price', __('Registration\'s share of the transaction total', 'event_espresso'), false, 0),
112
+				'REG_paid'=>new EE_Money_Field('REG_paid', __('Amount paid to date towards registration', 'event_espresso'), false, 0),
113
+				'REG_session'=>new EE_Plain_Text_Field('REG_session', __('Session ID of registration', 'event_espresso'), false, ''),
114
+				'REG_code'=>new EE_Plain_Text_Field('REG_code', __('Unique Code for this registration', 'event_espresso'), false, ''),
115
+				'REG_url_link'=>new EE_Plain_Text_Field('REG_url_link', __('String to be used in URL for identifying registration', 'event_espresso'), false, ''),
116
+				'REG_count'=>new EE_Integer_Field('REG_count', __('Count of this registration in the group registration ', 'event_espresso'), true, 1),
117
+				'REG_group_size'=>new EE_Integer_Field('REG_group_size', __('Number of registrations on this group', 'event_espresso'), false, 1),
118
+				'REG_att_is_going'=>new EE_Boolean_Field('REG_att_is_going', __('Flag indicating the registrant plans on attending', 'event_espresso'), false, false),
119
+				'REG_deleted' => new EE_Trashed_Flag_Field('REG_deleted', __('Flag indicating if registration has been archived or not.', 'event_espresso'), false, false)
120 120
 			)
121 121
 		);
122 122
 		$this->_model_relations = array(
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 			'Answer'=>new EE_Has_Many_Relation(),
129 129
 			'Checkin'=>new EE_Has_Many_Relation(),
130 130
 			'Registration_Payment' => new EE_Has_Many_Relation(),
131
-			'Payment'=>new EE_HABTM_Relation( 'Registration_Payment' ),
131
+			'Payment'=>new EE_HABTM_Relation('Registration_Payment'),
132 132
 		);
133 133
 		$this->_model_chain_to_wp_user = 'Event';
134 134
 
135
-		parent::__construct( $timezone );
135
+		parent::__construct($timezone);
136 136
 	}
137 137
 
138 138
 
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 	 *		@param bool  $translated If true will return the values as singular localized strings
166 166
 	 *		@return array
167 167
 	 */
168
-	public static function reg_status_array( $exclude = array(), $translated = FALSE ) {
169
-		EEM_Registration::instance()->_get_registration_status_array( $exclude );
170
-		return $translated ? EEM_Status::instance()->localized_status( self::$_reg_status, FALSE, 'sentence') : self::$_reg_status;
168
+	public static function reg_status_array($exclude = array(), $translated = FALSE) {
169
+		EEM_Registration::instance()->_get_registration_status_array($exclude);
170
+		return $translated ? EEM_Status::instance()->localized_status(self::$_reg_status, FALSE, 'sentence') : self::$_reg_status;
171 171
 	}
172 172
 
173 173
 
@@ -178,19 +178,19 @@  discard block
 block discarded – undo
178 178
 	 * @param array $exclude
179 179
 	 * @return array
180 180
 	 */
181
-	private function _get_registration_status_array( $exclude = array() ) {
181
+	private function _get_registration_status_array($exclude = array()) {
182 182
 		//in the very rare circumstance that we are deleting a model's table's data
183 183
 		//and the table hasn't actually been created, this could have an error
184 184
 		/** @type WPDB $wpdb */
185 185
 		global $wpdb;
186
-		EE_Registry::instance()->load_helper( 'Activation' );
187
-		if( EEH_Activation::table_exists( $wpdb->prefix . 'esp_status' ) ){
188
-			$SQL = 'SELECT STS_ID, STS_code FROM '. $wpdb->prefix . 'esp_status WHERE STS_type = "registration"';
189
-			$results = $wpdb->get_results( $SQL );
186
+		EE_Registry::instance()->load_helper('Activation');
187
+		if (EEH_Activation::table_exists($wpdb->prefix.'esp_status')) {
188
+			$SQL = 'SELECT STS_ID, STS_code FROM '.$wpdb->prefix.'esp_status WHERE STS_type = "registration"';
189
+			$results = $wpdb->get_results($SQL);
190 190
 			self::$_reg_status = array();
191
-			foreach ( $results as $status ) {
192
-				if ( ! in_array( $status->STS_ID, $exclude )) {
193
-					self::$_reg_status[ $status->STS_ID ] = $status->STS_code;
191
+			foreach ($results as $status) {
192
+				if ( ! in_array($status->STS_ID, $exclude)) {
193
+					self::$_reg_status[$status->STS_ID] = $status->STS_code;
194 194
 				}
195 195
 			}
196 196
 		}
@@ -205,15 +205,15 @@  discard block
 block discarded – undo
205 205
 	 * @param  array  $where_params Array of query_params as described in the comments for EEM_Base::get_all()
206 206
 	 * @return wpdb results array
207 207
 	 */
208
-	public function get_reg_months_and_years( $where_params ) {
208
+	public function get_reg_months_and_years($where_params) {
209 209
 		$query_params[0] = $where_params;
210 210
 		$query_params['group_by'] = array('reg_year', 'reg_month');
211
-		$query_params['order_by'] = array( 'REG_date' => 'DESC' );
211
+		$query_params['order_by'] = array('REG_date' => 'DESC');
212 212
 		$columns_to_select = array(
213 213
 			'reg_year' => array('YEAR(REG_date)', '%s'),
214 214
 			'reg_month' => array('MONTHNAME(REG_date)', '%s')
215 215
 			);
216
-		return $this->_get_all_wpdb_results( $query_params, OBJECT, $columns_to_select );
216
+		return $this->_get_all_wpdb_results($query_params, OBJECT, $columns_to_select);
217 217
 	}
218 218
 
219 219
 
@@ -225,11 +225,11 @@  discard block
 block discarded – undo
225 225
 	* 		@param		int		$ATT_ID
226 226
 	*		@return 	EE_Registration[]
227 227
 	*/
228
-	public function get_all_registrations_for_attendee( $ATT_ID = 0 ) {
229
-		if ( ! $ATT_ID ) {
228
+	public function get_all_registrations_for_attendee($ATT_ID = 0) {
229
+		if ( ! $ATT_ID) {
230 230
 			return FALSE;
231 231
 		}
232
-		return $this->get_all( array( array( 'ATT_ID' => $ATT_ID )));
232
+		return $this->get_all(array(array('ATT_ID' => $ATT_ID)));
233 233
 	}
234 234
 
235 235
 
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
 	 * @param string $REG_url_link
241 241
 	 * @return EE_Registration
242 242
 	 */
243
-	public function get_registration_for_reg_url_link($REG_url_link){
244
-		if(!$REG_url_link){
243
+	public function get_registration_for_reg_url_link($REG_url_link) {
244
+		if ( ! $REG_url_link) {
245 245
 			return false;
246 246
 		}
247 247
 		return $this->get_one(array(array('REG_url_link'=>$REG_url_link)));
@@ -259,13 +259,13 @@  discard block
 block discarded – undo
259 259
 	* 		@param    int		$att_nmbr 	in case the ATT_ID is the same for multiple registrations (same details used) then the attendee number is required
260 260
 	*		@return 		mixed		array on success, FALSE on fail
261 261
 	*/
262
-	public function get_registration_for_transaction_attendee( $TXN_ID = 0, $ATT_ID = 0, $att_nmbr = 0 ) {
262
+	public function get_registration_for_transaction_attendee($TXN_ID = 0, $ATT_ID = 0, $att_nmbr = 0) {
263 263
 		return $this->get_one(array(
264 264
 			array(
265 265
 				'TXN_ID'=>$TXN_ID,
266 266
 				'ATT_ID'=>$ATT_ID
267 267
 			),
268
-			'limit'=>array( min( ( $att_nmbr-1 ), 0 ), 1 )
268
+			'limit'=>array(min(($att_nmbr - 1), 0), 1)
269 269
 		));
270 270
 	}
271 271
 
@@ -277,17 +277,17 @@  discard block
 block discarded – undo
277 277
 	 *		@param $period string which can be passed to php's strtotime function (eg "-1 month")
278 278
 	 *		@return stdClass[] with properties regDate and total
279 279
 	*/
280
-	public function get_registrations_per_day_report( $period = '-1 month' ) {
280
+	public function get_registrations_per_day_report($period = '-1 month') {
281 281
 
282
-		$sql_date = $this->convert_datetime_for_query( 'REG_date', date("Y-m-d H:i:s", strtotime($period) ), 'Y-m-d H:i:s', 'UTC' );
283
-		$where = array( 'REG_date' => array( '>=', $sql_date ), 'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete ) );
282
+		$sql_date = $this->convert_datetime_for_query('REG_date', date("Y-m-d H:i:s", strtotime($period)), 'Y-m-d H:i:s', 'UTC');
283
+		$where = array('REG_date' => array('>=', $sql_date), 'STS_ID' => array('!=', EEM_Registration::status_id_incomplete));
284 284
 
285
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_day_report' ) ) {
285
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_day_report')) {
286 286
 			$where['Event.EVT_wp_user'] = get_current_user_id();
287 287
 		}
288 288
 
289
-		EE_Registry::instance()->load_helper( 'DTT_Helper' );
290
-		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset( $this->get_timezone(), 'REG_date' );
289
+		EE_Registry::instance()->load_helper('DTT_Helper');
290
+		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset($this->get_timezone(), 'REG_date');
291 291
 
292 292
 		$results = $this->_get_all_wpdb_results(
293 293
 				array(
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
 				),
298 298
 				OBJECT,
299 299
 				array(
300
-					'regDate'=>array( 'DATE(' . $query_interval . ')','%s'),
301
-					'total'=>array('count(REG_ID)','%d')
300
+					'regDate'=>array('DATE('.$query_interval.')', '%s'),
301
+					'total'=>array('count(REG_ID)', '%d')
302 302
 				));
303 303
 		return $results;
304 304
 	}
@@ -313,23 +313,23 @@  discard block
 block discarded – undo
313 313
 	 * @return stdClass[] with properties Registration_REG_date and a column for each registration status as the STS_ID
314 314
 	 *                    (i.e. RAP)
315 315
 	 */
316
-	public function get_registrations_per_day_and_per_status_report( $period = '-1 month' ) {
316
+	public function get_registrations_per_day_and_per_status_report($period = '-1 month') {
317 317
 		global $wpdb;
318
-		$registration_table = $wpdb->prefix . 'esp_registration';
318
+		$registration_table = $wpdb->prefix.'esp_registration';
319 319
 		$event_table = $wpdb->posts;
320
-		$sql_date = date("Y-m-d H:i:s", strtotime($period) );
320
+		$sql_date = date("Y-m-d H:i:s", strtotime($period));
321 321
 
322 322
 		//prepare the query interval for displaying offset
323
-		EE_Registry::instance()->load_helper( 'DTT_Helper' );
324
-		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset( $this->get_timezone(), 'dates.REG_date' );
323
+		EE_Registry::instance()->load_helper('DTT_Helper');
324
+		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset($this->get_timezone(), 'dates.REG_date');
325 325
 
326 326
 		//inner date query
327 327
 		$inner_date_query = "SELECT DISTINCT REG_date from $registration_table ";
328 328
 		$inner_where = " WHERE";
329 329
 		//exclude events not authored by user if permissions in effect
330
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
330
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
331 331
 			$inner_date_query .= "LEFT JOIN $event_table ON ID = EVT_ID";
332
-			$inner_where .= " post_author = " . get_current_user_id() . " AND";
332
+			$inner_where .= " post_author = ".get_current_user_id()." AND";
333 333
 		}
334 334
 		$inner_where .= " REG_date >= '$sql_date'";
335 335
 		$inner_date_query .= $inner_where;
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 		$select_parts = array();
342 342
 
343 343
 		//loop through registration stati to do parts for each status.
344
-		foreach ( EEM_Registration::reg_status_array() as $STS_ID => $STS_code ) {
345
-			if ( $STS_ID === EEM_Registration::status_id_incomplete ) {
344
+		foreach (EEM_Registration::reg_status_array() as $STS_ID => $STS_code) {
345
+			if ($STS_ID === EEM_Registration::status_id_incomplete) {
346 346
 				continue;
347 347
 			}
348 348
 			$select_parts[] = "COUNT($STS_code.REG_ID) as $STS_ID";
@@ -350,14 +350,14 @@  discard block
 block discarded – undo
350 350
 		}
351 351
 
352 352
 		//setup the selects
353
-		$select .= implode(', ', $select_parts );
353
+		$select .= implode(', ', $select_parts);
354 354
 		$select .= " FROM ($inner_date_query) AS dates LEFT JOIN ";
355 355
 
356 356
 		//setup the joins
357
-		$join .= implode( " LEFT JOIN ", $join_parts );
357
+		$join .= implode(" LEFT JOIN ", $join_parts);
358 358
 
359 359
 		//now let's put it all together
360
-		$query = $select . $join . ' GROUP BY Registration_REG_date';
360
+		$query = $select.$join.' GROUP BY Registration_REG_date';
361 361
 
362 362
 		//and execute it
363 363
 		$results = $wpdb->get_results(
@@ -378,23 +378,23 @@  discard block
 block discarded – undo
378 378
 	 * @param $period string which can be passed to php's strtotime function (eg "-1 month")
379 379
 	 *		@return stdClass[] each with properties event_name, reg_limit, and total
380 380
 	*/
381
-	public function get_registrations_per_event_report( $period = '-1 month' ) {
381
+	public function get_registrations_per_event_report($period = '-1 month') {
382 382
 
383
-		$date_sql = $this->convert_datetime_for_query( 'REG_date', date( "Y-m-d H:i:s", strtotime( $period )), 'Y-m-d H:i:s', 'UTC' );
384
-		$where = array( 'REG_date' => array( '>=', $date_sql ), 'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete ) );
383
+		$date_sql = $this->convert_datetime_for_query('REG_date', date("Y-m-d H:i:s", strtotime($period)), 'Y-m-d H:i:s', 'UTC');
384
+		$where = array('REG_date' => array('>=', $date_sql), 'STS_ID' => array('!=', EEM_Registration::status_id_incomplete));
385 385
 
386
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
386
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
387 387
 			$where['Event.EVT_wp_user'] = get_current_user_id();
388 388
 		}
389 389
 		$results = $this->_get_all_wpdb_results(array(
390 390
 			$where,
391 391
 			'group_by'=>'Event.EVT_name',
392 392
 			'order_by'=>'Event.EVT_name',
393
-			'limit'=>array(0,24)),
393
+			'limit'=>array(0, 24)),
394 394
 			OBJECT,
395 395
 			array(
396
-				'event_name'=>array('Event_CPT.post_title','%s'),
397
-				'total'=>array('COUNT(REG_ID)','%s')
396
+				'event_name'=>array('Event_CPT.post_title', '%s'),
397
+				'total'=>array('COUNT(REG_ID)', '%s')
398 398
 			)
399 399
 		);
400 400
 
@@ -412,19 +412,19 @@  discard block
 block discarded – undo
412 412
 	 * @return stdClass[] with properties `Registration_Event` and a column for each registration status as the STS_ID
413 413
 	 *                    (i.e. RAP)
414 414
 	 */
415
-	public function get_registrations_per_event_and_per_status_report( $period = '-1 month' ) {
415
+	public function get_registrations_per_event_and_per_status_report($period = '-1 month') {
416 416
 		global $wpdb;
417
-		$registration_table = $wpdb->prefix . 'esp_registration';
417
+		$registration_table = $wpdb->prefix.'esp_registration';
418 418
 		$event_table = $wpdb->posts;
419
-		$sql_date = date("Y-m-d H:i:s", strtotime($period) );
419
+		$sql_date = date("Y-m-d H:i:s", strtotime($period));
420 420
 
421 421
 		//inner date query
422 422
 		$inner_date_query = "SELECT DISTINCT EVT_ID, REG_date from $registration_table ";
423 423
 		$inner_where = " WHERE";
424 424
 		//exclude events not authored by user if permissions in effect
425
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
425
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
426 426
 			$inner_date_query .= "LEFT JOIN $event_table ON ID = EVT_ID";
427
-			$inner_where .= " post_author = " . get_current_user_id() . " AND";
427
+			$inner_where .= " post_author = ".get_current_user_id()." AND";
428 428
 		}
429 429
 		$inner_where .= " REG_date >= '$sql_date'";
430 430
 		$inner_date_query .= $inner_where;
@@ -436,8 +436,8 @@  discard block
 block discarded – undo
436 436
 		$select_parts = array();
437 437
 
438 438
 		//loop through registration stati to do parts for each status.
439
-		foreach ( EEM_Registration::reg_status_array() as $STS_ID => $STS_code ) {
440
-			if ( $STS_ID === EEM_Registration::status_id_incomplete ) {
439
+		foreach (EEM_Registration::reg_status_array() as $STS_ID => $STS_code) {
440
+			if ($STS_ID === EEM_Registration::status_id_incomplete) {
441 441
 				continue;
442 442
 			}
443 443
 			$select_parts[] = "COUNT($STS_code.REG_ID) as $STS_ID";
@@ -445,14 +445,14 @@  discard block
 block discarded – undo
445 445
 		}
446 446
 
447 447
 		//setup the selects
448
-		$select .= implode( ', ', $select_parts );
448
+		$select .= implode(', ', $select_parts);
449 449
 		$select .= " FROM ($inner_date_query) AS dates LEFT JOIN $event_table as Event ON Event.ID = dates.EVT_ID LEFT JOIN ";
450 450
 
451 451
 		//setup remaining joins
452
-		$join .= implode( " LEFT JOIN ", $join_parts );
452
+		$join .= implode(" LEFT JOIN ", $join_parts);
453 453
 
454 454
 		//now put it all together
455
-		$query = $select . $join . ' GROUP BY Registration_Event';
455
+		$query = $select.$join.' GROUP BY Registration_Event';
456 456
 
457 457
 		//and execute
458 458
 		$results = $wpdb->get_results(
@@ -468,11 +468,11 @@  discard block
 block discarded – undo
468 468
 	 * @param int $TXN_ID
469 469
 	 * @return EE_Registration
470 470
 	 */
471
-	public function get_primary_registration_for_transaction_ID( $TXN_ID = 0){
472
-		if( ! $TXN_ID ){
471
+	public function get_primary_registration_for_transaction_ID($TXN_ID = 0) {
472
+		if ( ! $TXN_ID) {
473 473
 			return false;
474 474
 		}
475
-		return $this->get_one(array(array('TXN_ID'=>$TXN_ID,'REG_count'=>  EEM_Registration::PRIMARY_REGISTRANT_COUNT)));
475
+		return $this->get_one(array(array('TXN_ID'=>$TXN_ID, 'REG_count'=>  EEM_Registration::PRIMARY_REGISTRANT_COUNT)));
476 476
 	}
477 477
 
478 478
 
@@ -484,11 +484,11 @@  discard block
 block discarded – undo
484 484
 	 *		@param boolean $for_incomplete_payments
485 485
 	 *		@return int
486 486
 	 */
487
-	public function get_event_registration_count ( $EVT_ID, $for_incomplete_payments = FALSE ) {
487
+	public function get_event_registration_count($EVT_ID, $for_incomplete_payments = FALSE) {
488 488
 		// we only count approved registrations towards registration limits
489
-		$query_params = array( array( 'EVT_ID' => $EVT_ID, 'STS_ID' => self::status_id_approved ) );
490
-		if( $for_incomplete_payments ){
491
-			$query_params[0]['Transaction.STS_ID']=array('!=',  EEM_Transaction::complete_status_code);
489
+		$query_params = array(array('EVT_ID' => $EVT_ID, 'STS_ID' => self::status_id_approved));
490
+		if ($for_incomplete_payments) {
491
+			$query_params[0]['Transaction.STS_ID'] = array('!=', EEM_Transaction::complete_status_code);
492 492
 		}
493 493
 
494 494
 		return $this->count($query_params);
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 		/** @type WPDB $wpdb */
505 505
 		global $wpdb;
506 506
 		return $wpdb->query(
507
-				'DELETE r FROM ' . $this->table() . ' r LEFT JOIN ' . EEM_Transaction::instance()->table() . ' t ON r.TXN_ID = t.TXN_ID WHERE t.TXN_ID IS NULL' );
507
+				'DELETE r FROM '.$this->table().' r LEFT JOIN '.EEM_Transaction::instance()->table().' t ON r.TXN_ID = t.TXN_ID WHERE t.TXN_ID IS NULL' );
508 508
 	}
509 509
 
510 510
 	/**
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 	 * @param boolean $checked_in whether to count registrations checked IN or OUT
515 515
 	 * @return int
516 516
 	 */
517
-	public function count_registrations_checked_into_datetime( $DTT_ID, $checked_in = true) {
517
+	public function count_registrations_checked_into_datetime($DTT_ID, $checked_in = true) {
518 518
 		return $this->count(
519 519
 			array(
520 520
 				array(
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 	 * @param boolean $checked_in whether to count registrations checked IN or OUT
533 533
 	 * @return int
534 534
 	 */
535
-	public function count_registrations_checked_into_event( $EVT_ID, $checked_in = true ) {
535
+	public function count_registrations_checked_into_event($EVT_ID, $checked_in = true) {
536 536
 		return $this->count(
537 537
 			array(
538 538
 				array(
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.