Completed
Push — master ( cde0c6...d99bf9 )
by Stephen
15:46
created
src/wp-includes/customize/class-wp-customize-filter-setting.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,5 +26,5 @@
 block discarded – undo
26 26
 	 *
27 27
 	 * @param mixed $value The value to update.
28 28
 	 */
29
-	public function update( $value ) {}
29
+	public function update($value) {}
30 30
 }
Please login to merge, or discard this patch.
src/wp-includes/customize/class-wp-customize-nav-menus-panel.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	public function render_screen_options() {
37 37
 		// Adds the screen options.
38
-		require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
39
-		add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );
38
+		require_once ABSPATH.'wp-admin/includes/nav-menu.php';
39
+		add_filter('manage_nav-menus_columns', 'wp_nav_menu_manage_columns');
40 40
 
41 41
 		// Display screen options.
42
-		$screen = WP_Screen::get( 'nav-menus.php' );
43
-		$screen->render_screen_options( array( 'wrap' => false ) );
42
+		$screen = WP_Screen::get('nav-menus.php');
43
+		$screen->render_screen_options(array('wrap' => false));
44 44
 	}
45 45
 
46 46
 	/**
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 	 * @deprecated 4.5.0 Deprecated in favor of wp_nav_menu_manage_columns().
53 53
 	 */
54 54
 	public function wp_nav_menu_manage_columns() {
55
-		_deprecated_function( __METHOD__, '4.5.0', 'wp_nav_menu_manage_columns' );
56
-		require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
55
+		_deprecated_function(__METHOD__, '4.5.0', 'wp_nav_menu_manage_columns');
56
+		require_once ABSPATH.'wp-admin/includes/nav-menu.php';
57 57
 		return wp_nav_menu_manage_columns();
58 58
 	}
59 59
 
@@ -72,20 +72,20 @@  discard block
 block discarded – undo
72 72
 		?>
73 73
 		<li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
74 74
 			<button type="button" class="customize-panel-back" tabindex="-1">
75
-				<span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
75
+				<span class="screen-reader-text"><?php _e('Back'); ?></span>
76 76
 			</button>
77 77
 			<div class="accordion-section-title">
78 78
 				<span class="preview-notice">
79 79
 					<?php
80 80
 					/* translators: %s: the site/panel title in the Customizer */
81
-					printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
81
+					printf(__('You are customizing %s'), '<strong class="panel-title">{{ data.title }}</strong>');
82 82
 					?>
83 83
 				</span>
84 84
 				<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false">
85
-					<span class="screen-reader-text"><?php _e( 'Help' ); ?></span>
85
+					<span class="screen-reader-text"><?php _e('Help'); ?></span>
86 86
 				</button>
87 87
 				<button type="button" class="customize-screen-options-toggle" aria-expanded="false">
88
-					<span class="screen-reader-text"><?php _e( 'Menu Options' ); ?></span>
88
+					<span class="screen-reader-text"><?php _e('Menu Options'); ?></span>
89 89
 				</button>
90 90
 			</div>
91 91
 			<# if ( data.description ) { #>
Please login to merge, or discard this patch.
src/wp-includes/customize/class-wp-customize-image-control.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,18 +28,18 @@  discard block
 block discarded – undo
28 28
 	 * @param string               $id      Control ID.
29 29
 	 * @param array                $args    Optional. Arguments to override class property defaults.
30 30
 	 */
31
-	public function __construct( $manager, $id, $args = array() ) {
32
-		parent::__construct( $manager, $id, $args );
31
+	public function __construct($manager, $id, $args = array()) {
32
+		parent::__construct($manager, $id, $args);
33 33
 
34
-		$this->button_labels = wp_parse_args( $this->button_labels, array(
35
-			'select'       => __( 'Select Image' ),
36
-			'change'       => __( 'Change Image' ),
37
-			'remove'       => __( 'Remove' ),
38
-			'default'      => __( 'Default' ),
39
-			'placeholder'  => __( 'No image selected' ),
40
-			'frame_title'  => __( 'Select Image' ),
41
-			'frame_button' => __( 'Choose Image' ),
42
-		) );
34
+		$this->button_labels = wp_parse_args($this->button_labels, array(
35
+			'select'       => __('Select Image'),
36
+			'change'       => __('Change Image'),
37
+			'remove'       => __('Remove'),
38
+			'default'      => __('Default'),
39
+			'placeholder'  => __('No image selected'),
40
+			'frame_title'  => __('Select Image'),
41
+			'frame_button' => __('Choose Image'),
42
+		));
43 43
 	}
44 44
 
45 45
 	/**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @param string $label
57 57
 	 * @param mixed $callback
58 58
 	 */
59
-	public function add_tab( $id, $label, $callback ) {}
59
+	public function add_tab($id, $label, $callback) {}
60 60
 
61 61
 	/**
62 62
 	 * @since 3.4.0
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @param string $id
66 66
 	 */
67
-	public function remove_tab( $id ) {}
67
+	public function remove_tab($id) {}
68 68
 
69 69
 	/**
70 70
 	 * @since 3.4.0
@@ -73,5 +73,5 @@  discard block
 block discarded – undo
73 73
 	 * @param string $url
74 74
 	 * @param string $thumbnail_url
75 75
 	 */
76
-	public function print_tab_image( $url, $thumbnail_url = null ) {}
76
+	public function print_tab_image($url, $thumbnail_url = null) {}
77 77
 }
Please login to merge, or discard this patch.
src/wp-includes/customize/class-wp-customize-cropped-image-control.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @access public
69 69
 	 */
70 70
 	public function enqueue() {
71
-		wp_enqueue_script( 'customize-views' );
71
+		wp_enqueue_script('customize-views');
72 72
 
73 73
 		parent::enqueue();
74 74
 	}
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 	public function to_json() {
85 85
 		parent::to_json();
86 86
 
87
-		$this->json['width']       = absint( $this->width );
88
-		$this->json['height']      = absint( $this->height );
89
-		$this->json['flex_width']  = absint( $this->flex_width );
90
-		$this->json['flex_height'] = absint( $this->flex_height );
87
+		$this->json['width']       = absint($this->width);
88
+		$this->json['height']      = absint($this->height);
89
+		$this->json['flex_width']  = absint($this->flex_width);
90
+		$this->json['flex_height'] = absint($this->flex_height);
91 91
 	}
92 92
 
93 93
 }
Please login to merge, or discard this patch.
src/wp-includes/customize/class-wp-widget-area-customize-control.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function to_json() {
44 44
 		parent::to_json();
45
-		$exported_properties = array( 'sidebar_id' );
46
-		foreach ( $exported_properties as $key ) {
47
-			$this->json[ $key ] = $this->$key;
45
+		$exported_properties = array('sidebar_id');
46
+		foreach ($exported_properties as $key) {
47
+			$this->json[$key] = $this->$key;
48 48
 		}
49 49
 	}
50 50
 
@@ -55,16 +55,16 @@  discard block
 block discarded – undo
55 55
 	 * @access public
56 56
 	 */
57 57
 	public function render_content() {
58
-		$id = 'reorder-widgets-desc-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );
58
+		$id = 'reorder-widgets-desc-'.str_replace(array('[', ']'), array('-', ''), $this->id);
59 59
 		?>
60 60
 		<button type="button" class="button-secondary add-new-widget" aria-expanded="false" aria-controls="available-widgets">
61
-			<?php _e( 'Add a Widget' ); ?>
61
+			<?php _e('Add a Widget'); ?>
62 62
 		</button>
63
-		<button type="button" class="button-link reorder-toggle" aria-label="<?php esc_attr_e( 'Reorder widgets' ); ?>" aria-describedby="<?php echo esc_attr( $id ); ?>">
64
-			<span class="reorder"><?php _ex( 'Reorder', 'Reorder widgets in Customizer' ); ?></span>
65
-			<span class="reorder-done"><?php _ex( 'Done', 'Cancel reordering widgets in Customizer' ); ?></span>
63
+		<button type="button" class="button-link reorder-toggle" aria-label="<?php esc_attr_e('Reorder widgets'); ?>" aria-describedby="<?php echo esc_attr($id); ?>">
64
+			<span class="reorder"><?php _ex('Reorder', 'Reorder widgets in Customizer'); ?></span>
65
+			<span class="reorder-done"><?php _ex('Done', 'Cancel reordering widgets in Customizer'); ?></span>
66 66
 		</button>
67
-		<p class="screen-reader-text" id="<?php echo esc_attr( $id ); ?>"><?php _e( 'When in reorder mode, additional controls to reorder widgets will be available in the widgets list above.' ); ?></p>
67
+		<p class="screen-reader-text" id="<?php echo esc_attr($id); ?>"><?php _e('When in reorder mode, additional controls to reorder widgets will be available in the widgets list above.'); ?></p>
68 68
 		<?php
69 69
 	}
70 70
 }
Please login to merge, or discard this patch.
src/wp-includes/customize/class-wp-customize-sidebar-section.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,6 +56,6 @@
 block discarded – undo
56 56
 	 * @return bool Whether sidebar is rendered.
57 57
 	 */
58 58
 	public function active_callback() {
59
-		return $this->manager->widgets->is_sidebar_rendered( $this->sidebar_id );
59
+		return $this->manager->widgets->is_sidebar_rendered($this->sidebar_id);
60 60
 	}
61 61
 }
Please login to merge, or discard this patch.
src/wp-includes/customize/class-wp-customize-media-control.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -52,19 +52,19 @@  discard block
 block discarded – undo
52 52
 	 * @param string               $id      Control ID.
53 53
 	 * @param array                $args    Optional. Arguments to override class property defaults.
54 54
 	 */
55
-	public function __construct( $manager, $id, $args = array() ) {
56
-		parent::__construct( $manager, $id, $args );
55
+	public function __construct($manager, $id, $args = array()) {
56
+		parent::__construct($manager, $id, $args);
57 57
 
58
-		if ( ! ( $this instanceof WP_Customize_Image_Control ) ) {
59
-			$this->button_labels = wp_parse_args( $this->button_labels, array(
60
-				'select'       => __( 'Select File' ),
61
-				'change'       => __( 'Change File' ),
62
-				'default'      => __( 'Default' ),
63
-				'remove'       => __( 'Remove' ),
64
-				'placeholder'  => __( 'No file selected' ),
65
-				'frame_title'  => __( 'Select File' ),
66
-				'frame_button' => __( 'Choose File' ),
67
-			) );
58
+		if ( ! ($this instanceof WP_Customize_Image_Control)) {
59
+			$this->button_labels = wp_parse_args($this->button_labels, array(
60
+				'select'       => __('Select File'),
61
+				'change'       => __('Change File'),
62
+				'default'      => __('Default'),
63
+				'remove'       => __('Remove'),
64
+				'placeholder'  => __('No file selected'),
65
+				'frame_title'  => __('Select File'),
66
+				'frame_button' => __('Choose File'),
67
+			));
68 68
 		}
69 69
 	}
70 70
 
@@ -88,40 +88,40 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function to_json() {
90 90
 		parent::to_json();
91
-		$this->json['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) );
91
+		$this->json['label'] = html_entity_decode($this->label, ENT_QUOTES, get_bloginfo('charset'));
92 92
 		$this->json['mime_type'] = $this->mime_type;
93 93
 		$this->json['button_labels'] = $this->button_labels;
94
-		$this->json['canUpload'] = current_user_can( 'upload_files' );
94
+		$this->json['canUpload'] = current_user_can('upload_files');
95 95
 
96 96
 		$value = $this->value();
97 97
 
98
-		if ( is_object( $this->setting ) ) {
99
-			if ( $this->setting->default ) {
98
+		if (is_object($this->setting)) {
99
+			if ($this->setting->default) {
100 100
 				// Fake an attachment model - needs all fields used by template.
101 101
 				// Note that the default value must be a URL, NOT an attachment ID.
102
-				$type = in_array( substr( $this->setting->default, -3 ), array( 'jpg', 'png', 'gif', 'bmp' ) ) ? 'image' : 'document';
102
+				$type = in_array(substr($this->setting->default, -3), array('jpg', 'png', 'gif', 'bmp')) ? 'image' : 'document';
103 103
 				$default_attachment = array(
104 104
 					'id' => 1,
105 105
 					'url' => $this->setting->default,
106 106
 					'type' => $type,
107
-					'icon' => wp_mime_type_icon( $type ),
108
-					'title' => basename( $this->setting->default ),
107
+					'icon' => wp_mime_type_icon($type),
108
+					'title' => basename($this->setting->default),
109 109
 				);
110 110
 
111
-				if ( 'image' === $type ) {
111
+				if ('image' === $type) {
112 112
 					$default_attachment['sizes'] = array(
113
-						'full' => array( 'url' => $this->setting->default ),
113
+						'full' => array('url' => $this->setting->default),
114 114
 					);
115 115
 				}
116 116
 
117 117
 				$this->json['defaultAttachment'] = $default_attachment;
118 118
 			}
119 119
 
120
-			if ( $value && $this->setting->default && $value === $this->setting->default ) {
120
+			if ($value && $this->setting->default && $value === $this->setting->default) {
121 121
 				// Set the default as the attachment.
122 122
 				$this->json['attachment'] = $this->json['defaultAttachment'];
123
-			} elseif ( $value ) {
124
-				$this->json['attachment'] = wp_prepare_attachment_for_js( $value );
123
+			} elseif ($value) {
124
+				$this->json['attachment'] = wp_prepare_attachment_for_js($value);
125 125
 			}
126 126
 		}
127 127
 	}
Please login to merge, or discard this patch.
src/wp-includes/class-wp-meta-query.php 2 patches
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -136,8 +136,9 @@  discard block
 block discarded – undo
136 136
 	 * }
137 137
 	 */
138 138
 	public function __construct( $meta_query = false ) {
139
-		if ( !$meta_query )
140
-			return;
139
+		if ( !$meta_query ) {
140
+					return;
141
+		}
141 142
 
142 143
 		if ( isset( $meta_query['relation'] ) && strtoupper( $meta_query['relation'] ) == 'OR' ) {
143 144
 			$this->relation = 'OR';
@@ -290,16 +291,19 @@  discard block
 block discarded – undo
290 291
 	 * @return string MySQL type.
291 292
 	 */
292 293
 	public function get_cast_for_type( $type = '' ) {
293
-		if ( empty( $type ) )
294
-			return 'CHAR';
294
+		if ( empty( $type ) ) {
295
+					return 'CHAR';
296
+		}
295 297
 
296 298
 		$meta_type = strtoupper( $type );
297 299
 
298
-		if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) )
299
-			return 'CHAR';
300
+		if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) ) {
301
+					return 'CHAR';
302
+		}
300 303
 
301
-		if ( 'NUMERIC' == $meta_type )
302
-			$meta_type = 'SIGNED';
304
+		if ( 'NUMERIC' == $meta_type ) {
305
+					$meta_type = 'SIGNED';
306
+		}
303 307
 
304 308
 		return $meta_type;
305 309
 	}
Please login to merge, or discard this patch.
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -136,17 +136,17 @@  discard block
 block discarded – undo
136 136
 	 *     }
137 137
 	 * }
138 138
 	 */
139
-	public function __construct( $meta_query = false ) {
140
-		if ( !$meta_query )
139
+	public function __construct($meta_query = false) {
140
+		if ( ! $meta_query)
141 141
 			return;
142 142
 
143
-		if ( isset( $meta_query['relation'] ) && strtoupper( $meta_query['relation'] ) == 'OR' ) {
143
+		if (isset($meta_query['relation']) && strtoupper($meta_query['relation']) == 'OR') {
144 144
 			$this->relation = 'OR';
145 145
 		} else {
146 146
 			$this->relation = 'AND';
147 147
 		}
148 148
 
149
-		$this->queries = $this->sanitize_query( $meta_query );
149
+		$this->queries = $this->sanitize_query($meta_query);
150 150
 	}
151 151
 
152 152
 	/**
@@ -160,44 +160,44 @@  discard block
 block discarded – undo
160 160
 	 * @param array $queries Array of query clauses.
161 161
 	 * @return array Sanitized array of query clauses.
162 162
 	 */
163
-	public function sanitize_query( $queries ) {
163
+	public function sanitize_query($queries) {
164 164
 		$clean_queries = array();
165 165
 
166
-		if ( ! is_array( $queries ) ) {
166
+		if ( ! is_array($queries)) {
167 167
 			return $clean_queries;
168 168
 		}
169 169
 
170
-		foreach ( $queries as $key => $query ) {
171
-			if ( 'relation' === $key ) {
170
+		foreach ($queries as $key => $query) {
171
+			if ('relation' === $key) {
172 172
 				$relation = $query;
173 173
 
174
-			} elseif ( ! is_array( $query ) ) {
174
+			} elseif ( ! is_array($query)) {
175 175
 				continue;
176 176
 
177 177
 			// First-order clause.
178
-			} elseif ( $this->is_first_order_clause( $query ) ) {
179
-				if ( isset( $query['value'] ) && array() === $query['value'] ) {
180
-					unset( $query['value'] );
178
+			} elseif ($this->is_first_order_clause($query)) {
179
+				if (isset($query['value']) && array() === $query['value']) {
180
+					unset($query['value']);
181 181
 				}
182 182
 
183
-				$clean_queries[ $key ] = $query;
183
+				$clean_queries[$key] = $query;
184 184
 
185 185
 			// Otherwise, it's a nested query, so we recurse.
186 186
 			} else {
187
-				$cleaned_query = $this->sanitize_query( $query );
187
+				$cleaned_query = $this->sanitize_query($query);
188 188
 
189
-				if ( ! empty( $cleaned_query ) ) {
190
-					$clean_queries[ $key ] = $cleaned_query;
189
+				if ( ! empty($cleaned_query)) {
190
+					$clean_queries[$key] = $cleaned_query;
191 191
 				}
192 192
 			}
193 193
 		}
194 194
 
195
-		if ( empty( $clean_queries ) ) {
195
+		if (empty($clean_queries)) {
196 196
 			return $clean_queries;
197 197
 		}
198 198
 
199 199
 		// Sanitize the 'relation' key provided in the query.
200
-		if ( isset( $relation ) && 'OR' === strtoupper( $relation ) ) {
200
+		if (isset($relation) && 'OR' === strtoupper($relation)) {
201 201
 			$clean_queries['relation'] = 'OR';
202 202
 			$this->has_or_relation = true;
203 203
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 		 * This value will not actually be used to join clauses, but it
207 207
 		 * simplifies the logic around combining key-only queries.
208 208
 		 */
209
-		} elseif ( 1 === count( $clean_queries ) ) {
209
+		} elseif (1 === count($clean_queries)) {
210 210
 			$clean_queries['relation'] = 'OR';
211 211
 
212 212
 		// Default to AND.
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
 	 * @param array $query Meta query arguments.
230 230
 	 * @return bool Whether the query clause is a first-order clause.
231 231
 	 */
232
-	protected function is_first_order_clause( $query ) {
233
-		return isset( $query['key'] ) || isset( $query['value'] );
232
+	protected function is_first_order_clause($query) {
233
+		return isset($query['key']) || isset($query['value']);
234 234
 	}
235 235
 
236 236
 	/**
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 *
242 242
 	 * @param array $qv The query variables
243 243
 	 */
244
-	public function parse_query_vars( $qv ) {
244
+	public function parse_query_vars($qv) {
245 245
 		$meta_query = array();
246 246
 
247 247
 		/*
@@ -251,34 +251,34 @@  discard block
 block discarded – undo
251 251
 		 * the rest of the meta_query).
252 252
 		 */
253 253
 		$primary_meta_query = array();
254
-		foreach ( array( 'key', 'compare', 'type' ) as $key ) {
255
-			if ( ! empty( $qv[ "meta_$key" ] ) ) {
256
-				$primary_meta_query[ $key ] = $qv[ "meta_$key" ];
254
+		foreach (array('key', 'compare', 'type') as $key) {
255
+			if ( ! empty($qv["meta_$key"])) {
256
+				$primary_meta_query[$key] = $qv["meta_$key"];
257 257
 			}
258 258
 		}
259 259
 
260 260
 		// WP_Query sets 'meta_value' = '' by default.
261
-		if ( isset( $qv['meta_value'] ) && '' !== $qv['meta_value'] && ( ! is_array( $qv['meta_value'] ) || $qv['meta_value'] ) ) {
261
+		if (isset($qv['meta_value']) && '' !== $qv['meta_value'] && ( ! is_array($qv['meta_value']) || $qv['meta_value'])) {
262 262
 			$primary_meta_query['value'] = $qv['meta_value'];
263 263
 		}
264 264
 
265
-		$existing_meta_query = isset( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ? $qv['meta_query'] : array();
265
+		$existing_meta_query = isset($qv['meta_query']) && is_array($qv['meta_query']) ? $qv['meta_query'] : array();
266 266
 
267
-		if ( ! empty( $primary_meta_query ) && ! empty( $existing_meta_query ) ) {
267
+		if ( ! empty($primary_meta_query) && ! empty($existing_meta_query)) {
268 268
 			$meta_query = array(
269 269
 				'relation' => 'AND',
270 270
 				$primary_meta_query,
271 271
 				$existing_meta_query,
272 272
 			);
273
-		} elseif ( ! empty( $primary_meta_query ) ) {
273
+		} elseif ( ! empty($primary_meta_query)) {
274 274
 			$meta_query = array(
275 275
 				$primary_meta_query,
276 276
 			);
277
-		} elseif ( ! empty( $existing_meta_query ) ) {
277
+		} elseif ( ! empty($existing_meta_query)) {
278 278
 			$meta_query = $existing_meta_query;
279 279
 		}
280 280
 
281
-		$this->__construct( $meta_query );
281
+		$this->__construct($meta_query);
282 282
 	}
283 283
 
284 284
 	/**
@@ -290,16 +290,16 @@  discard block
 block discarded – undo
290 290
 	 * @param string $type MySQL type to cast meta_value.
291 291
 	 * @return string MySQL type.
292 292
 	 */
293
-	public function get_cast_for_type( $type = '' ) {
294
-		if ( empty( $type ) )
293
+	public function get_cast_for_type($type = '') {
294
+		if (empty($type))
295 295
 			return 'CHAR';
296 296
 
297
-		$meta_type = strtoupper( $type );
297
+		$meta_type = strtoupper($type);
298 298
 
299
-		if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) )
299
+		if ( ! preg_match('/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type))
300 300
 			return 'CHAR';
301 301
 
302
-		if ( 'NUMERIC' == $meta_type )
302
+		if ('NUMERIC' == $meta_type)
303 303
 			$meta_type = 'SIGNED';
304 304
 
305 305
 		return $meta_type;
@@ -322,15 +322,15 @@  discard block
 block discarded – undo
322 322
 	 *     @type string $where SQL fragment to append to the main WHERE clause.
323 323
 	 * }
324 324
 	 */
325
-	public function get_sql( $type, $primary_table, $primary_id_column, $context = null ) {
326
-		if ( ! $meta_table = _get_meta_table( $type ) ) {
325
+	public function get_sql($type, $primary_table, $primary_id_column, $context = null) {
326
+		if ( ! $meta_table = _get_meta_table($type)) {
327 327
 			return false;
328 328
 		}
329 329
 
330 330
 		$this->table_aliases = array();
331 331
 
332 332
 		$this->meta_table     = $meta_table;
333
-		$this->meta_id_column = sanitize_key( $type . '_id' );
333
+		$this->meta_id_column = sanitize_key($type.'_id');
334 334
 
335 335
 		$this->primary_table     = $primary_table;
336 336
 		$this->primary_id_column = $primary_id_column;
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 		 * If any JOINs are LEFT JOINs (as in the case of NOT EXISTS), then all JOINs should
342 342
 		 * be LEFT. Otherwise posts with no metadata will be excluded from results.
343 343
 		 */
344
-		if ( false !== strpos( $sql['join'], 'LEFT JOIN' ) ) {
345
-			$sql['join'] = str_replace( 'INNER JOIN', 'LEFT JOIN', $sql['join'] );
344
+		if (false !== strpos($sql['join'], 'LEFT JOIN')) {
345
+			$sql['join'] = str_replace('INNER JOIN', 'LEFT JOIN', $sql['join']);
346 346
 		}
347 347
 
348 348
 		/**
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 		 * @param string $primary_id_column Primary column ID.
358 358
 		 * @param object $context           The main query object.
359 359
 		 */
360
-		return apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) );
360
+		return apply_filters_ref_array('get_meta_sql', array($sql, $this->queries, $type, $primary_table, $primary_id_column, $context));
361 361
 	}
362 362
 
363 363
 	/**
@@ -382,10 +382,10 @@  discard block
 block discarded – undo
382 382
 		 * To keep $this->queries unaltered, pass a copy.
383 383
 		 */
384 384
 		$queries = $this->queries;
385
-		$sql = $this->get_sql_for_query( $queries );
385
+		$sql = $this->get_sql_for_query($queries);
386 386
 
387
-		if ( ! empty( $sql['where'] ) ) {
388
-			$sql['where'] = ' AND ' . $sql['where'];
387
+		if ( ! empty($sql['where'])) {
388
+			$sql['where'] = ' AND '.$sql['where'];
389 389
 		}
390 390
 
391 391
 		return $sql;
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 *     @type string $where SQL fragment to append to the main WHERE clause.
411 411
 	 * }
412 412
 	 */
413
-	protected function get_sql_for_query( &$query, $depth = 0 ) {
413
+	protected function get_sql_for_query(&$query, $depth = 0) {
414 414
 		$sql_chunks = array(
415 415
 			'join'  => array(),
416 416
 			'where' => array(),
@@ -422,32 +422,32 @@  discard block
 block discarded – undo
422 422
 		);
423 423
 
424 424
 		$indent = '';
425
-		for ( $i = 0; $i < $depth; $i++ ) {
425
+		for ($i = 0; $i < $depth; $i++) {
426 426
 			$indent .= "  ";
427 427
 		}
428 428
 
429
-		foreach ( $query as $key => &$clause ) {
430
-			if ( 'relation' === $key ) {
429
+		foreach ($query as $key => &$clause) {
430
+			if ('relation' === $key) {
431 431
 				$relation = $query['relation'];
432
-			} elseif ( is_array( $clause ) ) {
432
+			} elseif (is_array($clause)) {
433 433
 
434 434
 				// This is a first-order clause.
435
-				if ( $this->is_first_order_clause( $clause ) ) {
436
-					$clause_sql = $this->get_sql_for_clause( $clause, $query, $key );
435
+				if ($this->is_first_order_clause($clause)) {
436
+					$clause_sql = $this->get_sql_for_clause($clause, $query, $key);
437 437
 
438
-					$where_count = count( $clause_sql['where'] );
439
-					if ( ! $where_count ) {
438
+					$where_count = count($clause_sql['where']);
439
+					if ( ! $where_count) {
440 440
 						$sql_chunks['where'][] = '';
441
-					} elseif ( 1 === $where_count ) {
441
+					} elseif (1 === $where_count) {
442 442
 						$sql_chunks['where'][] = $clause_sql['where'][0];
443 443
 					} else {
444
-						$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';
444
+						$sql_chunks['where'][] = '( '.implode(' AND ', $clause_sql['where']).' )';
445 445
 					}
446 446
 
447
-					$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );
447
+					$sql_chunks['join'] = array_merge($sql_chunks['join'], $clause_sql['join']);
448 448
 				// This is a subquery, so we recurse.
449 449
 				} else {
450
-					$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );
450
+					$clause_sql = $this->get_sql_for_query($clause, $depth + 1);
451 451
 
452 452
 					$sql_chunks['where'][] = $clause_sql['where'];
453 453
 					$sql_chunks['join'][]  = $clause_sql['join'];
@@ -456,21 +456,21 @@  discard block
 block discarded – undo
456 456
 		}
457 457
 
458 458
 		// Filter to remove empties.
459
-		$sql_chunks['join']  = array_filter( $sql_chunks['join'] );
460
-		$sql_chunks['where'] = array_filter( $sql_chunks['where'] );
459
+		$sql_chunks['join']  = array_filter($sql_chunks['join']);
460
+		$sql_chunks['where'] = array_filter($sql_chunks['where']);
461 461
 
462
-		if ( empty( $relation ) ) {
462
+		if (empty($relation)) {
463 463
 			$relation = 'AND';
464 464
 		}
465 465
 
466 466
 		// Filter duplicate JOIN clauses and combine into a single string.
467
-		if ( ! empty( $sql_chunks['join'] ) ) {
468
-			$sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) );
467
+		if ( ! empty($sql_chunks['join'])) {
468
+			$sql['join'] = implode(' ', array_unique($sql_chunks['join']));
469 469
 		}
470 470
 
471 471
 		// Generate a single WHERE clause with proper brackets and indentation.
472
-		if ( ! empty( $sql_chunks['where'] ) ) {
473
-			$sql['where'] = '( ' . "\n  " . $indent . implode( ' ' . "\n  " . $indent . $relation . ' ' . "\n  " . $indent, $sql_chunks['where'] ) . "\n" . $indent . ')';
472
+		if ( ! empty($sql_chunks['where'])) {
473
+			$sql['where'] = '( '."\n  ".$indent.implode(' '."\n  ".$indent.$relation.' '."\n  ".$indent, $sql_chunks['where'])."\n".$indent.')';
474 474
 		}
475 475
 
476 476
 		return $sql;
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 	 *     @type string $where SQL fragment to append to the main WHERE clause.
498 498
 	 * }
499 499
 	 */
500
-	public function get_sql_for_clause( &$clause, $parent_query, $clause_key = '' ) {
500
+	public function get_sql_for_clause(&$clause, $parent_query, $clause_key = '') {
501 501
 		global $wpdb;
502 502
 
503 503
 		$sql_chunks = array(
@@ -505,20 +505,20 @@  discard block
 block discarded – undo
505 505
 			'join' => array(),
506 506
 		);
507 507
 
508
-		if ( isset( $clause['compare'] ) ) {
509
-			$clause['compare'] = strtoupper( $clause['compare'] );
508
+		if (isset($clause['compare'])) {
509
+			$clause['compare'] = strtoupper($clause['compare']);
510 510
 		} else {
511
-			$clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '=';
511
+			$clause['compare'] = isset($clause['value']) && is_array($clause['value']) ? 'IN' : '=';
512 512
 		}
513 513
 
514
-		if ( ! in_array( $clause['compare'], array(
514
+		if ( ! in_array($clause['compare'], array(
515 515
 			'=', '!=', '>', '>=', '<', '<=',
516 516
 			'LIKE', 'NOT LIKE',
517 517
 			'IN', 'NOT IN',
518 518
 			'BETWEEN', 'NOT BETWEEN',
519 519
 			'EXISTS', 'NOT EXISTS',
520 520
 			'REGEXP', 'NOT REGEXP', 'RLIKE'
521
-		) ) ) {
521
+		))) {
522 522
 			$clause['compare'] = '=';
523 523
 		}
524 524
 
@@ -528,16 +528,16 @@  discard block
 block discarded – undo
528 528
 		$join = '';
529 529
 
530 530
 		// We prefer to avoid joins if possible. Look for an existing join compatible with this clause.
531
-		$alias = $this->find_compatible_table_alias( $clause, $parent_query );
532
-		if ( false === $alias ) {
533
-			$i = count( $this->table_aliases );
534
-			$alias = $i ? 'mt' . $i : $this->meta_table;
531
+		$alias = $this->find_compatible_table_alias($clause, $parent_query);
532
+		if (false === $alias) {
533
+			$i = count($this->table_aliases);
534
+			$alias = $i ? 'mt'.$i : $this->meta_table;
535 535
 
536 536
 			// JOIN clauses for NOT EXISTS have their own syntax.
537
-			if ( 'NOT EXISTS' === $meta_compare ) {
537
+			if ('NOT EXISTS' === $meta_compare) {
538 538
 				$join .= " LEFT JOIN $this->meta_table";
539 539
 				$join .= $i ? " AS $alias" : '';
540
-				$join .= $wpdb->prepare( " ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key'] );
540
+				$join .= $wpdb->prepare(" ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key']);
541 541
 
542 542
 			// All other JOIN clauses.
543 543
 			} else {
@@ -554,72 +554,72 @@  discard block
 block discarded – undo
554 554
 		$clause['alias'] = $alias;
555 555
 
556 556
 		// Determine the data type.
557
-		$_meta_type = isset( $clause['type'] ) ? $clause['type'] : '';
558
-		$meta_type  = $this->get_cast_for_type( $_meta_type );
557
+		$_meta_type = isset($clause['type']) ? $clause['type'] : '';
558
+		$meta_type  = $this->get_cast_for_type($_meta_type);
559 559
 		$clause['cast'] = $meta_type;
560 560
 
561 561
 		// Fallback for clause keys is the table alias. Key must be a string.
562
-		if ( is_int( $clause_key ) || ! $clause_key ) {
562
+		if (is_int($clause_key) || ! $clause_key) {
563 563
 			$clause_key = $clause['alias'];
564 564
 		}
565 565
 
566 566
 		// Ensure unique clause keys, so none are overwritten.
567 567
 		$iterator = 1;
568 568
 		$clause_key_base = $clause_key;
569
-		while ( isset( $this->clauses[ $clause_key ] ) ) {
570
-			$clause_key = $clause_key_base . '-' . $iterator;
569
+		while (isset($this->clauses[$clause_key])) {
570
+			$clause_key = $clause_key_base.'-'.$iterator;
571 571
 			$iterator++;
572 572
 		}
573 573
 
574 574
 		// Store the clause in our flat array.
575
-		$this->clauses[ $clause_key ] =& $clause;
575
+		$this->clauses[$clause_key] = & $clause;
576 576
 
577 577
 		// Next, build the WHERE clause.
578 578
 
579 579
 		// meta_key.
580
-		if ( array_key_exists( 'key', $clause ) ) {
581
-			if ( 'NOT EXISTS' === $meta_compare ) {
582
-				$sql_chunks['where'][] = $alias . '.' . $this->meta_id_column . ' IS NULL';
580
+		if (array_key_exists('key', $clause)) {
581
+			if ('NOT EXISTS' === $meta_compare) {
582
+				$sql_chunks['where'][] = $alias.'.'.$this->meta_id_column.' IS NULL';
583 583
 			} else {
584
-				$sql_chunks['where'][] = $wpdb->prepare( "$alias.meta_key = %s", trim( $clause['key'] ) );
584
+				$sql_chunks['where'][] = $wpdb->prepare("$alias.meta_key = %s", trim($clause['key']));
585 585
 			}
586 586
 		}
587 587
 
588 588
 		// meta_value.
589
-		if ( array_key_exists( 'value', $clause ) ) {
589
+		if (array_key_exists('value', $clause)) {
590 590
 			$meta_value = $clause['value'];
591 591
 
592
-			if ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
593
-				if ( ! is_array( $meta_value ) ) {
594
-					$meta_value = preg_split( '/[,\s]+/', $meta_value );
592
+			if (in_array($meta_compare, array('IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'))) {
593
+				if ( ! is_array($meta_value)) {
594
+					$meta_value = preg_split('/[,\s]+/', $meta_value);
595 595
 				}
596 596
 			} else {
597
-				$meta_value = trim( $meta_value );
597
+				$meta_value = trim($meta_value);
598 598
 			}
599 599
 
600
-			switch ( $meta_compare ) {
600
+			switch ($meta_compare) {
601 601
 				case 'IN' :
602 602
 				case 'NOT IN' :
603
-					$meta_compare_string = '(' . substr( str_repeat( ',%s', count( $meta_value ) ), 1 ) . ')';
604
-					$where = $wpdb->prepare( $meta_compare_string, $meta_value );
603
+					$meta_compare_string = '('.substr(str_repeat(',%s', count($meta_value)), 1).')';
604
+					$where = $wpdb->prepare($meta_compare_string, $meta_value);
605 605
 					break;
606 606
 
607 607
 				case 'BETWEEN' :
608 608
 				case 'NOT BETWEEN' :
609
-					$meta_value = array_slice( $meta_value, 0, 2 );
610
-					$where = $wpdb->prepare( '%s AND %s', $meta_value );
609
+					$meta_value = array_slice($meta_value, 0, 2);
610
+					$where = $wpdb->prepare('%s AND %s', $meta_value);
611 611
 					break;
612 612
 
613 613
 				case 'LIKE' :
614 614
 				case 'NOT LIKE' :
615
-					$meta_value = '%' . $wpdb->esc_like( $meta_value ) . '%';
616
-					$where = $wpdb->prepare( '%s', $meta_value );
615
+					$meta_value = '%'.$wpdb->esc_like($meta_value).'%';
616
+					$where = $wpdb->prepare('%s', $meta_value);
617 617
 					break;
618 618
 
619 619
 				// EXISTS with a value is interpreted as '='.
620 620
 				case 'EXISTS' :
621 621
 					$meta_compare = '=';
622
-					$where = $wpdb->prepare( '%s', $meta_value );
622
+					$where = $wpdb->prepare('%s', $meta_value);
623 623
 					break;
624 624
 
625 625
 				// 'value' is ignored for NOT EXISTS.
@@ -628,13 +628,13 @@  discard block
 block discarded – undo
628 628
 					break;
629 629
 
630 630
 				default :
631
-					$where = $wpdb->prepare( '%s', $meta_value );
631
+					$where = $wpdb->prepare('%s', $meta_value);
632 632
 					break;
633 633
 
634 634
 			}
635 635
 
636
-			if ( $where ) {
637
-				if ( 'CHAR' === $meta_type ) {
636
+			if ($where) {
637
+				if ('CHAR' === $meta_type) {
638 638
 					$sql_chunks['where'][] = "$alias.meta_value {$meta_compare} {$where}";
639 639
 				} else {
640 640
 					$sql_chunks['where'][] = "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$where}";
@@ -646,8 +646,8 @@  discard block
 block discarded – undo
646 646
 		 * Multiple WHERE clauses (for meta_key and meta_value) should
647 647
 		 * be joined in parentheses.
648 648
 		 */
649
-		if ( 1 < count( $sql_chunks['where'] ) ) {
650
-			$sql_chunks['where'] = array( '( ' . implode( ' AND ', $sql_chunks['where'] ) . ' )' );
649
+		if (1 < count($sql_chunks['where'])) {
650
+			$sql_chunks['where'] = array('( '.implode(' AND ', $sql_chunks['where']).' )');
651 651
 		}
652 652
 
653 653
 		return $sql_chunks;
@@ -689,34 +689,34 @@  discard block
 block discarded – undo
689 689
 	 * @param  array       $parent_query Parent query of $clause.
690 690
 	 * @return string|bool Table alias if found, otherwise false.
691 691
 	 */
692
-	protected function find_compatible_table_alias( $clause, $parent_query ) {
692
+	protected function find_compatible_table_alias($clause, $parent_query) {
693 693
 		$alias = false;
694 694
 
695
-		foreach ( $parent_query as $sibling ) {
695
+		foreach ($parent_query as $sibling) {
696 696
 			// If the sibling has no alias yet, there's nothing to check.
697
-			if ( empty( $sibling['alias'] ) ) {
697
+			if (empty($sibling['alias'])) {
698 698
 				continue;
699 699
 			}
700 700
 
701 701
 			// We're only interested in siblings that are first-order clauses.
702
-			if ( ! is_array( $sibling ) || ! $this->is_first_order_clause( $sibling ) ) {
702
+			if ( ! is_array($sibling) || ! $this->is_first_order_clause($sibling)) {
703 703
 				continue;
704 704
 			}
705 705
 
706 706
 			$compatible_compares = array();
707 707
 
708 708
 			// Clauses connected by OR can share joins as long as they have "positive" operators.
709
-			if ( 'OR' === $parent_query['relation'] ) {
710
-				$compatible_compares = array( '=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=' );
709
+			if ('OR' === $parent_query['relation']) {
710
+				$compatible_compares = array('=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=');
711 711
 
712 712
 			// Clauses joined by AND with "negative" operators share a join only if they also share a key.
713
-			} elseif ( isset( $sibling['key'] ) && isset( $clause['key'] ) && $sibling['key'] === $clause['key'] ) {
714
-				$compatible_compares = array( '!=', 'NOT IN', 'NOT LIKE' );
713
+			} elseif (isset($sibling['key']) && isset($clause['key']) && $sibling['key'] === $clause['key']) {
714
+				$compatible_compares = array('!=', 'NOT IN', 'NOT LIKE');
715 715
 			}
716 716
 
717
-			$clause_compare  = strtoupper( $clause['compare'] );
718
-			$sibling_compare = strtoupper( $sibling['compare'] );
719
-			if ( in_array( $clause_compare, $compatible_compares ) && in_array( $sibling_compare, $compatible_compares ) ) {
717
+			$clause_compare  = strtoupper($clause['compare']);
718
+			$sibling_compare = strtoupper($sibling['compare']);
719
+			if (in_array($clause_compare, $compatible_compares) && in_array($sibling_compare, $compatible_compares)) {
720 720
 				$alias = $sibling['alias'];
721 721
 				break;
722 722
 			}
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 		 * @param array       $parent_query Parent of $clause.
733 733
 		 * @param object      $this         WP_Meta_Query object.
734 734
 		 */
735
-		return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this ) ;
735
+		return apply_filters('meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this);
736 736
 	}
737 737
 
738 738
 	/**
Please login to merge, or discard this patch.
src/wp-includes/theme-compat/footer-embed.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
  *
17 17
  * @since 4.4.0
18 18
  */
19
-do_action( 'embed_footer' );
19
+do_action('embed_footer');
20 20
 ?>
21 21
 </body>
22 22
 </html>
Please login to merge, or discard this patch.