Completed
Push — master ( a7cd2a...eabd6c )
by Stephen
38:42
created
src/wp-includes/pluggable.php 4 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * These functions can be replaced via plugins. If plugins do not redefine these
4
- * functions, then these will be used instead.
5
- *
6
- * @package WordPress
7
- */
3
+	 * These functions can be replaced via plugins. If plugins do not redefine these
4
+	 * functions, then these will be used instead.
5
+	 *
6
+	 * @package WordPress
7
+	 */
8 8
 
9 9
 if ( !function_exists('wp_set_current_user') ) :
10 10
 /**
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 					$cookie_name = AUTH_COOKIE;
802 802
 					$scheme = 'auth';
803 803
 				}
804
-	    }
804
+		}
805 805
 
806 806
 		if ( empty($_COOKIE[$cookie_name]) )
807 807
 			return false;
Please login to merge, or discard this patch.
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
  *
743 743
  * @param string $cookie
744 744
  * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
745
- * @return array|false Authentication cookie components
745
+ * @return string Authentication cookie components
746 746
  */
747 747
 function wp_parse_auth_cookie($cookie = '', $scheme = '') {
748 748
 	if ( empty($cookie) ) {
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
  *
1042 1042
  * @since 1.2.0
1043 1043
  *
1044
- * @param int|string $action    Action nonce.
1044
+ * @param integer $action    Action nonce.
1045 1045
  * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
1046 1046
  *                              Default '_wpnonce'.
1047 1047
  * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
  *
1082 1082
  * @since 2.0.3
1083 1083
  *
1084
- * @param int|string   $action    Action nonce.
1084
+ * @param integer   $action    Action nonce.
1085 1085
  * @param false|string $query_arg Optional. Key to check for the nonce in `$_REQUEST` (since 2.5). If false,
1086 1086
  *                                `$_REQUEST` values will be evaluated for '_ajax_nonce', and '_wpnonce'
1087 1087
  *                                (in that order). Default false.
@@ -1531,7 +1531,7 @@  discard block
 block discarded – undo
1531 1531
  * should be notified, overriding the site setting.
1532 1532
  *
1533 1533
  * @param int $comment_id Comment ID.
1534
- * @return true Always returns true.
1534
+ * @return boolean Always returns true.
1535 1535
  */
1536 1536
 function wp_notify_moderator($comment_id) {
1537 1537
 	global $wpdb;
@@ -1782,8 +1782,8 @@  discard block
 block discarded – undo
1782 1782
  * @since 2.0.3
1783 1783
  *
1784 1784
  * @param string     $nonce  Nonce that was used in the form to verify
1785
- * @param string|int $action Should give context to what is taking place and be the same when nonce was created.
1786
- * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
1785
+ * @param integer $action Should give context to what is taking place and be the same when nonce was created.
1786
+ * @return string False if the nonce is invalid, 1 if the nonce is valid and generated between
1787 1787
  *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
1788 1788
  */
1789 1789
 function wp_verify_nonce( $nonce, $action = -1 ) {
@@ -1846,7 +1846,7 @@  discard block
 block discarded – undo
1846 1846
  * @since 2.0.3
1847 1847
  * @since 4.0.0 Session tokens were integrated with nonce creation
1848 1848
  *
1849
- * @param string|int $action Scalar value to add context to the nonce.
1849
+ * @param integer $action Scalar value to add context to the nonce.
1850 1850
  * @return string The token.
1851 1851
  */
1852 1852
 function wp_create_nonce($action = -1) {
Please login to merge, or discard this patch.
Spacing   +520 added lines, -520 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package WordPress
7 7
  */
8 8
 
9
-if ( !function_exists('wp_set_current_user') ) :
9
+if ( ! function_exists('wp_set_current_user')) :
10 10
 /**
11 11
  * Changes the current user by ID or name.
12 12
  *
@@ -27,30 +27,30 @@  discard block
 block discarded – undo
27 27
 	global $current_user;
28 28
 
29 29
 	// If `$id` matches the user who's already current, there's nothing to do.
30
-	if ( isset( $current_user )
31
-		&& ( $current_user instanceof WP_User )
32
-		&& ( $id == $current_user->ID )
33
-		&& ( null !== $id )
30
+	if (isset($current_user)
31
+		&& ($current_user instanceof WP_User)
32
+		&& ($id == $current_user->ID)
33
+		&& (null !== $id)
34 34
 	) {
35 35
 		return $current_user;
36 36
 	}
37 37
 
38
-	$current_user = new WP_User( $id, $name );
38
+	$current_user = new WP_User($id, $name);
39 39
 
40
-	setup_userdata( $current_user->ID );
40
+	setup_userdata($current_user->ID);
41 41
 
42 42
 	/**
43 43
 	 * Fires after the current user is set.
44 44
 	 *
45 45
 	 * @since 2.0.1
46 46
 	 */
47
-	do_action( 'set_current_user' );
47
+	do_action('set_current_user');
48 48
 
49 49
 	return $current_user;
50 50
 }
51 51
 endif;
52 52
 
53
-if ( !function_exists('wp_get_current_user') ) :
53
+if ( ! function_exists('wp_get_current_user')) :
54 54
 /**
55 55
  * Retrieve the current user object.
56 56
  *
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 }
71 71
 endif;
72 72
 
73
-if ( !function_exists('get_userdata') ) :
73
+if ( ! function_exists('get_userdata')) :
74 74
 /**
75 75
  * Retrieve user info by user ID.
76 76
  *
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
  * @param int $user_id User ID
80 80
  * @return WP_User|false WP_User object on success, false on failure.
81 81
  */
82
-function get_userdata( $user_id ) {
83
-	return get_user_by( 'id', $user_id );
82
+function get_userdata($user_id) {
83
+	return get_user_by('id', $user_id);
84 84
 }
85 85
 endif;
86 86
 
87
-if ( !function_exists('get_user_by') ) :
87
+if ( ! function_exists('get_user_by')) :
88 88
 /**
89 89
  * Retrieve user info by a given field
90 90
  *
@@ -95,20 +95,20 @@  discard block
 block discarded – undo
95 95
  * @param int|string $value A value for $field. A user ID, slug, email address, or login name.
96 96
  * @return WP_User|false WP_User object on success, false on failure.
97 97
  */
98
-function get_user_by( $field, $value ) {
99
-	$userdata = WP_User::get_data_by( $field, $value );
98
+function get_user_by($field, $value) {
99
+	$userdata = WP_User::get_data_by($field, $value);
100 100
 
101
-	if ( !$userdata )
101
+	if ( ! $userdata)
102 102
 		return false;
103 103
 
104 104
 	$user = new WP_User;
105
-	$user->init( $userdata );
105
+	$user->init($userdata);
106 106
 
107 107
 	return $user;
108 108
 }
109 109
 endif;
110 110
 
111
-if ( !function_exists('cache_users') ) :
111
+if ( ! function_exists('cache_users')) :
112 112
 /**
113 113
  * Retrieve info for user lists to prevent multiple queries by get_userdata()
114 114
  *
@@ -118,28 +118,28 @@  discard block
 block discarded – undo
118 118
  *
119 119
  * @param array $user_ids User ID numbers list
120 120
  */
121
-function cache_users( $user_ids ) {
121
+function cache_users($user_ids) {
122 122
 	global $wpdb;
123 123
 
124
-	$clean = _get_non_cached_ids( $user_ids, 'users' );
124
+	$clean = _get_non_cached_ids($user_ids, 'users');
125 125
 
126
-	if ( empty( $clean ) )
126
+	if (empty($clean))
127 127
 		return;
128 128
 
129
-	$list = implode( ',', $clean );
129
+	$list = implode(',', $clean);
130 130
 
131
-	$users = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($list)" );
131
+	$users = $wpdb->get_results("SELECT * FROM $wpdb->users WHERE ID IN ($list)");
132 132
 
133 133
 	$ids = array();
134
-	foreach ( $users as $user ) {
135
-		update_user_caches( $user );
134
+	foreach ($users as $user) {
135
+		update_user_caches($user);
136 136
 		$ids[] = $user->ID;
137 137
 	}
138
-	update_meta_cache( 'user', $ids );
138
+	update_meta_cache('user', $ids);
139 139
 }
140 140
 endif;
141 141
 
142
-if ( !function_exists( 'wp_mail' ) ) :
142
+if ( ! function_exists('wp_mail')) :
143 143
 /**
144 144
  * Send mail, similar to PHP's mail
145 145
  *
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
  * @param string|array $attachments Optional. Files to attach.
171 171
  * @return bool Whether the email contents were sent successfully.
172 172
  */
173
-function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
173
+function wp_mail($to, $subject, $message, $headers = '', $attachments = array()) {
174 174
 	// Compact the input, apply the filters, and extract them back out
175 175
 
176 176
 	/**
@@ -181,48 +181,48 @@  discard block
 block discarded – undo
181 181
 	 * @param array $args A compacted array of wp_mail() arguments, including the "to" email,
182 182
 	 *                    subject, message, headers, and attachments values.
183 183
 	 */
184
-	$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
184
+	$atts = apply_filters('wp_mail', compact('to', 'subject', 'message', 'headers', 'attachments'));
185 185
 
186
-	if ( isset( $atts['to'] ) ) {
186
+	if (isset($atts['to'])) {
187 187
 		$to = $atts['to'];
188 188
 	}
189 189
 
190
-	if ( isset( $atts['subject'] ) ) {
190
+	if (isset($atts['subject'])) {
191 191
 		$subject = $atts['subject'];
192 192
 	}
193 193
 
194
-	if ( isset( $atts['message'] ) ) {
194
+	if (isset($atts['message'])) {
195 195
 		$message = $atts['message'];
196 196
 	}
197 197
 
198
-	if ( isset( $atts['headers'] ) ) {
198
+	if (isset($atts['headers'])) {
199 199
 		$headers = $atts['headers'];
200 200
 	}
201 201
 
202
-	if ( isset( $atts['attachments'] ) ) {
202
+	if (isset($atts['attachments'])) {
203 203
 		$attachments = $atts['attachments'];
204 204
 	}
205 205
 
206
-	if ( ! is_array( $attachments ) ) {
207
-		$attachments = explode( "\n", str_replace( "\r\n", "\n", $attachments ) );
206
+	if ( ! is_array($attachments)) {
207
+		$attachments = explode("\n", str_replace("\r\n", "\n", $attachments));
208 208
 	}
209 209
 	global $phpmailer;
210 210
 
211 211
 	// (Re)create it, if it's gone missing
212
-	if ( ! ( $phpmailer instanceof PHPMailer ) ) {
213
-		require_once ABSPATH . WPINC . '/class-phpmailer.php';
214
-		require_once ABSPATH . WPINC . '/class-smtp.php';
215
-		$phpmailer = new PHPMailer( true );
212
+	if ( ! ($phpmailer instanceof PHPMailer)) {
213
+		require_once ABSPATH.WPINC.'/class-phpmailer.php';
214
+		require_once ABSPATH.WPINC.'/class-smtp.php';
215
+		$phpmailer = new PHPMailer(true);
216 216
 	}
217 217
 
218 218
 	// Headers
219
-	if ( empty( $headers ) ) {
219
+	if (empty($headers)) {
220 220
 		$headers = array();
221 221
 	} else {
222
-		if ( !is_array( $headers ) ) {
222
+		if ( ! is_array($headers)) {
223 223
 			// Explode the headers out, so this function can take both
224 224
 			// string headers and an array of headers.
225
-			$tempheaders = explode( "\n", str_replace( "\r\n", "\n", $headers ) );
225
+			$tempheaders = explode("\n", str_replace("\r\n", "\n", $headers));
226 226
 		} else {
227 227
 			$tempheaders = $headers;
228 228
 		}
@@ -231,69 +231,69 @@  discard block
 block discarded – undo
231 231
 		$bcc = array();
232 232
 
233 233
 		// If it's actually got contents
234
-		if ( !empty( $tempheaders ) ) {
234
+		if ( ! empty($tempheaders)) {
235 235
 			// Iterate through the raw headers
236
-			foreach ( (array) $tempheaders as $header ) {
237
-				if ( strpos($header, ':') === false ) {
238
-					if ( false !== stripos( $header, 'boundary=' ) ) {
239
-						$parts = preg_split('/boundary=/i', trim( $header ) );
240
-						$boundary = trim( str_replace( array( "'", '"' ), '', $parts[1] ) );
236
+			foreach ((array) $tempheaders as $header) {
237
+				if (strpos($header, ':') === false) {
238
+					if (false !== stripos($header, 'boundary=')) {
239
+						$parts = preg_split('/boundary=/i', trim($header));
240
+						$boundary = trim(str_replace(array("'", '"'), '', $parts[1]));
241 241
 					}
242 242
 					continue;
243 243
 				}
244 244
 				// Explode them out
245
-				list( $name, $content ) = explode( ':', trim( $header ), 2 );
245
+				list($name, $content) = explode(':', trim($header), 2);
246 246
 
247 247
 				// Cleanup crew
248
-				$name    = trim( $name    );
249
-				$content = trim( $content );
248
+				$name    = trim($name);
249
+				$content = trim($content);
250 250
 
251
-				switch ( strtolower( $name ) ) {
251
+				switch (strtolower($name)) {
252 252
 					// Mainly for legacy -- process a From: header if it's there
253 253
 					case 'from':
254
-						$bracket_pos = strpos( $content, '<' );
255
-						if ( $bracket_pos !== false ) {
254
+						$bracket_pos = strpos($content, '<');
255
+						if ($bracket_pos !== false) {
256 256
 							// Text before the bracketed email is the "From" name.
257
-							if ( $bracket_pos > 0 ) {
258
-								$from_name = substr( $content, 0, $bracket_pos - 1 );
259
-								$from_name = str_replace( '"', '', $from_name );
260
-								$from_name = trim( $from_name );
257
+							if ($bracket_pos > 0) {
258
+								$from_name = substr($content, 0, $bracket_pos - 1);
259
+								$from_name = str_replace('"', '', $from_name);
260
+								$from_name = trim($from_name);
261 261
 							}
262 262
 
263
-							$from_email = substr( $content, $bracket_pos + 1 );
264
-							$from_email = str_replace( '>', '', $from_email );
265
-							$from_email = trim( $from_email );
263
+							$from_email = substr($content, $bracket_pos + 1);
264
+							$from_email = str_replace('>', '', $from_email);
265
+							$from_email = trim($from_email);
266 266
 
267 267
 						// Avoid setting an empty $from_email.
268
-						} elseif ( '' !== trim( $content ) ) {
269
-							$from_email = trim( $content );
268
+						} elseif ('' !== trim($content)) {
269
+							$from_email = trim($content);
270 270
 						}
271 271
 						break;
272 272
 					case 'content-type':
273
-						if ( strpos( $content, ';' ) !== false ) {
274
-							list( $type, $charset_content ) = explode( ';', $content );
275
-							$content_type = trim( $type );
276
-							if ( false !== stripos( $charset_content, 'charset=' ) ) {
277
-								$charset = trim( str_replace( array( 'charset=', '"' ), '', $charset_content ) );
278
-							} elseif ( false !== stripos( $charset_content, 'boundary=' ) ) {
279
-								$boundary = trim( str_replace( array( 'BOUNDARY=', 'boundary=', '"' ), '', $charset_content ) );
273
+						if (strpos($content, ';') !== false) {
274
+							list($type, $charset_content) = explode(';', $content);
275
+							$content_type = trim($type);
276
+							if (false !== stripos($charset_content, 'charset=')) {
277
+								$charset = trim(str_replace(array('charset=', '"'), '', $charset_content));
278
+							} elseif (false !== stripos($charset_content, 'boundary=')) {
279
+								$boundary = trim(str_replace(array('BOUNDARY=', 'boundary=', '"'), '', $charset_content));
280 280
 								$charset = '';
281 281
 							}
282 282
 
283 283
 						// Avoid setting an empty $content_type.
284
-						} elseif ( '' !== trim( $content ) ) {
285
-							$content_type = trim( $content );
284
+						} elseif ('' !== trim($content)) {
285
+							$content_type = trim($content);
286 286
 						}
287 287
 						break;
288 288
 					case 'cc':
289
-						$cc = array_merge( (array) $cc, explode( ',', $content ) );
289
+						$cc = array_merge((array) $cc, explode(',', $content));
290 290
 						break;
291 291
 					case 'bcc':
292
-						$bcc = array_merge( (array) $bcc, explode( ',', $content ) );
292
+						$bcc = array_merge((array) $bcc, explode(',', $content));
293 293
 						break;
294 294
 					default:
295 295
 						// Add it to our grand headers array
296
-						$headers[trim( $name )] = trim( $content );
296
+						$headers[trim($name)] = trim($content);
297 297
 						break;
298 298
 				}
299 299
 			}
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
 	// From email and name
310 310
 	// If we don't have a name from the input headers
311
-	if ( !isset( $from_name ) )
311
+	if ( ! isset($from_name))
312 312
 		$from_name = 'WordPress';
313 313
 
314 314
 	/* If we don't have an email from the input headers default to wordpress@$sitename
@@ -318,14 +318,14 @@  discard block
 block discarded – undo
318 318
 	 * https://core.trac.wordpress.org/ticket/5007.
319 319
 	 */
320 320
 
321
-	if ( !isset( $from_email ) ) {
321
+	if ( ! isset($from_email)) {
322 322
 		// Get the site domain and get rid of www.
323
-		$sitename = strtolower( $_SERVER['SERVER_NAME'] );
324
-		if ( substr( $sitename, 0, 4 ) == 'www.' ) {
325
-			$sitename = substr( $sitename, 4 );
323
+		$sitename = strtolower($_SERVER['SERVER_NAME']);
324
+		if (substr($sitename, 0, 4) == 'www.') {
325
+			$sitename = substr($sitename, 4);
326 326
 		}
327 327
 
328
-		$from_email = 'wordpress@' . $sitename;
328
+		$from_email = 'wordpress@'.$sitename;
329 329
 	}
330 330
 
331 331
 	/**
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 	 *
336 336
 	 * @param string $from_email Email address to send from.
337 337
 	 */
338
-	$phpmailer->From = apply_filters( 'wp_mail_from', $from_email );
338
+	$phpmailer->From = apply_filters('wp_mail_from', $from_email);
339 339
 
340 340
 	/**
341 341
 	 * Filter the name to associate with the "from" email address.
@@ -344,24 +344,24 @@  discard block
 block discarded – undo
344 344
 	 *
345 345
 	 * @param string $from_name Name associated with the "from" email address.
346 346
 	 */
347
-	$phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name );
347
+	$phpmailer->FromName = apply_filters('wp_mail_from_name', $from_name);
348 348
 
349 349
 	// Set destination addresses
350
-	if ( !is_array( $to ) )
351
-		$to = explode( ',', $to );
350
+	if ( ! is_array($to))
351
+		$to = explode(',', $to);
352 352
 
353
-	foreach ( (array) $to as $recipient ) {
353
+	foreach ((array) $to as $recipient) {
354 354
 		try {
355 355
 			// Break $recipient into name and address parts if in the format "Foo <[email protected]>"
356 356
 			$recipient_name = '';
357
-			if ( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) {
358
-				if ( count( $matches ) == 3 ) {
357
+			if (preg_match('/(.*)<(.+)>/', $recipient, $matches)) {
358
+				if (count($matches) == 3) {
359 359
 					$recipient_name = $matches[1];
360 360
 					$recipient = $matches[2];
361 361
 				}
362 362
 			}
363
-			$phpmailer->AddAddress( $recipient, $recipient_name);
364
-		} catch ( phpmailerException $e ) {
363
+			$phpmailer->AddAddress($recipient, $recipient_name);
364
+		} catch (phpmailerException $e) {
365 365
 			continue;
366 366
 		}
367 367
 	}
@@ -371,37 +371,37 @@  discard block
 block discarded – undo
371 371
 	$phpmailer->Body    = $message;
372 372
 
373 373
 	// Add any CC and BCC recipients
374
-	if ( !empty( $cc ) ) {
375
-		foreach ( (array) $cc as $recipient ) {
374
+	if ( ! empty($cc)) {
375
+		foreach ((array) $cc as $recipient) {
376 376
 			try {
377 377
 				// Break $recipient into name and address parts if in the format "Foo <[email protected]>"
378 378
 				$recipient_name = '';
379
-				if ( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) {
380
-					if ( count( $matches ) == 3 ) {
379
+				if (preg_match('/(.*)<(.+)>/', $recipient, $matches)) {
380
+					if (count($matches) == 3) {
381 381
 						$recipient_name = $matches[1];
382 382
 						$recipient = $matches[2];
383 383
 					}
384 384
 				}
385
-				$phpmailer->AddCc( $recipient, $recipient_name );
386
-			} catch ( phpmailerException $e ) {
385
+				$phpmailer->AddCc($recipient, $recipient_name);
386
+			} catch (phpmailerException $e) {
387 387
 				continue;
388 388
 			}
389 389
 		}
390 390
 	}
391 391
 
392
-	if ( !empty( $bcc ) ) {
393
-		foreach ( (array) $bcc as $recipient) {
392
+	if ( ! empty($bcc)) {
393
+		foreach ((array) $bcc as $recipient) {
394 394
 			try {
395 395
 				// Break $recipient into name and address parts if in the format "Foo <[email protected]>"
396 396
 				$recipient_name = '';
397
-				if ( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) {
398
-					if ( count( $matches ) == 3 ) {
397
+				if (preg_match('/(.*)<(.+)>/', $recipient, $matches)) {
398
+					if (count($matches) == 3) {
399 399
 						$recipient_name = $matches[1];
400 400
 						$recipient = $matches[2];
401 401
 					}
402 402
 				}
403
-				$phpmailer->AddBcc( $recipient, $recipient_name );
404
-			} catch ( phpmailerException $e ) {
403
+				$phpmailer->AddBcc($recipient, $recipient_name);
404
+			} catch (phpmailerException $e) {
405 405
 				continue;
406 406
 			}
407 407
 		}
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 
413 413
 	// Set Content-Type and charset
414 414
 	// If we don't have a content-type from the input headers
415
-	if ( !isset( $content_type ) )
415
+	if ( ! isset($content_type))
416 416
 		$content_type = 'text/plain';
417 417
 
418 418
 	/**
@@ -422,17 +422,17 @@  discard block
 block discarded – undo
422 422
 	 *
423 423
 	 * @param string $content_type Default wp_mail() content type.
424 424
 	 */
425
-	$content_type = apply_filters( 'wp_mail_content_type', $content_type );
425
+	$content_type = apply_filters('wp_mail_content_type', $content_type);
426 426
 
427 427
 	$phpmailer->ContentType = $content_type;
428 428
 
429 429
 	// Set whether it's plaintext, depending on $content_type
430
-	if ( 'text/html' == $content_type )
431
-		$phpmailer->IsHTML( true );
430
+	if ('text/html' == $content_type)
431
+		$phpmailer->IsHTML(true);
432 432
 
433 433
 	// If we don't have a charset from the input headers
434
-	if ( !isset( $charset ) )
435
-		$charset = get_bloginfo( 'charset' );
434
+	if ( ! isset($charset))
435
+		$charset = get_bloginfo('charset');
436 436
 
437 437
 	// Set the content-type and charset
438 438
 
@@ -443,23 +443,23 @@  discard block
 block discarded – undo
443 443
 	 *
444 444
 	 * @param string $charset Default email charset.
445 445
 	 */
446
-	$phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
446
+	$phpmailer->CharSet = apply_filters('wp_mail_charset', $charset);
447 447
 
448 448
 	// Set custom headers
449
-	if ( !empty( $headers ) ) {
450
-		foreach ( (array) $headers as $name => $content ) {
451
-			$phpmailer->AddCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );
449
+	if ( ! empty($headers)) {
450
+		foreach ((array) $headers as $name => $content) {
451
+			$phpmailer->AddCustomHeader(sprintf('%1$s: %2$s', $name, $content));
452 452
 		}
453 453
 
454
-		if ( false !== stripos( $content_type, 'multipart' ) && ! empty($boundary) )
455
-			$phpmailer->AddCustomHeader( sprintf( "Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary ) );
454
+		if (false !== stripos($content_type, 'multipart') && ! empty($boundary))
455
+			$phpmailer->AddCustomHeader(sprintf("Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary));
456 456
 	}
457 457
 
458
-	if ( !empty( $attachments ) ) {
459
-		foreach ( $attachments as $attachment ) {
458
+	if ( ! empty($attachments)) {
459
+		foreach ($attachments as $attachment) {
460 460
 			try {
461 461
 				$phpmailer->AddAttachment($attachment);
462
-			} catch ( phpmailerException $e ) {
462
+			} catch (phpmailerException $e) {
463 463
 				continue;
464 464
 			}
465 465
 		}
@@ -472,14 +472,14 @@  discard block
 block discarded – undo
472 472
 	 *
473 473
 	 * @param PHPMailer &$phpmailer The PHPMailer instance, passed by reference.
474 474
 	 */
475
-	do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
475
+	do_action_ref_array('phpmailer_init', array(&$phpmailer));
476 476
 
477 477
 	// Send!
478 478
 	try {
479 479
 		return $phpmailer->Send();
480
-	} catch ( phpmailerException $e ) {
480
+	} catch (phpmailerException $e) {
481 481
 
482
-		$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
482
+		$mail_error_data = compact('to', 'subject', 'message', 'headers', 'attachments');
483 483
 
484 484
 		/**
485 485
 		 * Fires after a phpmailerException is caught.
@@ -489,14 +489,14 @@  discard block
 block discarded – undo
489 489
 		 * @param WP_Error $error A WP_Error object with the phpmailerException code, message, and an array
490 490
 		 *                        containing the mail recipient, subject, message, headers, and attachments.
491 491
 		 */
492
- 		do_action( 'wp_mail_failed', new WP_Error( $e->getCode(), $e->getMessage(), $mail_error_data ) );
492
+ 		do_action('wp_mail_failed', new WP_Error($e->getCode(), $e->getMessage(), $mail_error_data));
493 493
 
494 494
 		return false;
495 495
 	}
496 496
 }
497 497
 endif;
498 498
 
499
-if ( !function_exists('wp_authenticate') ) :
499
+if ( ! function_exists('wp_authenticate')) :
500 500
 /**
501 501
  * Authenticate a user, confirming the login credentials are valid.
502 502
  *
@@ -526,17 +526,17 @@  discard block
 block discarded – undo
526 526
 	 * @param string                $username Username or email address.
527 527
 	 * @param string                $password User password
528 528
 	 */
529
-	$user = apply_filters( 'authenticate', null, $username, $password );
529
+	$user = apply_filters('authenticate', null, $username, $password);
530 530
 
531
-	if ( $user == null ) {
531
+	if ($user == null) {
532 532
 		// TODO what should the error message be? (Or would these even happen?)
533 533
 		// Only needed if all authentication handlers fail to return anything.
534
-		$user = new WP_Error( 'authentication_failed', __( '<strong>ERROR</strong>: Invalid username, email address or incorrect password.' ) );
534
+		$user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username, email address or incorrect password.'));
535 535
 	}
536 536
 
537 537
 	$ignore_codes = array('empty_username', 'empty_password');
538 538
 
539
-	if (is_wp_error($user) && !in_array($user->get_error_code(), $ignore_codes) ) {
539
+	if (is_wp_error($user) && ! in_array($user->get_error_code(), $ignore_codes)) {
540 540
 		/**
541 541
 		 * Fires after a user login has failed.
542 542
 		 *
@@ -545,14 +545,14 @@  discard block
 block discarded – undo
545 545
 		 *
546 546
 		 * @param string $username Username or email address.
547 547
 		 */
548
-		do_action( 'wp_login_failed', $username );
548
+		do_action('wp_login_failed', $username);
549 549
 	}
550 550
 
551 551
 	return $user;
552 552
 }
553 553
 endif;
554 554
 
555
-if ( !function_exists('wp_logout') ) :
555
+if ( ! function_exists('wp_logout')) :
556 556
 /**
557 557
  * Log the current user out.
558 558
  *
@@ -567,11 +567,11 @@  discard block
 block discarded – undo
567 567
 	 *
568 568
 	 * @since 1.5.0
569 569
 	 */
570
-	do_action( 'wp_logout' );
570
+	do_action('wp_logout');
571 571
 }
572 572
 endif;
573 573
 
574
-if ( !function_exists('wp_validate_auth_cookie') ) :
574
+if ( ! function_exists('wp_validate_auth_cookie')) :
575 575
 /**
576 576
  * Validates authentication cookie.
577 577
  *
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
  * @return false|int False if invalid cookie, User ID if valid.
591 591
  */
592 592
 function wp_validate_auth_cookie($cookie = '', $scheme = '') {
593
-	if ( ! $cookie_elements = wp_parse_auth_cookie($cookie, $scheme) ) {
593
+	if ( ! $cookie_elements = wp_parse_auth_cookie($cookie, $scheme)) {
594 594
 		/**
595 595
 		 * Fires if an authentication cookie is malformed.
596 596
 		 *
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 		 * @param string $scheme Authentication scheme. Values include 'auth', 'secure_auth',
601 601
 		 *                       or 'logged_in'.
602 602
 		 */
603
-		do_action( 'auth_cookie_malformed', $cookie, $scheme );
603
+		do_action('auth_cookie_malformed', $cookie, $scheme);
604 604
 		return false;
605 605
 	}
606 606
 
@@ -611,12 +611,12 @@  discard block
 block discarded – undo
611 611
 	$expired = $expiration = $cookie_elements['expiration'];
612 612
 
613 613
 	// Allow a grace period for POST and AJAX requests
614
-	if ( defined('DOING_AJAX') || 'POST' == $_SERVER['REQUEST_METHOD'] ) {
614
+	if (defined('DOING_AJAX') || 'POST' == $_SERVER['REQUEST_METHOD']) {
615 615
 		$expired += HOUR_IN_SECONDS;
616 616
 	}
617 617
 
618 618
 	// Quick check to see if an honest cookie has expired
619
-	if ( $expired < time() ) {
619
+	if ($expired < time()) {
620 620
 		/**
621 621
 		 * Fires once an authentication cookie has expired.
622 622
 		 *
@@ -624,12 +624,12 @@  discard block
 block discarded – undo
624 624
 		 *
625 625
 		 * @param array $cookie_elements An array of data for the authentication cookie.
626 626
 		 */
627
-		do_action( 'auth_cookie_expired', $cookie_elements );
627
+		do_action('auth_cookie_expired', $cookie_elements);
628 628
 		return false;
629 629
 	}
630 630
 
631 631
 	$user = get_user_by('login', $username);
632
-	if ( ! $user ) {
632
+	if ( ! $user) {
633 633
 		/**
634 634
 		 * Fires if a bad username is entered in the user authentication process.
635 635
 		 *
@@ -637,19 +637,19 @@  discard block
 block discarded – undo
637 637
 		 *
638 638
 		 * @param array $cookie_elements An array of data for the authentication cookie.
639 639
 		 */
640
-		do_action( 'auth_cookie_bad_username', $cookie_elements );
640
+		do_action('auth_cookie_bad_username', $cookie_elements);
641 641
 		return false;
642 642
 	}
643 643
 
644 644
 	$pass_frag = substr($user->user_pass, 8, 4);
645 645
 
646
-	$key = wp_hash( $username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme );
646
+	$key = wp_hash($username.'|'.$pass_frag.'|'.$expiration.'|'.$token, $scheme);
647 647
 
648 648
 	// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
649
-	$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
650
-	$hash = hash_hmac( $algo, $username . '|' . $expiration . '|' . $token, $key );
649
+	$algo = function_exists('hash') ? 'sha256' : 'sha1';
650
+	$hash = hash_hmac($algo, $username.'|'.$expiration.'|'.$token, $key);
651 651
 
652
-	if ( ! hash_equals( $hash, $hmac ) ) {
652
+	if ( ! hash_equals($hash, $hmac)) {
653 653
 		/**
654 654
 		 * Fires if a bad authentication cookie hash is encountered.
655 655
 		 *
@@ -657,18 +657,18 @@  discard block
 block discarded – undo
657 657
 		 *
658 658
 		 * @param array $cookie_elements An array of data for the authentication cookie.
659 659
 		 */
660
-		do_action( 'auth_cookie_bad_hash', $cookie_elements );
660
+		do_action('auth_cookie_bad_hash', $cookie_elements);
661 661
 		return false;
662 662
 	}
663 663
 
664
-	$manager = WP_Session_Tokens::get_instance( $user->ID );
665
-	if ( ! $manager->verify( $token ) ) {
666
-		do_action( 'auth_cookie_bad_session_token', $cookie_elements );
664
+	$manager = WP_Session_Tokens::get_instance($user->ID);
665
+	if ( ! $manager->verify($token)) {
666
+		do_action('auth_cookie_bad_session_token', $cookie_elements);
667 667
 		return false;
668 668
 	}
669 669
 
670 670
 	// AJAX/POST grace period set above
671
-	if ( $expiration < time() ) {
671
+	if ($expiration < time()) {
672 672
 		$GLOBALS['login_grace_period'] = 1;
673 673
 	}
674 674
 
@@ -680,13 +680,13 @@  discard block
 block discarded – undo
680 680
 	 * @param array   $cookie_elements An array of data for the authentication cookie.
681 681
 	 * @param WP_User $user            User object.
682 682
 	 */
683
-	do_action( 'auth_cookie_valid', $cookie_elements, $user );
683
+	do_action('auth_cookie_valid', $cookie_elements, $user);
684 684
 
685 685
 	return $user->ID;
686 686
 }
687 687
 endif;
688 688
 
689
-if ( !function_exists('wp_generate_auth_cookie') ) :
689
+if ( ! function_exists('wp_generate_auth_cookie')) :
690 690
 /**
691 691
  * Generate authentication cookie contents.
692 692
  *
@@ -698,26 +698,26 @@  discard block
 block discarded – undo
698 698
  * @param string $token      User's session token to use for this cookie
699 699
  * @return string Authentication cookie contents. Empty string if user does not exist.
700 700
  */
701
-function wp_generate_auth_cookie( $user_id, $expiration, $scheme = 'auth', $token = '' ) {
701
+function wp_generate_auth_cookie($user_id, $expiration, $scheme = 'auth', $token = '') {
702 702
 	$user = get_userdata($user_id);
703
-	if ( ! $user ) {
703
+	if ( ! $user) {
704 704
 		return '';
705 705
 	}
706 706
 
707
-	if ( ! $token ) {
708
-		$manager = WP_Session_Tokens::get_instance( $user_id );
709
-		$token = $manager->create( $expiration );
707
+	if ( ! $token) {
708
+		$manager = WP_Session_Tokens::get_instance($user_id);
709
+		$token = $manager->create($expiration);
710 710
 	}
711 711
 
712 712
 	$pass_frag = substr($user->user_pass, 8, 4);
713 713
 
714
-	$key = wp_hash( $user->user_login . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme );
714
+	$key = wp_hash($user->user_login.'|'.$pass_frag.'|'.$expiration.'|'.$token, $scheme);
715 715
 
716 716
 	// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
717
-	$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
718
-	$hash = hash_hmac( $algo, $user->user_login . '|' . $expiration . '|' . $token, $key );
717
+	$algo = function_exists('hash') ? 'sha256' : 'sha1';
718
+	$hash = hash_hmac($algo, $user->user_login.'|'.$expiration.'|'.$token, $key);
719 719
 
720
-	$cookie = $user->user_login . '|' . $expiration . '|' . $token . '|' . $hash;
720
+	$cookie = $user->user_login.'|'.$expiration.'|'.$token.'|'.$hash;
721 721
 
722 722
 	/**
723 723
 	 * Filter the authentication cookie.
@@ -730,11 +730,11 @@  discard block
 block discarded – undo
730 730
 	 * @param string $scheme     Cookie scheme used. Accepts 'auth', 'secure_auth', or 'logged_in'.
731 731
 	 * @param string $token      User's session token used.
732 732
 	 */
733
-	return apply_filters( 'auth_cookie', $cookie, $user_id, $expiration, $scheme, $token );
733
+	return apply_filters('auth_cookie', $cookie, $user_id, $expiration, $scheme, $token);
734 734
 }
735 735
 endif;
736 736
 
737
-if ( !function_exists('wp_parse_auth_cookie') ) :
737
+if ( ! function_exists('wp_parse_auth_cookie')) :
738 738
 /**
739 739
  * Parse a cookie into its components
740 740
  *
@@ -745,8 +745,8 @@  discard block
 block discarded – undo
745 745
  * @return array|false Authentication cookie components
746 746
  */
747 747
 function wp_parse_auth_cookie($cookie = '', $scheme = '') {
748
-	if ( empty($cookie) ) {
749
-		switch ($scheme){
748
+	if (empty($cookie)) {
749
+		switch ($scheme) {
750 750
 			case 'auth':
751 751
 				$cookie_name = AUTH_COOKIE;
752 752
 				break;
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 				$cookie_name = LOGGED_IN_COOKIE;
758 758
 				break;
759 759
 			default:
760
-				if ( is_ssl() ) {
760
+				if (is_ssl()) {
761 761
 					$cookie_name = SECURE_AUTH_COOKIE;
762 762
 					$scheme = 'secure_auth';
763 763
 				} else {
@@ -766,23 +766,23 @@  discard block
 block discarded – undo
766 766
 				}
767 767
 	    }
768 768
 
769
-		if ( empty($_COOKIE[$cookie_name]) )
769
+		if (empty($_COOKIE[$cookie_name]))
770 770
 			return false;
771 771
 		$cookie = $_COOKIE[$cookie_name];
772 772
 	}
773 773
 
774 774
 	$cookie_elements = explode('|', $cookie);
775
-	if ( count( $cookie_elements ) !== 4 ) {
775
+	if (count($cookie_elements) !== 4) {
776 776
 		return false;
777 777
 	}
778 778
 
779
-	list( $username, $expiration, $token, $hmac ) = $cookie_elements;
779
+	list($username, $expiration, $token, $hmac) = $cookie_elements;
780 780
 
781
-	return compact( 'username', 'expiration', 'token', 'hmac', 'scheme' );
781
+	return compact('username', 'expiration', 'token', 'hmac', 'scheme');
782 782
 }
783 783
 endif;
784 784
 
785
-if ( !function_exists('wp_set_auth_cookie') ) :
785
+if ( ! function_exists('wp_set_auth_cookie')) :
786 786
 /**
787 787
  * Log in a user by setting authentication cookies.
788 788
  *
@@ -799,8 +799,8 @@  discard block
 block discarded – undo
799 799
  *                         Default is_ssl().
800 800
  * @param string $token    Optional. User's session token to use for this cookie.
801 801
  */
802
-function wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token = '' ) {
803
-	if ( $remember ) {
802
+function wp_set_auth_cookie($user_id, $remember = false, $secure = '', $token = '') {
803
+	if ($remember) {
804 804
 		/**
805 805
 		 * Filter the duration of the authentication cookie expiration period.
806 806
 		 *
@@ -810,25 +810,25 @@  discard block
 block discarded – undo
810 810
 		 * @param int  $user_id  User ID.
811 811
 		 * @param bool $remember Whether to remember the user login. Default false.
812 812
 		 */
813
-		$expiration = time() + apply_filters( 'auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember );
813
+		$expiration = time() + apply_filters('auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember);
814 814
 
815 815
 		/*
816 816
 		 * Ensure the browser will continue to send the cookie after the expiration time is reached.
817 817
 		 * Needed for the login grace period in wp_validate_auth_cookie().
818 818
 		 */
819
-		$expire = $expiration + ( 12 * HOUR_IN_SECONDS );
819
+		$expire = $expiration + (12 * HOUR_IN_SECONDS);
820 820
 	} else {
821 821
 		/** This filter is documented in wp-includes/pluggable.php */
822
-		$expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember );
822
+		$expiration = time() + apply_filters('auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember);
823 823
 		$expire = 0;
824 824
 	}
825 825
 
826
-	if ( '' === $secure ) {
826
+	if ('' === $secure) {
827 827
 		$secure = is_ssl();
828 828
 	}
829 829
 
830 830
 	// Front-end cookie is secure when the auth cookie is secure and the site's home URL is forced HTTPS.
831
-	$secure_logged_in_cookie = $secure && 'https' === parse_url( get_option( 'home' ), PHP_URL_SCHEME );
831
+	$secure_logged_in_cookie = $secure && 'https' === parse_url(get_option('home'), PHP_URL_SCHEME);
832 832
 
833 833
 	/**
834 834
 	 * Filter whether the connection is secure.
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 	 * @param bool $secure  Whether the connection is secure.
839 839
 	 * @param int  $user_id User ID.
840 840
 	 */
841
-	$secure = apply_filters( 'secure_auth_cookie', $secure, $user_id );
841
+	$secure = apply_filters('secure_auth_cookie', $secure, $user_id);
842 842
 
843 843
 	/**
844 844
 	 * Filter whether to use a secure cookie when logged-in.
@@ -849,9 +849,9 @@  discard block
 block discarded – undo
849 849
 	 * @param int  $user_id                 User ID.
850 850
 	 * @param bool $secure                  Whether the connection is secure.
851 851
 	 */
852
-	$secure_logged_in_cookie = apply_filters( 'secure_logged_in_cookie', $secure_logged_in_cookie, $user_id, $secure );
852
+	$secure_logged_in_cookie = apply_filters('secure_logged_in_cookie', $secure_logged_in_cookie, $user_id, $secure);
853 853
 
854
-	if ( $secure ) {
854
+	if ($secure) {
855 855
 		$auth_cookie_name = SECURE_AUTH_COOKIE;
856 856
 		$scheme = 'secure_auth';
857 857
 	} else {
@@ -859,13 +859,13 @@  discard block
 block discarded – undo
859 859
 		$scheme = 'auth';
860 860
 	}
861 861
 
862
-	if ( '' === $token ) {
863
-		$manager = WP_Session_Tokens::get_instance( $user_id );
864
-		$token   = $manager->create( $expiration );
862
+	if ('' === $token) {
863
+		$manager = WP_Session_Tokens::get_instance($user_id);
864
+		$token   = $manager->create($expiration);
865 865
 	}
866 866
 
867
-	$auth_cookie = wp_generate_auth_cookie( $user_id, $expiration, $scheme, $token );
868
-	$logged_in_cookie = wp_generate_auth_cookie( $user_id, $expiration, 'logged_in', $token );
867
+	$auth_cookie = wp_generate_auth_cookie($user_id, $expiration, $scheme, $token);
868
+	$logged_in_cookie = wp_generate_auth_cookie($user_id, $expiration, 'logged_in', $token);
869 869
 
870 870
 	/**
871 871
 	 * Fires immediately before the authentication cookie is set.
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
 	 * @param int    $user_id     User ID.
880 880
 	 * @param string $scheme      Authentication scheme. Values include 'auth', 'secure_auth', or 'logged_in'.
881 881
 	 */
882
-	do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme );
882
+	do_action('set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme);
883 883
 
884 884
 	/**
885 885
 	 * Fires immediately before the secure authentication cookie is set.
@@ -893,17 +893,17 @@  discard block
 block discarded – undo
893 893
 	 * @param int    $user_id          User ID.
894 894
 	 * @param string $scheme           Authentication scheme. Default 'logged_in'.
895 895
 	 */
896
-	do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in' );
896
+	do_action('set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in');
897 897
 
898 898
 	setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
899 899
 	setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
900 900
 	setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true);
901
-	if ( COOKIEPATH != SITECOOKIEPATH )
901
+	if (COOKIEPATH != SITECOOKIEPATH)
902 902
 		setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true);
903 903
 }
904 904
 endif;
905 905
 
906
-if ( !function_exists('wp_clear_auth_cookie') ) :
906
+if ( ! function_exists('wp_clear_auth_cookie')) :
907 907
 /**
908 908
  * Removes all of the cookies associated with authentication.
909 909
  *
@@ -915,30 +915,30 @@  discard block
 block discarded – undo
915 915
 	 *
916 916
 	 * @since 2.7.0
917 917
 	 */
918
-	do_action( 'clear_auth_cookie' );
918
+	do_action('clear_auth_cookie');
919 919
 
920
-	setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH,   COOKIE_DOMAIN );
921
-	setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH,   COOKIE_DOMAIN );
922
-	setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
923
-	setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
924
-	setcookie( LOGGED_IN_COOKIE,   ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,          COOKIE_DOMAIN );
925
-	setcookie( LOGGED_IN_COOKIE,   ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH,      COOKIE_DOMAIN );
920
+	setcookie(AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN);
921
+	setcookie(SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN);
922
+	setcookie(AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN);
923
+	setcookie(SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN);
924
+	setcookie(LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN);
925
+	setcookie(LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN);
926 926
 
927 927
 	// Old cookies
928
-	setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
929
-	setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
930
-	setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
931
-	setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
928
+	setcookie(AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN);
929
+	setcookie(AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN);
930
+	setcookie(SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN);
931
+	setcookie(SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN);
932 932
 
933 933
 	// Even older cookies
934
-	setcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
935
-	setcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
936
-	setcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
937
-	setcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
934
+	setcookie(USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN);
935
+	setcookie(PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN);
936
+	setcookie(USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN);
937
+	setcookie(PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN);
938 938
 }
939 939
 endif;
940 940
 
941
-if ( !function_exists('is_user_logged_in') ) :
941
+if ( ! function_exists('is_user_logged_in')) :
942 942
 /**
943 943
  * Checks if the current visitor is a logged in user.
944 944
  *
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 }
954 954
 endif;
955 955
 
956
-if ( !function_exists('auth_redirect') ) :
956
+if ( ! function_exists('auth_redirect')) :
957 957
 /**
958 958
  * Checks if a user is logged in, if not it redirects them to the login page.
959 959
  *
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 function auth_redirect() {
963 963
 	// Checks if a user is logged in, if not redirects them to the login page
964 964
 
965
-	$secure = ( is_ssl() || force_ssl_admin() );
965
+	$secure = (is_ssl() || force_ssl_admin());
966 966
 
967 967
 	/**
968 968
 	 * Filter whether to use a secure authentication redirect.
@@ -971,20 +971,20 @@  discard block
 block discarded – undo
971 971
 	 *
972 972
 	 * @param bool $secure Whether to use a secure authentication redirect. Default false.
973 973
 	 */
974
-	$secure = apply_filters( 'secure_auth_redirect', $secure );
974
+	$secure = apply_filters('secure_auth_redirect', $secure);
975 975
 
976 976
 	// If https is required and request is http, redirect
977
-	if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
978
-		if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
979
-			wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
977
+	if ($secure && ! is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin')) {
978
+		if (0 === strpos($_SERVER['REQUEST_URI'], 'http')) {
979
+			wp_redirect(set_url_scheme($_SERVER['REQUEST_URI'], 'https'));
980 980
 			exit();
981 981
 		} else {
982
-			wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
982
+			wp_redirect('https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
983 983
 			exit();
984 984
 		}
985 985
 	}
986 986
 
987
-	if ( is_user_admin() ) {
987
+	if (is_user_admin()) {
988 988
 		$scheme = 'logged_in';
989 989
 	} else {
990 990
 		/**
@@ -994,10 +994,10 @@  discard block
 block discarded – undo
994 994
 		 *
995 995
 		 * @param string $scheme Authentication redirect scheme. Default empty.
996 996
 		 */
997
-		$scheme = apply_filters( 'auth_redirect_scheme', '' );
997
+		$scheme = apply_filters('auth_redirect_scheme', '');
998 998
 	}
999 999
 
1000
-	if ( $user_id = wp_validate_auth_cookie( '',  $scheme) ) {
1000
+	if ($user_id = wp_validate_auth_cookie('', $scheme)) {
1001 1001
 		/**
1002 1002
 		 * Fires before the authentication redirect.
1003 1003
 		 *
@@ -1005,26 +1005,26 @@  discard block
 block discarded – undo
1005 1005
 		 *
1006 1006
 		 * @param int $user_id User ID.
1007 1007
 		 */
1008
-		do_action( 'auth_redirect', $user_id );
1008
+		do_action('auth_redirect', $user_id);
1009 1009
 
1010 1010
 		// If the user wants ssl but the session is not ssl, redirect.
1011
-		if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
1012
-			if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
1013
-				wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
1011
+		if ( ! $secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin')) {
1012
+			if (0 === strpos($_SERVER['REQUEST_URI'], 'http')) {
1013
+				wp_redirect(set_url_scheme($_SERVER['REQUEST_URI'], 'https'));
1014 1014
 				exit();
1015 1015
 			} else {
1016
-				wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
1016
+				wp_redirect('https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
1017 1017
 				exit();
1018 1018
 			}
1019 1019
 		}
1020 1020
 
1021
-		return;  // The cookie is good so we're done
1021
+		return; // The cookie is good so we're done
1022 1022
 	}
1023 1023
 
1024 1024
 	// The cookie is no good so force login
1025 1025
 	nocache_headers();
1026 1026
 
1027
-	$redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
1027
+	$redirect = (strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer()) ? wp_get_referer() : set_url_scheme('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
1028 1028
 
1029 1029
 	$login_url = wp_login_url($redirect, true);
1030 1030
 
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 }
1034 1034
 endif;
1035 1035
 
1036
-if ( !function_exists('check_admin_referer') ) :
1036
+if ( ! function_exists('check_admin_referer')) :
1037 1037
 /**
1038 1038
  * Makes sure that a user was referred from another admin page.
1039 1039
  *
@@ -1047,9 +1047,9 @@  discard block
 block discarded – undo
1047 1047
  * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
1048 1048
  *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
1049 1049
  */
1050
-function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
1050
+function check_admin_referer($action = -1, $query_arg = '_wpnonce') {
1051 1051
 	if ( -1 == $action )
1052
-		_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2' );
1052
+		_doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
1053 1053
 
1054 1054
 	$adminurl = strtolower(admin_url());
1055 1055
 	$referer = strtolower(wp_get_referer());
@@ -1064,10 +1064,10 @@  discard block
 block discarded – undo
1064 1064
 	 * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
1065 1065
 	 *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
1066 1066
 	 */
1067
-	do_action( 'check_admin_referer', $action, $result );
1067
+	do_action('check_admin_referer', $action, $result);
1068 1068
 
1069
-	if ( ! $result && ! ( -1 == $action && strpos( $referer, $adminurl ) === 0 ) ) {
1070
-		wp_nonce_ays( $action );
1069
+	if ( ! $result && ! ( -1 == $action && strpos($referer, $adminurl) === 0 )) {
1070
+		wp_nonce_ays($action);
1071 1071
 		die();
1072 1072
 	}
1073 1073
 
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 }
1076 1076
 endif;
1077 1077
 
1078
-if ( !function_exists('check_ajax_referer') ) :
1078
+if ( ! function_exists('check_ajax_referer')) :
1079 1079
 /**
1080 1080
  * Verifies the AJAX request to prevent processing requests external of the blog.
1081 1081
  *
@@ -1090,17 +1090,17 @@  discard block
 block discarded – undo
1090 1090
  * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
1091 1091
  *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
1092 1092
  */
1093
-function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
1093
+function check_ajax_referer($action = -1, $query_arg = false, $die = true) {
1094 1094
 	$nonce = '';
1095 1095
 
1096
-	if ( $query_arg && isset( $_REQUEST[ $query_arg ] ) )
1097
-		$nonce = $_REQUEST[ $query_arg ];
1098
-	elseif ( isset( $_REQUEST['_ajax_nonce'] ) )
1096
+	if ($query_arg && isset($_REQUEST[$query_arg]))
1097
+		$nonce = $_REQUEST[$query_arg];
1098
+	elseif (isset($_REQUEST['_ajax_nonce']))
1099 1099
 		$nonce = $_REQUEST['_ajax_nonce'];
1100
-	elseif ( isset( $_REQUEST['_wpnonce'] ) )
1100
+	elseif (isset($_REQUEST['_wpnonce']))
1101 1101
 		$nonce = $_REQUEST['_wpnonce'];
1102 1102
 
1103
-	$result = wp_verify_nonce( $nonce, $action );
1103
+	$result = wp_verify_nonce($nonce, $action);
1104 1104
 
1105 1105
 	/**
1106 1106
 	 * Fires once the AJAX request has been validated or not.
@@ -1111,13 +1111,13 @@  discard block
 block discarded – undo
1111 1111
 	 * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
1112 1112
 	 *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
1113 1113
 	 */
1114
-	do_action( 'check_ajax_referer', $action, $result );
1114
+	do_action('check_ajax_referer', $action, $result);
1115 1115
 
1116
-	if ( $die && false === $result ) {
1117
-		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1116
+	if ($die && false === $result) {
1117
+		if (defined('DOING_AJAX') && DOING_AJAX) {
1118 1118
 			wp_die( -1 );
1119 1119
 		} else {
1120
-			die( '-1' );
1120
+			die('-1');
1121 1121
 		}
1122 1122
 	}
1123 1123
 
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
 }
1126 1126
 endif;
1127 1127
 
1128
-if ( !function_exists('wp_redirect') ) :
1128
+if ( ! function_exists('wp_redirect')) :
1129 1129
 /**
1130 1130
  * Redirects to another page.
1131 1131
  *
@@ -1148,7 +1148,7 @@  discard block
 block discarded – undo
1148 1148
 	 * @param string $location The path to redirect to.
1149 1149
 	 * @param int    $status   Status code to use.
1150 1150
 	 */
1151
-	$location = apply_filters( 'wp_redirect', $location, $status );
1151
+	$location = apply_filters('wp_redirect', $location, $status);
1152 1152
 
1153 1153
 	/**
1154 1154
 	 * Filter the redirect status code.
@@ -1158,14 +1158,14 @@  discard block
 block discarded – undo
1158 1158
 	 * @param int    $status   Status code to use.
1159 1159
 	 * @param string $location The path to redirect to.
1160 1160
 	 */
1161
-	$status = apply_filters( 'wp_redirect_status', $status, $location );
1161
+	$status = apply_filters('wp_redirect_status', $status, $location);
1162 1162
 
1163
-	if ( ! $location )
1163
+	if ( ! $location)
1164 1164
 		return false;
1165 1165
 
1166 1166
 	$location = wp_sanitize_redirect($location);
1167 1167
 
1168
-	if ( !$is_IIS && PHP_SAPI != 'cgi-fcgi' )
1168
+	if ( ! $is_IIS && PHP_SAPI != 'cgi-fcgi')
1169 1169
 		status_header($status); // This causes problems on IIS and some FastCGI setups
1170 1170
 
1171 1171
 	header("Location: $location", true, $status);
@@ -1174,7 +1174,7 @@  discard block
 block discarded – undo
1174 1174
 }
1175 1175
 endif;
1176 1176
 
1177
-if ( !function_exists('wp_sanitize_redirect') ) :
1177
+if ( ! function_exists('wp_sanitize_redirect')) :
1178 1178
 /**
1179 1179
  * Sanitizes a URL for use in a redirect.
1180 1180
  *
@@ -1196,13 +1196,13 @@  discard block
 block discarded – undo
1196 1196
 			|   \xF4[\x80-\x8F][\x80-\xBF]{2}
1197 1197
 		){1,40}                              # ...one or more times
1198 1198
 		)/x';
1199
-	$location = preg_replace_callback( $regex, '_wp_sanitize_utf8_in_redirect', $location );
1199
+	$location = preg_replace_callback($regex, '_wp_sanitize_utf8_in_redirect', $location);
1200 1200
 	$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%!*\[\]()@]|i', '', $location);
1201 1201
 	$location = wp_kses_no_null($location);
1202 1202
 
1203 1203
 	// remove %0d and %0a from location
1204 1204
 	$strip = array('%0d', '%0a', '%0D', '%0A');
1205
-	return _deep_replace( $strip, $location );
1205
+	return _deep_replace($strip, $location);
1206 1206
 }
1207 1207
 
1208 1208
 /**
@@ -1217,12 +1217,12 @@  discard block
 block discarded – undo
1217 1217
  * @param array $matches RegEx matches against the redirect location.
1218 1218
  * @return string URL-encoded version of the first RegEx match.
1219 1219
  */
1220
-function _wp_sanitize_utf8_in_redirect( $matches ) {
1221
-	return urlencode( $matches[0] );
1220
+function _wp_sanitize_utf8_in_redirect($matches) {
1221
+	return urlencode($matches[0]);
1222 1222
 }
1223 1223
 endif;
1224 1224
 
1225
-if ( !function_exists('wp_safe_redirect') ) :
1225
+if ( ! function_exists('wp_safe_redirect')) :
1226 1226
 /**
1227 1227
  * Performs a safe (local) redirect, using wp_redirect().
1228 1228
  *
@@ -1252,13 +1252,13 @@  discard block
 block discarded – undo
1252 1252
 	 * @param string $fallback_url The fallback URL to use by default.
1253 1253
 	 * @param int    $status       The redirect status.
1254 1254
 	 */
1255
-	$location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );
1255
+	$location = wp_validate_redirect($location, apply_filters('wp_safe_redirect_fallback', admin_url(), $status));
1256 1256
 
1257 1257
 	wp_redirect($location, $status);
1258 1258
 }
1259 1259
 endif;
1260 1260
 
1261
-if ( !function_exists('wp_validate_redirect') ) :
1261
+if ( ! function_exists('wp_validate_redirect')) :
1262 1262
 /**
1263 1263
  * Validates a URL for use in a redirect.
1264 1264
  *
@@ -1275,33 +1275,33 @@  discard block
 block discarded – undo
1275 1275
  * @return string redirect-sanitized URL
1276 1276
  **/
1277 1277
 function wp_validate_redirect($location, $default = '') {
1278
-	$location = trim( $location );
1278
+	$location = trim($location);
1279 1279
 	// browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'
1280
-	if ( substr($location, 0, 2) == '//' )
1281
-		$location = 'http:' . $location;
1280
+	if (substr($location, 0, 2) == '//')
1281
+		$location = 'http:'.$location;
1282 1282
 
1283 1283
 	// In php 5 parse_url may fail if the URL query part contains http://, bug #38143
1284
-	$test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
1284
+	$test = ($cut = strpos($location, '?')) ? substr($location, 0, $cut) : $location;
1285 1285
 
1286 1286
 	// @-operator is used to prevent possible warnings in PHP < 5.3.3.
1287 1287
 	$lp = @parse_url($test);
1288 1288
 
1289 1289
 	// Give up if malformed URL
1290
-	if ( false === $lp )
1290
+	if (false === $lp)
1291 1291
 		return $default;
1292 1292
 
1293 1293
 	// Allow only http and https schemes. No data:, etc.
1294
-	if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) )
1294
+	if (isset($lp['scheme']) && ! ('http' == $lp['scheme'] || 'https' == $lp['scheme']))
1295 1295
 		return $default;
1296 1296
 
1297 1297
 	// Reject if certain components are set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
1298
-	if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
1298
+	if ( ! isset($lp['host']) && (isset($lp['scheme']) || isset($lp['user']) || isset($lp['pass']) || isset($lp['port']))) {
1299 1299
 		return $default;
1300 1300
 	}
1301 1301
 
1302 1302
 	// Reject malformed components parse_url() can return on odd inputs.
1303
-	foreach ( array( 'user', 'pass', 'host' ) as $component ) {
1304
-		if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) {
1303
+	foreach (array('user', 'pass', 'host') as $component) {
1304
+		if (isset($lp[$component]) && strpbrk($lp[$component], ':/?#@')) {
1305 1305
 			return $default;
1306 1306
 		}
1307 1307
 	}
@@ -1316,16 +1316,16 @@  discard block
 block discarded – undo
1316 1316
 	 * @param array       $hosts An array of allowed hosts.
1317 1317
 	 * @param bool|string $host  The parsed host; empty if not isset.
1318 1318
 	 */
1319
-	$allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '' );
1319
+	$allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');
1320 1320
 
1321
-	if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
1321
+	if (isset($lp['host']) && ( ! in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])))
1322 1322
 		$location = $default;
1323 1323
 
1324 1324
 	return $location;
1325 1325
 }
1326 1326
 endif;
1327 1327
 
1328
-if ( ! function_exists('wp_notify_postauthor') ) :
1328
+if ( ! function_exists('wp_notify_postauthor')) :
1329 1329
 /**
1330 1330
  * Notify an author (and/or others) of a comment/trackback/pingback on a post.
1331 1331
  *
@@ -1335,21 +1335,21 @@  discard block
 block discarded – undo
1335 1335
  * @param string          $deprecated Not used
1336 1336
  * @return bool True on completion. False if no email addresses were specified.
1337 1337
  */
1338
-function wp_notify_postauthor( $comment_id, $deprecated = null ) {
1339
-	if ( null !== $deprecated ) {
1340
-		_deprecated_argument( __FUNCTION__, '3.8' );
1338
+function wp_notify_postauthor($comment_id, $deprecated = null) {
1339
+	if (null !== $deprecated) {
1340
+		_deprecated_argument(__FUNCTION__, '3.8');
1341 1341
 	}
1342 1342
 
1343
-	$comment = get_comment( $comment_id );
1344
-	if ( empty( $comment ) || empty( $comment->comment_post_ID ) )
1343
+	$comment = get_comment($comment_id);
1344
+	if (empty($comment) || empty($comment->comment_post_ID))
1345 1345
 		return false;
1346 1346
 
1347
-	$post    = get_post( $comment->comment_post_ID );
1348
-	$author  = get_userdata( $post->post_author );
1347
+	$post    = get_post($comment->comment_post_ID);
1348
+	$author  = get_userdata($post->post_author);
1349 1349
 
1350 1350
 	// Who to notify? By default, just the post author, but others can be added.
1351 1351
 	$emails = array();
1352
-	if ( $author ) {
1352
+	if ($author) {
1353 1353
 		$emails[] = $author->user_email;
1354 1354
 	}
1355 1355
 
@@ -1364,16 +1364,16 @@  discard block
 block discarded – undo
1364 1364
 	 * @param array $emails     An array of email addresses to receive a comment notification.
1365 1365
 	 * @param int   $comment_id The comment ID.
1366 1366
 	 */
1367
-	$emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );
1368
-	$emails = array_filter( $emails );
1367
+	$emails = apply_filters('comment_notification_recipients', $emails, $comment->comment_ID);
1368
+	$emails = array_filter($emails);
1369 1369
 
1370 1370
 	// If there are no addresses to send the comment to, bail.
1371
-	if ( ! count( $emails ) ) {
1371
+	if ( ! count($emails)) {
1372 1372
 		return false;
1373 1373
 	}
1374 1374
 
1375 1375
 	// Facilitate unsetting below without knowing the keys.
1376
-	$emails = array_flip( $emails );
1376
+	$emails = array_flip($emails);
1377 1377
 
1378 1378
 	/**
1379 1379
 	 * Filter whether to notify comment authors of their comments on their own posts.
@@ -1387,28 +1387,28 @@  discard block
 block discarded – undo
1387 1387
 	 *                         Default false.
1388 1388
 	 * @param int  $comment_id The comment ID.
1389 1389
 	 */
1390
-	$notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID );
1390
+	$notify_author = apply_filters('comment_notification_notify_author', false, $comment->comment_ID);
1391 1391
 
1392 1392
 	// The comment was left by the author
1393
-	if ( $author && ! $notify_author && $comment->user_id == $post->post_author ) {
1394
-		unset( $emails[ $author->user_email ] );
1393
+	if ($author && ! $notify_author && $comment->user_id == $post->post_author) {
1394
+		unset($emails[$author->user_email]);
1395 1395
 	}
1396 1396
 
1397 1397
 	// The author moderated a comment on their own post
1398
-	if ( $author && ! $notify_author && $post->post_author == get_current_user_id() ) {
1399
-		unset( $emails[ $author->user_email ] );
1398
+	if ($author && ! $notify_author && $post->post_author == get_current_user_id()) {
1399
+		unset($emails[$author->user_email]);
1400 1400
 	}
1401 1401
 
1402 1402
 	// The post author is no longer a member of the blog
1403
-	if ( $author && ! $notify_author && ! user_can( $post->post_author, 'read_post', $post->ID ) ) {
1404
-		unset( $emails[ $author->user_email ] );
1403
+	if ($author && ! $notify_author && ! user_can($post->post_author, 'read_post', $post->ID)) {
1404
+		unset($emails[$author->user_email]);
1405 1405
 	}
1406 1406
 
1407 1407
 	// If there's no email to send the comment to, bail, otherwise flip array back around for use below
1408
-	if ( ! count( $emails ) ) {
1408
+	if ( ! count($emails)) {
1409 1409
 		return false;
1410 1410
 	} else {
1411
-		$emails = array_flip( $emails );
1411
+		$emails = array_flip($emails);
1412 1412
 	}
1413 1413
 
1414 1414
 	$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
@@ -1416,70 +1416,70 @@  discard block
 block discarded – undo
1416 1416
 	// The blogname option is escaped with esc_html on the way into the database in sanitize_option
1417 1417
 	// we want to reverse this for the plain text arena of emails.
1418 1418
 	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
1419
-	$comment_content = wp_specialchars_decode( $comment->comment_content );
1419
+	$comment_content = wp_specialchars_decode($comment->comment_content);
1420 1420
 
1421
-	switch ( $comment->comment_type ) {
1421
+	switch ($comment->comment_type) {
1422 1422
 		case 'trackback':
1423
-			$notify_message  = sprintf( __( 'New trackback on your post "%s"' ), $post->post_title ) . "\r\n";
1423
+			$notify_message  = sprintf(__('New trackback on your post "%s"'), $post->post_title)."\r\n";
1424 1424
 			/* translators: 1: website name, 2: website IP, 3: website hostname */
1425
-			$notify_message .= sprintf( __('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
1426
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
1427
-			$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
1428
-			$notify_message .= __( 'You can see all trackbacks on this post here:' ) . "\r\n";
1425
+			$notify_message .= sprintf(__('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain)."\r\n";
1426
+			$notify_message .= sprintf(__('URL: %s'), $comment->comment_author_url)."\r\n";
1427
+			$notify_message .= sprintf(__('Comment: %s'), "\r\n".$comment_content)."\r\n\r\n";
1428
+			$notify_message .= __('You can see all trackbacks on this post here:')."\r\n";
1429 1429
 			/* translators: 1: blog name, 2: post title */
1430
-			$subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title );
1430
+			$subject = sprintf(__('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title);
1431 1431
 			break;
1432 1432
 		case 'pingback':
1433
-			$notify_message  = sprintf( __( 'New pingback on your post "%s"' ), $post->post_title ) . "\r\n";
1433
+			$notify_message  = sprintf(__('New pingback on your post "%s"'), $post->post_title)."\r\n";
1434 1434
 			/* translators: 1: website name, 2: website IP, 3: website hostname */
1435
-			$notify_message .= sprintf( __('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
1436
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
1437
-			$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
1438
-			$notify_message .= __( 'You can see all pingbacks on this post here:' ) . "\r\n";
1435
+			$notify_message .= sprintf(__('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain)."\r\n";
1436
+			$notify_message .= sprintf(__('URL: %s'), $comment->comment_author_url)."\r\n";
1437
+			$notify_message .= sprintf(__('Comment: %s'), "\r\n".$comment_content)."\r\n\r\n";
1438
+			$notify_message .= __('You can see all pingbacks on this post here:')."\r\n";
1439 1439
 			/* translators: 1: blog name, 2: post title */
1440
-			$subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
1440
+			$subject = sprintf(__('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title);
1441 1441
 			break;
1442 1442
 		default: // Comments
1443
-			$notify_message  = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n";
1443
+			$notify_message  = sprintf(__('New comment on your post "%s"'), $post->post_title)."\r\n";
1444 1444
 			/* translators: 1: comment author, 2: author IP, 3: author domain */
1445
-			$notify_message .= sprintf( __( 'Author: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
1446
-			$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
1447
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
1448
-			$notify_message .= sprintf( __('Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
1449
-			$notify_message .= __( 'You can see all comments on this post here:' ) . "\r\n";
1445
+			$notify_message .= sprintf(__('Author: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain)."\r\n";
1446
+			$notify_message .= sprintf(__('Email: %s'), $comment->comment_author_email)."\r\n";
1447
+			$notify_message .= sprintf(__('URL: %s'), $comment->comment_author_url)."\r\n";
1448
+			$notify_message .= sprintf(__('Comment: %s'), "\r\n".$comment_content)."\r\n\r\n";
1449
+			$notify_message .= __('You can see all comments on this post here:')."\r\n";
1450 1450
 			/* translators: 1: blog name, 2: post title */
1451
-			$subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title );
1451
+			$subject = sprintf(__('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title);
1452 1452
 			break;
1453 1453
 	}
1454
-	$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
1455
-	$notify_message .= sprintf( __('Permalink: %s'), get_comment_link( $comment ) ) . "\r\n";
1454
+	$notify_message .= get_permalink($comment->comment_post_ID)."#comments\r\n\r\n";
1455
+	$notify_message .= sprintf(__('Permalink: %s'), get_comment_link($comment))."\r\n";
1456 1456
 
1457
-	if ( user_can( $post->post_author, 'edit_comment', $comment->comment_ID ) ) {
1458
-		if ( EMPTY_TRASH_DAYS ) {
1459
-			$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
1457
+	if (user_can($post->post_author, 'edit_comment', $comment->comment_ID)) {
1458
+		if (EMPTY_TRASH_DAYS) {
1459
+			$notify_message .= sprintf(__('Trash it: %s'), admin_url("comment.php?action=trash&c={$comment->comment_ID}#wpbody-content"))."\r\n";
1460 1460
 		} else {
1461
-			$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
1461
+			$notify_message .= sprintf(__('Delete it: %s'), admin_url("comment.php?action=delete&c={$comment->comment_ID}#wpbody-content"))."\r\n";
1462 1462
 		}
1463
-		$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
1463
+		$notify_message .= sprintf(__('Spam it: %s'), admin_url("comment.php?action=spam&c={$comment->comment_ID}#wpbody-content"))."\r\n";
1464 1464
 	}
1465 1465
 
1466
-	$wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
1466
+	$wp_email = 'wordpress@'.preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
1467 1467
 
1468
-	if ( '' == $comment->comment_author ) {
1468
+	if ('' == $comment->comment_author) {
1469 1469
 		$from = "From: \"$blogname\" <$wp_email>";
1470
-		if ( '' != $comment->comment_author_email )
1470
+		if ('' != $comment->comment_author_email)
1471 1471
 			$reply_to = "Reply-To: $comment->comment_author_email";
1472 1472
 	} else {
1473 1473
 		$from = "From: \"$comment->comment_author\" <$wp_email>";
1474
-		if ( '' != $comment->comment_author_email )
1474
+		if ('' != $comment->comment_author_email)
1475 1475
 			$reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
1476 1476
 	}
1477 1477
 
1478 1478
 	$message_headers = "$from\n"
1479
-		. "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
1479
+		. "Content-Type: text/plain; charset=\"".get_option('blog_charset')."\"\n";
1480 1480
 
1481
-	if ( isset($reply_to) )
1482
-		$message_headers .= $reply_to . "\n";
1481
+	if (isset($reply_to))
1482
+		$message_headers .= $reply_to."\n";
1483 1483
 
1484 1484
 	/**
1485 1485
 	 * Filter the comment notification email text.
@@ -1489,7 +1489,7 @@  discard block
 block discarded – undo
1489 1489
 	 * @param string $notify_message The comment notification email text.
1490 1490
 	 * @param int    $comment_id     Comment ID.
1491 1491
 	 */
1492
-	$notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment->comment_ID );
1492
+	$notify_message = apply_filters('comment_notification_text', $notify_message, $comment->comment_ID);
1493 1493
 
1494 1494
 	/**
1495 1495
 	 * Filter the comment notification email subject.
@@ -1499,7 +1499,7 @@  discard block
 block discarded – undo
1499 1499
 	 * @param string $subject    The comment notification email subject.
1500 1500
 	 * @param int    $comment_id Comment ID.
1501 1501
 	 */
1502
-	$subject = apply_filters( 'comment_notification_subject', $subject, $comment->comment_ID );
1502
+	$subject = apply_filters('comment_notification_subject', $subject, $comment->comment_ID);
1503 1503
 
1504 1504
 	/**
1505 1505
 	 * Filter the comment notification email headers.
@@ -1509,17 +1509,17 @@  discard block
 block discarded – undo
1509 1509
 	 * @param string $message_headers Headers for the comment notification email.
1510 1510
 	 * @param int    $comment_id      Comment ID.
1511 1511
 	 */
1512
-	$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment->comment_ID );
1512
+	$message_headers = apply_filters('comment_notification_headers', $message_headers, $comment->comment_ID);
1513 1513
 
1514
-	foreach ( $emails as $email ) {
1515
-		@wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
1514
+	foreach ($emails as $email) {
1515
+		@wp_mail($email, wp_specialchars_decode($subject), $notify_message, $message_headers);
1516 1516
 	}
1517 1517
 
1518 1518
 	return true;
1519 1519
 }
1520 1520
 endif;
1521 1521
 
1522
-if ( !function_exists('wp_notify_moderator') ) :
1522
+if ( ! function_exists('wp_notify_moderator')) :
1523 1523
 /**
1524 1524
  * Notifies the moderator of the site about a new comment that is awaiting approval.
1525 1525
  *
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
 function wp_notify_moderator($comment_id) {
1537 1537
 	global $wpdb;
1538 1538
 
1539
-	$maybe_notify = get_option( 'moderation_notify' );
1539
+	$maybe_notify = get_option('moderation_notify');
1540 1540
 
1541 1541
 	/**
1542 1542
 	 * Filter whether to send the site moderator email notifications, overriding the site setting.
@@ -1546,19 +1546,19 @@  discard block
 block discarded – undo
1546 1546
 	 * @param bool $maybe_notify Whether to notify blog moderator.
1547 1547
 	 * @param int  $comment_ID   The id of the comment for the notification.
1548 1548
 	 */
1549
-	$maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id );
1549
+	$maybe_notify = apply_filters('notify_moderator', $maybe_notify, $comment_id);
1550 1550
 
1551
-	if ( ! $maybe_notify ) {
1551
+	if ( ! $maybe_notify) {
1552 1552
 		return true;
1553 1553
 	}
1554 1554
 
1555 1555
 	$comment = get_comment($comment_id);
1556 1556
 	$post = get_post($comment->comment_post_ID);
1557
-	$user = get_userdata( $post->post_author );
1557
+	$user = get_userdata($post->post_author);
1558 1558
 	// Send to the administration and to the post author if the author can modify the comment.
1559
-	$emails = array( get_option( 'admin_email' ) );
1560
-	if ( $user && user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) {
1561
-		if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) )
1559
+	$emails = array(get_option('admin_email'));
1560
+	if ($user && user_can($user->ID, 'edit_comment', $comment_id) && ! empty($user->user_email)) {
1561
+		if (0 !== strcasecmp($user->user_email, get_option('admin_email')))
1562 1562
 			$emails[] = $user->user_email;
1563 1563
 	}
1564 1564
 
@@ -1568,49 +1568,49 @@  discard block
 block discarded – undo
1568 1568
 	// The blogname option is escaped with esc_html on the way into the database in sanitize_option
1569 1569
 	// we want to reverse this for the plain text arena of emails.
1570 1570
 	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
1571
-	$comment_content = wp_specialchars_decode( $comment->comment_content );
1571
+	$comment_content = wp_specialchars_decode($comment->comment_content);
1572 1572
 
1573
-	switch ( $comment->comment_type ) {
1573
+	switch ($comment->comment_type) {
1574 1574
 		case 'trackback':
1575
-			$notify_message  = sprintf( __('A new trackback on the post "%s" is waiting for your approval'), $post->post_title ) . "\r\n";
1576
-			$notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
1575
+			$notify_message  = sprintf(__('A new trackback on the post "%s" is waiting for your approval'), $post->post_title)."\r\n";
1576
+			$notify_message .= get_permalink($comment->comment_post_ID)."\r\n\r\n";
1577 1577
 			/* translators: 1: website name, 2: website IP, 3: website hostname */
1578
-			$notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
1579
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
1580
-			$notify_message .= __('Trackback excerpt: ') . "\r\n" . $comment_content . "\r\n\r\n";
1578
+			$notify_message .= sprintf(__('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain)."\r\n";
1579
+			$notify_message .= sprintf(__('URL: %s'), $comment->comment_author_url)."\r\n";
1580
+			$notify_message .= __('Trackback excerpt: ')."\r\n".$comment_content."\r\n\r\n";
1581 1581
 			break;
1582 1582
 		case 'pingback':
1583
-			$notify_message  = sprintf( __('A new pingback on the post "%s" is waiting for your approval'), $post->post_title ) . "\r\n";
1584
-			$notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
1583
+			$notify_message  = sprintf(__('A new pingback on the post "%s" is waiting for your approval'), $post->post_title)."\r\n";
1584
+			$notify_message .= get_permalink($comment->comment_post_ID)."\r\n\r\n";
1585 1585
 			/* translators: 1: website name, 2: website IP, 3: website hostname */
1586
-			$notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
1587
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
1588
-			$notify_message .= __('Pingback excerpt: ') . "\r\n" . $comment_content . "\r\n\r\n";
1586
+			$notify_message .= sprintf(__('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain)."\r\n";
1587
+			$notify_message .= sprintf(__('URL: %s'), $comment->comment_author_url)."\r\n";
1588
+			$notify_message .= __('Pingback excerpt: ')."\r\n".$comment_content."\r\n\r\n";
1589 1589
 			break;
1590 1590
 		default: // Comments
1591
-			$notify_message  = sprintf( __('A new comment on the post "%s" is waiting for your approval'), $post->post_title ) . "\r\n";
1592
-			$notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
1593
-			$notify_message .= sprintf( __( 'Author: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
1594
-			$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
1595
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
1596
-			$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
1591
+			$notify_message  = sprintf(__('A new comment on the post "%s" is waiting for your approval'), $post->post_title)."\r\n";
1592
+			$notify_message .= get_permalink($comment->comment_post_ID)."\r\n\r\n";
1593
+			$notify_message .= sprintf(__('Author: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain)."\r\n";
1594
+			$notify_message .= sprintf(__('Email: %s'), $comment->comment_author_email)."\r\n";
1595
+			$notify_message .= sprintf(__('URL: %s'), $comment->comment_author_url)."\r\n";
1596
+			$notify_message .= sprintf(__('Comment: %s'), "\r\n".$comment_content)."\r\n\r\n";
1597 1597
 			break;
1598 1598
 	}
1599 1599
 
1600
-	$notify_message .= sprintf( __( 'Approve it: %s' ), admin_url( "comment.php?action=approve&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1600
+	$notify_message .= sprintf(__('Approve it: %s'), admin_url("comment.php?action=approve&c={$comment_id}#wpbody-content"))."\r\n";
1601 1601
 
1602
-	if ( EMPTY_TRASH_DAYS )
1603
-		$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1602
+	if (EMPTY_TRASH_DAYS)
1603
+		$notify_message .= sprintf(__('Trash it: %s'), admin_url("comment.php?action=trash&c={$comment_id}#wpbody-content"))."\r\n";
1604 1604
 	else
1605
-		$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1605
+		$notify_message .= sprintf(__('Delete it: %s'), admin_url("comment.php?action=delete&c={$comment_id}#wpbody-content"))."\r\n";
1606 1606
 
1607
-	$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1607
+	$notify_message .= sprintf(__('Spam it: %s'), admin_url("comment.php?action=spam&c={$comment_id}#wpbody-content"))."\r\n";
1608 1608
 
1609
-	$notify_message .= sprintf( _n('Currently %s comment is waiting for approval. Please visit the moderation panel:',
1610
- 		'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n";
1611
-	$notify_message .= admin_url( "edit-comments.php?comment_status=moderated#wpbody-content" ) . "\r\n";
1609
+	$notify_message .= sprintf(_n('Currently %s comment is waiting for approval. Please visit the moderation panel:',
1610
+ 		'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting))."\r\n";
1611
+	$notify_message .= admin_url("edit-comments.php?comment_status=moderated#wpbody-content")."\r\n";
1612 1612
 
1613
-	$subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title );
1613
+	$subject = sprintf(__('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title);
1614 1614
 	$message_headers = '';
1615 1615
 
1616 1616
 	/**
@@ -1621,7 +1621,7 @@  discard block
 block discarded – undo
1621 1621
 	 * @param array $emails     List of email addresses to notify for comment moderation.
1622 1622
 	 * @param int   $comment_id Comment ID.
1623 1623
 	 */
1624
-	$emails = apply_filters( 'comment_moderation_recipients', $emails, $comment_id );
1624
+	$emails = apply_filters('comment_moderation_recipients', $emails, $comment_id);
1625 1625
 
1626 1626
 	/**
1627 1627
 	 * Filter the comment moderation email text.
@@ -1631,7 +1631,7 @@  discard block
 block discarded – undo
1631 1631
 	 * @param string $notify_message Text of the comment moderation email.
1632 1632
 	 * @param int    $comment_id     Comment ID.
1633 1633
 	 */
1634
-	$notify_message = apply_filters( 'comment_moderation_text', $notify_message, $comment_id );
1634
+	$notify_message = apply_filters('comment_moderation_text', $notify_message, $comment_id);
1635 1635
 
1636 1636
 	/**
1637 1637
 	 * Filter the comment moderation email subject.
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 	 * @param string $subject    Subject of the comment moderation email.
1642 1642
 	 * @param int    $comment_id Comment ID.
1643 1643
 	 */
1644
-	$subject = apply_filters( 'comment_moderation_subject', $subject, $comment_id );
1644
+	$subject = apply_filters('comment_moderation_subject', $subject, $comment_id);
1645 1645
 
1646 1646
 	/**
1647 1647
 	 * Filter the comment moderation email headers.
@@ -1651,17 +1651,17 @@  discard block
 block discarded – undo
1651 1651
 	 * @param string $message_headers Headers for the comment moderation email.
1652 1652
 	 * @param int    $comment_id      Comment ID.
1653 1653
 	 */
1654
-	$message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id );
1654
+	$message_headers = apply_filters('comment_moderation_headers', $message_headers, $comment_id);
1655 1655
 
1656
-	foreach ( $emails as $email ) {
1657
-		@wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
1656
+	foreach ($emails as $email) {
1657
+		@wp_mail($email, wp_specialchars_decode($subject), $notify_message, $message_headers);
1658 1658
 	}
1659 1659
 
1660 1660
 	return true;
1661 1661
 }
1662 1662
 endif;
1663 1663
 
1664
-if ( !function_exists('wp_password_change_notification') ) :
1664
+if ( ! function_exists('wp_password_change_notification')) :
1665 1665
 /**
1666 1666
  * Notify the blog admin of a user changing password, normally via email.
1667 1667
  *
@@ -1669,11 +1669,11 @@  discard block
 block discarded – undo
1669 1669
  *
1670 1670
  * @param WP_User $user User object.
1671 1671
  */
1672
-function wp_password_change_notification( $user ) {
1672
+function wp_password_change_notification($user) {
1673 1673
 	// send a copy of password change notification to the admin
1674 1674
 	// but check to see if it's the admin whose password we're changing, and skip this
1675
-	if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
1676
-		$message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n";
1675
+	if (0 !== strcasecmp($user->user_email, get_option('admin_email'))) {
1676
+		$message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login)."\r\n";
1677 1677
 		// The blogname option is escaped with esc_html on the way into the database in sanitize_option
1678 1678
 		// we want to reverse this for the plain text arena of emails.
1679 1679
 		$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
 }
1683 1683
 endif;
1684 1684
 
1685
-if ( !function_exists('wp_new_user_notification') ) :
1685
+if ( ! function_exists('wp_new_user_notification')) :
1686 1686
 /**
1687 1687
  * Email login credentials to a newly-registered user.
1688 1688
  *
@@ -1700,54 +1700,54 @@  discard block
 block discarded – undo
1700 1700
  * @param string $notify     Optional. Type of notification that should happen. Accepts 'admin' or an empty
1701 1701
  *                           string (admin only), or 'both' (admin and user). Default empty.
1702 1702
  */
1703
-function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
1704
-	if ( $deprecated !== null ) {
1705
-		_deprecated_argument( __FUNCTION__, '4.3.1' );
1703
+function wp_new_user_notification($user_id, $deprecated = null, $notify = '') {
1704
+	if ($deprecated !== null) {
1705
+		_deprecated_argument(__FUNCTION__, '4.3.1');
1706 1706
 	}
1707 1707
 
1708 1708
 	global $wpdb, $wp_hasher;
1709
-	$user = get_userdata( $user_id );
1709
+	$user = get_userdata($user_id);
1710 1710
 
1711 1711
 	// The blogname option is escaped with esc_html on the way into the database in sanitize_option
1712 1712
 	// we want to reverse this for the plain text arena of emails.
1713 1713
 	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
1714 1714
 
1715
-	$message  = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
1716
-	$message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
1717
-	$message .= sprintf(__('Email: %s'), $user->user_email) . "\r\n";
1715
+	$message  = sprintf(__('New user registration on your site %s:'), $blogname)."\r\n\r\n";
1716
+	$message .= sprintf(__('Username: %s'), $user->user_login)."\r\n\r\n";
1717
+	$message .= sprintf(__('Email: %s'), $user->user_email)."\r\n";
1718 1718
 
1719 1719
 	@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
1720 1720
 
1721 1721
 	// `$deprecated was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notifcation.
1722
-	if ( 'admin' === $notify || ( empty( $deprecated ) && empty( $notify ) ) ) {
1722
+	if ('admin' === $notify || (empty($deprecated) && empty($notify))) {
1723 1723
 		return;
1724 1724
 	}
1725 1725
 
1726 1726
 	// Generate something random for a password reset key.
1727
-	$key = wp_generate_password( 20, false );
1727
+	$key = wp_generate_password(20, false);
1728 1728
 
1729 1729
 	/** This action is documented in wp-login.php */
1730
-	do_action( 'retrieve_password_key', $user->user_login, $key );
1730
+	do_action('retrieve_password_key', $user->user_login, $key);
1731 1731
 
1732 1732
 	// Now insert the key, hashed, into the DB.
1733
-	if ( empty( $wp_hasher ) ) {
1734
-		require_once ABSPATH . WPINC . '/class-phpass.php';
1735
-		$wp_hasher = new PasswordHash( 8, true );
1733
+	if (empty($wp_hasher)) {
1734
+		require_once ABSPATH.WPINC.'/class-phpass.php';
1735
+		$wp_hasher = new PasswordHash(8, true);
1736 1736
 	}
1737
-	$hashed = time() . ':' . $wp_hasher->HashPassword( $key );
1738
-	$wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user->user_login ) );
1737
+	$hashed = time().':'.$wp_hasher->HashPassword($key);
1738
+	$wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $user->user_login));
1739 1739
 
1740
-	$message = sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
1741
-	$message .= __('To set your password, visit the following address:') . "\r\n\r\n";
1742
-	$message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login), 'login') . ">\r\n\r\n";
1740
+	$message = sprintf(__('Username: %s'), $user->user_login)."\r\n\r\n";
1741
+	$message .= __('To set your password, visit the following address:')."\r\n\r\n";
1742
+	$message .= '<'.network_site_url("wp-login.php?action=rp&key=$key&login=".rawurlencode($user->user_login), 'login').">\r\n\r\n";
1743 1743
 
1744
-	$message .= wp_login_url() . "\r\n";
1744
+	$message .= wp_login_url()."\r\n";
1745 1745
 
1746 1746
 	wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message);
1747 1747
 }
1748 1748
 endif;
1749 1749
 
1750
-if ( !function_exists('wp_nonce_tick') ) :
1750
+if ( ! function_exists('wp_nonce_tick')) :
1751 1751
 /**
1752 1752
  * Get the time-dependent variable for nonce creation.
1753 1753
  *
@@ -1766,13 +1766,13 @@  discard block
 block discarded – undo
1766 1766
 	 *
1767 1767
 	 * @param int $lifespan Lifespan of nonces in seconds. Default 86,400 seconds, or one day.
1768 1768
 	 */
1769
-	$nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS );
1769
+	$nonce_life = apply_filters('nonce_life', DAY_IN_SECONDS);
1770 1770
 
1771
-	return ceil(time() / ( $nonce_life / 2 ));
1771
+	return ceil(time() / ($nonce_life / 2));
1772 1772
 }
1773 1773
 endif;
1774 1774
 
1775
-if ( !function_exists('wp_verify_nonce') ) :
1775
+if ( ! function_exists('wp_verify_nonce')) :
1776 1776
 /**
1777 1777
  * Verify that correct nonce was used with time limit.
1778 1778
  *
@@ -1786,11 +1786,11 @@  discard block
 block discarded – undo
1786 1786
  * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
1787 1787
  *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
1788 1788
  */
1789
-function wp_verify_nonce( $nonce, $action = -1 ) {
1789
+function wp_verify_nonce($nonce, $action = -1) {
1790 1790
 	$nonce = (string) $nonce;
1791 1791
 	$user = wp_get_current_user();
1792 1792
 	$uid = (int) $user->ID;
1793
-	if ( ! $uid ) {
1793
+	if ( ! $uid) {
1794 1794
 		/**
1795 1795
 		 * Filter whether the user who generated the nonce is logged out.
1796 1796
 		 *
@@ -1799,10 +1799,10 @@  discard block
 block discarded – undo
1799 1799
 		 * @param int    $uid    ID of the nonce-owning user.
1800 1800
 		 * @param string $action The nonce action.
1801 1801
 		 */
1802
-		$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
1802
+		$uid = apply_filters('nonce_user_logged_out', $uid, $action);
1803 1803
 	}
1804 1804
 
1805
-	if ( empty( $nonce ) ) {
1805
+	if (empty($nonce)) {
1806 1806
 		return false;
1807 1807
 	}
1808 1808
 
@@ -1810,14 +1810,14 @@  discard block
 block discarded – undo
1810 1810
 	$i = wp_nonce_tick();
1811 1811
 
1812 1812
 	// Nonce generated 0-12 hours ago
1813
-	$expected = substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10 );
1814
-	if ( hash_equals( $expected, $nonce ) ) {
1813
+	$expected = substr(wp_hash($i.'|'.$action.'|'.$uid.'|'.$token, 'nonce'), -12, 10);
1814
+	if (hash_equals($expected, $nonce)) {
1815 1815
 		return 1;
1816 1816
 	}
1817 1817
 
1818 1818
 	// Nonce generated 12-24 hours ago
1819
-	$expected = substr( wp_hash( ( $i - 1 ) . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
1820
-	if ( hash_equals( $expected, $nonce ) ) {
1819
+	$expected = substr(wp_hash(($i - 1).'|'.$action.'|'.$uid.'|'.$token, 'nonce'), -12, 10);
1820
+	if (hash_equals($expected, $nonce)) {
1821 1821
 		return 2;
1822 1822
 	}
1823 1823
 
@@ -1831,14 +1831,14 @@  discard block
 block discarded – undo
1831 1831
 	 * @param WP_User    $user   The current user object.
1832 1832
 	 * @param string     $token  The user's session token.
1833 1833
 	 */
1834
-	do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token );
1834
+	do_action('wp_verify_nonce_failed', $nonce, $action, $user, $token);
1835 1835
 
1836 1836
 	// Invalid nonce
1837 1837
 	return false;
1838 1838
 }
1839 1839
 endif;
1840 1840
 
1841
-if ( !function_exists('wp_create_nonce') ) :
1841
+if ( ! function_exists('wp_create_nonce')) :
1842 1842
 /**
1843 1843
  * Creates a cryptographic token tied to a specific action, user, user session,
1844 1844
  * and window of time.
@@ -1852,19 +1852,19 @@  discard block
 block discarded – undo
1852 1852
 function wp_create_nonce($action = -1) {
1853 1853
 	$user = wp_get_current_user();
1854 1854
 	$uid = (int) $user->ID;
1855
-	if ( ! $uid ) {
1855
+	if ( ! $uid) {
1856 1856
 		/** This filter is documented in wp-includes/pluggable.php */
1857
-		$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
1857
+		$uid = apply_filters('nonce_user_logged_out', $uid, $action);
1858 1858
 	}
1859 1859
 
1860 1860
 	$token = wp_get_session_token();
1861 1861
 	$i = wp_nonce_tick();
1862 1862
 
1863
-	return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
1863
+	return substr(wp_hash($i.'|'.$action.'|'.$uid.'|'.$token, 'nonce'), -12, 10);
1864 1864
 }
1865 1865
 endif;
1866 1866
 
1867
-if ( !function_exists('wp_salt') ) :
1867
+if ( ! function_exists('wp_salt')) :
1868 1868
 /**
1869 1869
  * Get salt to add to hashes.
1870 1870
  *
@@ -1900,9 +1900,9 @@  discard block
 block discarded – undo
1900 1900
  * @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce)
1901 1901
  * @return string Salt value
1902 1902
  */
1903
-function wp_salt( $scheme = 'auth' ) {
1903
+function wp_salt($scheme = 'auth') {
1904 1904
 	static $cached_salts = array();
1905
-	if ( isset( $cached_salts[ $scheme ] ) ) {
1905
+	if (isset($cached_salts[$scheme])) {
1906 1906
 		/**
1907 1907
 		 * Filter the WordPress salt.
1908 1908
 		 *
@@ -1912,19 +1912,19 @@  discard block
 block discarded – undo
1912 1912
 		 * @param string $scheme      Authentication scheme. Values include 'auth',
1913 1913
 		 *                            'secure_auth', 'logged_in', and 'nonce'.
1914 1914
 		 */
1915
-		return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
1915
+		return apply_filters('salt', $cached_salts[$scheme], $scheme);
1916 1916
 	}
1917 1917
 
1918 1918
 	static $duplicated_keys;
1919
-	if ( null === $duplicated_keys ) {
1920
-		$duplicated_keys = array( 'put your unique phrase here' => true );
1921
-		foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
1922
-			foreach ( array( 'KEY', 'SALT' ) as $second ) {
1923
-				if ( ! defined( "{$first}_{$second}" ) ) {
1919
+	if (null === $duplicated_keys) {
1920
+		$duplicated_keys = array('put your unique phrase here' => true);
1921
+		foreach (array('AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET') as $first) {
1922
+			foreach (array('KEY', 'SALT') as $second) {
1923
+				if ( ! defined("{$first}_{$second}")) {
1924 1924
 					continue;
1925 1925
 				}
1926
-				$value = constant( "{$first}_{$second}" );
1927
-				$duplicated_keys[ $value ] = isset( $duplicated_keys[ $value ] );
1926
+				$value = constant("{$first}_{$second}");
1927
+				$duplicated_keys[$value] = isset($duplicated_keys[$value]);
1928 1928
 			}
1929 1929
 		}
1930 1930
 	}
@@ -1933,45 +1933,45 @@  discard block
 block discarded – undo
1933 1933
 		'key' => '',
1934 1934
 		'salt' => ''
1935 1935
 	);
1936
-	if ( defined( 'SECRET_KEY' ) && SECRET_KEY && empty( $duplicated_keys[ SECRET_KEY ] ) ) {
1936
+	if (defined('SECRET_KEY') && SECRET_KEY && empty($duplicated_keys[SECRET_KEY])) {
1937 1937
 		$values['key'] = SECRET_KEY;
1938 1938
 	}
1939
-	if ( 'auth' == $scheme && defined( 'SECRET_SALT' ) && SECRET_SALT && empty( $duplicated_keys[ SECRET_SALT ] ) ) {
1939
+	if ('auth' == $scheme && defined('SECRET_SALT') && SECRET_SALT && empty($duplicated_keys[SECRET_SALT])) {
1940 1940
 		$values['salt'] = SECRET_SALT;
1941 1941
 	}
1942 1942
 
1943
-	if ( in_array( $scheme, array( 'auth', 'secure_auth', 'logged_in', 'nonce' ) ) ) {
1944
-		foreach ( array( 'key', 'salt' ) as $type ) {
1945
-			$const = strtoupper( "{$scheme}_{$type}" );
1946
-			if ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) {
1947
-				$values[ $type ] = constant( $const );
1948
-			} elseif ( ! $values[ $type ] ) {
1949
-				$values[ $type ] = get_site_option( "{$scheme}_{$type}" );
1950
-				if ( ! $values[ $type ] ) {
1951
-					$values[ $type ] = wp_generate_password( 64, true, true );
1952
-					update_site_option( "{$scheme}_{$type}", $values[ $type ] );
1943
+	if (in_array($scheme, array('auth', 'secure_auth', 'logged_in', 'nonce'))) {
1944
+		foreach (array('key', 'salt') as $type) {
1945
+			$const = strtoupper("{$scheme}_{$type}");
1946
+			if (defined($const) && constant($const) && empty($duplicated_keys[constant($const)])) {
1947
+				$values[$type] = constant($const);
1948
+			} elseif ( ! $values[$type]) {
1949
+				$values[$type] = get_site_option("{$scheme}_{$type}");
1950
+				if ( ! $values[$type]) {
1951
+					$values[$type] = wp_generate_password(64, true, true);
1952
+					update_site_option("{$scheme}_{$type}", $values[$type]);
1953 1953
 				}
1954 1954
 			}
1955 1955
 		}
1956 1956
 	} else {
1957
-		if ( ! $values['key'] ) {
1958
-			$values['key'] = get_site_option( 'secret_key' );
1959
-			if ( ! $values['key'] ) {
1960
-				$values['key'] = wp_generate_password( 64, true, true );
1961
-				update_site_option( 'secret_key', $values['key'] );
1957
+		if ( ! $values['key']) {
1958
+			$values['key'] = get_site_option('secret_key');
1959
+			if ( ! $values['key']) {
1960
+				$values['key'] = wp_generate_password(64, true, true);
1961
+				update_site_option('secret_key', $values['key']);
1962 1962
 			}
1963 1963
 		}
1964
-		$values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
1964
+		$values['salt'] = hash_hmac('md5', $scheme, $values['key']);
1965 1965
 	}
1966 1966
 
1967
-	$cached_salts[ $scheme ] = $values['key'] . $values['salt'];
1967
+	$cached_salts[$scheme] = $values['key'].$values['salt'];
1968 1968
 
1969 1969
 	/** This filter is documented in wp-includes/pluggable.php */
1970
-	return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
1970
+	return apply_filters('salt', $cached_salts[$scheme], $scheme);
1971 1971
 }
1972 1972
 endif;
1973 1973
 
1974
-if ( !function_exists('wp_hash') ) :
1974
+if ( ! function_exists('wp_hash')) :
1975 1975
 /**
1976 1976
  * Get hash of given string.
1977 1977
  *
@@ -1988,7 +1988,7 @@  discard block
 block discarded – undo
1988 1988
 }
1989 1989
 endif;
1990 1990
 
1991
-if ( !function_exists('wp_hash_password') ) :
1991
+if ( ! function_exists('wp_hash_password')) :
1992 1992
 /**
1993 1993
  * Create a hash (encrypt) of a plain text password.
1994 1994
  *
@@ -2005,17 +2005,17 @@  discard block
 block discarded – undo
2005 2005
 function wp_hash_password($password) {
2006 2006
 	global $wp_hasher;
2007 2007
 
2008
-	if ( empty($wp_hasher) ) {
2009
-		require_once( ABSPATH . WPINC . '/class-phpass.php');
2008
+	if (empty($wp_hasher)) {
2009
+		require_once(ABSPATH.WPINC.'/class-phpass.php');
2010 2010
 		// By default, use the portable hash from phpass
2011 2011
 		$wp_hasher = new PasswordHash(8, true);
2012 2012
 	}
2013 2013
 
2014
-	return $wp_hasher->HashPassword( trim( $password ) );
2014
+	return $wp_hasher->HashPassword(trim($password));
2015 2015
 }
2016 2016
 endif;
2017 2017
 
2018
-if ( !function_exists('wp_check_password') ) :
2018
+if ( ! function_exists('wp_check_password')) :
2019 2019
 /**
2020 2020
  * Checks the plaintext password against the encrypted Password.
2021 2021
  *
@@ -2042,9 +2042,9 @@  discard block
 block discarded – undo
2042 2042
 	global $wp_hasher;
2043 2043
 
2044 2044
 	// If the hash is still md5...
2045
-	if ( strlen($hash) <= 32 ) {
2046
-		$check = hash_equals( $hash, md5( $password ) );
2047
-		if ( $check && $user_id ) {
2045
+	if (strlen($hash) <= 32) {
2046
+		$check = hash_equals($hash, md5($password));
2047
+		if ($check && $user_id) {
2048 2048
 			// Rehash using new hash.
2049 2049
 			wp_set_password($password, $user_id);
2050 2050
 			$hash = wp_hash_password($password);
@@ -2060,13 +2060,13 @@  discard block
 block discarded – undo
2060 2060
 		 * @param string     $hash     The hashed password.
2061 2061
 		 * @param string|int $user_id  User ID. Can be empty.
2062 2062
 		 */
2063
-		return apply_filters( 'check_password', $check, $password, $hash, $user_id );
2063
+		return apply_filters('check_password', $check, $password, $hash, $user_id);
2064 2064
 	}
2065 2065
 
2066 2066
 	// If the stored hash is longer than an MD5, presume the
2067 2067
 	// new style phpass portable hash.
2068
-	if ( empty($wp_hasher) ) {
2069
-		require_once( ABSPATH . WPINC . '/class-phpass.php');
2068
+	if (empty($wp_hasher)) {
2069
+		require_once(ABSPATH.WPINC.'/class-phpass.php');
2070 2070
 		// By default, use the portable hash from phpass
2071 2071
 		$wp_hasher = new PasswordHash(8, true);
2072 2072
 	}
@@ -2074,11 +2074,11 @@  discard block
 block discarded – undo
2074 2074
 	$check = $wp_hasher->CheckPassword($password, $hash);
2075 2075
 
2076 2076
 	/** This filter is documented in wp-includes/pluggable.php */
2077
-	return apply_filters( 'check_password', $check, $password, $hash, $user_id );
2077
+	return apply_filters('check_password', $check, $password, $hash, $user_id);
2078 2078
 }
2079 2079
 endif;
2080 2080
 
2081
-if ( !function_exists('wp_generate_password') ) :
2081
+if ( ! function_exists('wp_generate_password')) :
2082 2082
 /**
2083 2083
  * Generates a random password drawn from the defined set of characters.
2084 2084
  *
@@ -2091,15 +2091,15 @@  discard block
 block discarded – undo
2091 2091
  *                                  Used when generating secret keys and salts. Default false.
2092 2092
  * @return string The random password.
2093 2093
  */
2094
-function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) {
2094
+function wp_generate_password($length = 12, $special_chars = true, $extra_special_chars = false) {
2095 2095
 	$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
2096
-	if ( $special_chars )
2096
+	if ($special_chars)
2097 2097
 		$chars .= '!@#$%^&*()';
2098
-	if ( $extra_special_chars )
2098
+	if ($extra_special_chars)
2099 2099
 		$chars .= '-_ []{}<>~`+=,.;:/?|';
2100 2100
 
2101 2101
 	$password = '';
2102
-	for ( $i = 0; $i < $length; $i++ ) {
2102
+	for ($i = 0; $i < $length; $i++) {
2103 2103
 		$password .= substr($chars, wp_rand(0, strlen($chars) - 1), 1);
2104 2104
 	}
2105 2105
 
@@ -2110,11 +2110,11 @@  discard block
 block discarded – undo
2110 2110
 	 *
2111 2111
 	 * @param string $password The generated password.
2112 2112
 	 */
2113
-	return apply_filters( 'random_password', $password );
2113
+	return apply_filters('random_password', $password);
2114 2114
 }
2115 2115
 endif;
2116 2116
 
2117
-if ( !function_exists('wp_rand') ) :
2117
+if ( ! function_exists('wp_rand')) :
2118 2118
 /**
2119 2119
  * Generates a random number
2120 2120
  *
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
  * @param int $max Upper limit for the generated number
2130 2130
  * @return int A random number between min and max
2131 2131
  */
2132
-function wp_rand( $min = 0, $max = 0 ) {
2132
+function wp_rand($min = 0, $max = 0) {
2133 2133
 	global $rnd_value;
2134 2134
 
2135 2135
 	// Some misconfigured 32bit environments (Entropy PHP, for example) truncate integers larger than PHP_INT_MAX to PHP_INT_MAX rather than overflowing them to floats.
@@ -2141,38 +2141,38 @@  discard block
 block discarded – undo
2141 2141
 
2142 2142
 	// Use PHP's CSPRNG, or a compatible method
2143 2143
 	static $use_random_int_functionality = true;
2144
-	if ( $use_random_int_functionality ) {
2144
+	if ($use_random_int_functionality) {
2145 2145
 		try {
2146
-			$_max = ( 0 != $max ) ? $max : $max_random_number;
2146
+			$_max = (0 != $max) ? $max : $max_random_number;
2147 2147
 			// wp_rand() can accept arguments in either order, PHP cannot.
2148
-			$_max = max( $min, $_max );
2149
-			$_min = min( $min, $_max );
2150
-			$val = random_int( $_min, $_max );
2151
-			if ( false !== $val ) {
2152
-				return absint( $val );
2148
+			$_max = max($min, $_max);
2149
+			$_min = min($min, $_max);
2150
+			$val = random_int($_min, $_max);
2151
+			if (false !== $val) {
2152
+				return absint($val);
2153 2153
 			} else {
2154 2154
 				$use_random_int_functionality = false;
2155 2155
 			}
2156
-		} catch ( Error $e ) {
2156
+		} catch (Error $e) {
2157 2157
 			$use_random_int_functionality = false;
2158
-		} catch ( Exception $e ) {
2158
+		} catch (Exception $e) {
2159 2159
 			$use_random_int_functionality = false;
2160 2160
 		}
2161 2161
 	}
2162 2162
 
2163 2163
 	// Reset $rnd_value after 14 uses
2164 2164
 	// 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value
2165
-	if ( strlen($rnd_value) < 8 ) {
2166
-		if ( defined( 'WP_SETUP_CONFIG' ) )
2165
+	if (strlen($rnd_value) < 8) {
2166
+		if (defined('WP_SETUP_CONFIG'))
2167 2167
 			static $seed = '';
2168 2168
 		else
2169 2169
 			$seed = get_transient('random_seed');
2170
-		$rnd_value = md5( uniqid(microtime() . mt_rand(), true ) . $seed );
2170
+		$rnd_value = md5(uniqid(microtime().mt_rand(), true).$seed);
2171 2171
 		$rnd_value .= sha1($rnd_value);
2172
-		$rnd_value .= sha1($rnd_value . $seed);
2173
-		$seed = md5($seed . $rnd_value);
2174
-		if ( ! defined( 'WP_SETUP_CONFIG' ) && ! defined( 'WP_INSTALLING' ) ) {
2175
-			set_transient( 'random_seed', $seed );
2172
+		$rnd_value .= sha1($rnd_value.$seed);
2173
+		$seed = md5($seed.$rnd_value);
2174
+		if ( ! defined('WP_SETUP_CONFIG') && ! defined('WP_INSTALLING')) {
2175
+			set_transient('random_seed', $seed);
2176 2176
 		}
2177 2177
 	}
2178 2178
 
@@ -2185,14 +2185,14 @@  discard block
 block discarded – undo
2185 2185
 	$value = abs(hexdec($value));
2186 2186
 
2187 2187
 	// Reduce the value to be within the min - max range
2188
-	if ( $max != 0 )
2189
-		$value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 );
2188
+	if ($max != 0)
2189
+		$value = $min + ($max - $min + 1) * $value / ($max_random_number + 1);
2190 2190
 
2191 2191
 	return abs(intval($value));
2192 2192
 }
2193 2193
 endif;
2194 2194
 
2195
-if ( !function_exists('wp_set_password') ) :
2195
+if ( ! function_exists('wp_set_password')) :
2196 2196
 /**
2197 2197
  * Updates the user's password with a new encrypted one.
2198 2198
  *
@@ -2210,17 +2210,17 @@  discard block
 block discarded – undo
2210 2210
  * @param string $password The plaintext new user password
2211 2211
  * @param int    $user_id  User ID
2212 2212
  */
2213
-function wp_set_password( $password, $user_id ) {
2213
+function wp_set_password($password, $user_id) {
2214 2214
 	global $wpdb;
2215 2215
 
2216
-	$hash = wp_hash_password( $password );
2217
-	$wpdb->update($wpdb->users, array('user_pass' => $hash, 'user_activation_key' => ''), array('ID' => $user_id) );
2216
+	$hash = wp_hash_password($password);
2217
+	$wpdb->update($wpdb->users, array('user_pass' => $hash, 'user_activation_key' => ''), array('ID' => $user_id));
2218 2218
 
2219 2219
 	wp_cache_delete($user_id, 'users');
2220 2220
 }
2221 2221
 endif;
2222 2222
 
2223
-if ( !function_exists( 'get_avatar' ) ) :
2223
+if ( ! function_exists('get_avatar')) :
2224 2224
 /**
2225 2225
  * Retrieve the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post.
2226 2226
  *
@@ -2255,15 +2255,15 @@  discard block
 block discarded – undo
2255 2255
  * }
2256 2256
  * @return false|string `<img>` tag for the user's avatar. False on failure.
2257 2257
  */
2258
-function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = null ) {
2258
+function get_avatar($id_or_email, $size = 96, $default = '', $alt = '', $args = null) {
2259 2259
 	$defaults = array(
2260 2260
 		// get_avatar_data() args.
2261 2261
 		'size'          => 96,
2262 2262
 		'height'        => null,
2263 2263
 		'width'         => null,
2264
-		'default'       => get_option( 'avatar_default', 'mystery' ),
2264
+		'default'       => get_option('avatar_default', 'mystery'),
2265 2265
 		'force_default' => false,
2266
-		'rating'        => get_option( 'avatar_rating' ),
2266
+		'rating'        => get_option('avatar_rating'),
2267 2267
 		'scheme'        => null,
2268 2268
 		'alt'           => '',
2269 2269
 		'class'         => null,
@@ -2271,7 +2271,7 @@  discard block
 block discarded – undo
2271 2271
 		'extra_attr'    => '',
2272 2272
 	);
2273 2273
 
2274
-	if ( empty( $args ) ) {
2274
+	if (empty($args)) {
2275 2275
 		$args = array();
2276 2276
 	}
2277 2277
 
@@ -2279,17 +2279,17 @@  discard block
 block discarded – undo
2279 2279
 	$args['default'] = $default;
2280 2280
 	$args['alt']     = $alt;
2281 2281
 
2282
-	$args = wp_parse_args( $args, $defaults );
2282
+	$args = wp_parse_args($args, $defaults);
2283 2283
 
2284
-	if ( empty( $args['height'] ) ) {
2284
+	if (empty($args['height'])) {
2285 2285
 		$args['height'] = $args['size'];
2286 2286
 	}
2287
-	if ( empty( $args['width'] ) ) {
2287
+	if (empty($args['width'])) {
2288 2288
 		$args['width'] = $args['size'];
2289 2289
 	}
2290 2290
 
2291
-	if ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) {
2292
-		$id_or_email = get_comment( $id_or_email );
2291
+	if (is_object($id_or_email) && isset($id_or_email->comment_ID)) {
2292
+		$id_or_email = get_comment($id_or_email);
2293 2293
 	}
2294 2294
 
2295 2295
 	/**
@@ -2305,36 +2305,36 @@  discard block
 block discarded – undo
2305 2305
 	 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
2306 2306
 	 * @param array  $args        Arguments passed to get_avatar_url(), after processing.
2307 2307
 	 */
2308
-	$avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args );
2308
+	$avatar = apply_filters('pre_get_avatar', null, $id_or_email, $args);
2309 2309
 
2310
-	if ( ! is_null( $avatar ) ) {
2310
+	if ( ! is_null($avatar)) {
2311 2311
 		/** This filter is documented in wp-includes/pluggable.php */
2312
-		return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
2312
+		return apply_filters('get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args);
2313 2313
 	}
2314 2314
 
2315
-	if ( ! $args['force_display'] && ! get_option( 'show_avatars' ) ) {
2315
+	if ( ! $args['force_display'] && ! get_option('show_avatars')) {
2316 2316
 		return false;
2317 2317
 	}
2318 2318
 
2319
-	$url2x = get_avatar_url( $id_or_email, array_merge( $args, array( 'size' => $args['size'] * 2 ) ) );
2319
+	$url2x = get_avatar_url($id_or_email, array_merge($args, array('size' => $args['size'] * 2)));
2320 2320
 
2321
-	$args = get_avatar_data( $id_or_email, $args );
2321
+	$args = get_avatar_data($id_or_email, $args);
2322 2322
 
2323 2323
 	$url = $args['url'];
2324 2324
 
2325
-	if ( ! $url || is_wp_error( $url ) ) {
2325
+	if ( ! $url || is_wp_error($url)) {
2326 2326
 		return false;
2327 2327
 	}
2328 2328
 
2329
-	$class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );
2329
+	$class = array('avatar', 'avatar-'.(int) $args['size'], 'photo');
2330 2330
 
2331
-	if ( ! $args['found_avatar'] || $args['force_default'] ) {
2331
+	if ( ! $args['found_avatar'] || $args['force_default']) {
2332 2332
 		$class[] = 'avatar-default';
2333 2333
 	}
2334 2334
 
2335
-	if ( $args['class'] ) {
2336
-		if ( is_array( $args['class'] ) ) {
2337
-			$class = array_merge( $class, $args['class'] );
2335
+	if ($args['class']) {
2336
+		if (is_array($args['class'])) {
2337
+			$class = array_merge($class, $args['class']);
2338 2338
 		} else {
2339 2339
 			$class[] = $args['class'];
2340 2340
 		}
@@ -2342,10 +2342,10 @@  discard block
 block discarded – undo
2342 2342
 
2343 2343
 	$avatar = sprintf(
2344 2344
 		"<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>",
2345
-		esc_attr( $args['alt'] ),
2346
-		esc_url( $url ),
2347
-		esc_attr( "$url2x 2x" ),
2348
-		esc_attr( join( ' ', $class ) ),
2345
+		esc_attr($args['alt']),
2346
+		esc_url($url),
2347
+		esc_attr("$url2x 2x"),
2348
+		esc_attr(join(' ', $class)),
2349 2349
 		(int) $args['height'],
2350 2350
 		(int) $args['width'],
2351 2351
 		$args['extra_attr']
@@ -2365,11 +2365,11 @@  discard block
 block discarded – undo
2365 2365
 	 *                                       Default empty.
2366 2366
 	 * @param array  $args        Arguments passed to get_avatar_data(), after processing.
2367 2367
 	 */
2368
-	return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
2368
+	return apply_filters('get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args);
2369 2369
 }
2370 2370
 endif;
2371 2371
 
2372
-if ( !function_exists( 'wp_text_diff' ) ) :
2372
+if ( ! function_exists('wp_text_diff')) :
2373 2373
 /**
2374 2374
  * Displays a human readable HTML representation of the difference between two strings.
2375 2375
  *
@@ -2397,12 +2397,12 @@  discard block
 block discarded – undo
2397 2397
  * @param string|array $args         Optional. Change 'title', 'title_left', and 'title_right' defaults.
2398 2398
  * @return string Empty string if strings are equivalent or HTML with differences.
2399 2399
  */
2400
-function wp_text_diff( $left_string, $right_string, $args = null ) {
2401
-	$defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' );
2402
-	$args = wp_parse_args( $args, $defaults );
2400
+function wp_text_diff($left_string, $right_string, $args = null) {
2401
+	$defaults = array('title' => '', 'title_left' => '', 'title_right' => '');
2402
+	$args = wp_parse_args($args, $defaults);
2403 2403
 
2404
-	if ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) )
2405
-		require( ABSPATH . WPINC . '/wp-diff.php' );
2404
+	if ( ! class_exists('WP_Text_Diff_Renderer_Table', false))
2405
+		require(ABSPATH.WPINC.'/wp-diff.php');
2406 2406
 
2407 2407
 	$left_string  = normalize_whitespace($left_string);
2408 2408
 	$right_string = normalize_whitespace($right_string);
@@ -2410,31 +2410,31 @@  discard block
 block discarded – undo
2410 2410
 	$left_lines  = explode("\n", $left_string);
2411 2411
 	$right_lines = explode("\n", $right_string);
2412 2412
 	$text_diff = new Text_Diff($left_lines, $right_lines);
2413
-	$renderer  = new WP_Text_Diff_Renderer_Table( $args );
2413
+	$renderer  = new WP_Text_Diff_Renderer_Table($args);
2414 2414
 	$diff = $renderer->render($text_diff);
2415 2415
 
2416
-	if ( !$diff )
2416
+	if ( ! $diff)
2417 2417
 		return '';
2418 2418
 
2419
-	$r  = "<table class='diff'>\n";
2419
+	$r = "<table class='diff'>\n";
2420 2420
 
2421
-	if ( ! empty( $args[ 'show_split_view' ] ) ) {
2421
+	if ( ! empty($args['show_split_view'])) {
2422 2422
 		$r .= "<col class='content diffsplit left' /><col class='content diffsplit middle' /><col class='content diffsplit right' />";
2423 2423
 	} else {
2424 2424
 		$r .= "<col class='content' />";
2425 2425
 	}
2426 2426
 
2427
-	if ( $args['title'] || $args['title_left'] || $args['title_right'] )
2427
+	if ($args['title'] || $args['title_left'] || $args['title_right'])
2428 2428
 		$r .= "<thead>";
2429
-	if ( $args['title'] )
2429
+	if ($args['title'])
2430 2430
 		$r .= "<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\n";
2431
-	if ( $args['title_left'] || $args['title_right'] ) {
2431
+	if ($args['title_left'] || $args['title_right']) {
2432 2432
 		$r .= "<tr class='diff-sub-title'>\n";
2433 2433
 		$r .= "\t<td></td><th>$args[title_left]</th>\n";
2434 2434
 		$r .= "\t<td></td><th>$args[title_right]</th>\n";
2435 2435
 		$r .= "</tr>\n";
2436 2436
 	}
2437
-	if ( $args['title'] || $args['title_left'] || $args['title_right'] )
2437
+	if ($args['title'] || $args['title_left'] || $args['title_right'])
2438 2438
 		$r .= "</thead>\n";
2439 2439
 
2440 2440
 	$r .= "<tbody>\n$diff\n</tbody>\n";
Please login to merge, or discard this patch.
Braces   +109 added lines, -75 removed lines patch added patch discarded remove patch
@@ -98,8 +98,9 @@  discard block
 block discarded – undo
98 98
 function get_user_by( $field, $value ) {
99 99
 	$userdata = WP_User::get_data_by( $field, $value );
100 100
 
101
-	if ( !$userdata )
102
-		return false;
101
+	if ( !$userdata ) {
102
+			return false;
103
+	}
103 104
 
104 105
 	$user = new WP_User;
105 106
 	$user->init( $userdata );
@@ -123,8 +124,9 @@  discard block
 block discarded – undo
123 124
 
124 125
 	$clean = _get_non_cached_ids( $user_ids, 'users' );
125 126
 
126
-	if ( empty( $clean ) )
127
-		return;
127
+	if ( empty( $clean ) ) {
128
+			return;
129
+	}
128 130
 
129 131
 	$list = implode( ',', $clean );
130 132
 
@@ -308,8 +310,9 @@  discard block
 block discarded – undo
308 310
 
309 311
 	// From email and name
310 312
 	// If we don't have a name from the input headers
311
-	if ( !isset( $from_name ) )
312
-		$from_name = 'WordPress';
313
+	if ( !isset( $from_name ) ) {
314
+			$from_name = 'WordPress';
315
+	}
313 316
 
314 317
 	/* If we don't have an email from the input headers default to wordpress@$sitename
315 318
 	 * Some hosts will block outgoing mail from this address if it doesn't exist but
@@ -347,8 +350,9 @@  discard block
 block discarded – undo
347 350
 	$phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name );
348 351
 
349 352
 	// Set destination addresses
350
-	if ( !is_array( $to ) )
351
-		$to = explode( ',', $to );
353
+	if ( !is_array( $to ) ) {
354
+			$to = explode( ',', $to );
355
+	}
352 356
 
353 357
 	foreach ( (array) $to as $recipient ) {
354 358
 		try {
@@ -412,8 +416,9 @@  discard block
 block discarded – undo
412 416
 
413 417
 	// Set Content-Type and charset
414 418
 	// If we don't have a content-type from the input headers
415
-	if ( !isset( $content_type ) )
416
-		$content_type = 'text/plain';
419
+	if ( !isset( $content_type ) ) {
420
+			$content_type = 'text/plain';
421
+	}
417 422
 
418 423
 	/**
419 424
 	 * Filter the wp_mail() content type.
@@ -427,12 +432,14 @@  discard block
 block discarded – undo
427 432
 	$phpmailer->ContentType = $content_type;
428 433
 
429 434
 	// Set whether it's plaintext, depending on $content_type
430
-	if ( 'text/html' == $content_type )
431
-		$phpmailer->IsHTML( true );
435
+	if ( 'text/html' == $content_type ) {
436
+			$phpmailer->IsHTML( true );
437
+	}
432 438
 
433 439
 	// If we don't have a charset from the input headers
434
-	if ( !isset( $charset ) )
435
-		$charset = get_bloginfo( 'charset' );
440
+	if ( !isset( $charset ) ) {
441
+			$charset = get_bloginfo( 'charset' );
442
+	}
436 443
 
437 444
 	// Set the content-type and charset
438 445
 
@@ -451,8 +458,9 @@  discard block
 block discarded – undo
451 458
 			$phpmailer->AddCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );
452 459
 		}
453 460
 
454
-		if ( false !== stripos( $content_type, 'multipart' ) && ! empty($boundary) )
455
-			$phpmailer->AddCustomHeader( sprintf( "Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary ) );
461
+		if ( false !== stripos( $content_type, 'multipart' ) && ! empty($boundary) ) {
462
+					$phpmailer->AddCustomHeader( sprintf( "Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary ) );
463
+		}
456 464
 	}
457 465
 
458 466
 	if ( !empty( $attachments ) ) {
@@ -766,8 +774,9 @@  discard block
 block discarded – undo
766 774
 				}
767 775
 	    }
768 776
 
769
-		if ( empty($_COOKIE[$cookie_name]) )
770
-			return false;
777
+		if ( empty($_COOKIE[$cookie_name]) ) {
778
+					return false;
779
+		}
771 780
 		$cookie = $_COOKIE[$cookie_name];
772 781
 	}
773 782
 
@@ -898,9 +907,10 @@  discard block
 block discarded – undo
898 907
 	setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
899 908
 	setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
900 909
 	setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true);
901
-	if ( COOKIEPATH != SITECOOKIEPATH )
902
-		setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true);
903
-}
910
+	if ( COOKIEPATH != SITECOOKIEPATH ) {
911
+			setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true);
912
+	}
913
+	}
904 914
 endif;
905 915
 
906 916
 if ( !function_exists('wp_clear_auth_cookie') ) :
@@ -1048,8 +1058,9 @@  discard block
 block discarded – undo
1048 1058
  *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
1049 1059
  */
1050 1060
 function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
1051
-	if ( -1 == $action )
1052
-		_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2' );
1061
+	if ( -1 == $action ) {
1062
+			_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2' );
1063
+	}
1053 1064
 
1054 1065
 	$adminurl = strtolower(admin_url());
1055 1066
 	$referer = strtolower(wp_get_referer());
@@ -1093,12 +1104,13 @@  discard block
 block discarded – undo
1093 1104
 function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
1094 1105
 	$nonce = '';
1095 1106
 
1096
-	if ( $query_arg && isset( $_REQUEST[ $query_arg ] ) )
1097
-		$nonce = $_REQUEST[ $query_arg ];
1098
-	elseif ( isset( $_REQUEST['_ajax_nonce'] ) )
1099
-		$nonce = $_REQUEST['_ajax_nonce'];
1100
-	elseif ( isset( $_REQUEST['_wpnonce'] ) )
1101
-		$nonce = $_REQUEST['_wpnonce'];
1107
+	if ( $query_arg && isset( $_REQUEST[ $query_arg ] ) ) {
1108
+			$nonce = $_REQUEST[ $query_arg ];
1109
+	} elseif ( isset( $_REQUEST['_ajax_nonce'] ) ) {
1110
+			$nonce = $_REQUEST['_ajax_nonce'];
1111
+	} elseif ( isset( $_REQUEST['_wpnonce'] ) ) {
1112
+			$nonce = $_REQUEST['_wpnonce'];
1113
+	}
1102 1114
 
1103 1115
 	$result = wp_verify_nonce( $nonce, $action );
1104 1116
 
@@ -1160,13 +1172,16 @@  discard block
 block discarded – undo
1160 1172
 	 */
1161 1173
 	$status = apply_filters( 'wp_redirect_status', $status, $location );
1162 1174
 
1163
-	if ( ! $location )
1164
-		return false;
1175
+	if ( ! $location ) {
1176
+			return false;
1177
+	}
1165 1178
 
1166 1179
 	$location = wp_sanitize_redirect($location);
1167 1180
 
1168
-	if ( !$is_IIS && PHP_SAPI != 'cgi-fcgi' )
1169
-		status_header($status); // This causes problems on IIS and some FastCGI setups
1181
+	if ( !$is_IIS && PHP_SAPI != 'cgi-fcgi' ) {
1182
+			status_header($status);
1183
+	}
1184
+	// This causes problems on IIS and some FastCGI setups
1170 1185
 
1171 1186
 	header("Location: $location", true, $status);
1172 1187
 
@@ -1277,8 +1292,9 @@  discard block
 block discarded – undo
1277 1292
 function wp_validate_redirect($location, $default = '') {
1278 1293
 	$location = trim( $location );
1279 1294
 	// browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'
1280
-	if ( substr($location, 0, 2) == '//' )
1281
-		$location = 'http:' . $location;
1295
+	if ( substr($location, 0, 2) == '//' ) {
1296
+			$location = 'http:' . $location;
1297
+	}
1282 1298
 
1283 1299
 	// In php 5 parse_url may fail if the URL query part contains http://, bug #38143
1284 1300
 	$test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
@@ -1287,12 +1303,14 @@  discard block
 block discarded – undo
1287 1303
 	$lp = @parse_url($test);
1288 1304
 
1289 1305
 	// Give up if malformed URL
1290
-	if ( false === $lp )
1291
-		return $default;
1306
+	if ( false === $lp ) {
1307
+			return $default;
1308
+	}
1292 1309
 
1293 1310
 	// Allow only http and https schemes. No data:, etc.
1294
-	if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) )
1295
-		return $default;
1311
+	if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) ) {
1312
+			return $default;
1313
+	}
1296 1314
 
1297 1315
 	// Reject if certain components are set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
1298 1316
 	if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
@@ -1318,8 +1336,9 @@  discard block
 block discarded – undo
1318 1336
 	 */
1319 1337
 	$allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '' );
1320 1338
 
1321
-	if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
1322
-		$location = $default;
1339
+	if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) ) {
1340
+			$location = $default;
1341
+	}
1323 1342
 
1324 1343
 	return $location;
1325 1344
 }
@@ -1341,8 +1360,9 @@  discard block
 block discarded – undo
1341 1360
 	}
1342 1361
 
1343 1362
 	$comment = get_comment( $comment_id );
1344
-	if ( empty( $comment ) || empty( $comment->comment_post_ID ) )
1345
-		return false;
1363
+	if ( empty( $comment ) || empty( $comment->comment_post_ID ) ) {
1364
+			return false;
1365
+	}
1346 1366
 
1347 1367
 	$post    = get_post( $comment->comment_post_ID );
1348 1368
 	$author  = get_userdata( $post->post_author );
@@ -1467,19 +1487,22 @@  discard block
 block discarded – undo
1467 1487
 
1468 1488
 	if ( '' == $comment->comment_author ) {
1469 1489
 		$from = "From: \"$blogname\" <$wp_email>";
1470
-		if ( '' != $comment->comment_author_email )
1471
-			$reply_to = "Reply-To: $comment->comment_author_email";
1490
+		if ( '' != $comment->comment_author_email ) {
1491
+					$reply_to = "Reply-To: $comment->comment_author_email";
1492
+		}
1472 1493
 	} else {
1473 1494
 		$from = "From: \"$comment->comment_author\" <$wp_email>";
1474
-		if ( '' != $comment->comment_author_email )
1475
-			$reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
1495
+		if ( '' != $comment->comment_author_email ) {
1496
+					$reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
1497
+		}
1476 1498
 	}
1477 1499
 
1478 1500
 	$message_headers = "$from\n"
1479 1501
 		. "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
1480 1502
 
1481
-	if ( isset($reply_to) )
1482
-		$message_headers .= $reply_to . "\n";
1503
+	if ( isset($reply_to) ) {
1504
+			$message_headers .= $reply_to . "\n";
1505
+	}
1483 1506
 
1484 1507
 	/**
1485 1508
 	 * Filter the comment notification email text.
@@ -1558,8 +1581,9 @@  discard block
 block discarded – undo
1558 1581
 	// Send to the administration and to the post author if the author can modify the comment.
1559 1582
 	$emails = array( get_option( 'admin_email' ) );
1560 1583
 	if ( $user && user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) {
1561
-		if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) )
1562
-			$emails[] = $user->user_email;
1584
+		if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
1585
+					$emails[] = $user->user_email;
1586
+		}
1563 1587
 	}
1564 1588
 
1565 1589
 	$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
@@ -1599,10 +1623,11 @@  discard block
 block discarded – undo
1599 1623
 
1600 1624
 	$notify_message .= sprintf( __( 'Approve it: %s' ), admin_url( "comment.php?action=approve&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1601 1625
 
1602
-	if ( EMPTY_TRASH_DAYS )
1603
-		$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1604
-	else
1605
-		$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1626
+	if ( EMPTY_TRASH_DAYS ) {
1627
+			$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1628
+	} else {
1629
+			$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1630
+	}
1606 1631
 
1607 1632
 	$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment_id}#wpbody-content" ) ) . "\r\n";
1608 1633
 
@@ -2093,10 +2118,12 @@  discard block
 block discarded – undo
2093 2118
  */
2094 2119
 function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) {
2095 2120
 	$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
2096
-	if ( $special_chars )
2097
-		$chars .= '!@#$%^&*()';
2098
-	if ( $extra_special_chars )
2099
-		$chars .= '-_ []{}<>~`+=,.;:/?|';
2121
+	if ( $special_chars ) {
2122
+			$chars .= '!@#$%^&*()';
2123
+	}
2124
+	if ( $extra_special_chars ) {
2125
+			$chars .= '-_ []{}<>~`+=,.;:/?|';
2126
+	}
2100 2127
 
2101 2128
 	$password = '';
2102 2129
 	for ( $i = 0; $i < $length; $i++ ) {
@@ -2163,10 +2190,11 @@  discard block
 block discarded – undo
2163 2190
 	// Reset $rnd_value after 14 uses
2164 2191
 	// 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value
2165 2192
 	if ( strlen($rnd_value) < 8 ) {
2166
-		if ( defined( 'WP_SETUP_CONFIG' ) )
2167
-			static $seed = '';
2168
-		else
2169
-			$seed = get_transient('random_seed');
2193
+		if ( defined( 'WP_SETUP_CONFIG' ) ) {
2194
+					static $seed = '';
2195
+		} else {
2196
+					$seed = get_transient('random_seed');
2197
+		}
2170 2198
 		$rnd_value = md5( uniqid(microtime() . mt_rand(), true ) . $seed );
2171 2199
 		$rnd_value .= sha1($rnd_value);
2172 2200
 		$rnd_value .= sha1($rnd_value . $seed);
@@ -2185,8 +2213,9 @@  discard block
 block discarded – undo
2185 2213
 	$value = abs(hexdec($value));
2186 2214
 
2187 2215
 	// Reduce the value to be within the min - max range
2188
-	if ( $max != 0 )
2189
-		$value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 );
2216
+	if ( $max != 0 ) {
2217
+			$value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 );
2218
+	}
2190 2219
 
2191 2220
 	return abs(intval($value));
2192 2221
 }
@@ -2401,8 +2430,9 @@  discard block
 block discarded – undo
2401 2430
 	$defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' );
2402 2431
 	$args = wp_parse_args( $args, $defaults );
2403 2432
 
2404
-	if ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) )
2405
-		require( ABSPATH . WPINC . '/wp-diff.php' );
2433
+	if ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) ) {
2434
+			require( ABSPATH . WPINC . '/wp-diff.php' );
2435
+	}
2406 2436
 
2407 2437
 	$left_string  = normalize_whitespace($left_string);
2408 2438
 	$right_string = normalize_whitespace($right_string);
@@ -2413,8 +2443,9 @@  discard block
 block discarded – undo
2413 2443
 	$renderer  = new WP_Text_Diff_Renderer_Table( $args );
2414 2444
 	$diff = $renderer->render($text_diff);
2415 2445
 
2416
-	if ( !$diff )
2417
-		return '';
2446
+	if ( !$diff ) {
2447
+			return '';
2448
+	}
2418 2449
 
2419 2450
 	$r  = "<table class='diff'>\n";
2420 2451
 
@@ -2424,18 +2455,21 @@  discard block
 block discarded – undo
2424 2455
 		$r .= "<col class='content' />";
2425 2456
 	}
2426 2457
 
2427
-	if ( $args['title'] || $args['title_left'] || $args['title_right'] )
2428
-		$r .= "<thead>";
2429
-	if ( $args['title'] )
2430
-		$r .= "<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\n";
2458
+	if ( $args['title'] || $args['title_left'] || $args['title_right'] ) {
2459
+			$r .= "<thead>";
2460
+	}
2461
+	if ( $args['title'] ) {
2462
+			$r .= "<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\n";
2463
+	}
2431 2464
 	if ( $args['title_left'] || $args['title_right'] ) {
2432 2465
 		$r .= "<tr class='diff-sub-title'>\n";
2433 2466
 		$r .= "\t<td></td><th>$args[title_left]</th>\n";
2434 2467
 		$r .= "\t<td></td><th>$args[title_right]</th>\n";
2435 2468
 		$r .= "</tr>\n";
2436 2469
 	}
2437
-	if ( $args['title'] || $args['title_left'] || $args['title_right'] )
2438
-		$r .= "</thead>\n";
2470
+	if ( $args['title'] || $args['title_left'] || $args['title_right'] ) {
2471
+			$r .= "</thead>\n";
2472
+	}
2439 2473
 
2440 2474
 	$r .= "<tbody>\n$diff\n</tbody>\n";
2441 2475
 	$r .= "</table>";
Please login to merge, or discard this patch.
src/wp-includes/class-wp-admin-bar.php 3 patches
Braces   +94 added lines, -64 removed lines patch added patch discarded remove patch
@@ -60,8 +60,9 @@  discard block
 block discarded – undo
60 60
 			$header_callback = $admin_bar_args[0]['callback'];
61 61
 		}
62 62
 
63
-		if ( empty($header_callback) )
64
-			$header_callback = '_admin_bar_bump_cb';
63
+		if ( empty($header_callback) ) {
64
+					$header_callback = '_admin_bar_bump_cb';
65
+		}
65 66
 
66 67
 		add_action('wp_head', $header_callback);
67 68
 
@@ -107,16 +108,19 @@  discard block
 block discarded – undo
107 108
 	 */
108 109
 	public function add_node( $args ) {
109 110
 		// Shim for old method signature: add_node( $parent_id, $menu_obj, $args )
110
-		if ( func_num_args() >= 3 && is_string( func_get_arg(0) ) )
111
-			$args = array_merge( array( 'parent' => func_get_arg(0) ), func_get_arg(2) );
111
+		if ( func_num_args() >= 3 && is_string( func_get_arg(0) ) ) {
112
+					$args = array_merge( array( 'parent' => func_get_arg(0) ), func_get_arg(2) );
113
+		}
112 114
 
113
-		if ( is_object( $args ) )
114
-			$args = get_object_vars( $args );
115
+		if ( is_object( $args ) ) {
116
+					$args = get_object_vars( $args );
117
+		}
115 118
 
116 119
 		// Ensure we have a valid title.
117 120
 		if ( empty( $args['id'] ) ) {
118
-			if ( empty( $args['title'] ) )
119
-				return;
121
+			if ( empty( $args['title'] ) ) {
122
+							return;
123
+			}
120 124
 
121 125
 			_doing_it_wrong( __METHOD__, __( 'The menu ID should not be empty.' ), '3.3' );
122 126
 			// Deprecated: Generate an ID from the title.
@@ -133,12 +137,14 @@  discard block
 block discarded – undo
133 137
 		);
134 138
 
135 139
 		// If the node already exists, keep any data that isn't provided.
136
-		if ( $maybe_defaults = $this->get_node( $args['id'] ) )
137
-			$defaults = get_object_vars( $maybe_defaults );
140
+		if ( $maybe_defaults = $this->get_node( $args['id'] ) ) {
141
+					$defaults = get_object_vars( $maybe_defaults );
142
+		}
138 143
 
139 144
 		// Do the same for 'meta' items.
140
-		if ( ! empty( $defaults['meta'] ) && ! empty( $args['meta'] ) )
141
-			$args['meta'] = wp_parse_args( $args['meta'], $defaults['meta'] );
145
+		if ( ! empty( $defaults['meta'] ) && ! empty( $args['meta'] ) ) {
146
+					$args['meta'] = wp_parse_args( $args['meta'], $defaults['meta'] );
147
+		}
142 148
 
143 149
 		$args = wp_parse_args( $args, $defaults );
144 150
 
@@ -170,8 +176,9 @@  discard block
 block discarded – undo
170 176
 	 * @return object Node.
171 177
 	 */
172 178
 	final public function get_node( $id ) {
173
-		if ( $node = $this->_get_node( $id ) )
174
-			return clone $node;
179
+		if ( $node = $this->_get_node( $id ) ) {
180
+					return clone $node;
181
+		}
175 182
 	}
176 183
 
177 184
 	/**
@@ -179,22 +186,26 @@  discard block
 block discarded – undo
179 186
 	 * @return object|void
180 187
 	 */
181 188
 	final protected function _get_node( $id ) {
182
-		if ( $this->bound )
183
-			return;
189
+		if ( $this->bound ) {
190
+					return;
191
+		}
184 192
 
185
-		if ( empty( $id ) )
186
-			$id = 'root';
193
+		if ( empty( $id ) ) {
194
+					$id = 'root';
195
+		}
187 196
 
188
-		if ( isset( $this->nodes[ $id ] ) )
189
-			return $this->nodes[ $id ];
197
+		if ( isset( $this->nodes[ $id ] ) ) {
198
+					return $this->nodes[ $id ];
199
+		}
190 200
 	}
191 201
 
192 202
 	/**
193 203
 	 * @return array|void
194 204
 	 */
195 205
 	final public function get_nodes() {
196
-		if ( ! $nodes = $this->_get_nodes() )
197
-			return;
206
+		if ( ! $nodes = $this->_get_nodes() ) {
207
+					return;
208
+		}
198 209
 
199 210
 		foreach ( $nodes as &$node ) {
200 211
 			$node = clone $node;
@@ -206,8 +217,9 @@  discard block
 block discarded – undo
206 217
 	 * @return array|void
207 218
 	 */
208 219
 	final protected function _get_nodes() {
209
-		if ( $this->bound )
210
-			return;
220
+		if ( $this->bound ) {
221
+					return;
222
+		}
211 223
 
212 224
 		return $this->nodes;
213 225
 	}
@@ -253,16 +265,18 @@  discard block
 block discarded – undo
253 265
 	 */
254 266
 	public function render() {
255 267
 		$root = $this->_bind();
256
-		if ( $root )
257
-			$this->_render( $root );
268
+		if ( $root ) {
269
+					$this->_render( $root );
270
+		}
258 271
 	}
259 272
 
260 273
 	/**
261 274
 	 * @return object|void
262 275
 	 */
263 276
 	final protected function _bind() {
264
-		if ( $this->bound )
265
-			return;
277
+		if ( $this->bound ) {
278
+					return;
279
+		}
266 280
 
267 281
 		// Add the root node.
268 282
 		// Clear it first, just in case. Don't mess with The Root.
@@ -279,13 +293,15 @@  discard block
 block discarded – undo
279 293
 			unset( $node->group );
280 294
 
281 295
 			// The Root wants your orphans. No lonely items allowed.
282
-			if ( ! $node->parent )
283
-				$node->parent = 'root';
296
+			if ( ! $node->parent ) {
297
+							$node->parent = 'root';
298
+			}
284 299
 		}
285 300
 
286 301
 		foreach ( $this->_get_nodes() as $node ) {
287
-			if ( 'root' == $node->id )
288
-				continue;
302
+			if ( 'root' == $node->id ) {
303
+							continue;
304
+			}
289 305
 
290 306
 			// Fetch the parent node. If it isn't registered, ignore the node.
291 307
 			if ( ! $parent = $this->_get_node( $node->parent ) ) {
@@ -296,10 +312,11 @@  discard block
 block discarded – undo
296 312
 			$group_class = ( $node->parent == 'root' ) ? 'ab-top-menu' : 'ab-submenu';
297 313
 
298 314
 			if ( $node->type == 'group' ) {
299
-				if ( empty( $node->meta['class'] ) )
300
-					$node->meta['class'] = $group_class;
301
-				else
302
-					$node->meta['class'] .= ' ' . $group_class;
315
+				if ( empty( $node->meta['class'] ) ) {
316
+									$node->meta['class'] = $group_class;
317
+				} else {
318
+									$node->meta['class'] .= ' ' . $group_class;
319
+				}
303 320
 			}
304 321
 
305 322
 			// Items in items aren't allowed. Wrap nested items in 'default' groups.
@@ -357,10 +374,11 @@  discard block
 block discarded – undo
357 374
 						$container->parent = $grandparent->id;
358 375
 
359 376
 						$index = array_search( $parent, $grandparent->children, true );
360
-						if ( $index === false )
361
-							$grandparent->children[] = $container;
362
-						else
363
-							array_splice( $grandparent->children, $index, 1, array( $container ) );
377
+						if ( $index === false ) {
378
+													$grandparent->children[] = $container;
379
+						} else {
380
+													array_splice( $grandparent->children, $index, 1, array( $container ) );
381
+						}
364 382
 					}
365 383
 
366 384
 					$parent->parent = $container->id;
@@ -393,12 +411,13 @@  discard block
 block discarded – undo
393 411
 		// We have to do this here since admin bar shows on the front end.
394 412
 		$class = 'nojq nojs';
395 413
 		if ( $is_IE ) {
396
-			if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 7' ) )
397
-				$class .= ' ie7';
398
-			elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 8' ) )
399
-				$class .= ' ie8';
400
-			elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 9' ) )
401
-				$class .= ' ie9';
414
+			if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 7' ) ) {
415
+							$class .= ' ie7';
416
+			} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 8' ) ) {
417
+							$class .= ' ie8';
418
+			} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 9' ) ) {
419
+							$class .= ' ie9';
420
+			}
402 421
 		} elseif ( wp_is_mobile() ) {
403 422
 			$class .= ' mobile';
404 423
 		}
@@ -425,8 +444,9 @@  discard block
 block discarded – undo
425 444
 	 * @param object $node
426 445
 	 */
427 446
 	final protected function _render_container( $node ) {
428
-		if ( $node->type != 'container' || empty( $node->children ) )
429
-			return;
447
+		if ( $node->type != 'container' || empty( $node->children ) ) {
448
+					return;
449
+		}
430 450
 
431 451
 		?><div id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>" class="ab-group-container"><?php
432 452
 			foreach ( $node->children as $group ) {
@@ -443,13 +463,15 @@  discard block
 block discarded – undo
443 463
 			$this->_render_container( $node );
444 464
 			return;
445 465
 		}
446
-		if ( $node->type != 'group' || empty( $node->children ) )
447
-			return;
466
+		if ( $node->type != 'group' || empty( $node->children ) ) {
467
+					return;
468
+		}
448 469
 
449
-		if ( ! empty( $node->meta['class'] ) )
450
-			$class = ' class="' . esc_attr( trim( $node->meta['class'] ) ) . '"';
451
-		else
452
-			$class = '';
470
+		if ( ! empty( $node->meta['class'] ) ) {
471
+					$class = ' class="' . esc_attr( trim( $node->meta['class'] ) ) . '"';
472
+		} else {
473
+					$class = '';
474
+		}
453 475
 
454 476
 		?><ul id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $class; ?>><?php
455 477
 			foreach ( $node->children as $item ) {
@@ -462,8 +484,9 @@  discard block
 block discarded – undo
462 484
 	 * @param object $node
463 485
 	 */
464 486
 	final protected function _render_item( $node ) {
465
-		if ( $node->type != 'item' )
466
-			return;
487
+		if ( $node->type != 'item' ) {
488
+					return;
489
+		}
467 490
 
468 491
 		$is_parent = ! empty( $node->children );
469 492
 		$has_link  = ! empty( $node->href );
@@ -478,11 +501,13 @@  discard block
 block discarded – undo
478 501
 			$aria_attributes .= ' aria-haspopup="true"';
479 502
 		}
480 503
 
481
-		if ( ! empty( $node->meta['class'] ) )
482
-			$menuclass .= $node->meta['class'];
504
+		if ( ! empty( $node->meta['class'] ) ) {
505
+					$menuclass .= $node->meta['class'];
506
+		}
483 507
 
484
-		if ( $menuclass )
485
-			$menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"';
508
+		if ( $menuclass ) {
509
+					$menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"';
510
+		}
486 511
 
487 512
 		?>
488 513
 
@@ -502,8 +527,10 @@  discard block
 block discarded – undo
502 527
 					?> rel="<?php echo esc_attr( $node->meta['rel'] ); ?>"<?php
503 528
 				endif;
504 529
 				?>><?php
505
-			else:
530
+			else {
531
+				:
506 532
 				?><div class="ab-item ab-empty-item" <?php echo $aria_attributes;
533
+			}
507 534
 				if ( ! empty( $node->meta['title'] ) ) :
508 535
 					?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
509 536
 				endif;
@@ -514,9 +541,11 @@  discard block
 block discarded – undo
514 541
 
515 542
 			if ( $has_link ) :
516 543
 				?></a><?php
517
-			else:
544
+			else {
545
+				:
518 546
 				?></div><?php
519 547
 			endif;
548
+			}
520 549
 
521 550
 			if ( $is_parent ) :
522 551
 				?><div class="ab-sub-wrapper"><?php
@@ -526,8 +555,9 @@  discard block
 block discarded – undo
526 555
 				?></div><?php
527 556
 			endif;
528 557
 
529
-			if ( ! empty( $node->meta['html'] ) )
530
-				echo $node->meta['html'];
558
+			if ( ! empty( $node->meta['html'] ) ) {
559
+							echo $node->meta['html'];
560
+			}
531 561
 
532 562
 			?>
533 563
 		</li><?php
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Toolbar API: WP_Admin_Bar class
4
- *
5
- * @package WordPress
6
- * @subpackage Toolbar
7
- * @since 3.1.0
8
- */
3
+	 * Toolbar API: WP_Admin_Bar class
4
+	 *
5
+	 * @package WordPress
6
+	 * @subpackage Toolbar
7
+	 * @since 3.1.0
8
+	 */
9 9
 
10 10
 /**
11 11
  * Core class used to implement the Toolbar API.
Please login to merge, or discard this patch.
Spacing   +178 added lines, -178 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
 	 * @param string $name
22 22
 	 * @return string|array|void
23 23
 	 */
24
-	public function __get( $name ) {
25
-		switch ( $name ) {
24
+	public function __get($name) {
25
+		switch ($name) {
26 26
 			case 'proto' :
27 27
 				return is_ssl() ? 'https://' : 'http://';
28 28
 
29 29
 			case 'menu' :
30
-				_deprecated_argument( 'WP_Admin_Bar', '3.3', 'Modify admin bar nodes with WP_Admin_Bar::get_node(), WP_Admin_Bar::add_node(), and WP_Admin_Bar::remove_node(), not the <code>menu</code> property.' );
30
+				_deprecated_argument('WP_Admin_Bar', '3.3', 'Modify admin bar nodes with WP_Admin_Bar::get_node(), WP_Admin_Bar::add_node(), and WP_Admin_Bar::remove_node(), not the <code>menu</code> property.');
31 31
 				return array(); // Sorry, folks.
32 32
 		}
33 33
 	}
@@ -38,61 +38,61 @@  discard block
 block discarded – undo
38 38
 	public function initialize() {
39 39
 		$this->user = new stdClass;
40 40
 
41
-		if ( is_user_logged_in() ) {
41
+		if (is_user_logged_in()) {
42 42
 			/* Populate settings we need for the menu based on the current user. */
43
-			$this->user->blogs = get_blogs_of_user( get_current_user_id() );
44
-			if ( is_multisite() ) {
45
-				$this->user->active_blog = get_active_blog_for_user( get_current_user_id() );
46
-				$this->user->domain = empty( $this->user->active_blog ) ? user_admin_url() : trailingslashit( get_home_url( $this->user->active_blog->blog_id ) );
43
+			$this->user->blogs = get_blogs_of_user(get_current_user_id());
44
+			if (is_multisite()) {
45
+				$this->user->active_blog = get_active_blog_for_user(get_current_user_id());
46
+				$this->user->domain = empty($this->user->active_blog) ? user_admin_url() : trailingslashit(get_home_url($this->user->active_blog->blog_id));
47 47
 				$this->user->account_domain = $this->user->domain;
48 48
 			} else {
49 49
 				$this->user->active_blog = $this->user->blogs[get_current_blog_id()];
50
-				$this->user->domain = trailingslashit( home_url() );
50
+				$this->user->domain = trailingslashit(home_url());
51 51
 				$this->user->account_domain = $this->user->domain;
52 52
 			}
53 53
 		}
54 54
 
55
-		add_action( 'wp_head', 'wp_admin_bar_header' );
55
+		add_action('wp_head', 'wp_admin_bar_header');
56 56
 
57
-		add_action( 'admin_head', 'wp_admin_bar_header' );
57
+		add_action('admin_head', 'wp_admin_bar_header');
58 58
 
59
-		if ( current_theme_supports( 'admin-bar' ) ) {
59
+		if (current_theme_supports('admin-bar')) {
60 60
 			/**
61 61
 			 * To remove the default padding styles from WordPress for the Toolbar, use the following code:
62 62
 			 * add_theme_support( 'admin-bar', array( 'callback' => '__return_false' ) );
63 63
 			 */
64
-			$admin_bar_args = get_theme_support( 'admin-bar' );
64
+			$admin_bar_args = get_theme_support('admin-bar');
65 65
 			$header_callback = $admin_bar_args[0]['callback'];
66 66
 		}
67 67
 
68
-		if ( empty($header_callback) )
68
+		if (empty($header_callback))
69 69
 			$header_callback = '_admin_bar_bump_cb';
70 70
 
71 71
 		add_action('wp_head', $header_callback);
72 72
 
73
-		wp_enqueue_script( 'admin-bar' );
74
-		wp_enqueue_style( 'admin-bar' );
73
+		wp_enqueue_script('admin-bar');
74
+		wp_enqueue_style('admin-bar');
75 75
 
76 76
 		/**
77 77
 		 * Fires after WP_Admin_Bar is initialized.
78 78
 		 *
79 79
 		 * @since 3.1.0
80 80
 		 */
81
-		do_action( 'admin_bar_init' );
81
+		do_action('admin_bar_init');
82 82
 	}
83 83
 
84 84
 	/**
85 85
 	 * @param array $node
86 86
 	 */
87
-	public function add_menu( $node ) {
88
-		$this->add_node( $node );
87
+	public function add_menu($node) {
88
+		$this->add_node($node);
89 89
 	}
90 90
 
91 91
 	/**
92 92
 	 * @param string $id
93 93
 	 */
94
-	public function remove_menu( $id ) {
95
-		$this->remove_node( $id );
94
+	public function remove_menu($id) {
95
+		$this->remove_node($id);
96 96
 	}
97 97
 
98 98
 	/**
@@ -114,22 +114,22 @@  discard block
 block discarded – undo
114 114
 	 *                          'onclick', 'target', 'title', 'tabindex'. Default empty.
115 115
 	 * }
116 116
 	 */
117
-	public function add_node( $args ) {
117
+	public function add_node($args) {
118 118
 		// Shim for old method signature: add_node( $parent_id, $menu_obj, $args )
119
-		if ( func_num_args() >= 3 && is_string( func_get_arg(0) ) )
120
-			$args = array_merge( array( 'parent' => func_get_arg(0) ), func_get_arg(2) );
119
+		if (func_num_args() >= 3 && is_string(func_get_arg(0)))
120
+			$args = array_merge(array('parent' => func_get_arg(0)), func_get_arg(2));
121 121
 
122
-		if ( is_object( $args ) )
123
-			$args = get_object_vars( $args );
122
+		if (is_object($args))
123
+			$args = get_object_vars($args);
124 124
 
125 125
 		// Ensure we have a valid title.
126
-		if ( empty( $args['id'] ) ) {
127
-			if ( empty( $args['title'] ) )
126
+		if (empty($args['id'])) {
127
+			if (empty($args['title']))
128 128
 				return;
129 129
 
130
-			_doing_it_wrong( __METHOD__, __( 'The menu ID should not be empty.' ), '3.3' );
130
+			_doing_it_wrong(__METHOD__, __('The menu ID should not be empty.'), '3.3');
131 131
 			// Deprecated: Generate an ID from the title.
132
-			$args['id'] = esc_attr( sanitize_title( trim( $args['title'] ) ) );
132
+			$args['id'] = esc_attr(sanitize_title(trim($args['title'])));
133 133
 		}
134 134
 
135 135
 		$defaults = array(
@@ -142,34 +142,34 @@  discard block
 block discarded – undo
142 142
 		);
143 143
 
144 144
 		// If the node already exists, keep any data that isn't provided.
145
-		if ( $maybe_defaults = $this->get_node( $args['id'] ) )
146
-			$defaults = get_object_vars( $maybe_defaults );
145
+		if ($maybe_defaults = $this->get_node($args['id']))
146
+			$defaults = get_object_vars($maybe_defaults);
147 147
 
148 148
 		// Do the same for 'meta' items.
149
-		if ( ! empty( $defaults['meta'] ) && ! empty( $args['meta'] ) )
150
-			$args['meta'] = wp_parse_args( $args['meta'], $defaults['meta'] );
149
+		if ( ! empty($defaults['meta']) && ! empty($args['meta']))
150
+			$args['meta'] = wp_parse_args($args['meta'], $defaults['meta']);
151 151
 
152
-		$args = wp_parse_args( $args, $defaults );
152
+		$args = wp_parse_args($args, $defaults);
153 153
 
154 154
 		$back_compat_parents = array(
155
-			'my-account-with-avatar' => array( 'my-account', '3.3' ),
156
-			'my-blogs'               => array( 'my-sites',   '3.3' ),
155
+			'my-account-with-avatar' => array('my-account', '3.3'),
156
+			'my-blogs'               => array('my-sites', '3.3'),
157 157
 		);
158 158
 
159
-		if ( isset( $back_compat_parents[ $args['parent'] ] ) ) {
160
-			list( $new_parent, $version ) = $back_compat_parents[ $args['parent'] ];
161
-			_deprecated_argument( __METHOD__, $version, sprintf( 'Use <code>%s</code> as the parent for the <code>%s</code> admin bar node instead of <code>%s</code>.', $new_parent, $args['id'], $args['parent'] ) );
159
+		if (isset($back_compat_parents[$args['parent']])) {
160
+			list($new_parent, $version) = $back_compat_parents[$args['parent']];
161
+			_deprecated_argument(__METHOD__, $version, sprintf('Use <code>%s</code> as the parent for the <code>%s</code> admin bar node instead of <code>%s</code>.', $new_parent, $args['id'], $args['parent']));
162 162
 			$args['parent'] = $new_parent;
163 163
 		}
164 164
 
165
-		$this->_set_node( $args );
165
+		$this->_set_node($args);
166 166
 	}
167 167
 
168 168
 	/**
169 169
 	 * @param array $args
170 170
 	 */
171
-	final protected function _set_node( $args ) {
172
-		$this->nodes[ $args['id'] ] = (object) $args;
171
+	final protected function _set_node($args) {
172
+		$this->nodes[$args['id']] = (object) $args;
173 173
 	}
174 174
 
175 175
 	/**
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 	 * @param string $id
179 179
 	 * @return object Node.
180 180
 	 */
181
-	final public function get_node( $id ) {
182
-		if ( $node = $this->_get_node( $id ) )
181
+	final public function get_node($id) {
182
+		if ($node = $this->_get_node($id))
183 183
 			return clone $node;
184 184
 	}
185 185
 
@@ -187,25 +187,25 @@  discard block
 block discarded – undo
187 187
 	 * @param string $id
188 188
 	 * @return object|void
189 189
 	 */
190
-	final protected function _get_node( $id ) {
191
-		if ( $this->bound )
190
+	final protected function _get_node($id) {
191
+		if ($this->bound)
192 192
 			return;
193 193
 
194
-		if ( empty( $id ) )
194
+		if (empty($id))
195 195
 			$id = 'root';
196 196
 
197
-		if ( isset( $this->nodes[ $id ] ) )
198
-			return $this->nodes[ $id ];
197
+		if (isset($this->nodes[$id]))
198
+			return $this->nodes[$id];
199 199
 	}
200 200
 
201 201
 	/**
202 202
 	 * @return array|void
203 203
 	 */
204 204
 	final public function get_nodes() {
205
-		if ( ! $nodes = $this->_get_nodes() )
205
+		if ( ! $nodes = $this->_get_nodes())
206 206
 			return;
207 207
 
208
-		foreach ( $nodes as &$node ) {
208
+		foreach ($nodes as &$node) {
209 209
 			$node = clone $node;
210 210
 		}
211 211
 		return $nodes;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	 * @return array|void
216 216
 	 */
217 217
 	final protected function _get_nodes() {
218
-		if ( $this->bound )
218
+		if ($this->bound)
219 219
 			return;
220 220
 
221 221
 		return $this->nodes;
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
 	 *                         'class', 'onclick', 'target', and 'title'.
236 236
 	 * }
237 237
 	 */
238
-	final public function add_group( $args ) {
238
+	final public function add_group($args) {
239 239
 		$args['group'] = true;
240 240
 
241
-		$this->add_node( $args );
241
+		$this->add_node($args);
242 242
 	}
243 243
 
244 244
 	/**
@@ -246,15 +246,15 @@  discard block
 block discarded – undo
246 246
 	 *
247 247
 	 * @param string $id The ID of the item.
248 248
 	 */
249
-	public function remove_node( $id ) {
250
-		$this->_unset_node( $id );
249
+	public function remove_node($id) {
250
+		$this->_unset_node($id);
251 251
 	}
252 252
 
253 253
 	/**
254 254
 	 * @param string $id
255 255
 	 */
256
-	final protected function _unset_node( $id ) {
257
-		unset( $this->nodes[ $id ] );
256
+	final protected function _unset_node($id) {
257
+		unset($this->nodes[$id]);
258 258
 	}
259 259
 
260 260
 	/**
@@ -262,66 +262,66 @@  discard block
 block discarded – undo
262 262
 	 */
263 263
 	public function render() {
264 264
 		$root = $this->_bind();
265
-		if ( $root )
266
-			$this->_render( $root );
265
+		if ($root)
266
+			$this->_render($root);
267 267
 	}
268 268
 
269 269
 	/**
270 270
 	 * @return object|void
271 271
 	 */
272 272
 	final protected function _bind() {
273
-		if ( $this->bound )
273
+		if ($this->bound)
274 274
 			return;
275 275
 
276 276
 		// Add the root node.
277 277
 		// Clear it first, just in case. Don't mess with The Root.
278
-		$this->remove_node( 'root' );
279
-		$this->add_node( array(
278
+		$this->remove_node('root');
279
+		$this->add_node(array(
280 280
 			'id'    => 'root',
281 281
 			'group' => false,
282
-		) );
282
+		));
283 283
 
284 284
 		// Normalize nodes: define internal 'children' and 'type' properties.
285
-		foreach ( $this->_get_nodes() as $node ) {
285
+		foreach ($this->_get_nodes() as $node) {
286 286
 			$node->children = array();
287
-			$node->type = ( $node->group ) ? 'group' : 'item';
288
-			unset( $node->group );
287
+			$node->type = ($node->group) ? 'group' : 'item';
288
+			unset($node->group);
289 289
 
290 290
 			// The Root wants your orphans. No lonely items allowed.
291
-			if ( ! $node->parent )
291
+			if ( ! $node->parent)
292 292
 				$node->parent = 'root';
293 293
 		}
294 294
 
295
-		foreach ( $this->_get_nodes() as $node ) {
296
-			if ( 'root' == $node->id )
295
+		foreach ($this->_get_nodes() as $node) {
296
+			if ('root' == $node->id)
297 297
 				continue;
298 298
 
299 299
 			// Fetch the parent node. If it isn't registered, ignore the node.
300
-			if ( ! $parent = $this->_get_node( $node->parent ) ) {
300
+			if ( ! $parent = $this->_get_node($node->parent)) {
301 301
 				continue;
302 302
 			}
303 303
 
304 304
 			// Generate the group class (we distinguish between top level and other level groups).
305
-			$group_class = ( $node->parent == 'root' ) ? 'ab-top-menu' : 'ab-submenu';
305
+			$group_class = ($node->parent == 'root') ? 'ab-top-menu' : 'ab-submenu';
306 306
 
307
-			if ( $node->type == 'group' ) {
308
-				if ( empty( $node->meta['class'] ) )
307
+			if ($node->type == 'group') {
308
+				if (empty($node->meta['class']))
309 309
 					$node->meta['class'] = $group_class;
310 310
 				else
311
-					$node->meta['class'] .= ' ' . $group_class;
311
+					$node->meta['class'] .= ' '.$group_class;
312 312
 			}
313 313
 
314 314
 			// Items in items aren't allowed. Wrap nested items in 'default' groups.
315
-			if ( $parent->type == 'item' && $node->type == 'item' ) {
316
-				$default_id = $parent->id . '-default';
317
-				$default    = $this->_get_node( $default_id );
315
+			if ($parent->type == 'item' && $node->type == 'item') {
316
+				$default_id = $parent->id.'-default';
317
+				$default    = $this->_get_node($default_id);
318 318
 
319 319
 				// The default group is added here to allow groups that are
320 320
 				// added before standard menu items to render first.
321
-				if ( ! $default ) {
321
+				if ( ! $default) {
322 322
 					// Use _set_node because add_node can be overloaded.
323 323
 					// Make sure to specify default settings for all properties.
324
-					$this->_set_node( array(
324
+					$this->_set_node(array(
325 325
 						'id'        => $default_id,
326 326
 						'parent'    => $parent->id,
327 327
 						'type'      => 'group',
@@ -331,45 +331,45 @@  discard block
 block discarded – undo
331 331
 						),
332 332
 						'title'     => false,
333 333
 						'href'      => false,
334
-					) );
335
-					$default = $this->_get_node( $default_id );
334
+					));
335
+					$default = $this->_get_node($default_id);
336 336
 					$parent->children[] = $default;
337 337
 				}
338 338
 				$parent = $default;
339 339
 
340 340
 			// Groups in groups aren't allowed. Add a special 'container' node.
341 341
 			// The container will invisibly wrap both groups.
342
-			} elseif ( $parent->type == 'group' && $node->type == 'group' ) {
343
-				$container_id = $parent->id . '-container';
344
-				$container    = $this->_get_node( $container_id );
342
+			} elseif ($parent->type == 'group' && $node->type == 'group') {
343
+				$container_id = $parent->id.'-container';
344
+				$container    = $this->_get_node($container_id);
345 345
 
346 346
 				// We need to create a container for this group, life is sad.
347
-				if ( ! $container ) {
347
+				if ( ! $container) {
348 348
 					// Use _set_node because add_node can be overloaded.
349 349
 					// Make sure to specify default settings for all properties.
350
-					$this->_set_node( array(
350
+					$this->_set_node(array(
351 351
 						'id'       => $container_id,
352 352
 						'type'     => 'container',
353
-						'children' => array( $parent ),
353
+						'children' => array($parent),
354 354
 						'parent'   => false,
355 355
 						'title'    => false,
356 356
 						'href'     => false,
357 357
 						'meta'     => array(),
358
-					) );
358
+					));
359 359
 
360
-					$container = $this->_get_node( $container_id );
360
+					$container = $this->_get_node($container_id);
361 361
 
362 362
 					// Link the container node if a grandparent node exists.
363
-					$grandparent = $this->_get_node( $parent->parent );
363
+					$grandparent = $this->_get_node($parent->parent);
364 364
 
365
-					if ( $grandparent ) {
365
+					if ($grandparent) {
366 366
 						$container->parent = $grandparent->id;
367 367
 
368
-						$index = array_search( $parent, $grandparent->children, true );
369
-						if ( $index === false )
368
+						$index = array_search($parent, $grandparent->children, true);
369
+						if ($index === false)
370 370
 							$grandparent->children[] = $container;
371 371
 						else
372
-							array_splice( $grandparent->children, $index, 1, array( $container ) );
372
+							array_splice($grandparent->children, $index, 1, array($container));
373 373
 					}
374 374
 
375 375
 					$parent->parent = $container->id;
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 			$parent->children[] = $node;
386 386
 		}
387 387
 
388
-		$root = $this->_get_node( 'root' );
388
+		$root = $this->_get_node('root');
389 389
 		$this->bound = true;
390 390
 		return $root;
391 391
 	}
@@ -395,35 +395,35 @@  discard block
 block discarded – undo
395 395
 	 * @global bool $is_IE
396 396
 	 * @param object $root
397 397
 	 */
398
-	final protected function _render( $root ) {
398
+	final protected function _render($root) {
399 399
 		global $is_IE;
400 400
 
401 401
 		// Add browser classes.
402 402
 		// We have to do this here since admin bar shows on the front end.
403 403
 		$class = 'nojq nojs';
404
-		if ( $is_IE ) {
405
-			if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 7' ) )
404
+		if ($is_IE) {
405
+			if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7'))
406 406
 				$class .= ' ie7';
407
-			elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 8' ) )
407
+			elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8'))
408 408
 				$class .= ' ie8';
409
-			elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 9' ) )
409
+			elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 9'))
410 410
 				$class .= ' ie9';
411
-		} elseif ( wp_is_mobile() ) {
411
+		} elseif (wp_is_mobile()) {
412 412
 			$class .= ' mobile';
413 413
 		}
414 414
 
415 415
 		?>
416 416
 		<div id="wpadminbar" class="<?php echo $class; ?>">
417
-			<?php if ( ! is_admin() ) { ?>
418
-				<a class="screen-reader-shortcut" href="#wp-toolbar" tabindex="1"><?php _e( 'Skip to toolbar' ); ?></a>
417
+			<?php if ( ! is_admin()) { ?>
418
+				<a class="screen-reader-shortcut" href="#wp-toolbar" tabindex="1"><?php _e('Skip to toolbar'); ?></a>
419 419
 			<?php } ?>
420
-			<div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e( 'Toolbar' ); ?>" tabindex="0">
421
-				<?php foreach ( $root->children as $group ) {
422
-					$this->_render_group( $group );
420
+			<div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e('Toolbar'); ?>" tabindex="0">
421
+				<?php foreach ($root->children as $group) {
422
+					$this->_render_group($group);
423 423
 				} ?>
424 424
 			</div>
425
-			<?php if ( is_user_logged_in() ) : ?>
426
-			<a class="screen-reader-shortcut" href="<?php echo esc_url( wp_logout_url() ); ?>"><?php _e('Log Out'); ?></a>
425
+			<?php if (is_user_logged_in()) : ?>
426
+			<a class="screen-reader-shortcut" href="<?php echo esc_url(wp_logout_url()); ?>"><?php _e('Log Out'); ?></a>
427 427
 			<?php endif; ?>
428 428
 		</div>
429 429
 
@@ -433,13 +433,13 @@  discard block
 block discarded – undo
433 433
 	/**
434 434
 	 * @param object $node
435 435
 	 */
436
-	final protected function _render_container( $node ) {
437
-		if ( $node->type != 'container' || empty( $node->children ) )
436
+	final protected function _render_container($node) {
437
+		if ($node->type != 'container' || empty($node->children))
438 438
 			return;
439 439
 
440
-		?><div id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>" class="ab-group-container"><?php
441
-			foreach ( $node->children as $group ) {
442
-				$this->_render_group( $group );
440
+		?><div id="<?php echo esc_attr('wp-admin-bar-'.$node->id); ?>" class="ab-group-container"><?php
441
+			foreach ($node->children as $group) {
442
+				$this->_render_group($group);
443 443
 			}
444 444
 		?></div><?php
445 445
 	}
@@ -447,22 +447,22 @@  discard block
 block discarded – undo
447 447
 	/**
448 448
 	 * @param object $node
449 449
 	 */
450
-	final protected function _render_group( $node ) {
451
-		if ( $node->type == 'container' ) {
452
-			$this->_render_container( $node );
450
+	final protected function _render_group($node) {
451
+		if ($node->type == 'container') {
452
+			$this->_render_container($node);
453 453
 			return;
454 454
 		}
455
-		if ( $node->type != 'group' || empty( $node->children ) )
455
+		if ($node->type != 'group' || empty($node->children))
456 456
 			return;
457 457
 
458
-		if ( ! empty( $node->meta['class'] ) )
459
-			$class = ' class="' . esc_attr( trim( $node->meta['class'] ) ) . '"';
458
+		if ( ! empty($node->meta['class']))
459
+			$class = ' class="'.esc_attr(trim($node->meta['class'])).'"';
460 460
 		else
461 461
 			$class = '';
462 462
 
463
-		?><ul id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $class; ?>><?php
464
-			foreach ( $node->children as $item ) {
465
-				$this->_render_item( $item );
463
+		?><ul id="<?php echo esc_attr('wp-admin-bar-'.$node->id); ?>"<?php echo $class; ?>><?php
464
+			foreach ($node->children as $item) {
465
+				$this->_render_item($item);
466 466
 			}
467 467
 		?></ul><?php
468 468
 	}
@@ -470,84 +470,84 @@  discard block
 block discarded – undo
470 470
 	/**
471 471
 	 * @param object $node
472 472
 	 */
473
-	final protected function _render_item( $node ) {
474
-		if ( $node->type != 'item' )
473
+	final protected function _render_item($node) {
474
+		if ($node->type != 'item')
475 475
 			return;
476 476
 
477
-		$is_parent = ! empty( $node->children );
478
-		$has_link  = ! empty( $node->href );
477
+		$is_parent = ! empty($node->children);
478
+		$has_link  = ! empty($node->href);
479 479
 
480
-		$tabindex = isset( $node->meta['tabindex'] ) ? (int) $node->meta['tabindex'] : '';
481
-		$aria_attributes = $tabindex ? 'tabindex="' . $tabindex . '"' : '';
480
+		$tabindex = isset($node->meta['tabindex']) ? (int) $node->meta['tabindex'] : '';
481
+		$aria_attributes = $tabindex ? 'tabindex="'.$tabindex.'"' : '';
482 482
 
483 483
 		$menuclass = '';
484 484
 
485
-		if ( $is_parent ) {
485
+		if ($is_parent) {
486 486
 			$menuclass = 'menupop ';
487 487
 			$aria_attributes .= ' aria-haspopup="true"';
488 488
 		}
489 489
 
490
-		if ( ! empty( $node->meta['class'] ) )
490
+		if ( ! empty($node->meta['class']))
491 491
 			$menuclass .= $node->meta['class'];
492 492
 
493
-		if ( $menuclass )
494
-			$menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"';
493
+		if ($menuclass)
494
+			$menuclass = ' class="'.esc_attr(trim($menuclass)).'"';
495 495
 
496 496
 		?>
497 497
 
498
-		<li id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $menuclass; ?>><?php
499
-			if ( $has_link ):
500
-				?><a class="ab-item" <?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php
501
-					if ( ! empty( $node->meta['onclick'] ) ) :
502
-						?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php
498
+		<li id="<?php echo esc_attr('wp-admin-bar-'.$node->id); ?>"<?php echo $menuclass; ?>><?php
499
+			if ($has_link):
500
+				?><a class="ab-item" <?php echo $aria_attributes; ?> href="<?php echo esc_url($node->href) ?>"<?php
501
+					if ( ! empty($node->meta['onclick'])) :
502
+						?> onclick="<?php echo esc_js($node->meta['onclick']); ?>"<?php
503 503
 					endif;
504
-				if ( ! empty( $node->meta['target'] ) ) :
505
-					?> target="<?php echo esc_attr( $node->meta['target'] ); ?>"<?php
504
+				if ( ! empty($node->meta['target'])) :
505
+					?> target="<?php echo esc_attr($node->meta['target']); ?>"<?php
506 506
 				endif;
507
-				if ( ! empty( $node->meta['title'] ) ) :
508
-					?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
507
+				if ( ! empty($node->meta['title'])) :
508
+					?> title="<?php echo esc_attr($node->meta['title']); ?>"<?php
509 509
 				endif;
510
-				if ( ! empty( $node->meta['rel'] ) ) :
511
-					?> rel="<?php echo esc_attr( $node->meta['rel'] ); ?>"<?php
510
+				if ( ! empty($node->meta['rel'])) :
511
+					?> rel="<?php echo esc_attr($node->meta['rel']); ?>"<?php
512 512
 				endif;
513
-				if ( ! empty( $node->meta['lang'] ) ) :
514
-					?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php
513
+				if ( ! empty($node->meta['lang'])) :
514
+					?> lang="<?php echo esc_attr($node->meta['lang']); ?>"<?php
515 515
 				endif;
516
-				if ( ! empty( $node->meta['dir'] ) ) :
517
-					?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php
516
+				if ( ! empty($node->meta['dir'])) :
517
+					?> dir="<?php echo esc_attr($node->meta['dir']); ?>"<?php
518 518
 				endif;
519 519
 				?>><?php
520 520
 			else:
521 521
 				?><div class="ab-item ab-empty-item" <?php echo $aria_attributes;
522
-				if ( ! empty( $node->meta['title'] ) ) :
523
-					?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
522
+				if ( ! empty($node->meta['title'])) :
523
+					?> title="<?php echo esc_attr($node->meta['title']); ?>"<?php
524 524
 				endif;
525
-				if ( ! empty( $node->meta['lang'] ) ) :
526
-					?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php
525
+				if ( ! empty($node->meta['lang'])) :
526
+					?> lang="<?php echo esc_attr($node->meta['lang']); ?>"<?php
527 527
 				endif;
528
-				if ( ! empty( $node->meta['dir'] ) ) :
529
-					?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php
528
+				if ( ! empty($node->meta['dir'])) :
529
+					?> dir="<?php echo esc_attr($node->meta['dir']); ?>"<?php
530 530
 				endif;
531 531
 				?>><?php
532 532
 			endif;
533 533
 
534 534
 			echo $node->title;
535 535
 
536
-			if ( $has_link ) :
536
+			if ($has_link) :
537 537
 				?></a><?php
538 538
 			else:
539 539
 				?></div><?php
540 540
 			endif;
541 541
 
542
-			if ( $is_parent ) :
542
+			if ($is_parent) :
543 543
 				?><div class="ab-sub-wrapper"><?php
544
-					foreach ( $node->children as $group ) {
545
-						$this->_render_group( $group );
544
+					foreach ($node->children as $group) {
545
+						$this->_render_group($group);
546 546
 					}
547 547
 				?></div><?php
548 548
 			endif;
549 549
 
550
-			if ( ! empty( $node->meta['html'] ) )
550
+			if ( ! empty($node->meta['html']))
551 551
 				echo $node->meta['html'];
552 552
 
553 553
 			?>
@@ -558,9 +558,9 @@  discard block
 block discarded – undo
558 558
 	 * @param string $id    Unused.
559 559
 	 * @param object $node
560 560
 	 */
561
-	public function recursive_render( $id, $node ) {
562
-		_deprecated_function( __METHOD__, '3.3', 'WP_Admin_bar::render(), WP_Admin_Bar::_render_item()' );
563
-		$this->_render_item( $node );
561
+	public function recursive_render($id, $node) {
562
+		_deprecated_function(__METHOD__, '3.3', 'WP_Admin_bar::render(), WP_Admin_Bar::_render_item()');
563
+		$this->_render_item($node);
564 564
 	}
565 565
 
566 566
 	/**
@@ -568,32 +568,32 @@  discard block
 block discarded – undo
568 568
 	 */
569 569
 	public function add_menus() {
570 570
 		// User related, aligned right.
571
-		add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 0 );
572
-		add_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 4 );
573
-		add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 );
571
+		add_action('admin_bar_menu', 'wp_admin_bar_my_account_menu', 0);
572
+		add_action('admin_bar_menu', 'wp_admin_bar_search_menu', 4);
573
+		add_action('admin_bar_menu', 'wp_admin_bar_my_account_item', 7);
574 574
 
575 575
 		// Site related.
576
-		add_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 );
577
-		add_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 );
578
-		add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
579
-		add_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 );
580
-		add_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 );
581
-		add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 50 );
576
+		add_action('admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0);
577
+		add_action('admin_bar_menu', 'wp_admin_bar_wp_menu', 10);
578
+		add_action('admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20);
579
+		add_action('admin_bar_menu', 'wp_admin_bar_site_menu', 30);
580
+		add_action('admin_bar_menu', 'wp_admin_bar_customize_menu', 40);
581
+		add_action('admin_bar_menu', 'wp_admin_bar_updates_menu', 50);
582 582
 
583 583
 		// Content related.
584
-		if ( ! is_network_admin() && ! is_user_admin() ) {
585
-			add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
586
-			add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 );
584
+		if ( ! is_network_admin() && ! is_user_admin()) {
585
+			add_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
586
+			add_action('admin_bar_menu', 'wp_admin_bar_new_content_menu', 70);
587 587
 		}
588
-		add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );
588
+		add_action('admin_bar_menu', 'wp_admin_bar_edit_menu', 80);
589 589
 
590
-		add_action( 'admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200 );
590
+		add_action('admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200);
591 591
 
592 592
 		/**
593 593
 		 * Fires after menus are added to the menu bar.
594 594
 		 *
595 595
 		 * @since 3.1.0
596 596
 		 */
597
-		do_action( 'add_admin_bar_menus' );
597
+		do_action('add_admin_bar_menus');
598 598
 	}
599 599
 }
Please login to merge, or discard this patch.
src/wp-includes/theme-compat/header.php 3 patches
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,10 @@
 block discarded – undo
35 35
 </style>
36 36
 <?php } ?>
37 37
 
38
-<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
38
+<?php if ( is_singular() ) {
39
+	wp_enqueue_script( 'comment-reply' );
40
+}
41
+?>
39 42
 
40 43
 <?php wp_head(); ?>
41 44
 </head>
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package WordPress
4
- * @subpackage Theme_Compat
5
- * @deprecated 3.0
6
- *
7
- * This file is here for Backwards compatibility with old themes and will be removed in a future version
8
- *
9
- */
3
+	 * @package WordPress
4
+	 * @subpackage Theme_Compat
5
+	 * @deprecated 3.0
6
+	 *
7
+	 * This file is here for Backwards compatibility with old themes and will be removed in a future version
8
+	 *
9
+	 */
10 10
 _deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3.0', null, sprintf( __('Please include a %1$s template in your theme.'), basename(__FILE__) ) );
11 11
 
12 12
 // Do not delete these lines
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  */
10 10
 _deprecated_file(
11 11
 	/* translators: %s: template name */
12
-	sprintf( __( 'Theme without %s' ), basename( __FILE__ ) ),
12
+	sprintf(__('Theme without %s'), basename(__FILE__)),
13 13
 	'3.0',
14 14
 	null,
15 15
 	/* translators: %s: template name */
16
-	sprintf( __( 'Please include a %s template in your theme.' ), basename( __FILE__ ) )
16
+	sprintf(__('Please include a %s template in your theme.'), basename(__FILE__))
17 17
 );
18 18
 ?>
19 19
 <!DOCTYPE html>
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
28 28
 <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
29 29
 
30
-<?php if ( file_exists( get_stylesheet_directory() . '/images/kubrickbgwide.jpg' ) ) { ?>
30
+<?php if (file_exists(get_stylesheet_directory().'/images/kubrickbgwide.jpg')) { ?>
31 31
 <style type="text/css" media="screen">
32 32
 
33 33
 <?php
34 34
 // Checks to see whether it needs a sidebar
35
-if ( empty($withcomments) && !is_single() ) {
35
+if (empty($withcomments) && ! is_single()) {
36 36
 ?>
37 37
 	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg-<?php bloginfo('text_direction'); ?>.jpg") repeat-y top; border: none; }
38 38
 <?php } else { // No sidebar ?>
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 </style>
43 43
 <?php } ?>
44 44
 
45
-<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
45
+<?php if (is_singular()) wp_enqueue_script('comment-reply'); ?>
46 46
 
47 47
 <?php wp_head(); ?>
48 48
 </head>
Please login to merge, or discard this patch.
src/wp-includes/cron.php 3 patches
Braces   +72 added lines, -47 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
 	$event = apply_filters( 'schedule_event', $event );
40 40
 
41 41
 	// A plugin disallowed this event
42
-	if ( ! $event )
43
-		return false;
42
+	if ( ! $event ) {
43
+			return false;
44
+	}
44 45
 
45 46
 	$key = md5(serialize($event->args));
46 47
 
@@ -73,16 +74,18 @@  discard block
 block discarded – undo
73 74
 	$crons = _get_cron_array();
74 75
 	$schedules = wp_get_schedules();
75 76
 
76
-	if ( !isset( $schedules[$recurrence] ) )
77
-		return false;
77
+	if ( !isset( $schedules[$recurrence] ) ) {
78
+			return false;
79
+	}
78 80
 
79 81
 	$event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] );
80 82
 	/** This filter is documented in wp-includes/cron.php */
81 83
 	$event = apply_filters( 'schedule_event', $event );
82 84
 
83 85
 	// A plugin disallowed this event
84
-	if ( ! $event )
85
-		return false;
86
+	if ( ! $event ) {
87
+			return false;
88
+	}
86 89
 
87 90
 	$key = md5(serialize($event->args));
88 91
 
@@ -151,10 +154,12 @@  discard block
 block discarded – undo
151 154
 	$crons = _get_cron_array();
152 155
 	$key = md5(serialize($args));
153 156
 	unset( $crons[$timestamp][$hook][$key] );
154
-	if ( empty($crons[$timestamp][$hook]) )
155
-		unset( $crons[$timestamp][$hook] );
156
-	if ( empty($crons[$timestamp]) )
157
-		unset( $crons[$timestamp] );
157
+	if ( empty($crons[$timestamp][$hook]) ) {
158
+			unset( $crons[$timestamp][$hook] );
159
+	}
160
+	if ( empty($crons[$timestamp]) ) {
161
+			unset( $crons[$timestamp] );
162
+	}
158 163
 	_set_cron_array( $crons );
159 164
 }
160 165
 
@@ -178,8 +183,9 @@  discard block
 block discarded – undo
178 183
 	// It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing,
179 184
 	// and, wp_next_scheduled() returns the same schedule in an infinite loop.
180 185
 	$crons = _get_cron_array();
181
-	if ( empty( $crons ) )
182
-		return;
186
+	if ( empty( $crons ) ) {
187
+			return;
188
+	}
183 189
 
184 190
 	$key = md5( serialize( $args ) );
185 191
 	foreach ( $crons as $timestamp => $cron ) {
@@ -201,11 +207,13 @@  discard block
 block discarded – undo
201 207
 function wp_next_scheduled( $hook, $args = array() ) {
202 208
 	$crons = _get_cron_array();
203 209
 	$key = md5(serialize($args));
204
-	if ( empty($crons) )
205
-		return false;
210
+	if ( empty($crons) ) {
211
+			return false;
212
+	}
206 213
 	foreach ( $crons as $timestamp => $cron ) {
207
-		if ( isset( $cron[$hook][$key] ) )
208
-			return $timestamp;
214
+		if ( isset( $cron[$hook][$key] ) ) {
215
+					return $timestamp;
216
+		}
209 217
 	}
210 218
 	return false;
211 219
 }
@@ -216,11 +224,13 @@  discard block
 block discarded – undo
216 224
  * @since 2.1.0
217 225
  */
218 226
 function spawn_cron( $gmt_time = 0 ) {
219
-	if ( ! $gmt_time )
220
-		$gmt_time = microtime( true );
227
+	if ( ! $gmt_time ) {
228
+			$gmt_time = microtime( true );
229
+	}
221 230
 
222
-	if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) )
223
-		return;
231
+	if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) ) {
232
+			return;
233
+	}
224 234
 
225 235
 	/*
226 236
 	 * Get the cron lock, which is a unix timestamp of when the last cron was spawned
@@ -231,21 +241,25 @@  discard block
 block discarded – undo
231 241
 	 */
232 242
 	$lock = get_transient('doing_cron');
233 243
 
234
-	if ( $lock > $gmt_time + 10 * MINUTE_IN_SECONDS )
235
-		$lock = 0;
244
+	if ( $lock > $gmt_time + 10 * MINUTE_IN_SECONDS ) {
245
+			$lock = 0;
246
+	}
236 247
 
237 248
 	// don't run if another process is currently running it or more than once every 60 sec.
238
-	if ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time )
239
-		return;
249
+	if ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time ) {
250
+			return;
251
+	}
240 252
 
241 253
 	//sanity check
242 254
 	$crons = _get_cron_array();
243
-	if ( !is_array($crons) )
244
-		return;
255
+	if ( !is_array($crons) ) {
256
+			return;
257
+	}
245 258
 
246 259
 	$keys = array_keys( $crons );
247
-	if ( isset($keys[0]) && $keys[0] > $gmt_time )
248
-		return;
260
+	if ( isset($keys[0]) && $keys[0] > $gmt_time ) {
261
+			return;
262
+	}
249 263
 
250 264
 	if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {
251 265
 		if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) ||  defined( 'XMLRPC_REQUEST' ) ) {
@@ -311,23 +325,29 @@  discard block
 block discarded – undo
311 325
  */
312 326
 function wp_cron() {
313 327
 	// Prevent infinite loops caused by lack of wp-cron.php
314
-	if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false || ( defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ) )
315
-		return;
328
+	if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false || ( defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ) ) {
329
+			return;
330
+	}
316 331
 
317
-	if ( false === $crons = _get_cron_array() )
318
-		return;
332
+	if ( false === $crons = _get_cron_array() ) {
333
+			return;
334
+	}
319 335
 
320 336
 	$gmt_time = microtime( true );
321 337
 	$keys = array_keys( $crons );
322
-	if ( isset($keys[0]) && $keys[0] > $gmt_time )
323
-		return;
338
+	if ( isset($keys[0]) && $keys[0] > $gmt_time ) {
339
+			return;
340
+	}
324 341
 
325 342
 	$schedules = wp_get_schedules();
326 343
 	foreach ( $crons as $timestamp => $cronhooks ) {
327
-		if ( $timestamp > $gmt_time ) break;
344
+		if ( $timestamp > $gmt_time ) {
345
+			break;
346
+		}
328 347
 		foreach ( (array) $cronhooks as $hook => $args ) {
329
-			if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) )
330
-				continue;
348
+			if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) ) {
349
+							continue;
350
+			}
331 351
 			spawn_cron( $gmt_time );
332 352
 			break 2;
333 353
 		}
@@ -392,11 +412,13 @@  discard block
 block discarded – undo
392 412
 function wp_get_schedule($hook, $args = array()) {
393 413
 	$crons = _get_cron_array();
394 414
 	$key = md5(serialize($args));
395
-	if ( empty($crons) )
396
-		return false;
415
+	if ( empty($crons) ) {
416
+			return false;
417
+	}
397 418
 	foreach ( $crons as $timestamp => $cron ) {
398
-		if ( isset( $cron[$hook][$key] ) )
399
-			return $cron[$hook][$key]['schedule'];
419
+		if ( isset( $cron[$hook][$key] ) ) {
420
+					return $cron[$hook][$key]['schedule'];
421
+		}
400 422
 	}
401 423
 	return false;
402 424
 }
@@ -415,11 +437,13 @@  discard block
 block discarded – undo
415 437
  */
416 438
 function _get_cron_array()  {
417 439
 	$cron = get_option('cron');
418
-	if ( ! is_array($cron) )
419
-		return false;
440
+	if ( ! is_array($cron) ) {
441
+			return false;
442
+	}
420 443
 
421
-	if ( !isset($cron['version']) )
422
-		$cron = _upgrade_cron_array($cron);
444
+	if ( !isset($cron['version']) ) {
445
+			$cron = _upgrade_cron_array($cron);
446
+	}
423 447
 
424 448
 	unset($cron['version']);
425 449
 
@@ -451,8 +475,9 @@  discard block
 block discarded – undo
451 475
  * @return array An upgraded Cron info array.
452 476
  */
453 477
 function _upgrade_cron_array($cron) {
454
-	if ( isset($cron['version']) && 2 == $cron['version'])
455
-		return $cron;
478
+	if ( isset($cron['version']) && 2 == $cron['version']) {
479
+			return $cron;
480
+	}
456 481
 
457 482
 	$new_cron = array();
458 483
 
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * WordPress CRON API
4
- *
5
- * @package WordPress
6
- */
3
+	 * WordPress CRON API
4
+	 *
5
+	 * @package WordPress
6
+	 */
7 7
 
8 8
 /**
9 9
  * Schedules a hook to run only once.
Please login to merge, or discard this patch.
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -20,20 +20,20 @@  discard block
 block discarded – undo
20 20
  * @param array $args Optional. Arguments to pass to the hook's callback function.
21 21
  * @return false|void False when an event is not scheduled.
22 22
  */
23
-function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
23
+function wp_schedule_single_event($timestamp, $hook, $args = array()) {
24 24
 	// Make sure timestamp is a positive integer
25
-	if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
25
+	if ( ! is_numeric($timestamp) || $timestamp <= 0) {
26 26
 		return false;
27 27
 	}
28 28
 
29 29
 	// Don't schedule a duplicate if there's already an identical event due within 10 minutes of it
30 30
 	$next = wp_next_scheduled($hook, $args);
31
-	if ( $next && abs( $next - $timestamp ) <= 10 * MINUTE_IN_SECONDS ) {
31
+	if ($next && abs($next - $timestamp) <= 10 * MINUTE_IN_SECONDS) {
32 32
 		return false;
33 33
 	}
34 34
 
35 35
 	$crons = _get_cron_array();
36
-	$event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => false, 'args' => $args );
36
+	$event = (object) array('hook' => $hook, 'timestamp' => $timestamp, 'schedule' => false, 'args' => $args);
37 37
 	/**
38 38
 	 * Filter a single event before it is scheduled.
39 39
 	 *
@@ -41,17 +41,17 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @param object $event An object containing an event's data.
43 43
 	 */
44
-	$event = apply_filters( 'schedule_event', $event );
44
+	$event = apply_filters('schedule_event', $event);
45 45
 
46 46
 	// A plugin disallowed this event
47
-	if ( ! $event )
47
+	if ( ! $event)
48 48
 		return false;
49 49
 
50 50
 	$key = md5(serialize($event->args));
51 51
 
52
-	$crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args );
53
-	uksort( $crons, "strnatcasecmp" );
54
-	_set_cron_array( $crons );
52
+	$crons[$event->timestamp][$event->hook][$key] = array('schedule' => $event->schedule, 'args' => $event->args);
53
+	uksort($crons, "strnatcasecmp");
54
+	_set_cron_array($crons);
55 55
 }
56 56
 
57 57
 /**
@@ -74,31 +74,31 @@  discard block
 block discarded – undo
74 74
  * @param array $args Optional. Arguments to pass to the hook's callback function.
75 75
  * @return false|void False when an event is not scheduled.
76 76
  */
77
-function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) {
77
+function wp_schedule_event($timestamp, $recurrence, $hook, $args = array()) {
78 78
 	// Make sure timestamp is a positive integer
79
-	if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
79
+	if ( ! is_numeric($timestamp) || $timestamp <= 0) {
80 80
 		return false;
81 81
 	}
82 82
 
83 83
 	$crons = _get_cron_array();
84 84
 	$schedules = wp_get_schedules();
85 85
 
86
-	if ( !isset( $schedules[$recurrence] ) )
86
+	if ( ! isset($schedules[$recurrence]))
87 87
 		return false;
88 88
 
89
-	$event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] );
89
+	$event = (object) array('hook' => $hook, 'timestamp' => $timestamp, 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval']);
90 90
 	/** This filter is documented in wp-includes/cron.php */
91
-	$event = apply_filters( 'schedule_event', $event );
91
+	$event = apply_filters('schedule_event', $event);
92 92
 
93 93
 	// A plugin disallowed this event
94
-	if ( ! $event )
94
+	if ( ! $event)
95 95
 		return false;
96 96
 
97 97
 	$key = md5(serialize($event->args));
98 98
 
99
-	$crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args, 'interval' => $event->interval );
100
-	uksort( $crons, "strnatcasecmp" );
101
-	_set_cron_array( $crons );
99
+	$crons[$event->timestamp][$event->hook][$key] = array('schedule' => $event->schedule, 'args' => $event->args, 'interval' => $event->interval);
100
+	uksort($crons, "strnatcasecmp");
101
+	_set_cron_array($crons);
102 102
 }
103 103
 
104 104
 /**
@@ -112,39 +112,39 @@  discard block
 block discarded – undo
112 112
  * @param array $args Optional. Arguments to pass to the hook's callback function.
113 113
  * @return false|void False when an event is not scheduled.
114 114
  */
115
-function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() ) {
115
+function wp_reschedule_event($timestamp, $recurrence, $hook, $args = array()) {
116 116
 	// Make sure timestamp is a positive integer
117
-	if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
117
+	if ( ! is_numeric($timestamp) || $timestamp <= 0) {
118 118
 		return false;
119 119
 	}
120 120
 
121 121
 	$crons = _get_cron_array();
122 122
 	$schedules = wp_get_schedules();
123
-	$key = md5( serialize( $args ) );
123
+	$key = md5(serialize($args));
124 124
 	$interval = 0;
125 125
 
126 126
 	// First we try to get it from the schedule
127
-	if ( isset( $schedules[ $recurrence ] ) ) {
128
-		$interval = $schedules[ $recurrence ]['interval'];
127
+	if (isset($schedules[$recurrence])) {
128
+		$interval = $schedules[$recurrence]['interval'];
129 129
 	}
130 130
 	// Now we try to get it from the saved interval in case the schedule disappears
131
-	if ( 0 == $interval ) {
132
-		$interval = $crons[ $timestamp ][ $hook ][ $key ]['interval'];
131
+	if (0 == $interval) {
132
+		$interval = $crons[$timestamp][$hook][$key]['interval'];
133 133
 	}
134 134
 	// Now we assume something is wrong and fail to schedule
135
-	if ( 0 == $interval ) {
135
+	if (0 == $interval) {
136 136
 		return false;
137 137
 	}
138 138
 
139 139
 	$now = time();
140 140
 
141
-	if ( $timestamp >= $now ) {
141
+	if ($timestamp >= $now) {
142 142
 		$timestamp = $now + $interval;
143 143
 	} else {
144
-		$timestamp = $now + ( $interval - ( ( $now - $timestamp ) % $interval ) );
144
+		$timestamp = $now + ($interval - (($now - $timestamp) % $interval));
145 145
 	}
146 146
 
147
-	wp_schedule_event( $timestamp, $recurrence, $hook, $args );
147
+	wp_schedule_event($timestamp, $recurrence, $hook, $args);
148 148
 }
149 149
 
150 150
 /**
@@ -163,20 +163,20 @@  discard block
 block discarded – undo
163 163
  * as those used when originally scheduling the event.
164 164
  * @return false|void False when an event is not unscheduled.
165 165
  */
166
-function wp_unschedule_event( $timestamp, $hook, $args = array() ) {
166
+function wp_unschedule_event($timestamp, $hook, $args = array()) {
167 167
 	// Make sure timestamp is a positive integer
168
-	if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
168
+	if ( ! is_numeric($timestamp) || $timestamp <= 0) {
169 169
 		return false;
170 170
 	}
171 171
 
172 172
 	$crons = _get_cron_array();
173 173
 	$key = md5(serialize($args));
174
-	unset( $crons[$timestamp][$hook][$key] );
175
-	if ( empty($crons[$timestamp][$hook]) )
176
-		unset( $crons[$timestamp][$hook] );
177
-	if ( empty($crons[$timestamp]) )
178
-		unset( $crons[$timestamp] );
179
-	_set_cron_array( $crons );
174
+	unset($crons[$timestamp][$hook][$key]);
175
+	if (empty($crons[$timestamp][$hook]))
176
+		unset($crons[$timestamp][$hook]);
177
+	if (empty($crons[$timestamp]))
178
+		unset($crons[$timestamp]);
179
+	_set_cron_array($crons);
180 180
 }
181 181
 
182 182
 /**
@@ -187,25 +187,25 @@  discard block
 block discarded – undo
187 187
  * @param string $hook Action hook, the execution of which will be unscheduled.
188 188
  * @param array $args Optional. Arguments that were to be pass to the hook's callback function.
189 189
  */
190
-function wp_clear_scheduled_hook( $hook, $args = array() ) {
190
+function wp_clear_scheduled_hook($hook, $args = array()) {
191 191
 	// Backward compatibility
192 192
 	// Previously this function took the arguments as discrete vars rather than an array like the rest of the API
193
-	if ( !is_array($args) ) {
194
-		_deprecated_argument( __FUNCTION__, '3.0', __('This argument has changed to an array to match the behavior of the other cron functions.') );
195
-		$args = array_slice( func_get_args(), 1 );
193
+	if ( ! is_array($args)) {
194
+		_deprecated_argument(__FUNCTION__, '3.0', __('This argument has changed to an array to match the behavior of the other cron functions.'));
195
+		$args = array_slice(func_get_args(), 1);
196 196
 	}
197 197
 
198 198
 	// This logic duplicates wp_next_scheduled()
199 199
 	// It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing,
200 200
 	// and, wp_next_scheduled() returns the same schedule in an infinite loop.
201 201
 	$crons = _get_cron_array();
202
-	if ( empty( $crons ) )
202
+	if (empty($crons))
203 203
 		return;
204 204
 
205
-	$key = md5( serialize( $args ) );
206
-	foreach ( $crons as $timestamp => $cron ) {
207
-		if ( isset( $cron[ $hook ][ $key ] ) ) {
208
-			wp_unschedule_event( $timestamp, $hook, $args );
205
+	$key = md5(serialize($args));
206
+	foreach ($crons as $timestamp => $cron) {
207
+		if (isset($cron[$hook][$key])) {
208
+			wp_unschedule_event($timestamp, $hook, $args);
209 209
 		}
210 210
 	}
211 211
 }
@@ -219,13 +219,13 @@  discard block
 block discarded – undo
219 219
  * @param array $args Optional. Arguments to pass to the hook's callback function.
220 220
  * @return false|int The UNIX timestamp of the next time the scheduled event will occur.
221 221
  */
222
-function wp_next_scheduled( $hook, $args = array() ) {
222
+function wp_next_scheduled($hook, $args = array()) {
223 223
 	$crons = _get_cron_array();
224 224
 	$key = md5(serialize($args));
225
-	if ( empty($crons) )
225
+	if (empty($crons))
226 226
 		return false;
227
-	foreach ( $crons as $timestamp => $cron ) {
228
-		if ( isset( $cron[$hook][$key] ) )
227
+	foreach ($crons as $timestamp => $cron) {
228
+		if (isset($cron[$hook][$key]))
229 229
 			return $timestamp;
230 230
 	}
231 231
 	return false;
@@ -238,11 +238,11 @@  discard block
 block discarded – undo
238 238
  *
239 239
  * @param int $gmt_time Optional. Unix timestamp. Default 0 (current time is used).
240 240
  */
241
-function spawn_cron( $gmt_time = 0 ) {
242
-	if ( ! $gmt_time )
243
-		$gmt_time = microtime( true );
241
+function spawn_cron($gmt_time = 0) {
242
+	if ( ! $gmt_time)
243
+		$gmt_time = microtime(true);
244 244
 
245
-	if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) )
245
+	if (defined('DOING_CRON') || isset($_GET['doing_wp_cron']))
246 246
 		return;
247 247
 
248 248
 	/*
@@ -254,45 +254,45 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	$lock = get_transient('doing_cron');
256 256
 
257
-	if ( $lock > $gmt_time + 10 * MINUTE_IN_SECONDS )
257
+	if ($lock > $gmt_time + 10 * MINUTE_IN_SECONDS)
258 258
 		$lock = 0;
259 259
 
260 260
 	// don't run if another process is currently running it or more than once every 60 sec.
261
-	if ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time )
261
+	if ($lock + WP_CRON_LOCK_TIMEOUT > $gmt_time)
262 262
 		return;
263 263
 
264 264
 	//sanity check
265 265
 	$crons = _get_cron_array();
266
-	if ( !is_array($crons) )
266
+	if ( ! is_array($crons))
267 267
 		return;
268 268
 
269
-	$keys = array_keys( $crons );
270
-	if ( isset($keys[0]) && $keys[0] > $gmt_time )
269
+	$keys = array_keys($crons);
270
+	if (isset($keys[0]) && $keys[0] > $gmt_time)
271 271
 		return;
272 272
 
273
-	if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {
274
-		if ( 'GET' !== $_SERVER['REQUEST_METHOD'] || defined( 'DOING_AJAX' ) ||  defined( 'XMLRPC_REQUEST' ) ) {
273
+	if (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON) {
274
+		if ('GET' !== $_SERVER['REQUEST_METHOD'] || defined('DOING_AJAX') || defined('XMLRPC_REQUEST')) {
275 275
 			return;
276 276
 		}
277 277
 
278
-		$doing_wp_cron = sprintf( '%.22F', $gmt_time );
279
-		set_transient( 'doing_cron', $doing_wp_cron );
278
+		$doing_wp_cron = sprintf('%.22F', $gmt_time);
279
+		set_transient('doing_cron', $doing_wp_cron);
280 280
 
281 281
 		ob_start();
282
-		wp_redirect( add_query_arg( 'doing_wp_cron', $doing_wp_cron, wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
282
+		wp_redirect(add_query_arg('doing_wp_cron', $doing_wp_cron, wp_unslash($_SERVER['REQUEST_URI'])));
283 283
 		echo ' ';
284 284
 
285 285
 		// flush any buffers and send the headers
286
-		while ( @ob_end_flush() );
286
+		while (@ob_end_flush());
287 287
 		flush();
288 288
 
289
-		WP_DEBUG ? include_once( ABSPATH . 'wp-cron.php' ) : @include_once( ABSPATH . 'wp-cron.php' );
289
+		WP_DEBUG ? include_once(ABSPATH.'wp-cron.php') : @include_once(ABSPATH.'wp-cron.php');
290 290
 		return;
291 291
 	}
292 292
 
293 293
 	// Set the cron lock with the current unix timestamp, when the cron is being spawned.
294
-	$doing_wp_cron = sprintf( '%.22F', $gmt_time );
295
-	set_transient( 'doing_cron', $doing_wp_cron );
294
+	$doing_wp_cron = sprintf('%.22F', $gmt_time);
295
+	set_transient('doing_cron', $doing_wp_cron);
296 296
 
297 297
 	/**
298 298
 	 * Filter the cron request arguments.
@@ -315,18 +315,18 @@  discard block
 block discarded – undo
315 315
 	 * }
316 316
 	 * @param string $doing_wp_cron The unix timestamp of the cron lock.
317 317
 	 */
318
-	$cron_request = apply_filters( 'cron_request', array(
319
-		'url'  => add_query_arg( 'doing_wp_cron', $doing_wp_cron, site_url( 'wp-cron.php' ) ),
318
+	$cron_request = apply_filters('cron_request', array(
319
+		'url'  => add_query_arg('doing_wp_cron', $doing_wp_cron, site_url('wp-cron.php')),
320 320
 		'key'  => $doing_wp_cron,
321 321
 		'args' => array(
322 322
 			'timeout'   => 0.01,
323 323
 			'blocking'  => false,
324 324
 			/** This filter is documented in wp-includes/class-wp-http-streams.php */
325
-			'sslverify' => apply_filters( 'https_local_ssl_verify', false )
325
+			'sslverify' => apply_filters('https_local_ssl_verify', false)
326 326
 		)
327
-	), $doing_wp_cron );
327
+	), $doing_wp_cron);
328 328
 
329
-	wp_remote_post( $cron_request['url'], $cron_request['args'] );
329
+	wp_remote_post($cron_request['url'], $cron_request['args']);
330 330
 }
331 331
 
332 332
 /**
@@ -336,24 +336,24 @@  discard block
 block discarded – undo
336 336
  */
337 337
 function wp_cron() {
338 338
 	// Prevent infinite loops caused by lack of wp-cron.php
339
-	if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false || ( defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ) )
339
+	if (strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false || (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON))
340 340
 		return;
341 341
 
342
-	if ( false === $crons = _get_cron_array() )
342
+	if (false === $crons = _get_cron_array())
343 343
 		return;
344 344
 
345
-	$gmt_time = microtime( true );
346
-	$keys = array_keys( $crons );
347
-	if ( isset($keys[0]) && $keys[0] > $gmt_time )
345
+	$gmt_time = microtime(true);
346
+	$keys = array_keys($crons);
347
+	if (isset($keys[0]) && $keys[0] > $gmt_time)
348 348
 		return;
349 349
 
350 350
 	$schedules = wp_get_schedules();
351
-	foreach ( $crons as $timestamp => $cronhooks ) {
352
-		if ( $timestamp > $gmt_time ) break;
353
-		foreach ( (array) $cronhooks as $hook => $args ) {
354
-			if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) )
351
+	foreach ($crons as $timestamp => $cronhooks) {
352
+		if ($timestamp > $gmt_time) break;
353
+		foreach ((array) $cronhooks as $hook => $args) {
354
+			if (isset($schedules[$hook]['callback']) && ! call_user_func($schedules[$hook]['callback']))
355 355
 				continue;
356
-			spawn_cron( $gmt_time );
356
+			spawn_cron($gmt_time);
357 357
 			break 2;
358 358
 		}
359 359
 	}
@@ -391,9 +391,9 @@  discard block
 block discarded – undo
391 391
  */
392 392
 function wp_get_schedules() {
393 393
 	$schedules = array(
394
-		'hourly'     => array( 'interval' => HOUR_IN_SECONDS,      'display' => __( 'Once Hourly' ) ),
395
-		'twicedaily' => array( 'interval' => 12 * HOUR_IN_SECONDS, 'display' => __( 'Twice Daily' ) ),
396
-		'daily'      => array( 'interval' => DAY_IN_SECONDS,       'display' => __( 'Once Daily' ) ),
394
+		'hourly'     => array('interval' => HOUR_IN_SECONDS, 'display' => __('Once Hourly')),
395
+		'twicedaily' => array('interval' => 12 * HOUR_IN_SECONDS, 'display' => __('Twice Daily')),
396
+		'daily'      => array('interval' => DAY_IN_SECONDS, 'display' => __('Once Daily')),
397 397
 	);
398 398
 	/**
399 399
 	 * Filter the non-default cron schedules.
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 	 *
403 403
 	 * @param array $new_schedules An array of non-default cron schedules. Default empty.
404 404
 	 */
405
-	return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
405
+	return array_merge(apply_filters('cron_schedules', array()), $schedules);
406 406
 }
407 407
 
408 408
 /**
@@ -417,10 +417,10 @@  discard block
 block discarded – undo
417 417
 function wp_get_schedule($hook, $args = array()) {
418 418
 	$crons = _get_cron_array();
419 419
 	$key = md5(serialize($args));
420
-	if ( empty($crons) )
420
+	if (empty($crons))
421 421
 		return false;
422
-	foreach ( $crons as $timestamp => $cron ) {
423
-		if ( isset( $cron[$hook][$key] ) )
422
+	foreach ($crons as $timestamp => $cron) {
423
+		if (isset($cron[$hook][$key]))
424 424
 			return $cron[$hook][$key]['schedule'];
425 425
 	}
426 426
 	return false;
@@ -438,12 +438,12 @@  discard block
 block discarded – undo
438 438
  *
439 439
  * @return false|array CRON info array.
440 440
  */
441
-function _get_cron_array()  {
441
+function _get_cron_array() {
442 442
 	$cron = get_option('cron');
443
-	if ( ! is_array($cron) )
443
+	if ( ! is_array($cron))
444 444
 		return false;
445 445
 
446
-	if ( !isset($cron['version']) )
446
+	if ( ! isset($cron['version']))
447 447
 		$cron = _upgrade_cron_array($cron);
448 448
 
449 449
 	unset($cron['version']);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
  */
462 462
 function _set_cron_array($cron) {
463 463
 	$cron['version'] = 2;
464
-	update_option( 'cron', $cron );
464
+	update_option('cron', $cron);
465 465
 }
466 466
 
467 467
 /**
@@ -476,19 +476,19 @@  discard block
 block discarded – undo
476 476
  * @return array An upgraded Cron info array.
477 477
  */
478 478
 function _upgrade_cron_array($cron) {
479
-	if ( isset($cron['version']) && 2 == $cron['version'])
479
+	if (isset($cron['version']) && 2 == $cron['version'])
480 480
 		return $cron;
481 481
 
482 482
 	$new_cron = array();
483 483
 
484
-	foreach ( (array) $cron as $timestamp => $hooks) {
485
-		foreach ( (array) $hooks as $hook => $args ) {
484
+	foreach ((array) $cron as $timestamp => $hooks) {
485
+		foreach ((array) $hooks as $hook => $args) {
486 486
 			$key = md5(serialize($args['args']));
487 487
 			$new_cron[$timestamp][$hook][$key] = $args;
488 488
 		}
489 489
 	}
490 490
 
491 491
 	$new_cron['version'] = 2;
492
-	update_option( 'cron', $new_cron );
492
+	update_option('cron', $new_cron);
493 493
 	return $new_cron;
494 494
 }
Please login to merge, or discard this patch.
src/wp-includes/feed-rss2-comments.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * RSS2 Feed Template for displaying RSS2 Comments feed.
4
- *
5
- * @package WordPress
6
- */
3
+	 * RSS2 Feed Template for displaying RSS2 Comments feed.
4
+	 *
5
+	 * @package WordPress
6
+	 */
7 7
 
8 8
 header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
9 9
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@  discard block
 block discarded – undo
5 5
  * @package WordPress
6 6
  */
7 7
 
8
-header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
8
+header('Content-Type: '.feed_content_type('rss2').'; charset='.get_option('blog_charset'), true);
9 9
 
10 10
 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
11 11
 
12 12
 /** This action is documented in wp-includes/feed-rss2.php */
13
-do_action( 'rss_tag_pre', 'rss2-comments' );
13
+do_action('rss_tag_pre', 'rss2-comments');
14 14
 ?>
15 15
 <rss version="2.0"
16 16
 	xmlns:content="http://purl.org/rss/1.0/modules/content/"
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
20 20
 	<?php
21 21
 	/** This action is documented in wp-includes/feed-rss2.php */
22
-	do_action( 'rss2_ns' );
22
+	do_action('rss2_ns');
23 23
 	?>
24 24
 
25 25
 	<?php
@@ -28,17 +28,17 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @since 2.8.0
30 30
 	 */
31
-	do_action( 'rss2_comments_ns' );
31
+	do_action('rss2_comments_ns');
32 32
 	?>
33 33
 >
34 34
 <channel>
35 35
 	<title><?php
36
-		if ( is_singular() )
37
-			printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );
38
-		elseif ( is_search() )
39
-			printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
36
+		if (is_singular())
37
+			printf(ent2ncr(__('Comments on: %s')), get_the_title_rss());
38
+		elseif (is_search())
39
+			printf(ent2ncr(__('Comments for %1$s searching on %2$s')), get_bloginfo_rss('name'), get_search_query());
40 40
 		else
41
-			printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
41
+			printf(ent2ncr(__('Comments for %s')), get_wp_title_rss());
42 42
 	?></title>
43 43
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
44 44
 	<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 	<lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
47 47
 	<sy:updatePeriod><?php
48 48
 		/** This filter is documented in wp-includes/feed-rss2.php */
49
-		echo apply_filters( 'rss_update_period', 'hourly' );
49
+		echo apply_filters('rss_update_period', 'hourly');
50 50
 	?></sy:updatePeriod>
51 51
 	<sy:updateFrequency><?php
52 52
 		/** This filter is documented in wp-includes/feed-rss2.php */
53
-		echo apply_filters( 'rss_update_frequency', '1' );
53
+		echo apply_filters('rss_update_frequency', '1');
54 54
 	?></sy:updateFrequency>
55 55
 	<?php
56 56
 	/**
@@ -58,17 +58,17 @@  discard block
 block discarded – undo
58 58
 	 *
59 59
 	 * @since 2.3.0
60 60
 	 */
61
-	do_action( 'commentsrss2_head' );
61
+	do_action('commentsrss2_head');
62 62
 
63
-	if ( have_comments() ) : while ( have_comments() ) : the_comment();
64
-		$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
63
+	if (have_comments()) : while (have_comments()) : the_comment();
64
+		$comment_post = $GLOBALS['post'] = get_post($comment->comment_post_ID);
65 65
 	?>
66 66
 	<item>
67 67
 		<title><?php
68
-			if ( !is_singular() ) {
68
+			if ( ! is_singular()) {
69 69
 				$title = get_the_title($comment_post->ID);
70 70
 				/** This filter is documented in wp-includes/feed.php */
71
-				$title = apply_filters( 'the_title_rss', $title );
71
+				$title = apply_filters('the_title_rss', $title);
72 72
 				printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
73 73
 			} else {
74 74
 				printf(ent2ncr(__('By: %s')), get_comment_author_rss());
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		<dc:creator><![CDATA[<?php echo get_comment_author_rss() ?>]]></dc:creator>
79 79
 		<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true, false), false); ?></pubDate>
80 80
 		<guid isPermaLink="false"><?php comment_guid() ?></guid>
81
-<?php if ( post_password_required($comment_post) ) : ?>
81
+<?php if (post_password_required($comment_post)) : ?>
82 82
 		<description><?php echo ent2ncr(__('Protected Comments: Please enter your password to view comments.')); ?></description>
83 83
 		<content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
84 84
 <?php else : // post pass ?>
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @param int $comment->comment_ID The ID of the comment being displayed.
94 94
 	 * @param int $comment_post->ID    The ID of the post the comment is connected to.
95 95
 	 */
96
-	do_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID );
96
+	do_action('commentrss2_item', $comment->comment_ID, $comment_post->ID);
97 97
 ?>
98 98
 	</item>
99 99
 <?php endwhile; endif; ?>
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,12 +33,13 @@  discard block
 block discarded – undo
33 33
 >
34 34
 <channel>
35 35
 	<title><?php
36
-		if ( is_singular() )
37
-			printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );
38
-		elseif ( is_search() )
39
-			printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
40
-		else
41
-			printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
36
+		if ( is_singular() ) {
37
+					printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );
38
+		} elseif ( is_search() ) {
39
+					printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
40
+		} else {
41
+					printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
42
+		}
42 43
 	?></title>
43 44
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
44 45
 	<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
@@ -81,10 +82,13 @@  discard block
 block discarded – undo
81 82
 <?php if ( post_password_required($comment_post) ) : ?>
82 83
 		<description><?php echo ent2ncr(__('Protected Comments: Please enter your password to view comments.')); ?></description>
83 84
 		<content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
84
-<?php else : // post pass ?>
85
+<?php else {
86
+	: // post pass ?>
85 87
 		<description><![CDATA[<?php comment_text_rss() ?>]]></description>
86 88
 		<content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded>
87
-<?php endif; // post pass
89
+<?php endif;
90
+}
91
+// post pass
88 92
 	/**
89 93
 	 * Fires at the end of each RSS2 comment feed item.
90 94
 	 *
Please login to merge, or discard this patch.
src/wp-includes/ms-default-constants.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Defines constants and global variables that can be overridden, generally in wp-config.php.
4
- *
5
- * @package WordPress
6
- * @subpackage Multisite
7
- * @since 3.0.0
8
- */
3
+	 * Defines constants and global variables that can be overridden, generally in wp-config.php.
4
+	 *
5
+	 * @package WordPress
6
+	 * @subpackage Multisite
7
+	 * @since 3.0.0
8
+	 */
9 9
 
10 10
 /**
11 11
  * Defines Multisite upload constants.
Please login to merge, or discard this patch.
Braces   +27 added lines, -19 removed lines patch added patch discarded remove patch
@@ -23,12 +23,14 @@  discard block
 block discarded – undo
23 23
 	// This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.
24 24
 	add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
25 25
 
26
-	if ( ! get_site_option( 'ms_files_rewriting' ) )
27
-		return;
26
+	if ( ! get_site_option( 'ms_files_rewriting' ) ) {
27
+			return;
28
+	}
28 29
 
29 30
 	// Base uploads dir relative to ABSPATH
30
-	if ( !defined( 'UPLOADBLOGSDIR' ) )
31
-		define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
31
+	if ( !defined( 'UPLOADBLOGSDIR' ) ) {
32
+			define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
33
+	}
32 34
 
33 35
 	// Note, the main site in a post-MU network uses wp-content/uploads.
34 36
 	// This is handled in wp_upload_dir() by ignoring UPLOADS for this case.
@@ -36,8 +38,9 @@  discard block
 block discarded – undo
36 38
 		define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
37 39
 
38 40
 		// Uploads dir relative to ABSPATH
39
-		if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) )
40
-			define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
41
+		if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) {
42
+					define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
43
+		}
41 44
 	}
42 45
 }
43 46
 
@@ -52,14 +55,16 @@  discard block
 block discarded – undo
52 55
 	/**
53 56
 	 * @since 1.2.0
54 57
 	 */
55
-	if ( !defined( 'COOKIEPATH' ) )
56
-		define( 'COOKIEPATH', $current_site->path );
58
+	if ( !defined( 'COOKIEPATH' ) ) {
59
+			define( 'COOKIEPATH', $current_site->path );
60
+	}
57 61
 
58 62
 	/**
59 63
 	 * @since 1.5.0
60 64
 	 */
61
-	if ( !defined( 'SITECOOKIEPATH' ) )
62
-		define( 'SITECOOKIEPATH', $current_site->path );
65
+	if ( !defined( 'SITECOOKIEPATH' ) ) {
66
+			define( 'SITECOOKIEPATH', $current_site->path );
67
+	}
63 68
 
64 69
 	/**
65 70
 	 * @since 2.6.0
@@ -76,10 +81,11 @@  discard block
 block discarded – undo
76 81
 	 * @since 2.0.0
77 82
 	 */
78 83
 	if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) {
79
-		if ( !empty( $current_site->cookie_domain ) )
80
-			define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain);
81
-		else
82
-			define('COOKIE_DOMAIN', '.' . $current_site->domain);
84
+		if ( !empty( $current_site->cookie_domain ) ) {
85
+					define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain);
86
+		} else {
87
+					define('COOKIE_DOMAIN', '.' . $current_site->domain);
88
+		}
83 89
 	}
84 90
 }
85 91
 
@@ -96,16 +102,18 @@  discard block
 block discarded – undo
96 102
 	 * Optional support for X-Sendfile header
97 103
 	 * @since 3.0.0
98 104
 	 */
99
-	if ( !defined( 'WPMU_SENDFILE' ) )
100
-		define( 'WPMU_SENDFILE', false );
105
+	if ( !defined( 'WPMU_SENDFILE' ) ) {
106
+			define( 'WPMU_SENDFILE', false );
107
+	}
101 108
 
102 109
 	/**
103 110
 	 * Optional support for X-Accel-Redirect header
104 111
 	 * @since 3.0.0
105 112
 	 */
106
-	if ( !defined( 'WPMU_ACCEL_REDIRECT' ) )
107
-		define( 'WPMU_ACCEL_REDIRECT', false );
108
-}
113
+	if ( !defined( 'WPMU_ACCEL_REDIRECT' ) ) {
114
+			define( 'WPMU_ACCEL_REDIRECT', false );
115
+	}
116
+	}
109 117
 
110 118
 /**
111 119
  * Defines Multisite subdomain constants and handles warnings and notices.
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -21,23 +21,23 @@  discard block
 block discarded – undo
21 21
 	global $wpdb;
22 22
 
23 23
 	// This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.
24
-	add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
24
+	add_filter('default_site_option_ms_files_rewriting', '__return_true');
25 25
 
26
-	if ( ! get_site_option( 'ms_files_rewriting' ) )
26
+	if ( ! get_site_option('ms_files_rewriting'))
27 27
 		return;
28 28
 
29 29
 	// Base uploads dir relative to ABSPATH
30
-	if ( !defined( 'UPLOADBLOGSDIR' ) )
31
-		define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
30
+	if ( ! defined('UPLOADBLOGSDIR'))
31
+		define('UPLOADBLOGSDIR', 'wp-content/blogs.dir');
32 32
 
33 33
 	// Note, the main site in a post-MU network uses wp-content/uploads.
34 34
 	// This is handled in wp_upload_dir() by ignoring UPLOADS for this case.
35
-	if ( ! defined( 'UPLOADS' ) ) {
36
-		define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
35
+	if ( ! defined('UPLOADS')) {
36
+		define('UPLOADS', UPLOADBLOGSDIR."/{$wpdb->blogid}/files/");
37 37
 
38 38
 		// Uploads dir relative to ABSPATH
39
-		if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) )
40
-			define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
39
+		if ('wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined('BLOGUPLOADDIR'))
40
+			define('BLOGUPLOADDIR', WP_CONTENT_DIR."/blogs.dir/{$wpdb->blogid}/files/");
41 41
 	}
42 42
 }
43 43
 
@@ -52,34 +52,34 @@  discard block
 block discarded – undo
52 52
 	/**
53 53
 	 * @since 1.2.0
54 54
 	 */
55
-	if ( !defined( 'COOKIEPATH' ) )
56
-		define( 'COOKIEPATH', $current_site->path );
55
+	if ( ! defined('COOKIEPATH'))
56
+		define('COOKIEPATH', $current_site->path);
57 57
 
58 58
 	/**
59 59
 	 * @since 1.5.0
60 60
 	 */
61
-	if ( !defined( 'SITECOOKIEPATH' ) )
62
-		define( 'SITECOOKIEPATH', $current_site->path );
61
+	if ( ! defined('SITECOOKIEPATH'))
62
+		define('SITECOOKIEPATH', $current_site->path);
63 63
 
64 64
 	/**
65 65
 	 * @since 2.6.0
66 66
 	 */
67
-	if ( !defined( 'ADMIN_COOKIE_PATH' ) ) {
68
-		if ( ! is_subdomain_install() || trim( parse_url( get_option( 'siteurl' ), PHP_URL_PATH ), '/' ) ) {
69
-			define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );
67
+	if ( ! defined('ADMIN_COOKIE_PATH')) {
68
+		if ( ! is_subdomain_install() || trim(parse_url(get_option('siteurl'), PHP_URL_PATH), '/')) {
69
+			define('ADMIN_COOKIE_PATH', SITECOOKIEPATH);
70 70
 		} else {
71
-			define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
71
+			define('ADMIN_COOKIE_PATH', SITECOOKIEPATH.'wp-admin');
72 72
 		}
73 73
 	}
74 74
 
75 75
 	/**
76 76
 	 * @since 2.0.0
77 77
 	 */
78
-	if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) {
79
-		if ( !empty( $current_site->cookie_domain ) )
80
-			define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain);
78
+	if ( ! defined('COOKIE_DOMAIN') && is_subdomain_install()) {
79
+		if ( ! empty($current_site->cookie_domain))
80
+			define('COOKIE_DOMAIN', '.'.$current_site->cookie_domain);
81 81
 		else
82
-			define('COOKIE_DOMAIN', '.' . $current_site->domain);
82
+			define('COOKIE_DOMAIN', '.'.$current_site->domain);
83 83
 	}
84 84
 }
85 85
 
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
 	 * Optional support for X-Sendfile header
97 97
 	 * @since 3.0.0
98 98
 	 */
99
-	if ( !defined( 'WPMU_SENDFILE' ) )
100
-		define( 'WPMU_SENDFILE', false );
99
+	if ( ! defined('WPMU_SENDFILE'))
100
+		define('WPMU_SENDFILE', false);
101 101
 
102 102
 	/**
103 103
 	 * Optional support for X-Accel-Redirect header
104 104
 	 * @since 3.0.0
105 105
 	 */
106
-	if ( !defined( 'WPMU_ACCEL_REDIRECT' ) )
107
-		define( 'WPMU_ACCEL_REDIRECT', false );
106
+	if ( ! defined('WPMU_ACCEL_REDIRECT'))
107
+		define('WPMU_ACCEL_REDIRECT', false);
108 108
 }
109 109
 
110 110
 /**
@@ -124,41 +124,41 @@  discard block
 block discarded – undo
124 124
 	static $subdomain_error = null;
125 125
 	static $subdomain_error_warn = null;
126 126
 
127
-	if ( false === $subdomain_error ) {
127
+	if (false === $subdomain_error) {
128 128
 		return;
129 129
 	}
130 130
 
131
-	if ( $subdomain_error ) {
131
+	if ($subdomain_error) {
132 132
 		$vhost_deprecated = sprintf(
133 133
 			/* translators: 1: VHOST, 2: SUBDOMAIN_INSTALL, 3: wp-config.php, 4: is_subdomain_install() */
134
-			__( 'The constant %1$s <strong>is deprecated</strong>. Use the boolean constant %2$s in %3$s to enable a subdomain configuration. Use %4$s to check whether a subdomain configuration is enabled.' ),
134
+			__('The constant %1$s <strong>is deprecated</strong>. Use the boolean constant %2$s in %3$s to enable a subdomain configuration. Use %4$s to check whether a subdomain configuration is enabled.'),
135 135
 			'<code>VHOST</code>',
136 136
 			'<code>SUBDOMAIN_INSTALL</code>',
137 137
 			'<code>wp-config.php</code>',
138 138
 			'<code>is_subdomain_install()</code>'
139 139
 		);
140
-		if ( $subdomain_error_warn ) {
141
-			trigger_error( __( '<strong>Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL.</strong> The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.' ) . ' ' . $vhost_deprecated, E_USER_WARNING );
140
+		if ($subdomain_error_warn) {
141
+			trigger_error(__('<strong>Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL.</strong> The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.').' '.$vhost_deprecated, E_USER_WARNING);
142 142
 		} else {
143
-	 		_deprecated_argument( 'define()', '3.0', $vhost_deprecated );
143
+	 		_deprecated_argument('define()', '3.0', $vhost_deprecated);
144 144
 		}
145 145
 		return;
146 146
 	}
147 147
 
148
-	if ( defined( 'SUBDOMAIN_INSTALL' ) && defined( 'VHOST' ) ) {
148
+	if (defined('SUBDOMAIN_INSTALL') && defined('VHOST')) {
149 149
 		$subdomain_error = true;
150
-		if ( SUBDOMAIN_INSTALL !== ( 'yes' == VHOST ) ) {
150
+		if (SUBDOMAIN_INSTALL !== ('yes' == VHOST)) {
151 151
 			$subdomain_error_warn = true;
152 152
 		}
153
-	} elseif ( defined( 'SUBDOMAIN_INSTALL' ) ) {
153
+	} elseif (defined('SUBDOMAIN_INSTALL')) {
154 154
 		$subdomain_error = false;
155
-		define( 'VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no' );
156
-	} elseif ( defined( 'VHOST' ) ) {
155
+		define('VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no');
156
+	} elseif (defined('VHOST')) {
157 157
 		$subdomain_error = true;
158
-		define( 'SUBDOMAIN_INSTALL', 'yes' == VHOST );
158
+		define('SUBDOMAIN_INSTALL', 'yes' == VHOST);
159 159
 	} else {
160 160
 		$subdomain_error = false;
161
-		define( 'SUBDOMAIN_INSTALL', false );
162
-		define( 'VHOST', 'no' );
161
+		define('SUBDOMAIN_INSTALL', false);
162
+		define('VHOST', 'no');
163 163
 	}
164 164
 }
Please login to merge, or discard this patch.
src/wp-includes/deprecated.php 4 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Deprecated functions from past WordPress versions. You shouldn't use these
4
- * functions and look for the alternatives instead. The functions will be
5
- * removed in a later version.
6
- *
7
- * @package WordPress
8
- * @subpackage Deprecated
9
- */
3
+	 * Deprecated functions from past WordPress versions. You shouldn't use these
4
+	 * functions and look for the alternatives instead. The functions will be
5
+	 * removed in a later version.
6
+	 *
7
+	 * @package WordPress
8
+	 * @subpackage Deprecated
9
+	 */
10 10
 
11 11
 /*
12 12
  * Deprecated functions come here to die.
Please login to merge, or discard this patch.
Doc Comments   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
  * @param string $feed_image
611 611
  * @param string $exclude
612 612
  * @param bool $hierarchical
613
- * @return false|null
613
+ * @return false|string
614 614
  */
615 615
 function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
616 616
 				   $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
  * @see wp_list_categories()
631 631
  *
632 632
  * @param string|array $args
633
- * @return false|null|string
633
+ * @return false|string
634 634
  */
635 635
 function wp_list_cats($args = '') {
636 636
 	_deprecated_function( __FUNCTION__, '2.1', 'wp_list_categories()' );
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
  * @param bool $echo
781 781
  * @param int $author_id
782 782
  * @param string $author_nicename Optional.
783
- * @return string|null
783
+ * @return string
784 784
  */
785 785
 function get_author_link($echo, $author_id, $author_nicename = '') {
786 786
 	_deprecated_function( __FUNCTION__, '2.1', 'get_author_posts_url()' );
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
  * @deprecated 2.8.0 Use get_the_author_meta()
1603 1603
  * @see get_the_author_meta()
1604 1604
  *
1605
- * @return string|int The author's ID.
1605
+ * @return string The author's ID.
1606 1606
  */
1607 1607
 function get_the_author_ID() {
1608 1608
 	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' );
@@ -2101,7 +2101,6 @@  discard block
 block discarded – undo
2101 2101
  * @param string|int $name            Widget ID.
2102 2102
  * @param callable   $output_callback Run when widget is called.
2103 2103
  * @param string     $classname       Optional. Classname widget option. Default empty.
2104
- * @param mixed      $params ,...     Widget parameters.
2105 2104
  */
2106 2105
 function register_sidebar_widget($name, $output_callback, $classname = '') {
2107 2106
 	_deprecated_function( __FUNCTION__, '2.8', 'wp_register_sidebar_widget()' );
@@ -2419,7 +2418,7 @@  discard block
 block discarded – undo
2419 2418
  * @see count_user_posts()
2420 2419
  *
2421 2420
  * @param int $userid User to count posts for.
2422
- * @return int Number of posts the given user has written.
2421
+ * @return string Number of posts the given user has written.
2423 2422
  */
2424 2423
 function get_usernumposts( $userid ) {
2425 2424
 	_deprecated_function( __FUNCTION__, '3.0', 'count_user_posts()' );
@@ -3600,7 +3599,7 @@  discard block
 block discarded – undo
3600 3599
  * @deprecated 4.4.0 Use get_permalink()
3601 3600
  * @see get_permalink()
3602 3601
  *
3603
- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
3602
+ * @param integer $post_id Optional. Post ID or WP_Post object. Default is global $post.
3604 3603
  * @return string|false
3605 3604
  */
3606 3605
 function post_permalink( $post_id = 0 ) {
Please login to merge, or discard this patch.
Spacing   +525 added lines, -525 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
  * @return array Post data.
24 24
  */
25 25
 function get_postdata($postid) {
26
-	_deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' );
26
+	_deprecated_function(__FUNCTION__, '1.5.1', 'get_post()');
27 27
 
28 28
 	$post = get_post($postid);
29 29
 
30
-	$postdata = array (
30
+	$postdata = array(
31 31
 		'ID' => $post->ID,
32 32
 		'Author_ID' => $post->post_author,
33 33
 		'Date' => $post->post_date,
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 function start_wp() {
62 62
 	global $wp_query;
63 63
 
64
-	_deprecated_function( __FUNCTION__, '1.5', __('new WordPress Loop') );
64
+	_deprecated_function(__FUNCTION__, '1.5', __('new WordPress Loop'));
65 65
 
66 66
 	// Since the old style loop is being used, advance the query iterator here.
67 67
 	$wp_query->next_post();
68 68
 
69
-	setup_postdata( get_post() );
69
+	setup_postdata(get_post());
70 70
 }
71 71
 
72 72
 /**
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
  * @return int Category ID.
81 81
  */
82 82
 function the_category_ID($echo = true) {
83
-	_deprecated_function( __FUNCTION__, '0.71', 'get_the_category()' );
83
+	_deprecated_function(__FUNCTION__, '0.71', 'get_the_category()');
84 84
 
85 85
 	// Grab the first cat in the list.
86 86
 	$categories = get_the_category();
87 87
 	$cat = $categories[0]->term_id;
88 88
 
89
-	if ( $echo )
89
+	if ($echo)
90 90
 		echo $cat;
91 91
 
92 92
 	return $cat;
@@ -102,15 +102,15 @@  discard block
 block discarded – undo
102 102
  * @param string $before Optional. Text to display before the category. Default empty.
103 103
  * @param string $after  Optional. Text to display after the category. Default empty.
104 104
  */
105
-function the_category_head( $before = '', $after = '' ) {
105
+function the_category_head($before = '', $after = '') {
106 106
 	global $currentcat, $previouscat;
107 107
 
108
-	_deprecated_function( __FUNCTION__, '0.71', 'get_the_category_by_ID()' );
108
+	_deprecated_function(__FUNCTION__, '0.71', 'get_the_category_by_ID()');
109 109
 
110 110
 	// Grab the first cat in the list.
111 111
 	$categories = get_the_category();
112 112
 	$currentcat = $categories[0]->category_id;
113
-	if ( $currentcat != $previouscat ) {
113
+	if ($currentcat != $previouscat) {
114 114
 		echo $before;
115 115
 		echo get_the_category_by_ID($currentcat);
116 116
 		echo $after;
@@ -132,22 +132,22 @@  discard block
 block discarded – undo
132 132
  * @param int    $limitprev
133 133
  * @param string $excluded_categories
134 134
  */
135
-function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
135
+function previous_post($format = '%', $previous = 'previous post: ', $title = 'yes', $in_same_cat = 'no', $limitprev = 1, $excluded_categories = '') {
136 136
 
137
-	_deprecated_function( __FUNCTION__, '2.0', 'previous_post_link()' );
137
+	_deprecated_function(__FUNCTION__, '2.0', 'previous_post_link()');
138 138
 
139
-	if ( empty($in_same_cat) || 'no' == $in_same_cat )
139
+	if (empty($in_same_cat) || 'no' == $in_same_cat)
140 140
 		$in_same_cat = false;
141 141
 	else
142 142
 		$in_same_cat = true;
143 143
 
144 144
 	$post = get_previous_post($in_same_cat, $excluded_categories);
145 145
 
146
-	if ( !$post )
146
+	if ( ! $post)
147 147
 		return;
148 148
 
149 149
 	$string = '<a href="'.get_permalink($post->ID).'">'.$previous;
150
-	if ( 'yes' == $title )
150
+	if ('yes' == $title)
151 151
 		$string .= apply_filters('the_title', $post->post_title, $post->ID);
152 152
 	$string .= '</a>';
153 153
 	$format = str_replace('%', $string, $format);
@@ -168,21 +168,21 @@  discard block
 block discarded – undo
168 168
  * @param int $limitnext
169 169
  * @param string $excluded_categories
170 170
  */
171
-function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
172
-	_deprecated_function( __FUNCTION__, '2.0', 'next_post_link()' );
171
+function next_post($format = '%', $next = 'next post: ', $title = 'yes', $in_same_cat = 'no', $limitnext = 1, $excluded_categories = '') {
172
+	_deprecated_function(__FUNCTION__, '2.0', 'next_post_link()');
173 173
 
174
-	if ( empty($in_same_cat) || 'no' == $in_same_cat )
174
+	if (empty($in_same_cat) || 'no' == $in_same_cat)
175 175
 		$in_same_cat = false;
176 176
 	else
177 177
 		$in_same_cat = true;
178 178
 
179 179
 	$post = get_next_post($in_same_cat, $excluded_categories);
180 180
 
181
-	if ( !$post	)
181
+	if ( ! $post)
182 182
 		return;
183 183
 
184 184
 	$string = '<a href="'.get_permalink($post->ID).'">'.$next;
185
-	if ( 'yes' == $title )
185
+	if ('yes' == $title)
186 186
 		$string .= apply_filters('the_title', $post->post_title, $post->ID);
187 187
 	$string .= '</a>';
188 188
 	$format = str_replace('%', $string, $format);
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
  * @return bool
203 203
  */
204 204
 function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') {
205
-	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
205
+	_deprecated_function(__FUNCTION__, '2.0', 'current_user_can()');
206 206
 
207 207
 	$author_data = get_userdata($user_id);
208 208
 	return ($author_data->user_level > 1);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
  * @return bool
222 222
  */
223 223
 function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') {
224
-	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
224
+	_deprecated_function(__FUNCTION__, '2.0', 'current_user_can()');
225 225
 
226 226
 	$author_data = get_userdata($user_id);
227 227
 	return ($author_data->user_level >= 1);
@@ -240,15 +240,15 @@  discard block
 block discarded – undo
240 240
  * @return bool
241 241
  */
242 242
 function user_can_edit_post($user_id, $post_id, $blog_id = 1) {
243
-	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
243
+	_deprecated_function(__FUNCTION__, '2.0', 'current_user_can()');
244 244
 
245 245
 	$author_data = get_userdata($user_id);
246 246
 	$post = get_post($post_id);
247 247
 	$post_author_data = get_userdata($post->post_author);
248 248
 
249
-	if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2))
249
+	if ((($user_id == $post_author_data->ID) && ! ($post->post_status == 'publish' && $author_data->user_level < 2))
250 250
 			 || ($author_data->user_level > $post_author_data->user_level)
251
-			 || ($author_data->user_level >= 10) ) {
251
+			 || ($author_data->user_level >= 10)) {
252 252
 		return true;
253 253
 	} else {
254 254
 		return false;
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
  * @return bool
269 269
  */
270 270
 function user_can_delete_post($user_id, $post_id, $blog_id = 1) {
271
-	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
271
+	_deprecated_function(__FUNCTION__, '2.0', 'current_user_can()');
272 272
 
273 273
 	// right now if one can edit, one can delete
274 274
 	return user_can_edit_post($user_id, $post_id, $blog_id);
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
  * @return bool
288 288
  */
289 289
 function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') {
290
-	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
290
+	_deprecated_function(__FUNCTION__, '2.0', 'current_user_can()');
291 291
 
292 292
 	$author_data = get_userdata($user_id);
293 293
 	return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id));
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
  * @return bool returns true if $user_id can edit $post_id's date
307 307
  */
308 308
 function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) {
309
-	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
309
+	_deprecated_function(__FUNCTION__, '2.0', 'current_user_can()');
310 310
 
311 311
 	$author_data = get_userdata($user_id);
312 312
 	return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id));
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
  * @return bool returns true if $user_id can edit $post_id's comments
326 326
  */
327 327
 function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) {
328
-	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
328
+	_deprecated_function(__FUNCTION__, '2.0', 'current_user_can()');
329 329
 
330 330
 	// right now if one can edit a post, one can edit comments made on it
331 331
 	return user_can_edit_post($user_id, $post_id, $blog_id);
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
  * @return bool returns true if $user_id can delete $post_id's comments
345 345
  */
346 346
 function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) {
347
-	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
347
+	_deprecated_function(__FUNCTION__, '2.0', 'current_user_can()');
348 348
 
349 349
 	// right now if one can edit comments, one can delete comments
350 350
 	return user_can_edit_post_comments($user_id, $post_id, $blog_id);
@@ -362,11 +362,11 @@  discard block
 block discarded – undo
362 362
  * @return bool
363 363
  */
364 364
 function user_can_edit_user($user_id, $other_user) {
365
-	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
365
+	_deprecated_function(__FUNCTION__, '2.0', 'current_user_can()');
366 366
 
367 367
 	$user  = get_userdata($user_id);
368 368
 	$other = get_userdata($other_user);
369
-	if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )
369
+	if ($user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID)
370 370
 		return true;
371 371
 	else
372 372
 		return false;
@@ -395,11 +395,11 @@  discard block
 block discarded – undo
395 395
 function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id',
396 396
 						 $show_description = true, $show_rating = false,
397 397
 						 $limit = -1, $show_updated = 0) {
398
-	_deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' );
398
+	_deprecated_function(__FUNCTION__, '2.1', 'get_bookmarks()');
399 399
 
400 400
 	$cat_id = -1;
401 401
 	$cat = get_term_by('name', $cat_name, 'link_category');
402
-	if ( $cat )
402
+	if ($cat)
403 403
 		$cat_id = $cat->term_id;
404 404
 
405 405
 	get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated);
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 		'title_li' => '',
431 431
 	);
432 432
 
433
-	$r = wp_parse_args( $args, $defaults );
433
+	$r = wp_parse_args($args, $defaults);
434 434
 
435 435
 	return wp_list_bookmarks($r);
436 436
 }
@@ -454,12 +454,12 @@  discard block
 block discarded – undo
454 454
  * @param int $limit Limit to X entries. If not specified, all entries are shown.
455 455
  * @return array
456 456
  */
457
-function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) {
458
-	_deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' );
457
+function get_linkobjectsbyname($cat_name = "noname", $orderby = 'name', $limit = -1) {
458
+	_deprecated_function(__FUNCTION__, '2.1', 'get_bookmarks()');
459 459
 
460 460
 	$cat_id = -1;
461 461
 	$cat = get_term_by('name', $cat_name, 'link_category');
462
-	if ( $cat )
462
+	if ($cat)
463 463
 		$cat_id = $cat->term_id;
464 464
 
465 465
 	return get_linkobjects($cat_id, $orderby, $limit);
@@ -506,9 +506,9 @@  discard block
 block discarded – undo
506 506
  * @return array
507 507
  */
508 508
 function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) {
509
-	_deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' );
509
+	_deprecated_function(__FUNCTION__, '2.1', 'get_bookmarks()');
510 510
 
511
-	$links = get_bookmarks( array( 'category' => $category, 'orderby' => $orderby, 'limit' => $limit ) ) ;
511
+	$links = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'limit' => $limit));
512 512
 
513 513
 	$links_array = array();
514 514
 	foreach ($links as $link)
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
  */
540 540
 function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ",
541 541
 									$show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
542
-	_deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' );
542
+	_deprecated_function(__FUNCTION__, '2.1', 'get_bookmarks()');
543 543
 
544 544
 	get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
545 545
 }
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
  */
567 567
 function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true,
568 568
 							  $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
569
-	_deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' );
569
+	_deprecated_function(__FUNCTION__, '2.1', 'get_bookmarks()');
570 570
 
571 571
 	get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
572 572
 }
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
  * @return int Only returns 0.
582 582
  */
583 583
 function get_autotoggle($id = 0) {
584
-	_deprecated_function( __FUNCTION__, '2.1' );
584
+	_deprecated_function(__FUNCTION__, '2.1');
585 585
 	return 0;
586 586
 }
587 587
 
@@ -613,9 +613,9 @@  discard block
 block discarded – undo
613 613
  * @return false|null
614 614
  */
615 615
 function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
616
-				   $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,
617
-				   $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) {
618
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_list_categories()' );
616
+				   $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children = false, $child_of = 0, $categories = 0,
617
+				   $recurse = 0, $feed = '', $feed_image = '', $exclude = '', $hierarchical = false) {
618
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_list_categories()');
619 619
 
620 620
 	$query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children',
621 621
 		'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical');
@@ -633,22 +633,22 @@  discard block
 block discarded – undo
633 633
  * @return false|null|string
634 634
  */
635 635
 function wp_list_cats($args = '') {
636
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_list_categories()' );
636
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_list_categories()');
637 637
 
638
-	$r = wp_parse_args( $args );
638
+	$r = wp_parse_args($args);
639 639
 
640 640
 	// Map to new names.
641
-	if ( isset($r['optionall']) && isset($r['all']))
641
+	if (isset($r['optionall']) && isset($r['all']))
642 642
 		$r['show_option_all'] = $r['all'];
643
-	if ( isset($r['sort_column']) )
643
+	if (isset($r['sort_column']))
644 644
 		$r['orderby'] = $r['sort_column'];
645
-	if ( isset($r['sort_order']) )
645
+	if (isset($r['sort_order']))
646 646
 		$r['order'] = $r['sort_order'];
647
-	if ( isset($r['optiondates']) )
647
+	if (isset($r['optiondates']))
648 648
 		$r['show_last_update'] = $r['optiondates'];
649
-	if ( isset($r['optioncount']) )
649
+	if (isset($r['optioncount']))
650 650
 		$r['show_count'] = $r['optioncount'];
651
-	if ( isset($r['list']) )
651
+	if (isset($r['list']))
652 652
 		$r['style'] = $r['list'] ? 'list' : 'break';
653 653
 	$r['title_li'] = '';
654 654
 
@@ -677,14 +677,14 @@  discard block
 block discarded – undo
677 677
 function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc',
678 678
 		$show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false,
679 679
 		$selected = 0, $exclude = 0) {
680
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_dropdown_categories()' );
680
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_dropdown_categories()');
681 681
 
682 682
 	$show_option_all = '';
683
-	if ( $optionall )
683
+	if ($optionall)
684 684
 		$show_option_all = $all;
685 685
 
686 686
 	$show_option_none = '';
687
-	if ( $optionnone )
687
+	if ($optionnone)
688 688
 		$show_option_none = __('None');
689 689
 
690 690
 	$vars = compact('show_option_all', 'show_option_none', 'orderby', 'order',
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
  * @return null|string
710 710
  */
711 711
 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
712
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_list_authors()' );
712
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_list_authors()');
713 713
 
714 714
 	$args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image');
715 715
 	return wp_list_authors($args);
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
  * @return array
728 728
  */
729 729
 function wp_get_post_cats($blogid = '1', $post_ID = 0) {
730
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_get_post_categories()' );
730
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_get_post_categories()');
731 731
 	return wp_get_post_categories($post_ID);
732 732
 }
733 733
 
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
  * @return bool|mixed
746 746
  */
747 747
 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) {
748
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_set_post_categories()' );
748
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_set_post_categories()');
749 749
 	return wp_set_post_categories($post_ID, $post_categories);
750 750
 }
751 751
 
@@ -764,8 +764,8 @@  discard block
 block discarded – undo
764 764
  * @param bool $show_post_count
765 765
  * @return string|null
766 766
  */
767
-function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) {
768
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_get_archives()' );
767
+function get_archives($type = '', $limit = '', $format = 'html', $before = '', $after = '', $show_post_count = false) {
768
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_get_archives()');
769 769
 	$args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count');
770 770
 	return wp_get_archives($args);
771 771
 }
@@ -783,11 +783,11 @@  discard block
 block discarded – undo
783 783
  * @return string|null
784 784
  */
785 785
 function get_author_link($echo, $author_id, $author_nicename = '') {
786
-	_deprecated_function( __FUNCTION__, '2.1', 'get_author_posts_url()' );
786
+	_deprecated_function(__FUNCTION__, '2.1', 'get_author_posts_url()');
787 787
 
788 788
 	$link = get_author_posts_url($author_id, $author_nicename);
789 789
 
790
-	if ( $echo )
790
+	if ($echo)
791 791
 		echo $link;
792 792
 	return $link;
793 793
 }
@@ -808,9 +808,9 @@  discard block
 block discarded – undo
808 808
  * @param string $more_file
809 809
  * @return string
810 810
  */
811
-function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page',
812
-					$pagelink='%', $more_file='') {
813
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_link_pages()' );
811
+function link_pages($before = '<br />', $after = '<br />', $next_or_number = 'number', $nextpagelink = 'next page', $previouspagelink = 'previous page',
812
+					$pagelink = '%', $more_file = '') {
813
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_link_pages()');
814 814
 
815 815
 	$args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file');
816 816
 	return wp_link_pages($args);
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
  * @return string
828 828
  */
829 829
 function get_settings($option) {
830
-	_deprecated_function( __FUNCTION__, '2.1', 'get_option()' );
830
+	_deprecated_function(__FUNCTION__, '2.1', 'get_option()');
831 831
 
832 832
 	return get_option($option);
833 833
 }
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
  * @see the_permalink()
841 841
  */
842 842
 function permalink_link() {
843
-	_deprecated_function( __FUNCTION__, '1.2', 'the_permalink()' );
843
+	_deprecated_function(__FUNCTION__, '1.2', 'the_permalink()');
844 844
 	the_permalink();
845 845
 }
846 846
 
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
  * @param string $deprecated
855 855
  */
856 856
 function permalink_single_rss($deprecated = '') {
857
-	_deprecated_function( __FUNCTION__, '2.3', 'the_permalink_rss()' );
857
+	_deprecated_function(__FUNCTION__, '2.3', 'the_permalink_rss()');
858 858
 	the_permalink_rss();
859 859
 }
860 860
 
@@ -869,11 +869,11 @@  discard block
 block discarded – undo
869 869
  * @return null|string
870 870
  */
871 871
 function wp_get_links($args = '') {
872
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' );
872
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_list_bookmarks()');
873 873
 
874
-	if ( strpos( $args, '=' ) === false ) {
874
+	if (strpos($args, '=') === false) {
875 875
 		$cat_id = $args;
876
-		$args = add_query_arg( 'category', $cat_id, $args );
876
+		$args = add_query_arg('category', $cat_id, $args);
877 877
 	}
878 878
 
879 879
 	$defaults = array(
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
 		'title_li' => '',
893 893
 	);
894 894
 
895
-	$r = wp_parse_args( $args, $defaults );
895
+	$r = wp_parse_args($args, $defaults);
896 896
 
897 897
 	return wp_list_bookmarks($r);
898 898
 }
@@ -923,81 +923,81 @@  discard block
 block discarded – undo
923 923
  */
924 924
 function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
925 925
 			$show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) {
926
-	_deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' );
926
+	_deprecated_function(__FUNCTION__, '2.1', 'get_bookmarks()');
927 927
 
928 928
 	$order = 'ASC';
929
-	if ( substr($orderby, 0, 1) == '_' ) {
929
+	if (substr($orderby, 0, 1) == '_') {
930 930
 		$order = 'DESC';
931 931
 		$orderby = substr($orderby, 1);
932 932
 	}
933 933
 
934
-	if ( $category == -1 ) //get_bookmarks uses '' to signify all categories
934
+	if ($category == -1) //get_bookmarks uses '' to signify all categories
935 935
 		$category = '';
936 936
 
937 937
 	$results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit));
938 938
 
939
-	if ( !$results )
939
+	if ( ! $results)
940 940
 		return;
941 941
 
942 942
 	$output = '';
943 943
 
944
-	foreach ( (array) $results as $row ) {
945
-		if ( !isset($row->recently_updated) )
944
+	foreach ((array) $results as $row) {
945
+		if ( ! isset($row->recently_updated))
946 946
 			$row->recently_updated = false;
947 947
 		$output .= $before;
948
-		if ( $show_updated && $row->recently_updated )
948
+		if ($show_updated && $row->recently_updated)
949 949
 			$output .= get_option('links_recently_updated_prepend');
950 950
 		$the_link = '#';
951
-		if ( !empty($row->link_url) )
951
+		if ( ! empty($row->link_url))
952 952
 			$the_link = esc_url($row->link_url);
953 953
 		$rel = $row->link_rel;
954
-		if ( '' != $rel )
955
-			$rel = ' rel="' . $rel . '"';
954
+		if ('' != $rel)
955
+			$rel = ' rel="'.$rel.'"';
956 956
 
957 957
 		$desc = esc_attr(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display'));
958 958
 		$name = esc_attr(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display'));
959 959
 		$title = $desc;
960 960
 
961
-		if ( $show_updated )
961
+		if ($show_updated)
962 962
 			if (substr($row->link_updated_f, 0, 2) != '00')
963
-				$title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)) . ')';
963
+				$title .= ' ('.__('Last updated').' '.date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)).')';
964 964
 
965
-		if ( '' != $title )
966
-			$title = ' title="' . $title . '"';
965
+		if ('' != $title)
966
+			$title = ' title="'.$title.'"';
967 967
 
968
-		$alt = ' alt="' . $name . '"';
968
+		$alt = ' alt="'.$name.'"';
969 969
 
970 970
 		$target = $row->link_target;
971
-		if ( '' != $target )
972
-			$target = ' target="' . $target . '"';
971
+		if ('' != $target)
972
+			$target = ' target="'.$target.'"';
973 973
 
974
-		$output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
974
+		$output .= '<a href="'.$the_link.'"'.$rel.$title.$target.'>';
975 975
 
976
-		if ( $row->link_image != null && $show_images ) {
977
-			if ( strpos($row->link_image, 'http') !== false )
976
+		if ($row->link_image != null && $show_images) {
977
+			if (strpos($row->link_image, 'http') !== false)
978 978
 				$output .= "<img src=\"$row->link_image\" $alt $title />";
979 979
 			else // If it's a relative path
980
-				$output .= "<img src=\"" . get_option('siteurl') . "$row->link_image\" $alt $title />";
980
+				$output .= "<img src=\"".get_option('siteurl')."$row->link_image\" $alt $title />";
981 981
 		} else {
982 982
 			$output .= $name;
983 983
 		}
984 984
 
985 985
 		$output .= '</a>';
986 986
 
987
-		if ( $show_updated && $row->recently_updated )
987
+		if ($show_updated && $row->recently_updated)
988 988
 			$output .= get_option('links_recently_updated_append');
989 989
 
990
-		if ( $show_description && '' != $desc )
991
-			$output .= $between . $desc;
990
+		if ($show_description && '' != $desc)
991
+			$output .= $between.$desc;
992 992
 
993 993
 		if ($show_rating) {
994
-			$output .= $between . get_linkrating($row);
994
+			$output .= $between.get_linkrating($row);
995 995
 		}
996 996
 
997 997
 		$output .= "$after\n";
998 998
 	} // end while
999 999
 
1000
-	if ( !$echo )
1000
+	if ( ! $echo)
1001 1001
 		return $output;
1002 1002
 	echo $output;
1003 1003
 }
@@ -1015,29 +1015,29 @@  discard block
 block discarded – undo
1015 1015
  * @param string $order Sort link categories by 'name' or 'id'
1016 1016
  */
1017 1017
 function get_links_list($order = 'name') {
1018
-	_deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' );
1018
+	_deprecated_function(__FUNCTION__, '2.1', 'wp_list_bookmarks()');
1019 1019
 
1020 1020
 	$order = strtolower($order);
1021 1021
 
1022 1022
 	// Handle link category sorting
1023 1023
 	$direction = 'ASC';
1024
-	if ( '_' == substr($order,0,1) ) {
1024
+	if ('_' == substr($order, 0, 1)) {
1025 1025
 		$direction = 'DESC';
1026
-		$order = substr($order,1);
1026
+		$order = substr($order, 1);
1027 1027
 	}
1028 1028
 
1029
-	if ( !isset($direction) )
1029
+	if ( ! isset($direction))
1030 1030
 		$direction = '';
1031 1031
 
1032 1032
 	$cats = get_categories(array('type' => 'link', 'orderby' => $order, 'order' => $direction, 'hierarchical' => 0));
1033 1033
 
1034 1034
 	// Display each category
1035
-	if ( $cats ) {
1036
-		foreach ( (array) $cats as $cat ) {
1035
+	if ($cats) {
1036
+		foreach ((array) $cats as $cat) {
1037 1037
 			// Handle each category.
1038 1038
 
1039 1039
 			// Display the category name
1040
-			echo '  <li id="linkcat-' . $cat->term_id . '" class="linkcat"><h2>' . apply_filters('link_category', $cat->name ) . "</h2>\n\t<ul>\n";
1040
+			echo '  <li id="linkcat-'.$cat->term_id.'" class="linkcat"><h2>'.apply_filters('link_category', $cat->name)."</h2>\n\t<ul>\n";
1041 1041
 			// Call get_links() with all the appropriate params
1042 1042
 			get_links($cat->term_id, '<li>', "</li>", "\n", true, 'name', false);
1043 1043
 
@@ -1059,8 +1059,8 @@  discard block
 block discarded – undo
1059 1059
  * @param string $file the page to open in the popup window
1060 1060
  * @param bool $count the number of links in the db
1061 1061
  */
1062
-function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) {
1063
-	_deprecated_function( __FUNCTION__, '2.1' );
1062
+function links_popup_script($text = 'Links', $width = 400, $height = 400, $file = 'links.all.php', $count = true) {
1063
+	_deprecated_function(__FUNCTION__, '2.1');
1064 1064
 }
1065 1065
 
1066 1066
 /**
@@ -1073,8 +1073,8 @@  discard block
 block discarded – undo
1073 1073
  * @param object $link Link object.
1074 1074
  * @return mixed Value of the 'link_rating' field, false otherwise.
1075 1075
  */
1076
-function get_linkrating( $link ) {
1077
-	_deprecated_function( __FUNCTION__, '2.1', 'sanitize_bookmark_field()' );
1076
+function get_linkrating($link) {
1077
+	_deprecated_function(__FUNCTION__, '2.1', 'sanitize_bookmark_field()');
1078 1078
 	return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display');
1079 1079
 }
1080 1080
 
@@ -1089,16 +1089,16 @@  discard block
 block discarded – undo
1089 1089
  * @return string
1090 1090
  */
1091 1091
 function get_linkcatname($id = 0) {
1092
-	_deprecated_function( __FUNCTION__, '2.1', 'get_category()' );
1092
+	_deprecated_function(__FUNCTION__, '2.1', 'get_category()');
1093 1093
 
1094 1094
 	$id = (int) $id;
1095 1095
 
1096
-	if ( empty($id) )
1096
+	if (empty($id))
1097 1097
 		return '';
1098 1098
 
1099 1099
 	$cats = wp_get_link_cats($id);
1100 1100
 
1101
-	if ( empty($cats) || ! is_array($cats) )
1101
+	if (empty($cats) || ! is_array($cats))
1102 1102
 		return '';
1103 1103
 
1104 1104
 	$cat_id = (int) $cats[0]; // Take the first cat.
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
  * @param string $link_text
1118 1118
  */
1119 1119
 function comments_rss_link($link_text = 'Comments RSS') {
1120
-	_deprecated_function( __FUNCTION__, '2.5', 'post_comments_feed_link()' );
1120
+	_deprecated_function(__FUNCTION__, '2.5', 'post_comments_feed_link()');
1121 1121
 	post_comments_feed_link($link_text);
1122 1122
 }
1123 1123
 
@@ -1133,11 +1133,11 @@  discard block
 block discarded – undo
1133 1133
  * @return string
1134 1134
  */
1135 1135
 function get_category_rss_link($echo = false, $cat_ID = 1) {
1136
-	_deprecated_function( __FUNCTION__, '2.5', 'get_category_feed_link()' );
1136
+	_deprecated_function(__FUNCTION__, '2.5', 'get_category_feed_link()');
1137 1137
 
1138 1138
 	$link = get_category_feed_link($cat_ID, 'rss2');
1139 1139
 
1140
-	if ( $echo )
1140
+	if ($echo)
1141 1141
 		echo $link;
1142 1142
 	return $link;
1143 1143
 }
@@ -1154,10 +1154,10 @@  discard block
 block discarded – undo
1154 1154
  * @return string
1155 1155
  */
1156 1156
 function get_author_rss_link($echo = false, $author_id = 1) {
1157
-	_deprecated_function( __FUNCTION__, '2.5', 'get_author_feed_link()' );
1157
+	_deprecated_function(__FUNCTION__, '2.5', 'get_author_feed_link()');
1158 1158
 
1159 1159
 	$link = get_author_feed_link($author_id);
1160
-	if ( $echo )
1160
+	if ($echo)
1161 1161
 		echo $link;
1162 1162
 	return $link;
1163 1163
 }
@@ -1172,8 +1172,8 @@  discard block
 block discarded – undo
1172 1172
  * @return string
1173 1173
  */
1174 1174
 function comments_rss() {
1175
-	_deprecated_function( __FUNCTION__, '2.2', 'get_post_comments_feed_link()' );
1176
-	return esc_url( get_post_comments_feed_link() );
1175
+	_deprecated_function(__FUNCTION__, '2.2', 'get_post_comments_feed_link()');
1176
+	return esc_url(get_post_comments_feed_link());
1177 1177
 }
1178 1178
 
1179 1179
 /**
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
  * @return int The new user's ID.
1190 1190
  */
1191 1191
 function create_user($username, $password, $email) {
1192
-	_deprecated_function( __FUNCTION__, '2.0', 'wp_create_user()' );
1192
+	_deprecated_function(__FUNCTION__, '2.0', 'wp_create_user()');
1193 1193
 	return wp_create_user($username, $password, $email);
1194 1194
 }
1195 1195
 
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
  * @deprecated 2.5.0
1200 1200
  */
1201 1201
 function gzip_compression() {
1202
-	_deprecated_function( __FUNCTION__, '2.5' );
1202
+	_deprecated_function(__FUNCTION__, '2.5');
1203 1203
 	return false;
1204 1204
 }
1205 1205
 
@@ -1215,8 +1215,8 @@  discard block
 block discarded – undo
1215 1215
  * @param bool $include_unapproved Whether to include unapproved comments
1216 1216
  * @return array The comment data
1217 1217
  */
1218
-function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) {
1219
-	_deprecated_function( __FUNCTION__, '2.7', 'get_comment()' );
1218
+function get_commentdata($comment_ID, $no_cache = 0, $include_unapproved = false) {
1219
+	_deprecated_function(__FUNCTION__, '2.7', 'get_comment()');
1220 1220
 	return get_comment($comment_ID, ARRAY_A);
1221 1221
 }
1222 1222
 
@@ -1230,9 +1230,9 @@  discard block
 block discarded – undo
1230 1230
  * @param int $cat_ID Category ID
1231 1231
  * @return string category name
1232 1232
  */
1233
-function get_catname( $cat_ID ) {
1234
-	_deprecated_function( __FUNCTION__, '2.8', 'get_cat_name()' );
1235
-	return get_cat_name( $cat_ID );
1233
+function get_catname($cat_ID) {
1234
+	_deprecated_function(__FUNCTION__, '2.8', 'get_cat_name()');
1235
+	return get_cat_name($cat_ID);
1236 1236
 }
1237 1237
 
1238 1238
 /**
@@ -1248,25 +1248,25 @@  discard block
 block discarded – undo
1248 1248
  * @param array $visited Optional. Category Term IDs that have already been added.
1249 1249
  * @return string
1250 1250
  */
1251
-function get_category_children( $id, $before = '/', $after = '', $visited = array() ) {
1252
-	_deprecated_function( __FUNCTION__, '2.8', 'get_term_children()' );
1253
-	if ( 0 == $id )
1251
+function get_category_children($id, $before = '/', $after = '', $visited = array()) {
1252
+	_deprecated_function(__FUNCTION__, '2.8', 'get_term_children()');
1253
+	if (0 == $id)
1254 1254
 		return '';
1255 1255
 
1256 1256
 	$chain = '';
1257 1257
 	/** TODO: consult hierarchy */
1258 1258
 	$cat_ids = get_all_category_ids();
1259
-	foreach ( (array) $cat_ids as $cat_id ) {
1260
-		if ( $cat_id == $id )
1259
+	foreach ((array) $cat_ids as $cat_id) {
1260
+		if ($cat_id == $id)
1261 1261
 			continue;
1262 1262
 
1263
-		$category = get_category( $cat_id );
1264
-		if ( is_wp_error( $category ) )
1263
+		$category = get_category($cat_id);
1264
+		if (is_wp_error($category))
1265 1265
 			return $category;
1266
-		if ( $category->parent == $id && !in_array( $category->term_id, $visited ) ) {
1266
+		if ($category->parent == $id && ! in_array($category->term_id, $visited)) {
1267 1267
 			$visited[] = $category->term_id;
1268 1268
 			$chain .= $before.$category->term_id.$after;
1269
-			$chain .= get_category_children( $category->term_id, $before, $after );
1269
+			$chain .= get_category_children($category->term_id, $before, $after);
1270 1270
 		}
1271 1271
 	}
1272 1272
 	return $chain;
@@ -1284,11 +1284,11 @@  discard block
 block discarded – undo
1284 1284
  * @return object List of all of the category IDs.
1285 1285
  */
1286 1286
 function get_all_category_ids() {
1287
-	_deprecated_function( __FUNCTION__, '4.0', 'get_terms()' );
1287
+	_deprecated_function(__FUNCTION__, '4.0', 'get_terms()');
1288 1288
 
1289
-	if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
1290
-		$cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );
1291
-		wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
1289
+	if ( ! $cat_ids = wp_cache_get('all_category_ids', 'category')) {
1290
+		$cat_ids = get_terms('category', array('fields' => 'ids', 'get' => 'all'));
1291
+		wp_cache_add('all_category_ids', $cat_ids, 'category');
1292 1292
 	}
1293 1293
 
1294 1294
 	return $cat_ids;
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
  * @return string The author's description.
1305 1305
  */
1306 1306
 function get_the_author_description() {
1307
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'description\')' );
1307
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'description\')');
1308 1308
 	return get_the_author_meta('description');
1309 1309
 }
1310 1310
 
@@ -1316,7 +1316,7 @@  discard block
 block discarded – undo
1316 1316
  * @see the_author_meta()
1317 1317
  */
1318 1318
 function the_author_description() {
1319
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'description\')' );
1319
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'description\')');
1320 1320
 	the_author_meta('description');
1321 1321
 }
1322 1322
 
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
  * @return string The author's login name (username).
1331 1331
  */
1332 1332
 function get_the_author_login() {
1333
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'login\')' );
1333
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'login\')');
1334 1334
 	return get_the_author_meta('login');
1335 1335
 }
1336 1336
 
@@ -1342,7 +1342,7 @@  discard block
 block discarded – undo
1342 1342
  * @see the_author_meta()
1343 1343
  */
1344 1344
 function the_author_login() {
1345
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'login\')' );
1345
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'login\')');
1346 1346
 	the_author_meta('login');
1347 1347
 }
1348 1348
 
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
  * @return string The author's first name.
1357 1357
  */
1358 1358
 function get_the_author_firstname() {
1359
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'first_name\')' );
1359
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'first_name\')');
1360 1360
 	return get_the_author_meta('first_name');
1361 1361
 }
1362 1362
 
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
  * @see the_author_meta()
1369 1369
  */
1370 1370
 function the_author_firstname() {
1371
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' );
1371
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'first_name\')');
1372 1372
 	the_author_meta('first_name');
1373 1373
 }
1374 1374
 
@@ -1382,7 +1382,7 @@  discard block
 block discarded – undo
1382 1382
  * @return string The author's last name.
1383 1383
  */
1384 1384
 function get_the_author_lastname() {
1385
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'last_name\')' );
1385
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'last_name\')');
1386 1386
 	return get_the_author_meta('last_name');
1387 1387
 }
1388 1388
 
@@ -1394,7 +1394,7 @@  discard block
 block discarded – undo
1394 1394
  * @see the_author_meta()
1395 1395
  */
1396 1396
 function the_author_lastname() {
1397
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' );
1397
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'last_name\')');
1398 1398
 	the_author_meta('last_name');
1399 1399
 }
1400 1400
 
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
  * @return string The author's nickname.
1409 1409
  */
1410 1410
 function get_the_author_nickname() {
1411
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' );
1411
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')');
1412 1412
 	return get_the_author_meta('nickname');
1413 1413
 }
1414 1414
 
@@ -1420,7 +1420,7 @@  discard block
 block discarded – undo
1420 1420
  * @see the_author_meta()
1421 1421
  */
1422 1422
 function the_author_nickname() {
1423
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' );
1423
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'nickname\')');
1424 1424
 	the_author_meta('nickname');
1425 1425
 }
1426 1426
 
@@ -1434,7 +1434,7 @@  discard block
 block discarded – undo
1434 1434
  * @return string The author's username.
1435 1435
  */
1436 1436
 function get_the_author_email() {
1437
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'email\')' );
1437
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'email\')');
1438 1438
 	return get_the_author_meta('email');
1439 1439
 }
1440 1440
 
@@ -1446,7 +1446,7 @@  discard block
 block discarded – undo
1446 1446
  * @see the_author_meta()
1447 1447
  */
1448 1448
 function the_author_email() {
1449
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'email\')' );
1449
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'email\')');
1450 1450
 	the_author_meta('email');
1451 1451
 }
1452 1452
 
@@ -1460,7 +1460,7 @@  discard block
 block discarded – undo
1460 1460
  * @return string The author's ICQ number.
1461 1461
  */
1462 1462
 function get_the_author_icq() {
1463
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')' );
1463
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')');
1464 1464
 	return get_the_author_meta('icq');
1465 1465
 }
1466 1466
 
@@ -1472,7 +1472,7 @@  discard block
 block discarded – undo
1472 1472
  * @see the_author_meta()
1473 1473
  */
1474 1474
 function the_author_icq() {
1475
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'icq\')' );
1475
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'icq\')');
1476 1476
 	the_author_meta('icq');
1477 1477
 }
1478 1478
 
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
  * @return string The author's Yahoo! IM name.
1487 1487
  */
1488 1488
 function get_the_author_yim() {
1489
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')' );
1489
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')');
1490 1490
 	return get_the_author_meta('yim');
1491 1491
 }
1492 1492
 
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
  * @see the_author_meta()
1499 1499
  */
1500 1500
 function the_author_yim() {
1501
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'yim\')' );
1501
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'yim\')');
1502 1502
 	the_author_meta('yim');
1503 1503
 }
1504 1504
 
@@ -1512,7 +1512,7 @@  discard block
 block discarded – undo
1512 1512
  * @return string The author's MSN address.
1513 1513
  */
1514 1514
 function get_the_author_msn() {
1515
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' );
1515
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')');
1516 1516
 	return get_the_author_meta('msn');
1517 1517
 }
1518 1518
 
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
  * @see the_author_meta()
1525 1525
  */
1526 1526
 function the_author_msn() {
1527
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'msn\')' );
1527
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'msn\')');
1528 1528
 	the_author_meta('msn');
1529 1529
 }
1530 1530
 
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
  * @return string The author's AIM address.
1539 1539
  */
1540 1540
 function get_the_author_aim() {
1541
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')' );
1541
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')');
1542 1542
 	return get_the_author_meta('aim');
1543 1543
 }
1544 1544
 
@@ -1550,7 +1550,7 @@  discard block
 block discarded – undo
1550 1550
  * @see the_author_meta()
1551 1551
  */
1552 1552
 function the_author_aim() {
1553
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'aim\')' );
1553
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'aim\')');
1554 1554
 	the_author_meta('aim');
1555 1555
 }
1556 1556
 
@@ -1564,8 +1564,8 @@  discard block
 block discarded – undo
1564 1564
  * @param int $auth_id The ID of the author.
1565 1565
  * @return string The author's display name.
1566 1566
  */
1567
-function get_author_name( $auth_id = false ) {
1568
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')' );
1567
+function get_author_name($auth_id = false) {
1568
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')');
1569 1569
 	return get_the_author_meta('display_name', $auth_id);
1570 1570
 }
1571 1571
 
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
  * @return string The URL to the author's page.
1580 1580
  */
1581 1581
 function get_the_author_url() {
1582
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'url\')' );
1582
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'url\')');
1583 1583
 	return get_the_author_meta('url');
1584 1584
 }
1585 1585
 
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
  * @see the_author_meta()
1592 1592
  */
1593 1593
 function the_author_url() {
1594
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'url\')' );
1594
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'url\')');
1595 1595
 	the_author_meta('url');
1596 1596
 }
1597 1597
 
@@ -1605,7 +1605,7 @@  discard block
 block discarded – undo
1605 1605
  * @return string|int The author's ID.
1606 1606
  */
1607 1607
 function get_the_author_ID() {
1608
-	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' );
1608
+	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')');
1609 1609
 	return get_the_author_meta('ID');
1610 1610
 }
1611 1611
 
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
  * @see the_author_meta()
1618 1618
  */
1619 1619
 function the_author_ID() {
1620
-	_deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'ID\')' );
1620
+	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'ID\')');
1621 1621
 	the_author_meta('ID');
1622 1622
 }
1623 1623
 
@@ -1649,23 +1649,23 @@  discard block
 block discarded – undo
1649 1649
  * @param int $cut Optional. Amount of words to keep for the content.
1650 1650
  * @param int $encode_html Optional. How to encode the content.
1651 1651
  */
1652
-function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
1653
-	_deprecated_function( __FUNCTION__, '2.9', 'the_content_feed' );
1652
+function the_content_rss($more_link_text = '(more...)', $stripteaser = 0, $more_file = '', $cut = 0, $encode_html = 0) {
1653
+	_deprecated_function(__FUNCTION__, '2.9', 'the_content_feed');
1654 1654
 	$content = get_the_content($more_link_text, $stripteaser);
1655 1655
 	$content = apply_filters('the_content_rss', $content);
1656
-	if ( $cut && !$encode_html )
1656
+	if ($cut && ! $encode_html)
1657 1657
 		$encode_html = 2;
1658
-	if ( 1== $encode_html ) {
1658
+	if (1 == $encode_html) {
1659 1659
 		$content = esc_html($content);
1660 1660
 		$cut = 0;
1661
-	} elseif ( 0 == $encode_html ) {
1661
+	} elseif (0 == $encode_html) {
1662 1662
 		$content = make_url_footnote($content);
1663
-	} elseif ( 2 == $encode_html ) {
1663
+	} elseif (2 == $encode_html) {
1664 1664
 		$content = strip_tags($content);
1665 1665
 	}
1666
-	if ( $cut ) {
1666
+	if ($cut) {
1667 1667
 		$blah = explode(' ', $content);
1668
-		if ( count($blah) > $cut ) {
1668
+		if (count($blah) > $cut) {
1669 1669
 			$k = $cut;
1670 1670
 			$use_dotdotdot = 1;
1671 1671
 		} else {
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
 		}
1675 1675
 
1676 1676
 		/** @todo Check performance, might be faster to use array slice instead. */
1677
-		for ( $i=0; $i<$k; $i++ )
1677
+		for ($i = 0; $i < $k; $i++)
1678 1678
 			$excerpt .= $blah[$i].' ';
1679 1679
 		$excerpt .= ($use_dotdotdot) ? '...' : '';
1680 1680
 		$content = $excerpt;
@@ -1695,20 +1695,20 @@  discard block
 block discarded – undo
1695 1695
  * @param string $content Content to get links
1696 1696
  * @return string HTML stripped out of content with links at the bottom.
1697 1697
  */
1698
-function make_url_footnote( $content ) {
1699
-	_deprecated_function( __FUNCTION__, '2.9', '' );
1700
-	preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
1698
+function make_url_footnote($content) {
1699
+	_deprecated_function(__FUNCTION__, '2.9', '');
1700
+	preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
1701 1701
 	$links_summary = "\n";
1702
-	for ( $i = 0, $c = count( $matches[0] ); $i < $c; $i++ ) {
1702
+	for ($i = 0, $c = count($matches[0]); $i < $c; $i++) {
1703 1703
 		$link_match = $matches[0][$i];
1704
-		$link_number = '['.($i+1).']';
1704
+		$link_number = '['.($i + 1).']';
1705 1705
 		$link_url = $matches[2][$i];
1706 1706
 		$link_text = $matches[4][$i];
1707
-		$content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );
1708
-		$link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
1709
-		$links_summary .= "\n" . $link_number . ' ' . $link_url;
1707
+		$content = str_replace($link_match, $link_text.' '.$link_number, $content);
1708
+		$link_url = ((strtolower(substr($link_url, 0, 7)) != 'http://') && (strtolower(substr($link_url, 0, 8)) != 'https://')) ? get_option('home').$link_url : $link_url;
1709
+		$links_summary .= "\n".$link_number.' '.$link_url;
1710 1710
 	}
1711
-	$content  = strip_tags( $content );
1711
+	$content  = strip_tags($content);
1712 1712
 	$content .= $links_summary;
1713 1713
 	return $content;
1714 1714
 }
@@ -1734,9 +1734,9 @@  discard block
 block discarded – undo
1734 1734
  * @param string $domain Optional. Domain to retrieve the translated text
1735 1735
  * @return string Translated context string without pipe
1736 1736
  */
1737
-function _c( $text, $domain = 'default' ) {
1738
-	_deprecated_function( __FUNCTION__, '2.9', '_x()' );
1739
-	return before_last_bar( translate( $text, $domain ) );
1737
+function _c($text, $domain = 'default') {
1738
+	_deprecated_function(__FUNCTION__, '2.9', '_x()');
1739
+	return before_last_bar(translate($text, $domain));
1740 1740
 }
1741 1741
 
1742 1742
 /**
@@ -1751,9 +1751,9 @@  discard block
 block discarded – undo
1751 1751
  * @param string $domain Domain to retrieve the translated text
1752 1752
  * @return string Translated text
1753 1753
  */
1754
-function translate_with_context( $text, $domain = 'default' ) {
1755
-	_deprecated_function( __FUNCTION__, '2.9', '_x()' );
1756
-	return before_last_bar( translate( $text, $domain ) );
1754
+function translate_with_context($text, $domain = 'default') {
1755
+	_deprecated_function(__FUNCTION__, '2.9', '_x()');
1756
+	return before_last_bar(translate($text, $domain));
1757 1757
 }
1758 1758
 
1759 1759
 /**
@@ -1772,9 +1772,9 @@  discard block
 block discarded – undo
1772 1772
  *                       Default 'default'.
1773 1773
  * @return string The translated singular or plural form.
1774 1774
  */
1775
-function _nc( $single, $plural, $number, $domain = 'default' ) {
1776
-	_deprecated_function( __FUNCTION__, '2.9', '_nx()' );
1777
-	return before_last_bar( _n( $single, $plural, $number, $domain ) );
1775
+function _nc($single, $plural, $number, $domain = 'default') {
1776
+	_deprecated_function(__FUNCTION__, '2.9', '_nx()');
1777
+	return before_last_bar(_n($single, $plural, $number, $domain));
1778 1778
 }
1779 1779
 
1780 1780
 /**
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
  * @see _n()
1786 1786
  */
1787 1787
 function __ngettext() {
1788
-	_deprecated_function( __FUNCTION__, '2.8', '_n()' );
1788
+	_deprecated_function(__FUNCTION__, '2.8', '_n()');
1789 1789
 	$args = func_get_args();
1790 1790
 	return call_user_func_array('_n', $args);
1791 1791
 }
@@ -1798,7 +1798,7 @@  discard block
 block discarded – undo
1798 1798
  * @see _n_noop()
1799 1799
  */
1800 1800
 function __ngettext_noop() {
1801
-	_deprecated_function( __FUNCTION__, '2.8', '_n_noop()' );
1801
+	_deprecated_function(__FUNCTION__, '2.8', '_n_noop()');
1802 1802
 	$args = func_get_args();
1803 1803
 	return call_user_func_array('_n_noop', $args);
1804 1804
 
@@ -1814,7 +1814,7 @@  discard block
 block discarded – undo
1814 1814
  * @return array List of all options.
1815 1815
  */
1816 1816
 function get_alloptions() {
1817
-	_deprecated_function( __FUNCTION__, '3.0', 'wp_load_alloptions()' );
1817
+	_deprecated_function(__FUNCTION__, '3.0', 'wp_load_alloptions()');
1818 1818
 	return wp_load_alloptions();
1819 1819
 }
1820 1820
 
@@ -1832,14 +1832,14 @@  discard block
 block discarded – undo
1832 1832
  * @return string
1833 1833
  */
1834 1834
 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {
1835
-	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_link()' );
1835
+	_deprecated_function(__FUNCTION__, '2.5', 'wp_get_attachment_link()');
1836 1836
 	$id = (int) $id;
1837 1837
 	$_post = get_post($id);
1838 1838
 
1839
-	if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )
1839
+	if (('attachment' != $_post->post_type) || ! $url = wp_get_attachment_url($_post->ID))
1840 1840
 		return __('Missing Attachment');
1841 1841
 
1842
-	if ( $permalink )
1842
+	if ($permalink)
1843 1843
 		$url = get_attachment_link($_post->ID);
1844 1844
 
1845 1845
 	$post_title = esc_attr($_post->post_title);
@@ -1859,31 +1859,31 @@  discard block
 block discarded – undo
1859 1859
  * @param bool $fullsize Optional, default to false. Whether to have full image.
1860 1860
  * @return array Icon URL and full path to file, respectively.
1861 1861
  */
1862
-function get_attachment_icon_src( $id = 0, $fullsize = false ) {
1863
-	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' );
1862
+function get_attachment_icon_src($id = 0, $fullsize = false) {
1863
+	_deprecated_function(__FUNCTION__, '2.5', 'wp_get_attachment_image_src()');
1864 1864
 	$id = (int) $id;
1865
-	if ( !$post = get_post($id) )
1865
+	if ( ! $post = get_post($id))
1866 1866
 		return false;
1867 1867
 
1868
-	$file = get_attached_file( $post->ID );
1868
+	$file = get_attached_file($post->ID);
1869 1869
 
1870
-	if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
1870
+	if ( ! $fullsize && $src = wp_get_attachment_thumb_url($post->ID)) {
1871 1871
 		// We have a thumbnail desired, specified and existing
1872 1872
 
1873 1873
 		$src_file = basename($src);
1874
-	} elseif ( wp_attachment_is_image( $post->ID ) ) {
1874
+	} elseif (wp_attachment_is_image($post->ID)) {
1875 1875
 		// We have an image without a thumbnail
1876 1876
 
1877
-		$src = wp_get_attachment_url( $post->ID );
1877
+		$src = wp_get_attachment_url($post->ID);
1878 1878
 		$src_file = & $file;
1879
-	} elseif ( $src = wp_mime_type_icon( $post->ID ) ) {
1879
+	} elseif ($src = wp_mime_type_icon($post->ID)) {
1880 1880
 		// No thumb, no image. We'll look for a mime-related icon instead.
1881 1881
 
1882
-		$icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
1883
-		$src_file = $icon_dir . '/' . basename($src);
1882
+		$icon_dir = apply_filters('icon_dir', get_template_directory().'/images');
1883
+		$src_file = $icon_dir.'/'.basename($src);
1884 1884
 	}
1885 1885
 
1886
-	if ( !isset($src) || !$src )
1886
+	if ( ! isset($src) || ! $src)
1887 1887
 		return false;
1888 1888
 
1889 1889
 	return array($src, $src_file);
@@ -1901,27 +1901,27 @@  discard block
 block discarded – undo
1901 1901
  * @param array $max_dims Optional. Dimensions of image.
1902 1902
  * @return false|string HTML content.
1903 1903
  */
1904
-function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
1905
-	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' );
1904
+function get_attachment_icon($id = 0, $fullsize = false, $max_dims = false) {
1905
+	_deprecated_function(__FUNCTION__, '2.5', 'wp_get_attachment_image()');
1906 1906
 	$id = (int) $id;
1907
-	if ( !$post = get_post($id) )
1907
+	if ( ! $post = get_post($id))
1908 1908
 		return false;
1909 1909
 
1910
-	if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )
1910
+	if ( ! $src = get_attachment_icon_src($post->ID, $fullsize))
1911 1911
 		return false;
1912 1912
 
1913 1913
 	list($src, $src_file) = $src;
1914 1914
 
1915 1915
 	// Do we need to constrain the image?
1916
-	if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {
1916
+	if (($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file)) {
1917 1917
 
1918 1918
 		$imagesize = getimagesize($src_file);
1919 1919
 
1920
-		if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
1920
+		if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1]) {
1921 1921
 			$actual_aspect = $imagesize[0] / $imagesize[1];
1922 1922
 			$desired_aspect = $max_dims[0] / $max_dims[1];
1923 1923
 
1924
-			if ( $actual_aspect >= $desired_aspect ) {
1924
+			if ($actual_aspect >= $desired_aspect) {
1925 1925
 				$height = $actual_aspect * $max_dims[0];
1926 1926
 				$constraint = "width='{$max_dims[0]}' ";
1927 1927
 				$post->iconsize = array($max_dims[0], $height);
@@ -1942,7 +1942,7 @@  discard block
 block discarded – undo
1942 1942
 
1943 1943
 	$icon = "<img src='$src' title='$post_title' alt='$post_title' $constraint/>";
1944 1944
 
1945
-	return apply_filters( 'attachment_icon', $icon, $post->ID );
1945
+	return apply_filters('attachment_icon', $icon, $post->ID);
1946 1946
 }
1947 1947
 
1948 1948
 /**
@@ -1958,12 +1958,12 @@  discard block
 block discarded – undo
1958 1958
  * @return false|string
1959 1959
  */
1960 1960
 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
1961
-	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' );
1961
+	_deprecated_function(__FUNCTION__, '2.5', 'wp_get_attachment_image()');
1962 1962
 	$id = (int) $id;
1963
-	if ( !$post = get_post($id) )
1963
+	if ( ! $post = get_post($id))
1964 1964
 		return false;
1965 1965
 
1966
-	if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
1966
+	if ($innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
1967 1967
 		return $innerHTML;
1968 1968
 
1969 1969
 	$innerHTML = esc_attr($post->post_title);
@@ -1985,8 +1985,8 @@  discard block
 block discarded – undo
1985 1985
  *                            'attribute', 'js', 'db', or 'display'. Default 'raw'.
1986 1986
  * @return object|array Bookmark object or array, depending on the type specified by `$output`.
1987 1987
  */
1988
-function get_link( $bookmark_id, $output = OBJECT, $filter = 'raw' ) {
1989
-	_deprecated_function( __FUNCTION__, '2.1', 'get_bookmark()' );
1988
+function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') {
1989
+	_deprecated_function(__FUNCTION__, '2.1', 'get_bookmark()');
1990 1990
 	return get_bookmark($bookmark_id, $output, $filter);
1991 1991
 }
1992 1992
 
@@ -2001,9 +2001,9 @@  discard block
 block discarded – undo
2001 2001
  * @param array $protocols An array of acceptable protocols.
2002 2002
  * @return string The cleaned URL.
2003 2003
  */
2004
-function sanitize_url( $url, $protocols = null ) {
2005
-	_deprecated_function( __FUNCTION__, '2.8', 'esc_url_raw()' );
2006
-	return esc_url_raw( $url, $protocols );
2004
+function sanitize_url($url, $protocols = null) {
2005
+	_deprecated_function(__FUNCTION__, '2.8', 'esc_url_raw()');
2006
+	return esc_url_raw($url, $protocols);
2007 2007
 }
2008 2008
 
2009 2009
 /**
@@ -2022,12 +2022,12 @@  discard block
 block discarded – undo
2022 2022
  * @param string $context Optional. How the URL will be used. Default is 'display'.
2023 2023
  * @return string The cleaned $url after the 'clean_url' filter is applied.
2024 2024
  */
2025
-function clean_url( $url, $protocols = null, $context = 'display' ) {
2026
-	if ( $context == 'db' )
2027
-		_deprecated_function( 'clean_url( $context = \'db\' )', '3.0', 'esc_url_raw()' );
2025
+function clean_url($url, $protocols = null, $context = 'display') {
2026
+	if ($context == 'db')
2027
+		_deprecated_function('clean_url( $context = \'db\' )', '3.0', 'esc_url_raw()');
2028 2028
 	else
2029
-		_deprecated_function( __FUNCTION__, '3.0', 'esc_url()' );
2030
-	return esc_url( $url, $protocols, $context );
2029
+		_deprecated_function(__FUNCTION__, '3.0', 'esc_url()');
2030
+	return esc_url($url, $protocols, $context);
2031 2031
 }
2032 2032
 
2033 2033
 /**
@@ -2042,9 +2042,9 @@  discard block
 block discarded – undo
2042 2042
  * @param string $text The text to be escaped.
2043 2043
  * @return string Escaped text.
2044 2044
  */
2045
-function js_escape( $text ) {
2046
-	_deprecated_function( __FUNCTION__, '2.8', 'esc_js()' );
2047
-	return esc_js( $text );
2045
+function js_escape($text) {
2046
+	_deprecated_function(__FUNCTION__, '2.8', 'esc_js()');
2047
+	return esc_js($text);
2048 2048
 }
2049 2049
 
2050 2050
 /**
@@ -2059,13 +2059,13 @@  discard block
 block discarded – undo
2059 2059
  * @param false        $double_encode Whether to double encode. Unused.
2060 2060
  * @return string Escaped `$string`.
2061 2061
  */
2062
-function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
2063
-	_deprecated_function( __FUNCTION__, '2.8', 'esc_html()' );
2064
-	if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args
2062
+function wp_specialchars($string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false) {
2063
+	_deprecated_function(__FUNCTION__, '2.8', 'esc_html()');
2064
+	if (func_num_args() > 1) { // Maintain backwards compat for people passing additional args
2065 2065
 		$args = func_get_args();
2066
-		return call_user_func_array( '_wp_specialchars', $args );
2066
+		return call_user_func_array('_wp_specialchars', $args);
2067 2067
 	} else {
2068
-		return esc_html( $string );
2068
+		return esc_html($string);
2069 2069
 	}
2070 2070
 }
2071 2071
 
@@ -2079,9 +2079,9 @@  discard block
 block discarded – undo
2079 2079
  * @param string $text
2080 2080
  * @return string
2081 2081
  */
2082
-function attribute_escape( $text ) {
2083
-	_deprecated_function( __FUNCTION__, '2.8', 'esc_attr()' );
2084
-	return esc_attr( $text );
2082
+function attribute_escape($text) {
2083
+	_deprecated_function(__FUNCTION__, '2.8', 'esc_attr()');
2084
+	return esc_attr($text);
2085 2085
 }
2086 2086
 
2087 2087
 /**
@@ -2104,10 +2104,10 @@  discard block
 block discarded – undo
2104 2104
  * @param mixed      $params ,...     Widget parameters.
2105 2105
  */
2106 2106
 function register_sidebar_widget($name, $output_callback, $classname = '') {
2107
-	_deprecated_function( __FUNCTION__, '2.8', 'wp_register_sidebar_widget()' );
2107
+	_deprecated_function(__FUNCTION__, '2.8', 'wp_register_sidebar_widget()');
2108 2108
 	// Compat
2109
-	if ( is_array($name) ) {
2110
-		if ( count($name) == 3 )
2109
+	if (is_array($name)) {
2110
+		if (count($name) == 3)
2111 2111
 			$name = sprintf($name[0], $name[2]);
2112 2112
 		else
2113 2113
 			$name = $name[0];
@@ -2115,11 +2115,11 @@  discard block
 block discarded – undo
2115 2115
 
2116 2116
 	$id = sanitize_title($name);
2117 2117
 	$options = array();
2118
-	if ( !empty($classname) && is_string($classname) )
2118
+	if ( ! empty($classname) && is_string($classname))
2119 2119
 		$options['classname'] = $classname;
2120 2120
 	$params = array_slice(func_get_args(), 2);
2121 2121
 	$args = array($id, $name, $output_callback, $options);
2122
-	if ( !empty($params) )
2122
+	if ( ! empty($params))
2123 2123
 		$args = array_merge($args, $params);
2124 2124
 
2125 2125
 	call_user_func_array('wp_register_sidebar_widget', $args);
@@ -2135,7 +2135,7 @@  discard block
 block discarded – undo
2135 2135
  * @param int|string $id Widget ID.
2136 2136
  */
2137 2137
 function unregister_sidebar_widget($id) {
2138
-	_deprecated_function( __FUNCTION__, '2.8', 'wp_unregister_sidebar_widget()' );
2138
+	_deprecated_function(__FUNCTION__, '2.8', 'wp_unregister_sidebar_widget()');
2139 2139
 	return wp_unregister_sidebar_widget($id);
2140 2140
 }
2141 2141
 
@@ -2159,10 +2159,10 @@  discard block
 block discarded – undo
2159 2159
  * @param int $height Widget height.
2160 2160
  */
2161 2161
 function register_widget_control($name, $control_callback, $width = '', $height = '') {
2162
-	_deprecated_function( __FUNCTION__, '2.8', 'wp_register_widget_control()' );
2162
+	_deprecated_function(__FUNCTION__, '2.8', 'wp_register_widget_control()');
2163 2163
 	// Compat
2164
-	if ( is_array($name) ) {
2165
-		if ( count($name) == 3 )
2164
+	if (is_array($name)) {
2165
+		if (count($name) == 3)
2166 2166
 			$name = sprintf($name[0], $name[2]);
2167 2167
 		else
2168 2168
 			$name = $name[0];
@@ -2170,13 +2170,13 @@  discard block
 block discarded – undo
2170 2170
 
2171 2171
 	$id = sanitize_title($name);
2172 2172
 	$options = array();
2173
-	if ( !empty($width) )
2173
+	if ( ! empty($width))
2174 2174
 		$options['width'] = $width;
2175
-	if ( !empty($height) )
2175
+	if ( ! empty($height))
2176 2176
 		$options['height'] = $height;
2177 2177
 	$params = array_slice(func_get_args(), 4);
2178 2178
 	$args = array($id, $name, $control_callback, $options);
2179
-	if ( !empty($params) )
2179
+	if ( ! empty($params))
2180 2180
 		$args = array_merge($args, $params);
2181 2181
 
2182 2182
 	call_user_func_array('wp_register_widget_control', $args);
@@ -2192,7 +2192,7 @@  discard block
 block discarded – undo
2192 2192
  * @param int|string $id Widget ID.
2193 2193
  */
2194 2194
 function unregister_widget_control($id) {
2195
-	_deprecated_function( __FUNCTION__, '2.8', 'wp_unregister_widget_control()' );
2195
+	_deprecated_function(__FUNCTION__, '2.8', 'wp_unregister_widget_control()');
2196 2196
 	return wp_unregister_widget_control($id);
2197 2197
 }
2198 2198
 
@@ -2208,32 +2208,32 @@  discard block
 block discarded – undo
2208 2208
  * @param mixed $meta_value Metadata value.
2209 2209
  * @return bool True deletion completed and false if user_id is not a number.
2210 2210
  */
2211
-function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
2212
-	_deprecated_function( __FUNCTION__, '3.0', 'delete_user_meta()' );
2211
+function delete_usermeta($user_id, $meta_key, $meta_value = '') {
2212
+	_deprecated_function(__FUNCTION__, '3.0', 'delete_user_meta()');
2213 2213
 	global $wpdb;
2214
-	if ( !is_numeric( $user_id ) )
2214
+	if ( ! is_numeric($user_id))
2215 2215
 		return false;
2216 2216
 	$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
2217 2217
 
2218
-	if ( is_array($meta_value) || is_object($meta_value) )
2218
+	if (is_array($meta_value) || is_object($meta_value))
2219 2219
 		$meta_value = serialize($meta_value);
2220
-	$meta_value = trim( $meta_value );
2220
+	$meta_value = trim($meta_value);
2221 2221
 
2222
-	$cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2222
+	$cur = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key));
2223 2223
 
2224
-	if ( $cur && $cur->umeta_id )
2225
-		do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2224
+	if ($cur && $cur->umeta_id)
2225
+		do_action('delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value);
2226 2226
 
2227
-	if ( ! empty($meta_value) )
2228
-		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) );
2227
+	if ( ! empty($meta_value))
2228
+		$wpdb->query($wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value));
2229 2229
 	else
2230
-		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2230
+		$wpdb->query($wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key));
2231 2231
 
2232
-	clean_user_cache( $user_id );
2233
-	wp_cache_delete( $user_id, 'user_meta' );
2232
+	clean_user_cache($user_id);
2233
+	wp_cache_delete($user_id, 'user_meta');
2234 2234
 
2235
-	if ( $cur && $cur->umeta_id )
2236
-		do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2235
+	if ($cur && $cur->umeta_id)
2236
+		do_action('deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value);
2237 2237
 
2238 2238
 	return true;
2239 2239
 }
@@ -2254,28 +2254,28 @@  discard block
 block discarded – undo
2254 2254
  * @param string $meta_key Optional. Metadata key.
2255 2255
  * @return mixed
2256 2256
  */
2257
-function get_usermeta( $user_id, $meta_key = '' ) {
2258
-	_deprecated_function( __FUNCTION__, '3.0', 'get_user_meta()' );
2257
+function get_usermeta($user_id, $meta_key = '') {
2258
+	_deprecated_function(__FUNCTION__, '3.0', 'get_user_meta()');
2259 2259
 	global $wpdb;
2260 2260
 	$user_id = (int) $user_id;
2261 2261
 
2262
-	if ( !$user_id )
2262
+	if ( ! $user_id)
2263 2263
 		return false;
2264 2264
 
2265
-	if ( !empty($meta_key) ) {
2265
+	if ( ! empty($meta_key)) {
2266 2266
 		$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
2267 2267
 		$user = wp_cache_get($user_id, 'users');
2268 2268
 		// Check the cached user object
2269
-		if ( false !== $user && isset($user->$meta_key) )
2269
+		if (false !== $user && isset($user->$meta_key))
2270 2270
 			$metas = array($user->$meta_key);
2271 2271
 		else
2272
-			$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2272
+			$metas = $wpdb->get_col($wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key));
2273 2273
 	} else {
2274
-		$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user_id) );
2274
+		$metas = $wpdb->get_col($wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user_id));
2275 2275
 	}
2276 2276
 
2277
-	if ( empty($metas) ) {
2278
-		if ( empty($meta_key) )
2277
+	if (empty($metas)) {
2278
+		if (empty($meta_key))
2279 2279
 			return array();
2280 2280
 		else
2281 2281
 			return '';
@@ -2283,7 +2283,7 @@  discard block
 block discarded – undo
2283 2283
 
2284 2284
 	$metas = array_map('maybe_unserialize', $metas);
2285 2285
 
2286
-	if ( count($metas) == 1 )
2286
+	if (count($metas) == 1)
2287 2287
 		return $metas[0];
2288 2288
 	else
2289 2289
 		return $metas;
@@ -2307,15 +2307,15 @@  discard block
 block discarded – undo
2307 2307
  * @param mixed $meta_value Metadata value.
2308 2308
  * @return bool True on successful update, false on failure.
2309 2309
  */
2310
-function update_usermeta( $user_id, $meta_key, $meta_value ) {
2311
-	_deprecated_function( __FUNCTION__, '3.0', 'update_user_meta()' );
2310
+function update_usermeta($user_id, $meta_key, $meta_value) {
2311
+	_deprecated_function(__FUNCTION__, '3.0', 'update_user_meta()');
2312 2312
 	global $wpdb;
2313
-	if ( !is_numeric( $user_id ) )
2313
+	if ( ! is_numeric($user_id))
2314 2314
 		return false;
2315 2315
 	$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
2316 2316
 
2317 2317
 	/** @todo Might need fix because usermeta data is assumed to be already escaped */
2318
-	if ( is_string($meta_value) )
2318
+	if (is_string($meta_value))
2319 2319
 		$meta_value = stripslashes($meta_value);
2320 2320
 	$meta_value = maybe_serialize($meta_value);
2321 2321
 
@@ -2323,25 +2323,25 @@  discard block
 block discarded – undo
2323 2323
 		return delete_usermeta($user_id, $meta_key);
2324 2324
 	}
2325 2325
 
2326
-	$cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2326
+	$cur = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key));
2327 2327
 
2328
-	if ( $cur )
2329
-		do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2328
+	if ($cur)
2329
+		do_action('update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value);
2330 2330
 
2331
-	if ( !$cur )
2332
-		$wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') );
2333
-	elseif ( $cur->meta_value != $meta_value )
2334
-		$wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') );
2331
+	if ( ! $cur)
2332
+		$wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value'));
2333
+	elseif ($cur->meta_value != $meta_value)
2334
+		$wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key'));
2335 2335
 	else
2336 2336
 		return false;
2337 2337
 
2338
-	clean_user_cache( $user_id );
2339
-	wp_cache_delete( $user_id, 'user_meta' );
2338
+	clean_user_cache($user_id);
2339
+	wp_cache_delete($user_id, 'user_meta');
2340 2340
 
2341
-	if ( !$cur )
2342
-		do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value );
2341
+	if ( ! $cur)
2342
+		do_action('added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value);
2343 2343
 	else
2344
-		do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2344
+		do_action('updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value);
2345 2345
 
2346 2346
 	return true;
2347 2347
 }
@@ -2362,14 +2362,14 @@  discard block
 block discarded – undo
2362 2362
  * @param int $id Site ID.
2363 2363
  * @return array List of users that are part of that site ID
2364 2364
  */
2365
-function get_users_of_blog( $id = '' ) {
2366
-	_deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
2365
+function get_users_of_blog($id = '') {
2366
+	_deprecated_function(__FUNCTION__, '3.1', 'get_users()');
2367 2367
 
2368 2368
 	global $wpdb, $blog_id;
2369
-	if ( empty($id) )
2369
+	if (empty($id))
2370 2370
 		$id = (int) $blog_id;
2371 2371
 	$blog_prefix = $wpdb->get_blog_prefix($id);
2372
-	$users = $wpdb->get_results( "SELECT user_id, user_id AS ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id" );
2372
+	$users = $wpdb->get_results("SELECT user_id, user_id AS ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id");
2373 2373
 	return $users;
2374 2374
 }
2375 2375
 
@@ -2382,13 +2382,13 @@  discard block
 block discarded – undo
2382 2382
  *
2383 2383
  * @param bool $add Optional, default is true. Add or remove links. Defaults to true.
2384 2384
  */
2385
-function automatic_feed_links( $add = true ) {
2386
-	_deprecated_function( __FUNCTION__, '3.0', "add_theme_support( 'automatic-feed-links' )" );
2385
+function automatic_feed_links($add = true) {
2386
+	_deprecated_function(__FUNCTION__, '3.0', "add_theme_support( 'automatic-feed-links' )");
2387 2387
 
2388
-	if ( $add )
2389
-		add_theme_support( 'automatic-feed-links' );
2388
+	if ($add)
2389
+		add_theme_support('automatic-feed-links');
2390 2390
 	else
2391
-		remove_action( 'wp_head', 'feed_links_extra', 3 ); // Just do this yourself in 3.0+
2391
+		remove_action('wp_head', 'feed_links_extra', 3); // Just do this yourself in 3.0+
2392 2392
 }
2393 2393
 
2394 2394
 /**
@@ -2402,13 +2402,13 @@  discard block
 block discarded – undo
2402 2402
  * @param false|int $user Optional. User ID to retrieve the field for. Default false (current user).
2403 2403
  * @return string The author's field from the current author's DB object.
2404 2404
  */
2405
-function get_profile( $field, $user = false ) {
2406
-	_deprecated_function( __FUNCTION__, '3.0', 'get_the_author_meta()' );
2407
-	if ( $user ) {
2408
-		$user = get_user_by( 'login', $user );
2405
+function get_profile($field, $user = false) {
2406
+	_deprecated_function(__FUNCTION__, '3.0', 'get_the_author_meta()');
2407
+	if ($user) {
2408
+		$user = get_user_by('login', $user);
2409 2409
 		$user = $user->ID;
2410 2410
 	}
2411
-	return get_the_author_meta( $field, $user );
2411
+	return get_the_author_meta($field, $user);
2412 2412
 }
2413 2413
 
2414 2414
 /**
@@ -2421,9 +2421,9 @@  discard block
 block discarded – undo
2421 2421
  * @param int $userid User to count posts for.
2422 2422
  * @return int Number of posts the given user has written.
2423 2423
  */
2424
-function get_usernumposts( $userid ) {
2425
-	_deprecated_function( __FUNCTION__, '3.0', 'count_user_posts()' );
2426
-	return count_user_posts( $userid );
2424
+function get_usernumposts($userid) {
2425
+	_deprecated_function(__FUNCTION__, '3.0', 'count_user_posts()');
2426
+	return count_user_posts($userid);
2427 2427
 }
2428 2428
 
2429 2429
 /**
@@ -2437,7 +2437,7 @@  discard block
 block discarded – undo
2437 2437
  * @return string An HTML entity
2438 2438
  */
2439 2439
 function funky_javascript_callback($matches) {
2440
-	return "&#".base_convert($matches[1],16,10).";";
2440
+	return "&#".base_convert($matches[1], 16, 10).";";
2441 2441
 }
2442 2442
 
2443 2443
 /**
@@ -2455,12 +2455,12 @@  discard block
 block discarded – undo
2455 2455
  * @return string Fixed text.
2456 2456
  */
2457 2457
 function funky_javascript_fix($text) {
2458
-	_deprecated_function( __FUNCTION__, '3.0' );
2458
+	_deprecated_function(__FUNCTION__, '3.0');
2459 2459
 	// Fixes for browsers' JavaScript bugs.
2460 2460
 	global $is_macIE, $is_winIE;
2461 2461
 
2462
-	if ( $is_winIE || $is_macIE )
2463
-		$text =  preg_replace_callback("/\%u([0-9A-F]{4,4})/",
2462
+	if ($is_winIE || $is_macIE)
2463
+		$text = preg_replace_callback("/\%u([0-9A-F]{4,4})/",
2464 2464
 					"funky_javascript_callback",
2465 2465
 					$text);
2466 2466
 
@@ -2477,9 +2477,9 @@  discard block
 block discarded – undo
2477 2477
  * @param string $taxonomy Name of taxonomy object
2478 2478
  * @return bool Whether the taxonomy exists.
2479 2479
  */
2480
-function is_taxonomy( $taxonomy ) {
2481
-	_deprecated_function( __FUNCTION__, '3.0', 'taxonomy_exists()' );
2482
-	return taxonomy_exists( $taxonomy );
2480
+function is_taxonomy($taxonomy) {
2481
+	_deprecated_function(__FUNCTION__, '3.0', 'taxonomy_exists()');
2482
+	return taxonomy_exists($taxonomy);
2483 2483
 }
2484 2484
 
2485 2485
 /**
@@ -2494,9 +2494,9 @@  discard block
 block discarded – undo
2494 2494
  * @param int $parent ID of parent term under which to confine the exists search.
2495 2495
  * @return mixed Get the term id or Term Object, if exists.
2496 2496
  */
2497
-function is_term( $term, $taxonomy = '', $parent = 0 ) {
2498
-	_deprecated_function( __FUNCTION__, '3.0', 'term_exists()' );
2499
-	return term_exists( $term, $taxonomy, $parent );
2497
+function is_term($term, $taxonomy = '', $parent = 0) {
2498
+	_deprecated_function(__FUNCTION__, '3.0', 'term_exists()');
2499
+	return term_exists($term, $taxonomy, $parent);
2500 2500
 }
2501 2501
 
2502 2502
 /**
@@ -2512,11 +2512,11 @@  discard block
 block discarded – undo
2512 2512
  * @return bool
2513 2513
  */
2514 2514
 function is_plugin_page() {
2515
-	_deprecated_function( __FUNCTION__, '3.1'  );
2515
+	_deprecated_function(__FUNCTION__, '3.1');
2516 2516
 
2517 2517
 	global $plugin_page;
2518 2518
 
2519
-	if ( isset($plugin_page) )
2519
+	if (isset($plugin_page))
2520 2520
 		return true;
2521 2521
 
2522 2522
 	return false;
@@ -2535,7 +2535,7 @@  discard block
 block discarded – undo
2535 2535
  * @return bool Always return True
2536 2536
  */
2537 2537
 function update_category_cache() {
2538
-	_deprecated_function( __FUNCTION__, '3.1'  );
2538
+	_deprecated_function(__FUNCTION__, '3.1');
2539 2539
 
2540 2540
 	return true;
2541 2541
 }
@@ -2549,7 +2549,7 @@  discard block
 block discarded – undo
2549 2549
  * @return bool
2550 2550
  */
2551 2551
 function wp_timezone_supported() {
2552
-	_deprecated_function( __FUNCTION__, '3.2' );
2552
+	_deprecated_function(__FUNCTION__, '3.2');
2553 2553
 
2554 2554
 	return true;
2555 2555
 }
@@ -2569,9 +2569,9 @@  discard block
 block discarded – undo
2569 2569
  * @param bool   $extended      Optional. Unused.
2570 2570
  */
2571 2571
 function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) {
2572
-	_deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
2572
+	_deprecated_function(__FUNCTION__, '3.3', 'wp_editor()');
2573 2573
 
2574
-	wp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) );
2574
+	wp_editor($content, $id, array('media_buttons' => $media_buttons));
2575 2575
 }
2576 2576
 
2577 2577
 /**
@@ -2584,20 +2584,20 @@  discard block
 block discarded – undo
2584 2584
  * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays.
2585 2585
  */
2586 2586
 function get_user_metavalues($ids) {
2587
-	_deprecated_function( __FUNCTION__, '3.3' );
2587
+	_deprecated_function(__FUNCTION__, '3.3');
2588 2588
 
2589 2589
 	$objects = array();
2590 2590
 
2591 2591
 	$ids = array_map('intval', $ids);
2592
-	foreach ( $ids as $id )
2592
+	foreach ($ids as $id)
2593 2593
 		$objects[$id] = array();
2594 2594
 
2595 2595
 	$metas = update_meta_cache('user', $ids);
2596 2596
 
2597
-	foreach ( $metas as $id => $meta ) {
2598
-		foreach ( $meta as $key => $metavalues ) {
2599
-			foreach ( $metavalues as $value ) {
2600
-				$objects[$id][] = (object)array( 'user_id' => $id, 'meta_key' => $key, 'meta_value' => $value);
2597
+	foreach ($metas as $id => $meta) {
2598
+		foreach ($meta as $key => $metavalues) {
2599
+			foreach ($metavalues as $value) {
2600
+				$objects[$id][] = (object) array('user_id' => $id, 'meta_key' => $key, 'meta_value' => $value);
2601 2601
 			}
2602 2602
 		}
2603 2603
 	}
@@ -2618,23 +2618,23 @@  discard block
 block discarded – undo
2618 2618
  * @return object|array The now sanitized User Object or Array (will be the same type as $user)
2619 2619
  */
2620 2620
 function sanitize_user_object($user, $context = 'display') {
2621
-	_deprecated_function( __FUNCTION__, '3.3' );
2621
+	_deprecated_function(__FUNCTION__, '3.3');
2622 2622
 
2623
-	if ( is_object($user) ) {
2624
-		if ( !isset($user->ID) )
2623
+	if (is_object($user)) {
2624
+		if ( ! isset($user->ID))
2625 2625
 			$user->ID = 0;
2626
-		if ( ! ( $user instanceof WP_User ) ) {
2626
+		if ( ! ($user instanceof WP_User)) {
2627 2627
 			$vars = get_object_vars($user);
2628
-			foreach ( array_keys($vars) as $field ) {
2629
-				if ( is_string($user->$field) || is_numeric($user->$field) )
2628
+			foreach (array_keys($vars) as $field) {
2629
+				if (is_string($user->$field) || is_numeric($user->$field))
2630 2630
 					$user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context);
2631 2631
 			}
2632 2632
 		}
2633 2633
 		$user->filter = $context;
2634 2634
 	} else {
2635
-		if ( !isset($user['ID']) )
2635
+		if ( ! isset($user['ID']))
2636 2636
 			$user['ID'] = 0;
2637
-		foreach ( array_keys($user) as $field )
2637
+		foreach (array_keys($user) as $field)
2638 2638
 			$user[$field] = sanitize_user_field($field, $user[$field], $user['ID'], $context);
2639 2639
 		$user['filter'] = $context;
2640 2640
 	}
@@ -2657,17 +2657,17 @@  discard block
 block discarded – undo
2657 2657
  * @return string
2658 2658
  */
2659 2659
 function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {
2660
-	_deprecated_function( __FUNCTION__, '3.3' );
2660
+	_deprecated_function(__FUNCTION__, '3.3');
2661 2661
 
2662 2662
 	$posts = get_boundary_post($in_same_cat, $excluded_categories, $start);
2663 2663
 	// If there is no post stop.
2664
-	if ( empty($posts) )
2664
+	if (empty($posts))
2665 2665
 		return;
2666 2666
 
2667 2667
 	// Even though we limited get_posts to return only 1 item it still returns an array of objects.
2668 2668
 	$post = $posts[0];
2669 2669
 
2670
-	if ( empty($post->post_title) )
2670
+	if (empty($post->post_title))
2671 2671
 		$post->post_title = $start ? __('First Post') : __('Last Post');
2672 2672
 
2673 2673
 	$date = mysql2date(get_option('date_format'), $post->post_date);
@@ -2678,10 +2678,10 @@  discard block
 block discarded – undo
2678 2678
 
2679 2679
 	$link = $start ? "<link rel='start' title='" : "<link rel='end' title='";
2680 2680
 	$link .= esc_attr($title);
2681
-	$link .= "' href='" . get_permalink($post) . "' />\n";
2681
+	$link .= "' href='".get_permalink($post)."' />\n";
2682 2682
 
2683 2683
 	$boundary = $start ? 'start' : 'end';
2684
-	return apply_filters( "{$boundary}_post_rel_link", $link );
2684
+	return apply_filters("{$boundary}_post_rel_link", $link);
2685 2685
 }
2686 2686
 
2687 2687
 /**
@@ -2695,7 +2695,7 @@  discard block
 block discarded – undo
2695 2695
  * @param string $excluded_categories Optional. Excluded categories IDs.
2696 2696
  */
2697 2697
 function start_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {
2698
-	_deprecated_function( __FUNCTION__, '3.3' );
2698
+	_deprecated_function(__FUNCTION__, '3.3');
2699 2699
 
2700 2700
 	echo get_boundary_post_rel_link($title, $in_same_cat, $excluded_categories, true);
2701 2701
 }
@@ -2709,10 +2709,10 @@  discard block
 block discarded – undo
2709 2709
  * @return string
2710 2710
  */
2711 2711
 function get_index_rel_link() {
2712
-	_deprecated_function( __FUNCTION__, '3.3' );
2712
+	_deprecated_function(__FUNCTION__, '3.3');
2713 2713
 
2714
-	$link = "<link rel='index' title='" . esc_attr( get_bloginfo( 'name', 'display' ) ) . "' href='" . esc_url( user_trailingslashit( get_bloginfo( 'url', 'display' ) ) ) . "' />\n";
2715
-	return apply_filters( "index_rel_link", $link );
2714
+	$link = "<link rel='index' title='".esc_attr(get_bloginfo('name', 'display'))."' href='".esc_url(user_trailingslashit(get_bloginfo('url', 'display')))."' />\n";
2715
+	return apply_filters("index_rel_link", $link);
2716 2716
 }
2717 2717
 
2718 2718
 /**
@@ -2722,7 +2722,7 @@  discard block
 block discarded – undo
2722 2722
  * @deprecated 3.3.0
2723 2723
  */
2724 2724
 function index_rel_link() {
2725
-	_deprecated_function( __FUNCTION__, '3.3' );
2725
+	_deprecated_function(__FUNCTION__, '3.3');
2726 2726
 
2727 2727
 	echo get_index_rel_link();
2728 2728
 }
@@ -2736,13 +2736,13 @@  discard block
 block discarded – undo
2736 2736
  * @param string $title Optional. Link title format. Default '%title'.
2737 2737
  * @return string
2738 2738
  */
2739
-function get_parent_post_rel_link( $title = '%title' ) {
2740
-	_deprecated_function( __FUNCTION__, '3.3' );
2739
+function get_parent_post_rel_link($title = '%title') {
2740
+	_deprecated_function(__FUNCTION__, '3.3');
2741 2741
 
2742
-	if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) )
2742
+	if ( ! empty($GLOBALS['post']) && ! empty($GLOBALS['post']->post_parent))
2743 2743
 		$post = get_post($GLOBALS['post']->post_parent);
2744 2744
 
2745
-	if ( empty($post) )
2745
+	if (empty($post))
2746 2746
 		return;
2747 2747
 
2748 2748
 	$date = mysql2date(get_option('date_format'), $post->post_date);
@@ -2752,10 +2752,10 @@  discard block
 block discarded – undo
2752 2752
 	$title = apply_filters('the_title', $title, $post->ID);
2753 2753
 
2754 2754
 	$link = "<link rel='up' title='";
2755
-	$link .= esc_attr( $title );
2756
-	$link .= "' href='" . get_permalink($post) . "' />\n";
2755
+	$link .= esc_attr($title);
2756
+	$link .= "' href='".get_permalink($post)."' />\n";
2757 2757
 
2758
-	return apply_filters( "parent_post_rel_link", $link );
2758
+	return apply_filters("parent_post_rel_link", $link);
2759 2759
 }
2760 2760
 
2761 2761
 /**
@@ -2766,8 +2766,8 @@  discard block
 block discarded – undo
2766 2766
  *
2767 2767
  * @param string $title Optional. Link title format. Default '%title'.
2768 2768
  */
2769
-function parent_post_rel_link( $title = '%title' ) {
2770
-	_deprecated_function( __FUNCTION__, '3.3' );
2769
+function parent_post_rel_link($title = '%title') {
2770
+	_deprecated_function(__FUNCTION__, '3.3');
2771 2771
 
2772 2772
 	echo get_parent_post_rel_link($title);
2773 2773
 }
@@ -2780,18 +2780,18 @@  discard block
 block discarded – undo
2780 2780
  *
2781 2781
  * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance.
2782 2782
  */
2783
-function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) {
2784
-	_deprecated_function( __FUNCTION__, '3.3' );
2783
+function wp_admin_bar_dashboard_view_site_menu($wp_admin_bar) {
2784
+	_deprecated_function(__FUNCTION__, '3.3');
2785 2785
 
2786 2786
 	$user_id = get_current_user_id();
2787 2787
 
2788
-	if ( 0 != $user_id ) {
2789
-		if ( is_admin() )
2790
-			$wp_admin_bar->add_menu( array( 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url() ) );
2791
-		elseif ( is_multisite() )
2792
-			$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );
2788
+	if (0 != $user_id) {
2789
+		if (is_admin())
2790
+			$wp_admin_bar->add_menu(array('id' => 'view-site', 'title' => __('Visit Site'), 'href' => home_url()));
2791
+		elseif (is_multisite())
2792
+			$wp_admin_bar->add_menu(array('id' => 'dashboard', 'title' => __('Dashboard'), 'href' => get_dashboard_url($user_id)));
2793 2793
 		else
2794
-			$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );
2794
+			$wp_admin_bar->add_menu(array('id' => 'dashboard', 'title' => __('Dashboard'), 'href' => admin_url()));
2795 2795
 	}
2796 2796
 }
2797 2797
 
@@ -2805,10 +2805,10 @@  discard block
 block discarded – undo
2805 2805
  * @param int $blog_id Site ID
2806 2806
  * @return bool True if the current users belong to $blog_id, false if not.
2807 2807
  */
2808
-function is_blog_user( $blog_id = 0 ) {
2809
-	_deprecated_function( __FUNCTION__, '3.3', 'is_user_member_of_blog()' );
2808
+function is_blog_user($blog_id = 0) {
2809
+	_deprecated_function(__FUNCTION__, '3.3', 'is_user_member_of_blog()');
2810 2810
 
2811
-	return is_user_member_of_blog( get_current_user_id(), $blog_id );
2811
+	return is_user_member_of_blog(get_current_user_id(), $blog_id);
2812 2812
 }
2813 2813
 
2814 2814
 /**
@@ -2824,8 +2824,8 @@  discard block
 block discarded – undo
2824 2824
  * @param string $mode     Type of access you required to the stream.
2825 2825
  * @return false Always false.
2826 2826
  */
2827
-function debug_fopen( $filename, $mode ) {
2828
-	_deprecated_function( __FUNCTION__, 'error_log()' );
2827
+function debug_fopen($filename, $mode) {
2828
+	_deprecated_function(__FUNCTION__, 'error_log()');
2829 2829
 	return false;
2830 2830
 }
2831 2831
 
@@ -2841,10 +2841,10 @@  discard block
 block discarded – undo
2841 2841
  * @param mixed  $fp     Unused.
2842 2842
  * @param string $string Message to log.
2843 2843
  */
2844
-function debug_fwrite( $fp, $string ) {
2845
-	_deprecated_function( __FUNCTION__, 'error_log()' );
2846
-	if ( ! empty( $GLOBALS['debug'] ) )
2847
-		error_log( $string );
2844
+function debug_fwrite($fp, $string) {
2845
+	_deprecated_function(__FUNCTION__, 'error_log()');
2846
+	if ( ! empty($GLOBALS['debug']))
2847
+		error_log($string);
2848 2848
 }
2849 2849
 
2850 2850
 /**
@@ -2858,8 +2858,8 @@  discard block
 block discarded – undo
2858 2858
  *
2859 2859
  * @param mixed $fp Unused.
2860 2860
  */
2861
-function debug_fclose( $fp ) {
2862
-	_deprecated_function( __FUNCTION__, 'error_log()' );
2861
+function debug_fclose($fp) {
2862
+	_deprecated_function(__FUNCTION__, 'error_log()');
2863 2863
 }
2864 2864
 
2865 2865
 /**
@@ -2876,21 +2876,21 @@  discard block
 block discarded – undo
2876 2876
  * @return array Theme list with theme data.
2877 2877
  */
2878 2878
 function get_themes() {
2879
-	_deprecated_function( __FUNCTION__, '3.4', 'wp_get_themes()' );
2879
+	_deprecated_function(__FUNCTION__, '3.4', 'wp_get_themes()');
2880 2880
 
2881 2881
 	global $wp_themes;
2882
-	if ( isset( $wp_themes ) )
2882
+	if (isset($wp_themes))
2883 2883
 		return $wp_themes;
2884 2884
 
2885 2885
 	$themes = wp_get_themes();
2886 2886
 	$wp_themes = array();
2887 2887
 
2888
-	foreach ( $themes as $theme ) {
2888
+	foreach ($themes as $theme) {
2889 2889
 		$name = $theme->get('Name');
2890
-		if ( isset( $wp_themes[ $name ] ) )
2891
-			$wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
2890
+		if (isset($wp_themes[$name]))
2891
+			$wp_themes[$name.'/'.$theme->get_stylesheet()] = $theme;
2892 2892
 		else
2893
-			$wp_themes[ $name ] = $theme;
2893
+			$wp_themes[$name] = $theme;
2894 2894
 	}
2895 2895
 
2896 2896
 	return $wp_themes;
@@ -2906,12 +2906,12 @@  discard block
 block discarded – undo
2906 2906
  * @param string $theme Theme name.
2907 2907
  * @return array|null Null, if theme name does not exist. Theme data, if exists.
2908 2908
  */
2909
-function get_theme( $theme ) {
2910
-	_deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme( $stylesheet )' );
2909
+function get_theme($theme) {
2910
+	_deprecated_function(__FUNCTION__, '3.4', 'wp_get_theme( $stylesheet )');
2911 2911
 
2912 2912
 	$themes = get_themes();
2913
-	if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
2914
-		return $themes[ $theme ];
2913
+	if (is_array($themes) && array_key_exists($theme, $themes))
2914
+		return $themes[$theme];
2915 2915
 	return null;
2916 2916
 }
2917 2917
 
@@ -2925,9 +2925,9 @@  discard block
 block discarded – undo
2925 2925
  * @return string
2926 2926
  */
2927 2927
 function get_current_theme() {
2928
-	_deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
2928
+	_deprecated_function(__FUNCTION__, '3.4', 'wp_get_theme()');
2929 2929
 
2930
-	if ( $theme = get_option( 'current_theme' ) )
2930
+	if ($theme = get_option('current_theme'))
2931 2931
 		return $theme;
2932 2932
 
2933 2933
 	return wp_get_theme()->get('Name');
@@ -2946,10 +2946,10 @@  discard block
 block discarded – undo
2946 2946
  * @return string The pre block without paragraph/line-break conversion.
2947 2947
  */
2948 2948
 function clean_pre($matches) {
2949
-	_deprecated_function( __FUNCTION__, '3.4' );
2949
+	_deprecated_function(__FUNCTION__, '3.4');
2950 2950
 
2951
-	if ( is_array($matches) )
2952
-		$text = $matches[1] . $matches[2] . "</pre>";
2951
+	if (is_array($matches))
2952
+		$text = $matches[1].$matches[2]."</pre>";
2953 2953
 	else
2954 2954
 		$text = $matches;
2955 2955
 
@@ -2972,15 +2972,15 @@  discard block
 block discarded – undo
2972 2972
  * @param callable $admin_head_callback Call on custom header administration screen.
2973 2973
  * @param callable $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional.
2974 2974
  */
2975
-function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) {
2976
-	_deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-header\', $args )' );
2975
+function add_custom_image_header($wp_head_callback, $admin_head_callback, $admin_preview_callback = '') {
2976
+	_deprecated_function(__FUNCTION__, '3.4', 'add_theme_support( \'custom-header\', $args )');
2977 2977
 	$args = array(
2978 2978
 		'wp-head-callback'    => $wp_head_callback,
2979 2979
 		'admin-head-callback' => $admin_head_callback,
2980 2980
 	);
2981
-	if ( $admin_preview_callback )
2981
+	if ($admin_preview_callback)
2982 2982
 		$args['admin-preview-callback'] = $admin_preview_callback;
2983
-	return add_theme_support( 'custom-header', $args );
2983
+	return add_theme_support('custom-header', $args);
2984 2984
 }
2985 2985
 
2986 2986
 /**
@@ -2993,8 +2993,8 @@  discard block
 block discarded – undo
2993 2993
  * @return null|bool Whether support was removed.
2994 2994
  */
2995 2995
 function remove_custom_image_header() {
2996
-	_deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support( \'custom-header\' )' );
2997
-	return remove_theme_support( 'custom-header' );
2996
+	_deprecated_function(__FUNCTION__, '3.4', 'remove_theme_support( \'custom-header\' )');
2997
+	return remove_theme_support('custom-header');
2998 2998
 }
2999 2999
 
3000 3000
 /**
@@ -3008,16 +3008,16 @@  discard block
 block discarded – undo
3008 3008
  * @param callable $admin_head_callback Call on custom background administration screen.
3009 3009
  * @param callable $admin_preview_callback Output a custom background image div on the custom background administration screen. Optional.
3010 3010
  */
3011
-function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {
3012
-	_deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )' );
3011
+function add_custom_background($wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '') {
3012
+	_deprecated_function(__FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )');
3013 3013
 	$args = array();
3014
-	if ( $wp_head_callback )
3014
+	if ($wp_head_callback)
3015 3015
 		$args['wp-head-callback'] = $wp_head_callback;
3016
-	if ( $admin_head_callback )
3016
+	if ($admin_head_callback)
3017 3017
 		$args['admin-head-callback'] = $admin_head_callback;
3018
-	if ( $admin_preview_callback )
3018
+	if ($admin_preview_callback)
3019 3019
 		$args['admin-preview-callback'] = $admin_preview_callback;
3020
-	return add_theme_support( 'custom-background', $args );
3020
+	return add_theme_support('custom-background', $args);
3021 3021
 }
3022 3022
 
3023 3023
 /**
@@ -3030,8 +3030,8 @@  discard block
 block discarded – undo
3030 3030
  * @return null|bool Whether support was removed.
3031 3031
  */
3032 3032
 function remove_custom_background() {
3033
-	_deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support( \'custom-background\' )' );
3034
-	return remove_theme_support( 'custom-background' );
3033
+	_deprecated_function(__FUNCTION__, '3.4', 'remove_theme_support( \'custom-background\' )');
3034
+	return remove_theme_support('custom-background');
3035 3035
 }
3036 3036
 
3037 3037
 /**
@@ -3044,9 +3044,9 @@  discard block
 block discarded – undo
3044 3044
  * @param string $theme_file Theme file path.
3045 3045
  * @return array Theme data.
3046 3046
  */
3047
-function get_theme_data( $theme_file ) {
3048
-	_deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
3049
-	$theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );
3047
+function get_theme_data($theme_file) {
3048
+	_deprecated_function(__FUNCTION__, '3.4', 'wp_get_theme()');
3049
+	$theme = new WP_Theme(basename(dirname($theme_file)), dirname(dirname($theme_file)));
3050 3050
 
3051 3051
 	$theme_data = array(
3052 3052
 		'Name' => $theme->get('Name'),
@@ -3062,9 +3062,9 @@  discard block
 block discarded – undo
3062 3062
 		'AuthorName' => $theme->get('Author'),
3063 3063
 	);
3064 3064
 
3065
-	foreach ( apply_filters( 'extra_theme_headers', array() ) as $extra_header ) {
3066
-		if ( ! isset( $theme_data[ $extra_header ] ) )
3067
-			$theme_data[ $extra_header ] = $theme->get( $extra_header );
3065
+	foreach (apply_filters('extra_theme_headers', array()) as $extra_header) {
3066
+		if ( ! isset($theme_data[$extra_header]))
3067
+			$theme_data[$extra_header] = $theme->get($extra_header);
3068 3068
 	}
3069 3069
 
3070 3070
 	return $theme_data;
@@ -3081,10 +3081,10 @@  discard block
 block discarded – undo
3081 3081
  *
3082 3082
  * @param array $pages list of page objects
3083 3083
  */
3084
-function update_page_cache( &$pages ) {
3085
-	_deprecated_function( __FUNCTION__, '3.4', 'update_post_cache()' );
3084
+function update_page_cache(&$pages) {
3085
+	_deprecated_function(__FUNCTION__, '3.4', 'update_post_cache()');
3086 3086
 
3087
-	update_post_cache( $pages );
3087
+	update_post_cache($pages);
3088 3088
 }
3089 3089
 
3090 3090
 /**
@@ -3099,10 +3099,10 @@  discard block
 block discarded – undo
3099 3099
  *
3100 3100
  * @param int $id Page ID to clean
3101 3101
  */
3102
-function clean_page_cache( $id ) {
3103
-	_deprecated_function( __FUNCTION__, '3.4', 'clean_post_cache()' );
3102
+function clean_page_cache($id) {
3103
+	_deprecated_function(__FUNCTION__, '3.4', 'clean_post_cache()');
3104 3104
 
3105
-	clean_post_cache( $id );
3105
+	clean_post_cache($id);
3106 3106
 }
3107 3107
 
3108 3108
 /**
@@ -3117,9 +3117,9 @@  discard block
 block discarded – undo
3117 3117
  * @param string $action Nonce action.
3118 3118
  * @return string Are you sure message.
3119 3119
  */
3120
-function wp_explain_nonce( $action ) {
3121
-	_deprecated_function( __FUNCTION__, '3.4.1', 'wp_nonce_ays()' );
3122
-	return __( 'Are you sure you want to do this?' );
3120
+function wp_explain_nonce($action) {
3121
+	_deprecated_function(__FUNCTION__, '3.4.1', 'wp_nonce_ays()');
3122
+	return __('Are you sure you want to do this?');
3123 3123
 }
3124 3124
 
3125 3125
 /**
@@ -3131,9 +3131,9 @@  discard block
 block discarded – undo
3131 3131
  *
3132 3132
  * @param int $post_id An optional post ID.
3133 3133
  */
3134
-function sticky_class( $post_id = null ) {
3135
-	_deprecated_function( __FUNCTION__, '3.5', 'post_class()' );
3136
-	if ( is_sticky( $post_id ) )
3134
+function sticky_class($post_id = null) {
3135
+	_deprecated_function(__FUNCTION__, '3.5', 'post_class()');
3136
+	if (is_sticky($post_id))
3137 3137
 		echo ' sticky';
3138 3138
 }
3139 3139
 
@@ -3149,8 +3149,8 @@  discard block
 block discarded – undo
3149 3149
  *
3150 3150
  * @param WP_Post &$post Post object, passed by reference (unused).
3151 3151
  */
3152
-function _get_post_ancestors( &$post ) {
3153
-	_deprecated_function( __FUNCTION__, '3.5' );
3152
+function _get_post_ancestors(&$post) {
3153
+	_deprecated_function(__FUNCTION__, '3.5');
3154 3154
 }
3155 3155
 
3156 3156
 /**
@@ -3163,23 +3163,23 @@  discard block
 block discarded – undo
3163 3163
  * @param string $file Filename of the image to load.
3164 3164
  * @return resource The resulting image resource on success, Error string on failure.
3165 3165
  */
3166
-function wp_load_image( $file ) {
3167
-	_deprecated_function( __FUNCTION__, '3.5', 'wp_get_image_editor()' );
3166
+function wp_load_image($file) {
3167
+	_deprecated_function(__FUNCTION__, '3.5', 'wp_get_image_editor()');
3168 3168
 
3169
-	if ( is_numeric( $file ) )
3170
-		$file = get_attached_file( $file );
3169
+	if (is_numeric($file))
3170
+		$file = get_attached_file($file);
3171 3171
 
3172
-	if ( ! is_file( $file ) )
3172
+	if ( ! is_file($file))
3173 3173
 		return sprintf(__('File &#8220;%s&#8221; doesn&#8217;t exist?'), $file);
3174 3174
 
3175
-	if ( ! function_exists('imagecreatefromstring') )
3175
+	if ( ! function_exists('imagecreatefromstring'))
3176 3176
 		return __('The GD image library is not installed.');
3177 3177
 
3178 3178
 	// Set artificially high because GD uses uncompressed images in memory
3179
-	@ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
3180
-	$image = imagecreatefromstring( file_get_contents( $file ) );
3179
+	@ini_set('memory_limit', apply_filters('image_memory_limit', WP_MAX_MEMORY_LIMIT));
3180
+	$image = imagecreatefromstring(file_get_contents($file));
3181 3181
 
3182
-	if ( !is_resource( $image ) )
3182
+	if ( ! is_resource($image))
3183 3183
 		return sprintf(__('File &#8220;%s&#8221; is not an image.'), $file);
3184 3184
 
3185 3185
 	return $image;
@@ -3209,22 +3209,22 @@  discard block
 block discarded – undo
3209 3209
  * @param int $jpeg_quality Optional, default is 90. Image quality percentage.
3210 3210
  * @return mixed WP_Error on failure. String with new destination path.
3211 3211
  */
3212
-function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90 ) {
3213
-	_deprecated_function( __FUNCTION__, '3.5', 'wp_get_image_editor()' );
3212
+function image_resize($file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90) {
3213
+	_deprecated_function(__FUNCTION__, '3.5', 'wp_get_image_editor()');
3214 3214
 
3215
-	$editor = wp_get_image_editor( $file );
3216
-	if ( is_wp_error( $editor ) )
3215
+	$editor = wp_get_image_editor($file);
3216
+	if (is_wp_error($editor))
3217 3217
 		return $editor;
3218
-	$editor->set_quality( $jpeg_quality );
3218
+	$editor->set_quality($jpeg_quality);
3219 3219
 
3220
-	$resized = $editor->resize( $max_w, $max_h, $crop );
3221
-	if ( is_wp_error( $resized ) )
3220
+	$resized = $editor->resize($max_w, $max_h, $crop);
3221
+	if (is_wp_error($resized))
3222 3222
 		return $resized;
3223 3223
 
3224
-	$dest_file = $editor->generate_filename( $suffix, $dest_path );
3225
-	$saved = $editor->save( $dest_file );
3224
+	$dest_file = $editor->generate_filename($suffix, $dest_path);
3225
+	$saved = $editor->save($dest_file);
3226 3226
 
3227
-	if ( is_wp_error( $saved ) )
3227
+	if (is_wp_error($saved))
3228 3228
 		return $saved;
3229 3229
 
3230 3230
 	return $dest_file;
@@ -3244,9 +3244,9 @@  discard block
 block discarded – undo
3244 3244
  * @param string $mode How to return result, either OBJECT, ARRAY_N, or ARRAY_A.
3245 3245
  * @return WP_Post|null Post object or array holding post contents and information
3246 3246
  */
3247
-function wp_get_single_post( $postid = 0, $mode = OBJECT ) {
3248
-	_deprecated_function( __FUNCTION__, '3.5', 'get_post()' );
3249
-	return get_post( $postid, $mode );
3247
+function wp_get_single_post($postid = 0, $mode = OBJECT) {
3248
+	_deprecated_function(__FUNCTION__, '3.5', 'get_post()');
3249
+	return get_post($postid, $mode);
3250 3250
 }
3251 3251
 
3252 3252
 /**
@@ -3261,9 +3261,9 @@  discard block
 block discarded – undo
3261 3261
  * @return bool False if does not authenticate, true if username and password authenticates.
3262 3262
  */
3263 3263
 function user_pass_ok($user_login, $user_pass) {
3264
-	_deprecated_function( __FUNCTION__, '3.5', 'wp_authenticate()' );
3265
-	$user = wp_authenticate( $user_login, $user_pass );
3266
-	if ( is_wp_error( $user ) )
3264
+	_deprecated_function(__FUNCTION__, '3.5', 'wp_authenticate()');
3265
+	$user = wp_authenticate($user_login, $user_pass);
3266
+	if (is_wp_error($user))
3267 3267
 		return false;
3268 3268
 
3269 3269
 	return true;
@@ -3288,10 +3288,10 @@  discard block
 block discarded – undo
3288 3288
  * @return bool
3289 3289
  */
3290 3290
 function gd_edit_image_support($mime_type) {
3291
-	_deprecated_function( __FUNCTION__, '3.5', 'wp_image_editor_supports()' );
3291
+	_deprecated_function(__FUNCTION__, '3.5', 'wp_image_editor_supports()');
3292 3292
 
3293
-	if ( function_exists('imagetypes') ) {
3294
-		switch( $mime_type ) {
3293
+	if (function_exists('imagetypes')) {
3294
+		switch ($mime_type) {
3295 3295
 			case 'image/jpeg':
3296 3296
 				return (imagetypes() & IMG_JPG) != 0;
3297 3297
 			case 'image/png':
@@ -3300,7 +3300,7 @@  discard block
 block discarded – undo
3300 3300
 				return (imagetypes() & IMG_GIF) != 0;
3301 3301
 		}
3302 3302
 	} else {
3303
-		switch( $mime_type ) {
3303
+		switch ($mime_type) {
3304 3304
 			case 'image/jpeg':
3305 3305
 				return function_exists('imagecreatefromjpeg');
3306 3306
 			case 'image/png':
@@ -3322,22 +3322,22 @@  discard block
 block discarded – undo
3322 3322
  * @param int $bytes An integer byte value.
3323 3323
  * @return string A shorthand byte value.
3324 3324
  */
3325
-function wp_convert_bytes_to_hr( $bytes ) {
3326
-	_deprecated_function( __FUNCTION__, '3.6', 'size_format()' );
3325
+function wp_convert_bytes_to_hr($bytes) {
3326
+	_deprecated_function(__FUNCTION__, '3.6', 'size_format()');
3327 3327
 
3328
-	$units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );
3329
-	$log   = log( $bytes, KB_IN_BYTES );
3328
+	$units = array(0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB', 4 => 'TB');
3329
+	$log   = log($bytes, KB_IN_BYTES);
3330 3330
 	$power = (int) $log;
3331
-	$size  = pow( KB_IN_BYTES, $log - $power );
3331
+	$size  = pow(KB_IN_BYTES, $log - $power);
3332 3332
 
3333
-	if ( ! is_nan( $size ) && array_key_exists( $power, $units ) ) {
3334
-		$unit = $units[ $power ];
3333
+	if ( ! is_nan($size) && array_key_exists($power, $units)) {
3334
+		$unit = $units[$power];
3335 3335
 	} else {
3336 3336
 		$size = $bytes;
3337 3337
 		$unit = $units[0];
3338 3338
 	}
3339 3339
 
3340
-	return $size . $unit;
3340
+	return $size.$unit;
3341 3341
 }
3342 3342
 
3343 3343
 /**
@@ -3350,9 +3350,9 @@  discard block
 block discarded – undo
3350 3350
  * @param string $t Search terms to "tidy", e.g. trim.
3351 3351
  * @return string Trimmed search terms.
3352 3352
  */
3353
-function _search_terms_tidy( $t ) {
3354
-	_deprecated_function( __FUNCTION__, '3.7' );
3355
-	return trim( $t, "\"'\n\r " );
3353
+function _search_terms_tidy($t) {
3354
+	_deprecated_function(__FUNCTION__, '3.7');
3355
+	return trim($t, "\"'\n\r ");
3356 3356
 }
3357 3357
 
3358 3358
 /**
@@ -3368,10 +3368,10 @@  discard block
 block discarded – undo
3368 3368
  */
3369 3369
 function rich_edit_exists() {
3370 3370
 	global $wp_rich_edit_exists;
3371
-	_deprecated_function( __FUNCTION__, '3.9' );
3371
+	_deprecated_function(__FUNCTION__, '3.9');
3372 3372
 
3373
-	if ( ! isset( $wp_rich_edit_exists ) )
3374
-		$wp_rich_edit_exists = file_exists( ABSPATH . WPINC . '/js/tinymce/tinymce.js' );
3373
+	if ( ! isset($wp_rich_edit_exists))
3374
+		$wp_rich_edit_exists = file_exists(ABSPATH.WPINC.'/js/tinymce/tinymce.js');
3375 3375
 
3376 3376
 	return $wp_rich_edit_exists;
3377 3377
 }
@@ -3386,7 +3386,7 @@  discard block
 block discarded – undo
3386 3386
  * @param int $count Number of topics.
3387 3387
  * @return int Number of topics.
3388 3388
  */
3389
-function default_topic_count_text( $count ) {
3389
+function default_topic_count_text($count) {
3390 3390
 	return $count;
3391 3391
 }
3392 3392
 
@@ -3401,8 +3401,8 @@  discard block
 block discarded – undo
3401 3401
  * @param string $content The text to format.
3402 3402
  * @return string The very same text.
3403 3403
  */
3404
-function format_to_post( $content ) {
3405
-	_deprecated_function( __FUNCTION__, '3.9' );
3404
+function format_to_post($content) {
3405
+	_deprecated_function(__FUNCTION__, '3.9');
3406 3406
 	return $content;
3407 3407
 }
3408 3408
 
@@ -3417,8 +3417,8 @@  discard block
 block discarded – undo
3417 3417
  * @return string text, safe for inclusion in LIKE query.
3418 3418
  */
3419 3419
 function like_escape($text) {
3420
-	_deprecated_function( __FUNCTION__, '4.0', 'wpdb::esc_like()' );
3421
-	return str_replace( array( "%", "_" ), array( "\\%", "\\_" ), $text );
3420
+	_deprecated_function(__FUNCTION__, '4.0', 'wpdb::esc_like()');
3421
+	return str_replace(array("%", "_"), array("\\%", "\\_"), $text);
3422 3422
 }
3423 3423
 
3424 3424
 /**
@@ -3433,14 +3433,14 @@  discard block
 block discarded – undo
3433 3433
  * @param string $url The URL to test.
3434 3434
  * @return bool Whether SSL access is available.
3435 3435
  */
3436
-function url_is_accessable_via_ssl( $url ) {
3437
-	_deprecated_function( __FUNCTION__, '4.0' );
3436
+function url_is_accessable_via_ssl($url) {
3437
+	_deprecated_function(__FUNCTION__, '4.0');
3438 3438
 
3439
-	$response = wp_remote_get( set_url_scheme( $url, 'https' ) );
3439
+	$response = wp_remote_get(set_url_scheme($url, 'https'));
3440 3440
 
3441
-	if ( !is_wp_error( $response ) ) {
3442
-		$status = wp_remote_retrieve_response_code( $response );
3443
-		if ( 200 == $status || 401 == $status ) {
3441
+	if ( ! is_wp_error($response)) {
3442
+		$status = wp_remote_retrieve_response_code($response);
3443
+		if (200 == $status || 401 == $status) {
3444 3444
 			return true;
3445 3445
 		}
3446 3446
 	}
@@ -3458,7 +3458,7 @@  discard block
 block discarded – undo
3458 3458
  * @deprecated 4.3.0
3459 3459
  */
3460 3460
 function preview_theme() {
3461
-	_deprecated_function( __FUNCTION__, '4.3' );
3461
+	_deprecated_function(__FUNCTION__, '4.3');
3462 3462
 }
3463 3463
 
3464 3464
 /**
@@ -3471,7 +3471,7 @@  discard block
 block discarded – undo
3471 3471
  * @return string
3472 3472
  */
3473 3473
 function _preview_theme_template_filter() {
3474
-	_deprecated_function( __FUNCTION__, '4.3' );
3474
+	_deprecated_function(__FUNCTION__, '4.3');
3475 3475
 	return '';
3476 3476
 }
3477 3477
 
@@ -3485,7 +3485,7 @@  discard block
 block discarded – undo
3485 3485
  * @return string
3486 3486
  */
3487 3487
 function _preview_theme_stylesheet_filter() {
3488
-	_deprecated_function( __FUNCTION__, '4.3' );
3488
+	_deprecated_function(__FUNCTION__, '4.3');
3489 3489
 	return '';
3490 3490
 }
3491 3491
 
@@ -3499,8 +3499,8 @@  discard block
 block discarded – undo
3499 3499
  * @param string $content
3500 3500
  * @return string
3501 3501
  */
3502
-function preview_theme_ob_filter( $content ) {
3503
-	_deprecated_function( __FUNCTION__, '4.3' );
3502
+function preview_theme_ob_filter($content) {
3503
+	_deprecated_function(__FUNCTION__, '4.3');
3504 3504
 	return $content;
3505 3505
 }
3506 3506
 
@@ -3516,8 +3516,8 @@  discard block
 block discarded – undo
3516 3516
  * @param array $matches
3517 3517
  * @return string
3518 3518
  */
3519
-function preview_theme_ob_filter_callback( $matches ) {
3520
-	_deprecated_function( __FUNCTION__, '4.3' );
3519
+function preview_theme_ob_filter_callback($matches) {
3520
+	_deprecated_function(__FUNCTION__, '4.3');
3521 3521
 	return '';
3522 3522
 }
3523 3523
 
@@ -3534,9 +3534,9 @@  discard block
 block discarded – undo
3534 3534
  * @return string The formatted text after filter is applied.
3535 3535
  */
3536 3536
 function wp_richedit_pre($text) {
3537
-	_deprecated_function( __FUNCTION__, '4.3', 'format_for_editor()' );
3537
+	_deprecated_function(__FUNCTION__, '4.3', 'format_for_editor()');
3538 3538
 
3539
-	if ( empty( $text ) ) {
3539
+	if (empty($text)) {
3540 3540
 		/**
3541 3541
 		 * Filter text returned for the rich text editor.
3542 3542
 		 *
@@ -3552,15 +3552,15 @@  discard block
 block discarded – undo
3552 3552
 		 *
3553 3553
 		 * @param string $output Text for the rich text editor.
3554 3554
 		 */
3555
-		return apply_filters( 'richedit_pre', '' );
3555
+		return apply_filters('richedit_pre', '');
3556 3556
 	}
3557 3557
 
3558 3558
 	$output = convert_chars($text);
3559 3559
 	$output = wpautop($output);
3560
-	$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
3560
+	$output = htmlspecialchars($output, ENT_NOQUOTES, get_option('blog_charset'));
3561 3561
 
3562 3562
 	/** This filter is documented in wp-includes/deprecated.php */
3563
-	return apply_filters( 'richedit_pre', $output );
3563
+	return apply_filters('richedit_pre', $output);
3564 3564
 }
3565 3565
 
3566 3566
 /**
@@ -3577,10 +3577,10 @@  discard block
 block discarded – undo
3577 3577
  * @return string Formatted text after filter applied.
3578 3578
  */
3579 3579
 function wp_htmledit_pre($output) {
3580
-	_deprecated_function( __FUNCTION__, '4.3', 'format_for_editor()' );
3580
+	_deprecated_function(__FUNCTION__, '4.3', 'format_for_editor()');
3581 3581
 
3582
-	if ( !empty($output) )
3583
-		$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
3582
+	if ( ! empty($output))
3583
+		$output = htmlspecialchars($output, ENT_NOQUOTES, get_option('blog_charset')); // convert only < > &
3584 3584
 
3585 3585
 	/**
3586 3586
 	 * Filter the text before it is formatted for the HTML editor.
@@ -3590,7 +3590,7 @@  discard block
 block discarded – undo
3590 3590
 	 *
3591 3591
 	 * @param string $output The HTML-formatted text.
3592 3592
 	 */
3593
-	return apply_filters( 'htmledit_pre', $output );
3593
+	return apply_filters('htmledit_pre', $output);
3594 3594
 }
3595 3595
 
3596 3596
 /**
@@ -3603,10 +3603,10 @@  discard block
 block discarded – undo
3603 3603
  * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
3604 3604
  * @return string|false
3605 3605
  */
3606
-function post_permalink( $post_id = 0 ) {
3607
-	_deprecated_function( __FUNCTION__, '4.4', 'get_permalink()' );
3606
+function post_permalink($post_id = 0) {
3607
+	_deprecated_function(__FUNCTION__, '4.4', 'get_permalink()');
3608 3608
 
3609
-	return get_permalink( $post_id );
3609
+	return get_permalink($post_id);
3610 3610
 }
3611 3611
 
3612 3612
 /**
@@ -3625,44 +3625,44 @@  discard block
 block discarded – undo
3625 3625
  *                               returns false. Default 1.
3626 3626
  * @return bool|string False on failure and string of headers if HEAD request.
3627 3627
  */
3628
-function wp_get_http( $url, $file_path = false, $red = 1 ) {
3629
-	_deprecated_function( __FUNCTION__, '4.4', 'WP_Http' );
3628
+function wp_get_http($url, $file_path = false, $red = 1) {
3629
+	_deprecated_function(__FUNCTION__, '4.4', 'WP_Http');
3630 3630
 
3631
-	@set_time_limit( 60 );
3631
+	@set_time_limit(60);
3632 3632
 
3633
-	if ( $red > 5 )
3633
+	if ($red > 5)
3634 3634
 		return false;
3635 3635
 
3636 3636
 	$options = array();
3637 3637
 	$options['redirection'] = 5;
3638 3638
 
3639
-	if ( false == $file_path )
3639
+	if (false == $file_path)
3640 3640
 		$options['method'] = 'HEAD';
3641 3641
 	else
3642 3642
 		$options['method'] = 'GET';
3643 3643
 
3644
-	$response = wp_safe_remote_request( $url, $options );
3644
+	$response = wp_safe_remote_request($url, $options);
3645 3645
 
3646
-	if ( is_wp_error( $response ) )
3646
+	if (is_wp_error($response))
3647 3647
 		return false;
3648 3648
 
3649
-	$headers = wp_remote_retrieve_headers( $response );
3650
-	$headers['response'] = wp_remote_retrieve_response_code( $response );
3649
+	$headers = wp_remote_retrieve_headers($response);
3650
+	$headers['response'] = wp_remote_retrieve_response_code($response);
3651 3651
 
3652 3652
 	// WP_HTTP no longer follows redirects for HEAD requests.
3653
-	if ( 'HEAD' == $options['method'] && in_array($headers['response'], array(301, 302)) && isset( $headers['location'] ) ) {
3654
-		return wp_get_http( $headers['location'], $file_path, ++$red );
3653
+	if ('HEAD' == $options['method'] && in_array($headers['response'], array(301, 302)) && isset($headers['location'])) {
3654
+		return wp_get_http($headers['location'], $file_path, ++$red);
3655 3655
 	}
3656 3656
 
3657
-	if ( false == $file_path )
3657
+	if (false == $file_path)
3658 3658
 		return $headers;
3659 3659
 
3660 3660
 	// GET request - write it to the supplied filename
3661 3661
 	$out_fp = fopen($file_path, 'w');
3662
-	if ( !$out_fp )
3662
+	if ( ! $out_fp)
3663 3663
 		return $headers;
3664 3664
 
3665
-	fwrite( $out_fp,  wp_remote_retrieve_body( $response ) );
3665
+	fwrite($out_fp, wp_remote_retrieve_body($response));
3666 3666
 	fclose($out_fp);
3667 3667
 	clearstatcache();
3668 3668
 
@@ -3679,9 +3679,9 @@  discard block
 block discarded – undo
3679 3679
  * @param string|bool $force Optional Whether to force SSL login. Default null.
3680 3680
  * @return bool True if forced, false if not forced.
3681 3681
  */
3682
-function force_ssl_login( $force = null ) {
3683
-	_deprecated_function( __FUNCTION__, '4.4', 'force_ssl_admin()' );
3684
-	return force_ssl_admin( $force );
3682
+function force_ssl_login($force = null) {
3683
+	_deprecated_function(__FUNCTION__, '4.4', 'force_ssl_admin()');
3684
+	return force_ssl_admin($force);
3685 3685
 }
3686 3686
 
3687 3687
 /**
@@ -3693,7 +3693,7 @@  discard block
 block discarded – undo
3693 3693
  * @return string Full path to comments popup template file.
3694 3694
  */
3695 3695
 function get_comments_popup_template() {
3696
-	_deprecated_function( __FUNCTION__, '4.5' );
3696
+	_deprecated_function(__FUNCTION__, '4.5');
3697 3697
 
3698 3698
 	return '';
3699 3699
 }
@@ -3707,7 +3707,7 @@  discard block
 block discarded – undo
3707 3707
  * @return bool
3708 3708
  */
3709 3709
 function is_comments_popup() {
3710
-	_deprecated_function( __FUNCTION__, '4.5' );
3710
+	_deprecated_function(__FUNCTION__, '4.5');
3711 3711
 
3712 3712
 	return false;
3713 3713
 }
@@ -3719,7 +3719,7 @@  discard block
 block discarded – undo
3719 3719
  * @deprecated 4.5.0
3720 3720
  */
3721 3721
 function comments_popup_script() {
3722
-	_deprecated_function( __FUNCTION__, '4.5' );
3722
+	_deprecated_function(__FUNCTION__, '4.5');
3723 3723
 }
3724 3724
 
3725 3725
 /**
@@ -3731,8 +3731,8 @@  discard block
 block discarded – undo
3731 3731
  * @param string $text Content to replace links to open in a new window.
3732 3732
  * @return string Content that has filtered links.
3733 3733
  */
3734
-function popuplinks( $text ) {
3735
-	_deprecated_function( __FUNCTION__, '4.5' );
3734
+function popuplinks($text) {
3735
+	_deprecated_function(__FUNCTION__, '4.5');
3736 3736
 	$text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);
3737 3737
 	return $text;
3738 3738
 }
Please login to merge, or discard this patch.
Braces   +388 added lines, -270 removed lines patch added patch discarded remove patch
@@ -86,8 +86,9 @@  discard block
 block discarded – undo
86 86
 	$categories = get_the_category();
87 87
 	$cat = $categories[0]->term_id;
88 88
 
89
-	if ( $echo )
90
-		echo $cat;
89
+	if ( $echo ) {
90
+			echo $cat;
91
+	}
91 92
 
92 93
 	return $cat;
93 94
 }
@@ -136,19 +137,22 @@  discard block
 block discarded – undo
136 137
 
137 138
 	_deprecated_function( __FUNCTION__, '2.0', 'previous_post_link()' );
138 139
 
139
-	if ( empty($in_same_cat) || 'no' == $in_same_cat )
140
-		$in_same_cat = false;
141
-	else
142
-		$in_same_cat = true;
140
+	if ( empty($in_same_cat) || 'no' == $in_same_cat ) {
141
+			$in_same_cat = false;
142
+	} else {
143
+			$in_same_cat = true;
144
+	}
143 145
 
144 146
 	$post = get_previous_post($in_same_cat, $excluded_categories);
145 147
 
146
-	if ( !$post )
147
-		return;
148
+	if ( !$post ) {
149
+			return;
150
+	}
148 151
 
149 152
 	$string = '<a href="'.get_permalink($post->ID).'">'.$previous;
150
-	if ( 'yes' == $title )
151
-		$string .= apply_filters('the_title', $post->post_title, $post->ID);
153
+	if ( 'yes' == $title ) {
154
+			$string .= apply_filters('the_title', $post->post_title, $post->ID);
155
+	}
152 156
 	$string .= '</a>';
153 157
 	$format = str_replace('%', $string, $format);
154 158
 	echo $format;
@@ -171,19 +175,22 @@  discard block
 block discarded – undo
171 175
 function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
172 176
 	_deprecated_function( __FUNCTION__, '2.0', 'next_post_link()' );
173 177
 
174
-	if ( empty($in_same_cat) || 'no' == $in_same_cat )
175
-		$in_same_cat = false;
176
-	else
177
-		$in_same_cat = true;
178
+	if ( empty($in_same_cat) || 'no' == $in_same_cat ) {
179
+			$in_same_cat = false;
180
+	} else {
181
+			$in_same_cat = true;
182
+	}
178 183
 
179 184
 	$post = get_next_post($in_same_cat, $excluded_categories);
180 185
 
181
-	if ( !$post	)
182
-		return;
186
+	if ( !$post	) {
187
+			return;
188
+	}
183 189
 
184 190
 	$string = '<a href="'.get_permalink($post->ID).'">'.$next;
185
-	if ( 'yes' == $title )
186
-		$string .= apply_filters('the_title', $post->post_title, $post->ID);
191
+	if ( 'yes' == $title ) {
192
+			$string .= apply_filters('the_title', $post->post_title, $post->ID);
193
+	}
187 194
 	$string .= '</a>';
188 195
 	$format = str_replace('%', $string, $format);
189 196
 	echo $format;
@@ -366,11 +373,12 @@  discard block
 block discarded – undo
366 373
 
367 374
 	$user  = get_userdata($user_id);
368 375
 	$other = get_userdata($other_user);
369
-	if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )
370
-		return true;
371
-	else
372
-		return false;
373
-}
376
+	if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID ) {
377
+			return true;
378
+	} else {
379
+			return false;
380
+	}
381
+	}
374 382
 
375 383
 /**
376 384
  * Gets the links associated with category $cat_name.
@@ -399,8 +407,9 @@  discard block
 block discarded – undo
399 407
 
400 408
 	$cat_id = -1;
401 409
 	$cat = get_term_by('name', $cat_name, 'link_category');
402
-	if ( $cat )
403
-		$cat_id = $cat->term_id;
410
+	if ( $cat ) {
411
+			$cat_id = $cat->term_id;
412
+	}
404 413
 
405 414
 	get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated);
406 415
 }
@@ -459,8 +468,9 @@  discard block
 block discarded – undo
459 468
 
460 469
 	$cat_id = -1;
461 470
 	$cat = get_term_by('name', $cat_name, 'link_category');
462
-	if ( $cat )
463
-		$cat_id = $cat->term_id;
471
+	if ( $cat ) {
472
+			$cat_id = $cat->term_id;
473
+	}
464 474
 
465 475
 	return get_linkobjects($cat_id, $orderby, $limit);
466 476
 }
@@ -511,8 +521,9 @@  discard block
 block discarded – undo
511 521
 	$links = get_bookmarks( array( 'category' => $category, 'orderby' => $orderby, 'limit' => $limit ) ) ;
512 522
 
513 523
 	$links_array = array();
514
-	foreach ($links as $link)
515
-		$links_array[] = $link;
524
+	foreach ($links as $link) {
525
+			$links_array[] = $link;
526
+	}
516 527
 
517 528
 	return $links_array;
518 529
 }
@@ -638,18 +649,24 @@  discard block
 block discarded – undo
638 649
 	$r = wp_parse_args( $args );
639 650
 
640 651
 	// Map to new names.
641
-	if ( isset($r['optionall']) && isset($r['all']))
642
-		$r['show_option_all'] = $r['all'];
643
-	if ( isset($r['sort_column']) )
644
-		$r['orderby'] = $r['sort_column'];
645
-	if ( isset($r['sort_order']) )
646
-		$r['order'] = $r['sort_order'];
647
-	if ( isset($r['optiondates']) )
648
-		$r['show_last_update'] = $r['optiondates'];
649
-	if ( isset($r['optioncount']) )
650
-		$r['show_count'] = $r['optioncount'];
651
-	if ( isset($r['list']) )
652
-		$r['style'] = $r['list'] ? 'list' : 'break';
652
+	if ( isset($r['optionall']) && isset($r['all'])) {
653
+			$r['show_option_all'] = $r['all'];
654
+	}
655
+	if ( isset($r['sort_column']) ) {
656
+			$r['orderby'] = $r['sort_column'];
657
+	}
658
+	if ( isset($r['sort_order']) ) {
659
+			$r['order'] = $r['sort_order'];
660
+	}
661
+	if ( isset($r['optiondates']) ) {
662
+			$r['show_last_update'] = $r['optiondates'];
663
+	}
664
+	if ( isset($r['optioncount']) ) {
665
+			$r['show_count'] = $r['optioncount'];
666
+	}
667
+	if ( isset($r['list']) ) {
668
+			$r['style'] = $r['list'] ? 'list' : 'break';
669
+	}
653 670
 	$r['title_li'] = '';
654 671
 
655 672
 	return wp_list_categories($r);
@@ -680,12 +697,14 @@  discard block
 block discarded – undo
680 697
 	_deprecated_function( __FUNCTION__, '2.1', 'wp_dropdown_categories()' );
681 698
 
682 699
 	$show_option_all = '';
683
-	if ( $optionall )
684
-		$show_option_all = $all;
700
+	if ( $optionall ) {
701
+			$show_option_all = $all;
702
+	}
685 703
 
686 704
 	$show_option_none = '';
687
-	if ( $optionnone )
688
-		$show_option_none = __('None');
705
+	if ( $optionnone ) {
706
+			$show_option_none = __('None');
707
+	}
689 708
 
690 709
 	$vars = compact('show_option_all', 'show_option_none', 'orderby', 'order',
691 710
 					'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude');
@@ -787,8 +806,9 @@  discard block
 block discarded – undo
787 806
 
788 807
 	$link = get_author_posts_url($author_id, $author_nicename);
789 808
 
790
-	if ( $echo )
791
-		echo $link;
809
+	if ( $echo ) {
810
+			echo $link;
811
+	}
792 812
 	return $link;
793 813
 }
794 814
 
@@ -931,64 +951,78 @@  discard block
 block discarded – undo
931 951
 		$orderby = substr($orderby, 1);
932 952
 	}
933 953
 
934
-	if ( $category == -1 ) //get_bookmarks uses '' to signify all categories
954
+	if ( $category == -1 ) {
955
+		//get_bookmarks uses '' to signify all categories
935 956
 		$category = '';
957
+	}
936 958
 
937 959
 	$results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit));
938 960
 
939
-	if ( !$results )
940
-		return;
961
+	if ( !$results ) {
962
+			return;
963
+	}
941 964
 
942 965
 	$output = '';
943 966
 
944 967
 	foreach ( (array) $results as $row ) {
945
-		if ( !isset($row->recently_updated) )
946
-			$row->recently_updated = false;
968
+		if ( !isset($row->recently_updated) ) {
969
+					$row->recently_updated = false;
970
+		}
947 971
 		$output .= $before;
948
-		if ( $show_updated && $row->recently_updated )
949
-			$output .= get_option('links_recently_updated_prepend');
972
+		if ( $show_updated && $row->recently_updated ) {
973
+					$output .= get_option('links_recently_updated_prepend');
974
+		}
950 975
 		$the_link = '#';
951
-		if ( !empty($row->link_url) )
952
-			$the_link = esc_url($row->link_url);
976
+		if ( !empty($row->link_url) ) {
977
+					$the_link = esc_url($row->link_url);
978
+		}
953 979
 		$rel = $row->link_rel;
954
-		if ( '' != $rel )
955
-			$rel = ' rel="' . $rel . '"';
980
+		if ( '' != $rel ) {
981
+					$rel = ' rel="' . $rel . '"';
982
+		}
956 983
 
957 984
 		$desc = esc_attr(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display'));
958 985
 		$name = esc_attr(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display'));
959 986
 		$title = $desc;
960 987
 
961
-		if ( $show_updated )
962
-			if (substr($row->link_updated_f, 0, 2) != '00')
988
+		if ( $show_updated ) {
989
+					if (substr($row->link_updated_f, 0, 2) != '00')
963 990
 				$title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)) . ')';
991
+		}
964 992
 
965
-		if ( '' != $title )
966
-			$title = ' title="' . $title . '"';
993
+		if ( '' != $title ) {
994
+					$title = ' title="' . $title . '"';
995
+		}
967 996
 
968 997
 		$alt = ' alt="' . $name . '"';
969 998
 
970 999
 		$target = $row->link_target;
971
-		if ( '' != $target )
972
-			$target = ' target="' . $target . '"';
1000
+		if ( '' != $target ) {
1001
+					$target = ' target="' . $target . '"';
1002
+		}
973 1003
 
974 1004
 		$output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
975 1005
 
976 1006
 		if ( $row->link_image != null && $show_images ) {
977
-			if ( strpos($row->link_image, 'http') !== false )
978
-				$output .= "<img src=\"$row->link_image\" $alt $title />";
979
-			else // If it's a relative path
1007
+			if ( strpos($row->link_image, 'http') !== false ) {
1008
+							$output .= "<img src=\"$row->link_image\" $alt $title />";
1009
+			} else {
1010
+				// If it's a relative path
980 1011
 				$output .= "<img src=\"" . get_option('siteurl') . "$row->link_image\" $alt $title />";
1012
+			}
981 1013
 		} else {
982 1014
 			$output .= $name;
983 1015
 		}
984 1016
 
985 1017
 		$output .= '</a>';
986 1018
 
987
-		if ( $show_updated && $row->recently_updated )
988
-			$output .= get_option('links_recently_updated_append');
1019
+		if ( $show_updated && $row->recently_updated ) {
1020
+					$output .= get_option('links_recently_updated_append');
1021
+		}
989 1022
 
990
-		if ( $show_description && '' != $desc )
991
-			$output .= $between . $desc;
1023
+		if ( $show_description && '' != $desc ) {
1024
+					$output .= $between . $desc;
1025
+		}
992 1026
 
993 1027
 		if ($show_rating) {
994 1028
 			$output .= $between . get_linkrating($row);
@@ -997,8 +1031,9 @@  discard block
 block discarded – undo
997 1031
 		$output .= "$after\n";
998 1032
 	} // end while
999 1033
 
1000
-	if ( !$echo )
1001
-		return $output;
1034
+	if ( !$echo ) {
1035
+			return $output;
1036
+	}
1002 1037
 	echo $output;
1003 1038
 }
1004 1039
 
@@ -1026,8 +1061,9 @@  discard block
 block discarded – undo
1026 1061
 		$order = substr($order,1);
1027 1062
 	}
1028 1063
 
1029
-	if ( !isset($direction) )
1030
-		$direction = '';
1064
+	if ( !isset($direction) ) {
1065
+			$direction = '';
1066
+	}
1031 1067
 
1032 1068
 	$cats = get_categories(array('type' => 'link', 'orderby' => $order, 'order' => $direction, 'hierarchical' => 0));
1033 1069
 
@@ -1093,13 +1129,15 @@  discard block
 block discarded – undo
1093 1129
 
1094 1130
 	$id = (int) $id;
1095 1131
 
1096
-	if ( empty($id) )
1097
-		return '';
1132
+	if ( empty($id) ) {
1133
+			return '';
1134
+	}
1098 1135
 
1099 1136
 	$cats = wp_get_link_cats($id);
1100 1137
 
1101
-	if ( empty($cats) || ! is_array($cats) )
1102
-		return '';
1138
+	if ( empty($cats) || ! is_array($cats) ) {
1139
+			return '';
1140
+	}
1103 1141
 
1104 1142
 	$cat_id = (int) $cats[0]; // Take the first cat.
1105 1143
 
@@ -1137,8 +1175,9 @@  discard block
 block discarded – undo
1137 1175
 
1138 1176
 	$link = get_category_feed_link($cat_ID, 'rss2');
1139 1177
 
1140
-	if ( $echo )
1141
-		echo $link;
1178
+	if ( $echo ) {
1179
+			echo $link;
1180
+	}
1142 1181
 	return $link;
1143 1182
 }
1144 1183
 
@@ -1157,8 +1196,9 @@  discard block
 block discarded – undo
1157 1196
 	_deprecated_function( __FUNCTION__, '2.5', 'get_author_feed_link()' );
1158 1197
 
1159 1198
 	$link = get_author_feed_link($author_id);
1160
-	if ( $echo )
1161
-		echo $link;
1199
+	if ( $echo ) {
1200
+			echo $link;
1201
+	}
1162 1202
 	return $link;
1163 1203
 }
1164 1204
 
@@ -1250,19 +1290,22 @@  discard block
 block discarded – undo
1250 1290
  */
1251 1291
 function get_category_children( $id, $before = '/', $after = '', $visited = array() ) {
1252 1292
 	_deprecated_function( __FUNCTION__, '2.8', 'get_term_children()' );
1253
-	if ( 0 == $id )
1254
-		return '';
1293
+	if ( 0 == $id ) {
1294
+			return '';
1295
+	}
1255 1296
 
1256 1297
 	$chain = '';
1257 1298
 	/** TODO: consult hierarchy */
1258 1299
 	$cat_ids = get_all_category_ids();
1259 1300
 	foreach ( (array) $cat_ids as $cat_id ) {
1260
-		if ( $cat_id == $id )
1261
-			continue;
1301
+		if ( $cat_id == $id ) {
1302
+					continue;
1303
+		}
1262 1304
 
1263 1305
 		$category = get_category( $cat_id );
1264
-		if ( is_wp_error( $category ) )
1265
-			return $category;
1306
+		if ( is_wp_error( $category ) ) {
1307
+					return $category;
1308
+		}
1266 1309
 		if ( $category->parent == $id && !in_array( $category->term_id, $visited ) ) {
1267 1310
 			$visited[] = $category->term_id;
1268 1311
 			$chain .= $before.$category->term_id.$after;
@@ -1653,8 +1696,9 @@  discard block
 block discarded – undo
1653 1696
 	_deprecated_function( __FUNCTION__, '2.9', 'the_content_feed' );
1654 1697
 	$content = get_the_content($more_link_text, $stripteaser);
1655 1698
 	$content = apply_filters('the_content_rss', $content);
1656
-	if ( $cut && !$encode_html )
1657
-		$encode_html = 2;
1699
+	if ( $cut && !$encode_html ) {
1700
+			$encode_html = 2;
1701
+	}
1658 1702
 	if ( 1== $encode_html ) {
1659 1703
 		$content = esc_html($content);
1660 1704
 		$cut = 0;
@@ -1674,8 +1718,9 @@  discard block
 block discarded – undo
1674 1718
 		}
1675 1719
 
1676 1720
 		/** @todo Check performance, might be faster to use array slice instead. */
1677
-		for ( $i=0; $i<$k; $i++ )
1678
-			$excerpt .= $blah[$i].' ';
1721
+		for ( $i=0; $i<$k; $i++ ) {
1722
+					$excerpt .= $blah[$i].' ';
1723
+		}
1679 1724
 		$excerpt .= ($use_dotdotdot) ? '...' : '';
1680 1725
 		$content = $excerpt;
1681 1726
 	}
@@ -1836,11 +1881,13 @@  discard block
 block discarded – undo
1836 1881
 	$id = (int) $id;
1837 1882
 	$_post = get_post($id);
1838 1883
 
1839
-	if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )
1840
-		return __('Missing Attachment');
1884
+	if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) {
1885
+			return __('Missing Attachment');
1886
+	}
1841 1887
 
1842
-	if ( $permalink )
1843
-		$url = get_attachment_link($_post->ID);
1888
+	if ( $permalink ) {
1889
+			$url = get_attachment_link($_post->ID);
1890
+	}
1844 1891
 
1845 1892
 	$post_title = esc_attr($_post->post_title);
1846 1893
 
@@ -1862,8 +1909,9 @@  discard block
 block discarded – undo
1862 1909
 function get_attachment_icon_src( $id = 0, $fullsize = false ) {
1863 1910
 	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' );
1864 1911
 	$id = (int) $id;
1865
-	if ( !$post = get_post($id) )
1866
-		return false;
1912
+	if ( !$post = get_post($id) ) {
1913
+			return false;
1914
+	}
1867 1915
 
1868 1916
 	$file = get_attached_file( $post->ID );
1869 1917
 
@@ -1883,8 +1931,9 @@  discard block
 block discarded – undo
1883 1931
 		$src_file = $icon_dir . '/' . basename($src);
1884 1932
 	}
1885 1933
 
1886
-	if ( !isset($src) || !$src )
1887
-		return false;
1934
+	if ( !isset($src) || !$src ) {
1935
+			return false;
1936
+	}
1888 1937
 
1889 1938
 	return array($src, $src_file);
1890 1939
 }
@@ -1904,11 +1953,13 @@  discard block
 block discarded – undo
1904 1953
 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
1905 1954
 	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' );
1906 1955
 	$id = (int) $id;
1907
-	if ( !$post = get_post($id) )
1908
-		return false;
1956
+	if ( !$post = get_post($id) ) {
1957
+			return false;
1958
+	}
1909 1959
 
1910
-	if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )
1911
-		return false;
1960
+	if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) ) {
1961
+			return false;
1962
+	}
1912 1963
 
1913 1964
 	list($src, $src_file) = $src;
1914 1965
 
@@ -1960,11 +2011,13 @@  discard block
 block discarded – undo
1960 2011
 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
1961 2012
 	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' );
1962 2013
 	$id = (int) $id;
1963
-	if ( !$post = get_post($id) )
1964
-		return false;
2014
+	if ( !$post = get_post($id) ) {
2015
+			return false;
2016
+	}
1965 2017
 
1966
-	if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
1967
-		return $innerHTML;
2018
+	if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims)) {
2019
+			return $innerHTML;
2020
+	}
1968 2021
 
1969 2022
 	$innerHTML = esc_attr($post->post_title);
1970 2023
 
@@ -2023,10 +2076,11 @@  discard block
 block discarded – undo
2023 2076
  * @return string The cleaned $url after the 'clean_url' filter is applied.
2024 2077
  */
2025 2078
 function clean_url( $url, $protocols = null, $context = 'display' ) {
2026
-	if ( $context == 'db' )
2027
-		_deprecated_function( 'clean_url( $context = \'db\' )', '3.0', 'esc_url_raw()' );
2028
-	else
2029
-		_deprecated_function( __FUNCTION__, '3.0', 'esc_url()' );
2079
+	if ( $context == 'db' ) {
2080
+			_deprecated_function( 'clean_url( $context = \'db\' )', '3.0', 'esc_url_raw()' );
2081
+	} else {
2082
+			_deprecated_function( __FUNCTION__, '3.0', 'esc_url()' );
2083
+	}
2030 2084
 	return esc_url( $url, $protocols, $context );
2031 2085
 }
2032 2086
 
@@ -2107,20 +2161,23 @@  discard block
 block discarded – undo
2107 2161
 	_deprecated_function( __FUNCTION__, '2.8', 'wp_register_sidebar_widget()' );
2108 2162
 	// Compat
2109 2163
 	if ( is_array($name) ) {
2110
-		if ( count($name) == 3 )
2111
-			$name = sprintf($name[0], $name[2]);
2112
-		else
2113
-			$name = $name[0];
2164
+		if ( count($name) == 3 ) {
2165
+					$name = sprintf($name[0], $name[2]);
2166
+		} else {
2167
+					$name = $name[0];
2168
+		}
2114 2169
 	}
2115 2170
 
2116 2171
 	$id = sanitize_title($name);
2117 2172
 	$options = array();
2118
-	if ( !empty($classname) && is_string($classname) )
2119
-		$options['classname'] = $classname;
2173
+	if ( !empty($classname) && is_string($classname) ) {
2174
+			$options['classname'] = $classname;
2175
+	}
2120 2176
 	$params = array_slice(func_get_args(), 2);
2121 2177
 	$args = array($id, $name, $output_callback, $options);
2122
-	if ( !empty($params) )
2123
-		$args = array_merge($args, $params);
2178
+	if ( !empty($params) ) {
2179
+			$args = array_merge($args, $params);
2180
+	}
2124 2181
 
2125 2182
 	call_user_func_array('wp_register_sidebar_widget', $args);
2126 2183
 }
@@ -2162,22 +2219,26 @@  discard block
 block discarded – undo
2162 2219
 	_deprecated_function( __FUNCTION__, '2.8', 'wp_register_widget_control()' );
2163 2220
 	// Compat
2164 2221
 	if ( is_array($name) ) {
2165
-		if ( count($name) == 3 )
2166
-			$name = sprintf($name[0], $name[2]);
2167
-		else
2168
-			$name = $name[0];
2222
+		if ( count($name) == 3 ) {
2223
+					$name = sprintf($name[0], $name[2]);
2224
+		} else {
2225
+					$name = $name[0];
2226
+		}
2169 2227
 	}
2170 2228
 
2171 2229
 	$id = sanitize_title($name);
2172 2230
 	$options = array();
2173
-	if ( !empty($width) )
2174
-		$options['width'] = $width;
2175
-	if ( !empty($height) )
2176
-		$options['height'] = $height;
2231
+	if ( !empty($width) ) {
2232
+			$options['width'] = $width;
2233
+	}
2234
+	if ( !empty($height) ) {
2235
+			$options['height'] = $height;
2236
+	}
2177 2237
 	$params = array_slice(func_get_args(), 4);
2178 2238
 	$args = array($id, $name, $control_callback, $options);
2179
-	if ( !empty($params) )
2180
-		$args = array_merge($args, $params);
2239
+	if ( !empty($params) ) {
2240
+			$args = array_merge($args, $params);
2241
+	}
2181 2242
 
2182 2243
 	call_user_func_array('wp_register_widget_control', $args);
2183 2244
 }
@@ -2211,29 +2272,34 @@  discard block
 block discarded – undo
2211 2272
 function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
2212 2273
 	_deprecated_function( __FUNCTION__, '3.0', 'delete_user_meta()' );
2213 2274
 	global $wpdb;
2214
-	if ( !is_numeric( $user_id ) )
2215
-		return false;
2275
+	if ( !is_numeric( $user_id ) ) {
2276
+			return false;
2277
+	}
2216 2278
 	$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
2217 2279
 
2218
-	if ( is_array($meta_value) || is_object($meta_value) )
2219
-		$meta_value = serialize($meta_value);
2280
+	if ( is_array($meta_value) || is_object($meta_value) ) {
2281
+			$meta_value = serialize($meta_value);
2282
+	}
2220 2283
 	$meta_value = trim( $meta_value );
2221 2284
 
2222 2285
 	$cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2223 2286
 
2224
-	if ( $cur && $cur->umeta_id )
2225
-		do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2287
+	if ( $cur && $cur->umeta_id ) {
2288
+			do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2289
+	}
2226 2290
 
2227
-	if ( ! empty($meta_value) )
2228
-		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) );
2229
-	else
2230
-		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2291
+	if ( ! empty($meta_value) ) {
2292
+			$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) );
2293
+	} else {
2294
+			$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2295
+	}
2231 2296
 
2232 2297
 	clean_user_cache( $user_id );
2233 2298
 	wp_cache_delete( $user_id, 'user_meta' );
2234 2299
 
2235
-	if ( $cur && $cur->umeta_id )
2236
-		do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2300
+	if ( $cur && $cur->umeta_id ) {
2301
+			do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2302
+	}
2237 2303
 
2238 2304
 	return true;
2239 2305
 }
@@ -2259,35 +2325,39 @@  discard block
 block discarded – undo
2259 2325
 	global $wpdb;
2260 2326
 	$user_id = (int) $user_id;
2261 2327
 
2262
-	if ( !$user_id )
2263
-		return false;
2328
+	if ( !$user_id ) {
2329
+			return false;
2330
+	}
2264 2331
 
2265 2332
 	if ( !empty($meta_key) ) {
2266 2333
 		$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
2267 2334
 		$user = wp_cache_get($user_id, 'users');
2268 2335
 		// Check the cached user object
2269
-		if ( false !== $user && isset($user->$meta_key) )
2270
-			$metas = array($user->$meta_key);
2271
-		else
2272
-			$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2336
+		if ( false !== $user && isset($user->$meta_key) ) {
2337
+					$metas = array($user->$meta_key);
2338
+		} else {
2339
+					$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2340
+		}
2273 2341
 	} else {
2274 2342
 		$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user_id) );
2275 2343
 	}
2276 2344
 
2277 2345
 	if ( empty($metas) ) {
2278
-		if ( empty($meta_key) )
2279
-			return array();
2280
-		else
2281
-			return '';
2346
+		if ( empty($meta_key) ) {
2347
+					return array();
2348
+		} else {
2349
+					return '';
2350
+		}
2282 2351
 	}
2283 2352
 
2284 2353
 	$metas = array_map('maybe_unserialize', $metas);
2285 2354
 
2286
-	if ( count($metas) == 1 )
2287
-		return $metas[0];
2288
-	else
2289
-		return $metas;
2290
-}
2355
+	if ( count($metas) == 1 ) {
2356
+			return $metas[0];
2357
+	} else {
2358
+			return $metas;
2359
+	}
2360
+	}
2291 2361
 
2292 2362
 /**
2293 2363
  * Update metadata of user.
@@ -2310,13 +2380,15 @@  discard block
 block discarded – undo
2310 2380
 function update_usermeta( $user_id, $meta_key, $meta_value ) {
2311 2381
 	_deprecated_function( __FUNCTION__, '3.0', 'update_user_meta()' );
2312 2382
 	global $wpdb;
2313
-	if ( !is_numeric( $user_id ) )
2314
-		return false;
2383
+	if ( !is_numeric( $user_id ) ) {
2384
+			return false;
2385
+	}
2315 2386
 	$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
2316 2387
 
2317 2388
 	/** @todo Might need fix because usermeta data is assumed to be already escaped */
2318
-	if ( is_string($meta_value) )
2319
-		$meta_value = stripslashes($meta_value);
2389
+	if ( is_string($meta_value) ) {
2390
+			$meta_value = stripslashes($meta_value);
2391
+	}
2320 2392
 	$meta_value = maybe_serialize($meta_value);
2321 2393
 
2322 2394
 	if (empty($meta_value)) {
@@ -2325,23 +2397,26 @@  discard block
 block discarded – undo
2325 2397
 
2326 2398
 	$cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
2327 2399
 
2328
-	if ( $cur )
2329
-		do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2400
+	if ( $cur ) {
2401
+			do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2402
+	}
2330 2403
 
2331
-	if ( !$cur )
2332
-		$wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') );
2333
-	elseif ( $cur->meta_value != $meta_value )
2334
-		$wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') );
2335
-	else
2336
-		return false;
2404
+	if ( !$cur ) {
2405
+			$wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') );
2406
+	} elseif ( $cur->meta_value != $meta_value ) {
2407
+			$wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') );
2408
+	} else {
2409
+			return false;
2410
+	}
2337 2411
 
2338 2412
 	clean_user_cache( $user_id );
2339 2413
 	wp_cache_delete( $user_id, 'user_meta' );
2340 2414
 
2341
-	if ( !$cur )
2342
-		do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value );
2343
-	else
2344
-		do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2415
+	if ( !$cur ) {
2416
+			do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value );
2417
+	} else {
2418
+			do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
2419
+	}
2345 2420
 
2346 2421
 	return true;
2347 2422
 }
@@ -2366,8 +2441,9 @@  discard block
 block discarded – undo
2366 2441
 	_deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
2367 2442
 
2368 2443
 	global $wpdb, $blog_id;
2369
-	if ( empty($id) )
2370
-		$id = (int) $blog_id;
2444
+	if ( empty($id) ) {
2445
+			$id = (int) $blog_id;
2446
+	}
2371 2447
 	$blog_prefix = $wpdb->get_blog_prefix($id);
2372 2448
 	$users = $wpdb->get_results( "SELECT user_id, user_id AS ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id" );
2373 2449
 	return $users;
@@ -2385,10 +2461,12 @@  discard block
 block discarded – undo
2385 2461
 function automatic_feed_links( $add = true ) {
2386 2462
 	_deprecated_function( __FUNCTION__, '3.0', "add_theme_support( 'automatic-feed-links' )" );
2387 2463
 
2388
-	if ( $add )
2389
-		add_theme_support( 'automatic-feed-links' );
2390
-	else
2391
-		remove_action( 'wp_head', 'feed_links_extra', 3 ); // Just do this yourself in 3.0+
2464
+	if ( $add ) {
2465
+			add_theme_support( 'automatic-feed-links' );
2466
+	} else {
2467
+			remove_action( 'wp_head', 'feed_links_extra', 3 );
2468
+	}
2469
+	// Just do this yourself in 3.0+
2392 2470
 }
2393 2471
 
2394 2472
 /**
@@ -2459,10 +2537,11 @@  discard block
 block discarded – undo
2459 2537
 	// Fixes for browsers' JavaScript bugs.
2460 2538
 	global $is_macIE, $is_winIE;
2461 2539
 
2462
-	if ( $is_winIE || $is_macIE )
2463
-		$text =  preg_replace_callback("/\%u([0-9A-F]{4,4})/",
2540
+	if ( $is_winIE || $is_macIE ) {
2541
+			$text =  preg_replace_callback("/\%u([0-9A-F]{4,4})/",
2464 2542
 					"funky_javascript_callback",
2465 2543
 					$text);
2544
+	}
2466 2545
 
2467 2546
 	return $text;
2468 2547
 }
@@ -2516,8 +2595,9 @@  discard block
 block discarded – undo
2516 2595
 
2517 2596
 	global $plugin_page;
2518 2597
 
2519
-	if ( isset($plugin_page) )
2520
-		return true;
2598
+	if ( isset($plugin_page) ) {
2599
+			return true;
2600
+	}
2521 2601
 
2522 2602
 	return false;
2523 2603
 }
@@ -2589,8 +2669,9 @@  discard block
 block discarded – undo
2589 2669
 	$objects = array();
2590 2670
 
2591 2671
 	$ids = array_map('intval', $ids);
2592
-	foreach ( $ids as $id )
2593
-		$objects[$id] = array();
2672
+	foreach ( $ids as $id ) {
2673
+			$objects[$id] = array();
2674
+	}
2594 2675
 
2595 2676
 	$metas = update_meta_cache('user', $ids);
2596 2677
 
@@ -2621,21 +2702,25 @@  discard block
 block discarded – undo
2621 2702
 	_deprecated_function( __FUNCTION__, '3.3' );
2622 2703
 
2623 2704
 	if ( is_object($user) ) {
2624
-		if ( !isset($user->ID) )
2625
-			$user->ID = 0;
2705
+		if ( !isset($user->ID) ) {
2706
+					$user->ID = 0;
2707
+		}
2626 2708
 		if ( ! ( $user instanceof WP_User ) ) {
2627 2709
 			$vars = get_object_vars($user);
2628 2710
 			foreach ( array_keys($vars) as $field ) {
2629
-				if ( is_string($user->$field) || is_numeric($user->$field) )
2630
-					$user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context);
2711
+				if ( is_string($user->$field) || is_numeric($user->$field) ) {
2712
+									$user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context);
2713
+				}
2631 2714
 			}
2632 2715
 		}
2633 2716
 		$user->filter = $context;
2634 2717
 	} else {
2635
-		if ( !isset($user['ID']) )
2636
-			$user['ID'] = 0;
2637
-		foreach ( array_keys($user) as $field )
2638
-			$user[$field] = sanitize_user_field($field, $user[$field], $user['ID'], $context);
2718
+		if ( !isset($user['ID']) ) {
2719
+					$user['ID'] = 0;
2720
+		}
2721
+		foreach ( array_keys($user) as $field ) {
2722
+					$user[$field] = sanitize_user_field($field, $user[$field], $user['ID'], $context);
2723
+		}
2639 2724
 		$user['filter'] = $context;
2640 2725
 	}
2641 2726
 
@@ -2661,14 +2746,16 @@  discard block
 block discarded – undo
2661 2746
 
2662 2747
 	$posts = get_boundary_post($in_same_cat, $excluded_categories, $start);
2663 2748
 	// If there is no post stop.
2664
-	if ( empty($posts) )
2665
-		return;
2749
+	if ( empty($posts) ) {
2750
+			return;
2751
+	}
2666 2752
 
2667 2753
 	// Even though we limited get_posts to return only 1 item it still returns an array of objects.
2668 2754
 	$post = $posts[0];
2669 2755
 
2670
-	if ( empty($post->post_title) )
2671
-		$post->post_title = $start ? __('First Post') : __('Last Post');
2756
+	if ( empty($post->post_title) ) {
2757
+			$post->post_title = $start ? __('First Post') : __('Last Post');
2758
+	}
2672 2759
 
2673 2760
 	$date = mysql2date(get_option('date_format'), $post->post_date);
2674 2761
 
@@ -2739,11 +2826,13 @@  discard block
 block discarded – undo
2739 2826
 function get_parent_post_rel_link( $title = '%title' ) {
2740 2827
 	_deprecated_function( __FUNCTION__, '3.3' );
2741 2828
 
2742
-	if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) )
2743
-		$post = get_post($GLOBALS['post']->post_parent);
2829
+	if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) ) {
2830
+			$post = get_post($GLOBALS['post']->post_parent);
2831
+	}
2744 2832
 
2745
-	if ( empty($post) )
2746
-		return;
2833
+	if ( empty($post) ) {
2834
+			return;
2835
+	}
2747 2836
 
2748 2837
 	$date = mysql2date(get_option('date_format'), $post->post_date);
2749 2838
 
@@ -2786,12 +2875,13 @@  discard block
 block discarded – undo
2786 2875
 	$user_id = get_current_user_id();
2787 2876
 
2788 2877
 	if ( 0 != $user_id ) {
2789
-		if ( is_admin() )
2790
-			$wp_admin_bar->add_menu( array( 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url() ) );
2791
-		elseif ( is_multisite() )
2792
-			$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );
2793
-		else
2794
-			$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );
2878
+		if ( is_admin() ) {
2879
+					$wp_admin_bar->add_menu( array( 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url() ) );
2880
+		} elseif ( is_multisite() ) {
2881
+					$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );
2882
+		} else {
2883
+					$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );
2884
+		}
2795 2885
 	}
2796 2886
 }
2797 2887
 
@@ -2843,9 +2933,10 @@  discard block
 block discarded – undo
2843 2933
  */
2844 2934
 function debug_fwrite( $fp, $string ) {
2845 2935
 	_deprecated_function( __FUNCTION__, 'error_log()' );
2846
-	if ( ! empty( $GLOBALS['debug'] ) )
2847
-		error_log( $string );
2848
-}
2936
+	if ( ! empty( $GLOBALS['debug'] ) ) {
2937
+			error_log( $string );
2938
+	}
2939
+	}
2849 2940
 
2850 2941
 /**
2851 2942
  * Close the debugging file handle.
@@ -2879,18 +2970,20 @@  discard block
 block discarded – undo
2879 2970
 	_deprecated_function( __FUNCTION__, '3.4', 'wp_get_themes()' );
2880 2971
 
2881 2972
 	global $wp_themes;
2882
-	if ( isset( $wp_themes ) )
2883
-		return $wp_themes;
2973
+	if ( isset( $wp_themes ) ) {
2974
+			return $wp_themes;
2975
+	}
2884 2976
 
2885 2977
 	$themes = wp_get_themes();
2886 2978
 	$wp_themes = array();
2887 2979
 
2888 2980
 	foreach ( $themes as $theme ) {
2889 2981
 		$name = $theme->get('Name');
2890
-		if ( isset( $wp_themes[ $name ] ) )
2891
-			$wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
2892
-		else
2893
-			$wp_themes[ $name ] = $theme;
2982
+		if ( isset( $wp_themes[ $name ] ) ) {
2983
+					$wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
2984
+		} else {
2985
+					$wp_themes[ $name ] = $theme;
2986
+		}
2894 2987
 	}
2895 2988
 
2896 2989
 	return $wp_themes;
@@ -2910,8 +3003,9 @@  discard block
 block discarded – undo
2910 3003
 	_deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme( $stylesheet )' );
2911 3004
 
2912 3005
 	$themes = get_themes();
2913
-	if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
2914
-		return $themes[ $theme ];
3006
+	if ( is_array( $themes ) && array_key_exists( $theme, $themes ) ) {
3007
+			return $themes[ $theme ];
3008
+	}
2915 3009
 	return null;
2916 3010
 }
2917 3011
 
@@ -2927,8 +3021,9 @@  discard block
 block discarded – undo
2927 3021
 function get_current_theme() {
2928 3022
 	_deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
2929 3023
 
2930
-	if ( $theme = get_option( 'current_theme' ) )
2931
-		return $theme;
3024
+	if ( $theme = get_option( 'current_theme' ) ) {
3025
+			return $theme;
3026
+	}
2932 3027
 
2933 3028
 	return wp_get_theme()->get('Name');
2934 3029
 }
@@ -2948,10 +3043,11 @@  discard block
 block discarded – undo
2948 3043
 function clean_pre($matches) {
2949 3044
 	_deprecated_function( __FUNCTION__, '3.4' );
2950 3045
 
2951
-	if ( is_array($matches) )
2952
-		$text = $matches[1] . $matches[2] . "</pre>";
2953
-	else
2954
-		$text = $matches;
3046
+	if ( is_array($matches) ) {
3047
+			$text = $matches[1] . $matches[2] . "</pre>";
3048
+	} else {
3049
+			$text = $matches;
3050
+	}
2955 3051
 
2956 3052
 	$text = str_replace(array('<br />', '<br/>', '<br>'), array('', '', ''), $text);
2957 3053
 	$text = str_replace('<p>', "\n", $text);
@@ -2978,8 +3074,9 @@  discard block
 block discarded – undo
2978 3074
 		'wp-head-callback'    => $wp_head_callback,
2979 3075
 		'admin-head-callback' => $admin_head_callback,
2980 3076
 	);
2981
-	if ( $admin_preview_callback )
2982
-		$args['admin-preview-callback'] = $admin_preview_callback;
3077
+	if ( $admin_preview_callback ) {
3078
+			$args['admin-preview-callback'] = $admin_preview_callback;
3079
+	}
2983 3080
 	return add_theme_support( 'custom-header', $args );
2984 3081
 }
2985 3082
 
@@ -3011,12 +3108,15 @@  discard block
 block discarded – undo
3011 3108
 function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {
3012 3109
 	_deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )' );
3013 3110
 	$args = array();
3014
-	if ( $wp_head_callback )
3015
-		$args['wp-head-callback'] = $wp_head_callback;
3016
-	if ( $admin_head_callback )
3017
-		$args['admin-head-callback'] = $admin_head_callback;
3018
-	if ( $admin_preview_callback )
3019
-		$args['admin-preview-callback'] = $admin_preview_callback;
3111
+	if ( $wp_head_callback ) {
3112
+			$args['wp-head-callback'] = $wp_head_callback;
3113
+	}
3114
+	if ( $admin_head_callback ) {
3115
+			$args['admin-head-callback'] = $admin_head_callback;
3116
+	}
3117
+	if ( $admin_preview_callback ) {
3118
+			$args['admin-preview-callback'] = $admin_preview_callback;
3119
+	}
3020 3120
 	return add_theme_support( 'custom-background', $args );
3021 3121
 }
3022 3122
 
@@ -3063,8 +3163,9 @@  discard block
 block discarded – undo
3063 3163
 	);
3064 3164
 
3065 3165
 	foreach ( apply_filters( 'extra_theme_headers', array() ) as $extra_header ) {
3066
-		if ( ! isset( $theme_data[ $extra_header ] ) )
3067
-			$theme_data[ $extra_header ] = $theme->get( $extra_header );
3166
+		if ( ! isset( $theme_data[ $extra_header ] ) ) {
3167
+					$theme_data[ $extra_header ] = $theme->get( $extra_header );
3168
+		}
3068 3169
 	}
3069 3170
 
3070 3171
 	return $theme_data;
@@ -3133,9 +3234,10 @@  discard block
 block discarded – undo
3133 3234
  */
3134 3235
 function sticky_class( $post_id = null ) {
3135 3236
 	_deprecated_function( __FUNCTION__, '3.5', 'post_class()' );
3136
-	if ( is_sticky( $post_id ) )
3137
-		echo ' sticky';
3138
-}
3237
+	if ( is_sticky( $post_id ) ) {
3238
+			echo ' sticky';
3239
+	}
3240
+	}
3139 3241
 
3140 3242
 /**
3141 3243
  * Retrieve post ancestors.
@@ -3166,21 +3268,25 @@  discard block
 block discarded – undo
3166 3268
 function wp_load_image( $file ) {
3167 3269
 	_deprecated_function( __FUNCTION__, '3.5', 'wp_get_image_editor()' );
3168 3270
 
3169
-	if ( is_numeric( $file ) )
3170
-		$file = get_attached_file( $file );
3271
+	if ( is_numeric( $file ) ) {
3272
+			$file = get_attached_file( $file );
3273
+	}
3171 3274
 
3172
-	if ( ! is_file( $file ) )
3173
-		return sprintf(__('File &#8220;%s&#8221; doesn&#8217;t exist?'), $file);
3275
+	if ( ! is_file( $file ) ) {
3276
+			return sprintf(__('File &#8220;%s&#8221; doesn&#8217;t exist?'), $file);
3277
+	}
3174 3278
 
3175
-	if ( ! function_exists('imagecreatefromstring') )
3176
-		return __('The GD image library is not installed.');
3279
+	if ( ! function_exists('imagecreatefromstring') ) {
3280
+			return __('The GD image library is not installed.');
3281
+	}
3177 3282
 
3178 3283
 	// Set artificially high because GD uses uncompressed images in memory
3179 3284
 	@ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
3180 3285
 	$image = imagecreatefromstring( file_get_contents( $file ) );
3181 3286
 
3182
-	if ( !is_resource( $image ) )
3183
-		return sprintf(__('File &#8220;%s&#8221; is not an image.'), $file);
3287
+	if ( !is_resource( $image ) ) {
3288
+			return sprintf(__('File &#8220;%s&#8221; is not an image.'), $file);
3289
+	}
3184 3290
 
3185 3291
 	return $image;
3186 3292
 }
@@ -3213,19 +3319,22 @@  discard block
 block discarded – undo
3213 3319
 	_deprecated_function( __FUNCTION__, '3.5', 'wp_get_image_editor()' );
3214 3320
 
3215 3321
 	$editor = wp_get_image_editor( $file );
3216
-	if ( is_wp_error( $editor ) )
3217
-		return $editor;
3322
+	if ( is_wp_error( $editor ) ) {
3323
+			return $editor;
3324
+	}
3218 3325
 	$editor->set_quality( $jpeg_quality );
3219 3326
 
3220 3327
 	$resized = $editor->resize( $max_w, $max_h, $crop );
3221
-	if ( is_wp_error( $resized ) )
3222
-		return $resized;
3328
+	if ( is_wp_error( $resized ) ) {
3329
+			return $resized;
3330
+	}
3223 3331
 
3224 3332
 	$dest_file = $editor->generate_filename( $suffix, $dest_path );
3225 3333
 	$saved = $editor->save( $dest_file );
3226 3334
 
3227
-	if ( is_wp_error( $saved ) )
3228
-		return $saved;
3335
+	if ( is_wp_error( $saved ) ) {
3336
+			return $saved;
3337
+	}
3229 3338
 
3230 3339
 	return $dest_file;
3231 3340
 }
@@ -3263,8 +3372,9 @@  discard block
 block discarded – undo
3263 3372
 function user_pass_ok($user_login, $user_pass) {
3264 3373
 	_deprecated_function( __FUNCTION__, '3.5', 'wp_authenticate()' );
3265 3374
 	$user = wp_authenticate( $user_login, $user_pass );
3266
-	if ( is_wp_error( $user ) )
3267
-		return false;
3375
+	if ( is_wp_error( $user ) ) {
3376
+			return false;
3377
+	}
3268 3378
 
3269 3379
 	return true;
3270 3380
 }
@@ -3370,8 +3480,9 @@  discard block
 block discarded – undo
3370 3480
 	global $wp_rich_edit_exists;
3371 3481
 	_deprecated_function( __FUNCTION__, '3.9' );
3372 3482
 
3373
-	if ( ! isset( $wp_rich_edit_exists ) )
3374
-		$wp_rich_edit_exists = file_exists( ABSPATH . WPINC . '/js/tinymce/tinymce.js' );
3483
+	if ( ! isset( $wp_rich_edit_exists ) ) {
3484
+			$wp_rich_edit_exists = file_exists( ABSPATH . WPINC . '/js/tinymce/tinymce.js' );
3485
+	}
3375 3486
 
3376 3487
 	return $wp_rich_edit_exists;
3377 3488
 }
@@ -3579,8 +3690,10 @@  discard block
 block discarded – undo
3579 3690
 function wp_htmledit_pre($output) {
3580 3691
 	_deprecated_function( __FUNCTION__, '4.3', 'format_for_editor()' );
3581 3692
 
3582
-	if ( !empty($output) )
3583
-		$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
3693
+	if ( !empty($output) ) {
3694
+			$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
3695
+	}
3696
+	// convert only < > &
3584 3697
 
3585 3698
 	/**
3586 3699
 	 * Filter the text before it is formatted for the HTML editor.
@@ -3630,21 +3743,24 @@  discard block
 block discarded – undo
3630 3743
 
3631 3744
 	@set_time_limit( 60 );
3632 3745
 
3633
-	if ( $red > 5 )
3634
-		return false;
3746
+	if ( $red > 5 ) {
3747
+			return false;
3748
+	}
3635 3749
 
3636 3750
 	$options = array();
3637 3751
 	$options['redirection'] = 5;
3638 3752
 
3639
-	if ( false == $file_path )
3640
-		$options['method'] = 'HEAD';
3641
-	else
3642
-		$options['method'] = 'GET';
3753
+	if ( false == $file_path ) {
3754
+			$options['method'] = 'HEAD';
3755
+	} else {
3756
+			$options['method'] = 'GET';
3757
+	}
3643 3758
 
3644 3759
 	$response = wp_safe_remote_request( $url, $options );
3645 3760
 
3646
-	if ( is_wp_error( $response ) )
3647
-		return false;
3761
+	if ( is_wp_error( $response ) ) {
3762
+			return false;
3763
+	}
3648 3764
 
3649 3765
 	$headers = wp_remote_retrieve_headers( $response );
3650 3766
 	$headers['response'] = wp_remote_retrieve_response_code( $response );
@@ -3654,13 +3770,15 @@  discard block
 block discarded – undo
3654 3770
 		return wp_get_http( $headers['location'], $file_path, ++$red );
3655 3771
 	}
3656 3772
 
3657
-	if ( false == $file_path )
3658
-		return $headers;
3773
+	if ( false == $file_path ) {
3774
+			return $headers;
3775
+	}
3659 3776
 
3660 3777
 	// GET request - write it to the supplied filename
3661 3778
 	$out_fp = fopen($file_path, 'w');
3662
-	if ( !$out_fp )
3663
-		return $headers;
3779
+	if ( !$out_fp ) {
3780
+			return $headers;
3781
+	}
3664 3782
 
3665 3783
 	fwrite( $out_fp,  wp_remote_retrieve_body( $response ) );
3666 3784
 	fclose($out_fp);
Please login to merge, or discard this patch.
src/wp-includes/class-wp-customize-manager.php 4 patches
Braces   +31 added lines, -21 removed lines patch added patch discarded remove patch
@@ -441,8 +441,9 @@  discard block
 block discarded – undo
441 441
 		 */
442 442
 		do_action( 'customize_register', $this );
443 443
 
444
-		if ( $this->is_preview() && ! is_admin() )
445
-			$this->customize_preview_init();
444
+		if ( $this->is_preview() && ! is_admin() ) {
445
+					$this->customize_preview_init();
446
+		}
446 447
 	}
447 448
 
448 449
 	/**
@@ -457,8 +458,9 @@  discard block
 block discarded – undo
457 458
 	 * @return int
458 459
 	 */
459 460
 	public function wp_redirect_status( $status ) {
460
-		if ( $this->is_preview() && ! is_admin() )
461
-			return 200;
461
+		if ( $this->is_preview() && ! is_admin() ) {
462
+					return 200;
463
+		}
462 464
 
463 465
 		return $status;
464 466
 	}
@@ -1056,8 +1058,9 @@  discard block
 block discarded – undo
1056 1058
 	 * @return WP_Customize_Section|void The section, if set.
1057 1059
 	 */
1058 1060
 	public function get_section( $id ) {
1059
-		if ( isset( $this->sections[ $id ] ) )
1060
-			return $this->sections[ $id ];
1061
+		if ( isset( $this->sections[ $id ] ) ) {
1062
+					return $this->sections[ $id ];
1063
+		}
1061 1064
 	}
1062 1065
 
1063 1066
 	/**
@@ -1127,8 +1130,9 @@  discard block
 block discarded – undo
1127 1130
 	 * @return WP_Customize_Control|void The control object, if set.
1128 1131
 	 */
1129 1132
 	public function get_control( $id ) {
1130
-		if ( isset( $this->controls[ $id ] ) )
1131
-			return $this->controls[ $id ];
1133
+		if ( isset( $this->controls[ $id ] ) ) {
1134
+					return $this->controls[ $id ];
1135
+		}
1132 1136
 	}
1133 1137
 
1134 1138
 	/**
@@ -1592,12 +1596,14 @@  discard block
 block discarded – undo
1592 1596
 	 * @return mixed
1593 1597
 	 */
1594 1598
 	public function _sanitize_header_textcolor( $color ) {
1595
-		if ( 'blank' === $color )
1596
-			return 'blank';
1599
+		if ( 'blank' === $color ) {
1600
+					return 'blank';
1601
+		}
1597 1602
 
1598 1603
 		$color = sanitize_hex_color_no_hash( $color );
1599
-		if ( empty( $color ) )
1600
-			$color = get_theme_support( 'custom-header', 'default-text-color' );
1604
+		if ( empty( $color ) ) {
1605
+					$color = get_theme_support( 'custom-header', 'default-text-color' );
1606
+		}
1601 1607
 
1602 1608
 		return $color;
1603 1609
 	}
@@ -1615,13 +1621,15 @@  discard block
 block discarded – undo
1615 1621
  * @return string|void
1616 1622
  */
1617 1623
 function sanitize_hex_color( $color ) {
1618
-	if ( '' === $color )
1619
-		return '';
1624
+	if ( '' === $color ) {
1625
+			return '';
1626
+	}
1620 1627
 
1621 1628
 	// 3 or 6 hex digits, or the empty string.
1622
-	if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) )
1623
-		return $color;
1624
-}
1629
+	if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) {
1630
+			return $color;
1631
+	}
1632
+	}
1625 1633
 
1626 1634
 /**
1627 1635
  * Sanitizes a hex color without a hash. Use sanitize_hex_color() when possible.
@@ -1640,8 +1648,9 @@  discard block
 block discarded – undo
1640 1648
 function sanitize_hex_color_no_hash( $color ) {
1641 1649
 	$color = ltrim( $color, '#' );
1642 1650
 
1643
-	if ( '' === $color )
1644
-		return '';
1651
+	if ( '' === $color ) {
1652
+			return '';
1653
+	}
1645 1654
 
1646 1655
 	return sanitize_hex_color( '#' . $color ) ? $color : null;
1647 1656
 }
@@ -1658,8 +1667,9 @@  discard block
 block discarded – undo
1658 1667
  * @return string
1659 1668
  */
1660 1669
 function maybe_hash_hex_color( $color ) {
1661
-	if ( $unhashed = sanitize_hex_color_no_hash( $color ) )
1662
-		return '#' . $unhashed;
1670
+	if ( $unhashed = sanitize_hex_color_no_hash( $color ) ) {
1671
+			return '#' . $unhashed;
1672
+	}
1663 1673
 
1664 1674
 	return $color;
1665 1675
 }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -339,8 +339,8 @@
 block discarded – undo
339 339
 	 *
340 340
 	 * @since 3.4.0
341 341
 	 *
342
-	 * @param mixed $ajax_message AJAX return
343
-	 * @param mixed $message UI message
342
+	 * @param integer $ajax_message AJAX return
343
+	 * @param string $message UI message
344 344
 	 */
345 345
 	protected function wp_die( $ajax_message, $message = null ) {
346 346
 		if ( $this->doing_ajax() || isset( $_POST['customized'] ) ) {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * WordPress Customize Manager classes
4
- *
5
- * @package WordPress
6
- * @subpackage Customize
7
- * @since 3.4.0
8
- */
3
+	 * WordPress Customize Manager classes
4
+	 *
5
+	 * @package WordPress
6
+	 * @subpackage Customize
7
+	 * @since 3.4.0
8
+	 */
9 9
 
10 10
 /**
11 11
  * Customize Manager class.
Please login to merge, or discard this patch.
Spacing   +503 added lines, -503 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * @access protected
110 110
 	 * @var array
111 111
 	 */
112
-	protected $components = array( 'widgets', 'nav_menus', 'selective_refresh' );
112
+	protected $components = array('widgets', 'nav_menus', 'selective_refresh');
113 113
 
114 114
 	/**
115 115
 	 * Registered instances of WP_Customize_Section.
@@ -205,41 +205,41 @@  discard block
 block discarded – undo
205 205
 	 * @since 3.4.0
206 206
 	 */
207 207
 	public function __construct() {
208
-		require_once( ABSPATH . WPINC . '/class-wp-customize-setting.php' );
209
-		require_once( ABSPATH . WPINC . '/class-wp-customize-panel.php' );
210
-		require_once( ABSPATH . WPINC . '/class-wp-customize-section.php' );
211
-		require_once( ABSPATH . WPINC . '/class-wp-customize-control.php' );
212
-
213
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php' );
214
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php' );
215
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php' );
216
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php' );
217
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php' );
218
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' );
219
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' );
220
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' );
221
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' );
222
-		require_once( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' );
223
-		require_once( ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php' );
224
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php' );
225
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php' );
226
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php' );
227
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php' );
228
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php' );
229
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-control.php' );
230
-
231
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php' );
232
-
233
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php' );
234
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php' );
235
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php' );
236
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-section.php' );
237
-
238
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php' );
239
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php' );
240
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php' );
241
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php' );
242
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php' );
208
+		require_once(ABSPATH.WPINC.'/class-wp-customize-setting.php');
209
+		require_once(ABSPATH.WPINC.'/class-wp-customize-panel.php');
210
+		require_once(ABSPATH.WPINC.'/class-wp-customize-section.php');
211
+		require_once(ABSPATH.WPINC.'/class-wp-customize-control.php');
212
+
213
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-color-control.php');
214
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-media-control.php');
215
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-upload-control.php');
216
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-image-control.php');
217
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-background-image-control.php');
218
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-cropped-image-control.php');
219
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-site-icon-control.php');
220
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-header-image-control.php');
221
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-theme-control.php');
222
+		require_once(ABSPATH.WPINC.'/customize/class-wp-widget-area-customize-control.php');
223
+		require_once(ABSPATH.WPINC.'/customize/class-wp-widget-form-customize-control.php');
224
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-nav-menu-control.php');
225
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-nav-menu-item-control.php');
226
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-nav-menu-location-control.php');
227
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-nav-menu-name-control.php');
228
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-nav-menu-auto-add-control.php');
229
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-new-menu-control.php');
230
+
231
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-nav-menus-panel.php');
232
+
233
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-themes-section.php');
234
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-sidebar-section.php');
235
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-nav-menu-section.php');
236
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-new-menu-section.php');
237
+
238
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-filter-setting.php');
239
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-header-image-setting.php');
240
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-background-image-setting.php');
241
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-nav-menu-item-setting.php');
242
+		require_once(ABSPATH.WPINC.'/customize/class-wp-customize-nav-menu-setting.php');
243 243
 
244 244
 		/**
245 245
 		 * Filter the core Customizer components to load.
@@ -256,54 +256,54 @@  discard block
 block discarded – undo
256 256
 		 * @param array                $components List of core components to load.
257 257
 		 * @param WP_Customize_Manager $this       WP_Customize_Manager instance.
258 258
 		 */
259
-		$components = apply_filters( 'customize_loaded_components', $this->components, $this );
259
+		$components = apply_filters('customize_loaded_components', $this->components, $this);
260 260
 
261
-		if ( in_array( 'widgets', $components, true ) ) {
262
-			require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' );
263
-			$this->widgets = new WP_Customize_Widgets( $this );
261
+		if (in_array('widgets', $components, true)) {
262
+			require_once(ABSPATH.WPINC.'/class-wp-customize-widgets.php');
263
+			$this->widgets = new WP_Customize_Widgets($this);
264 264
 		}
265 265
 
266
-		if ( in_array( 'nav_menus', $components, true ) ) {
267
-			require_once( ABSPATH . WPINC . '/class-wp-customize-nav-menus.php' );
268
-			$this->nav_menus = new WP_Customize_Nav_Menus( $this );
266
+		if (in_array('nav_menus', $components, true)) {
267
+			require_once(ABSPATH.WPINC.'/class-wp-customize-nav-menus.php');
268
+			$this->nav_menus = new WP_Customize_Nav_Menus($this);
269 269
 		}
270 270
 
271
-		if ( in_array( 'selective_refresh', $components, true ) ) {
272
-			require_once( ABSPATH . WPINC . '/customize/class-wp-customize-selective-refresh.php' );
273
-			$this->selective_refresh = new WP_Customize_Selective_Refresh( $this );
271
+		if (in_array('selective_refresh', $components, true)) {
272
+			require_once(ABSPATH.WPINC.'/customize/class-wp-customize-selective-refresh.php');
273
+			$this->selective_refresh = new WP_Customize_Selective_Refresh($this);
274 274
 		}
275 275
 
276
-		add_filter( 'wp_die_handler', array( $this, 'wp_die_handler' ) );
276
+		add_filter('wp_die_handler', array($this, 'wp_die_handler'));
277 277
 
278
-		add_action( 'setup_theme', array( $this, 'setup_theme' ) );
279
-		add_action( 'wp_loaded',   array( $this, 'wp_loaded' ) );
278
+		add_action('setup_theme', array($this, 'setup_theme'));
279
+		add_action('wp_loaded', array($this, 'wp_loaded'));
280 280
 
281 281
 		// Run wp_redirect_status late to make sure we override the status last.
282
-		add_action( 'wp_redirect_status', array( $this, 'wp_redirect_status' ), 1000 );
282
+		add_action('wp_redirect_status', array($this, 'wp_redirect_status'), 1000);
283 283
 
284 284
 		// Do not spawn cron (especially the alternate cron) while running the Customizer.
285
-		remove_action( 'init', 'wp_cron' );
285
+		remove_action('init', 'wp_cron');
286 286
 
287 287
 		// Do not run update checks when rendering the controls.
288
-		remove_action( 'admin_init', '_maybe_update_core' );
289
-		remove_action( 'admin_init', '_maybe_update_plugins' );
290
-		remove_action( 'admin_init', '_maybe_update_themes' );
288
+		remove_action('admin_init', '_maybe_update_core');
289
+		remove_action('admin_init', '_maybe_update_plugins');
290
+		remove_action('admin_init', '_maybe_update_themes');
291 291
 
292
-		add_action( 'wp_ajax_customize_save',           array( $this, 'save' ) );
293
-		add_action( 'wp_ajax_customize_refresh_nonces', array( $this, 'refresh_nonces' ) );
292
+		add_action('wp_ajax_customize_save', array($this, 'save'));
293
+		add_action('wp_ajax_customize_refresh_nonces', array($this, 'refresh_nonces'));
294 294
 
295
-		add_action( 'customize_register',                 array( $this, 'register_controls' ) );
296
-		add_action( 'customize_register',                 array( $this, 'register_dynamic_settings' ), 11 ); // allow code to create settings first
297
-		add_action( 'customize_controls_init',            array( $this, 'prepare_controls' ) );
298
-		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ) );
295
+		add_action('customize_register', array($this, 'register_controls'));
296
+		add_action('customize_register', array($this, 'register_dynamic_settings'), 11); // allow code to create settings first
297
+		add_action('customize_controls_init', array($this, 'prepare_controls'));
298
+		add_action('customize_controls_enqueue_scripts', array($this, 'enqueue_control_scripts'));
299 299
 
300 300
 		// Render Panel, Section, and Control templates.
301
-		add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_panel_templates' ), 1 );
302
-		add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_section_templates' ), 1 );
303
-		add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_control_templates' ), 1 );
301
+		add_action('customize_controls_print_footer_scripts', array($this, 'render_panel_templates'), 1);
302
+		add_action('customize_controls_print_footer_scripts', array($this, 'render_section_templates'), 1);
303
+		add_action('customize_controls_print_footer_scripts', array($this, 'render_control_templates'), 1);
304 304
 
305 305
 		// Export the settings to JS via the _wpCustomizeSettings variable.
306
-		add_action( 'customize_controls_print_footer_scripts', array( $this, 'customize_pane_settings' ), 1000 );
306
+		add_action('customize_controls_print_footer_scripts', array($this, 'customize_pane_settings'), 1000);
307 307
 	}
308 308
 
309 309
 	/**
@@ -316,20 +316,20 @@  discard block
 block discarded – undo
316 316
 	 * @param string|null $action Whether the supplied AJAX action is being run.
317 317
 	 * @return bool True if it's an AJAX request, false otherwise.
318 318
 	 */
319
-	public function doing_ajax( $action = null ) {
320
-		$doing_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX );
321
-		if ( ! $doing_ajax ) {
319
+	public function doing_ajax($action = null) {
320
+		$doing_ajax = (defined('DOING_AJAX') && DOING_AJAX);
321
+		if ( ! $doing_ajax) {
322 322
 			return false;
323 323
 		}
324 324
 
325
-		if ( ! $action ) {
325
+		if ( ! $action) {
326 326
 			return true;
327 327
 		} else {
328 328
 			/*
329 329
 			 * Note: we can't just use doing_action( "wp_ajax_{$action}" ) because we need
330 330
 			 * to check before admin-ajax.php gets to that point.
331 331
 			 */
332
-			return isset( $_REQUEST['action'] ) && wp_unslash( $_REQUEST['action'] ) === $action;
332
+			return isset($_REQUEST['action']) && wp_unslash($_REQUEST['action']) === $action;
333 333
 		}
334 334
 	}
335 335
 
@@ -342,16 +342,16 @@  discard block
 block discarded – undo
342 342
 	 * @param mixed $ajax_message AJAX return
343 343
 	 * @param mixed $message UI message
344 344
 	 */
345
-	protected function wp_die( $ajax_message, $message = null ) {
346
-		if ( $this->doing_ajax() || isset( $_POST['customized'] ) ) {
347
-			wp_die( $ajax_message );
345
+	protected function wp_die($ajax_message, $message = null) {
346
+		if ($this->doing_ajax() || isset($_POST['customized'])) {
347
+			wp_die($ajax_message);
348 348
 		}
349 349
 
350
-		if ( ! $message ) {
351
-			$message = __( 'Cheatin&#8217; uh?' );
350
+		if ( ! $message) {
351
+			$message = __('Cheatin&#8217; uh?');
352 352
 		}
353 353
 
354
-		wp_die( $message );
354
+		wp_die($message);
355 355
 	}
356 356
 
357 357
 	/**
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 	 * @return string
363 363
 	 */
364 364
 	public function wp_die_handler() {
365
-		if ( $this->doing_ajax() || isset( $_POST['customized'] ) ) {
365
+		if ($this->doing_ajax() || isset($_POST['customized'])) {
366 366
 			return '_ajax_wp_die_handler';
367 367
 		}
368 368
 
@@ -379,41 +379,41 @@  discard block
 block discarded – undo
379 379
 	public function setup_theme() {
380 380
 		send_origin_headers();
381 381
 
382
-		$doing_ajax_or_is_customized = ( $this->doing_ajax() || isset( $_POST['customized'] ) );
383
-		if ( is_admin() && ! $doing_ajax_or_is_customized ) {
382
+		$doing_ajax_or_is_customized = ($this->doing_ajax() || isset($_POST['customized']));
383
+		if (is_admin() && ! $doing_ajax_or_is_customized) {
384 384
 			auth_redirect();
385
-		} elseif ( $doing_ajax_or_is_customized && ! is_user_logged_in() ) {
386
-			$this->wp_die( 0, __( 'You must be logged in to complete this action.' ) );
385
+		} elseif ($doing_ajax_or_is_customized && ! is_user_logged_in()) {
386
+			$this->wp_die(0, __('You must be logged in to complete this action.'));
387 387
 		}
388 388
 
389
-		show_admin_bar( false );
389
+		show_admin_bar(false);
390 390
 
391
-		if ( ! current_user_can( 'customize' ) ) {
392
-			$this->wp_die( -1, __( 'You are not allowed to customize the appearance of this site.' ) );
391
+		if ( ! current_user_can('customize')) {
392
+			$this->wp_die( -1, __('You are not allowed to customize the appearance of this site.') );
393 393
 		}
394 394
 
395 395
 		$this->original_stylesheet = get_stylesheet();
396 396
 
397
-		$this->theme = wp_get_theme( isset( $_REQUEST['theme'] ) ? $_REQUEST['theme'] : null );
397
+		$this->theme = wp_get_theme(isset($_REQUEST['theme']) ? $_REQUEST['theme'] : null);
398 398
 
399
-		if ( $this->is_theme_active() ) {
399
+		if ($this->is_theme_active()) {
400 400
 			// Once the theme is loaded, we'll validate it.
401
-			add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
401
+			add_action('after_setup_theme', array($this, 'after_setup_theme'));
402 402
 		} else {
403 403
 			// If the requested theme is not the active theme and the user doesn't have the
404 404
 			// switch_themes cap, bail.
405
-			if ( ! current_user_can( 'switch_themes' ) ) {
406
-				$this->wp_die( -1, __( 'You are not allowed to edit theme options on this site.' ) );
405
+			if ( ! current_user_can('switch_themes')) {
406
+				$this->wp_die( -1, __('You are not allowed to edit theme options on this site.') );
407 407
 			}
408 408
 
409 409
 			// If the theme has errors while loading, bail.
410
-			if ( $this->theme()->errors() ) {
410
+			if ($this->theme()->errors()) {
411 411
 				$this->wp_die( -1, $this->theme()->errors()->get_error_message() );
412 412
 			}
413 413
 
414 414
 			// If the theme isn't allowed per multisite settings, bail.
415
-			if ( ! $this->theme()->is_allowed() ) {
416
-				$this->wp_die( -1, __( 'The requested theme does not exist.' ) );
415
+			if ( ! $this->theme()->is_allowed()) {
416
+				$this->wp_die( -1, __('The requested theme does not exist.') );
417 417
 			}
418 418
 		}
419 419
 
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
 	 * @since 3.4.0
427 427
 	 */
428 428
 	public function after_setup_theme() {
429
-		$doing_ajax_or_is_customized = ( $this->doing_ajax() || isset( $_SERVER['customized'] ) );
430
-		if ( ! $doing_ajax_or_is_customized && ! validate_current_theme() ) {
431
-			wp_redirect( 'themes.php?broken=true' );
429
+		$doing_ajax_or_is_customized = ($this->doing_ajax() || isset($_SERVER['customized']));
430
+		if ( ! $doing_ajax_or_is_customized && ! validate_current_theme()) {
431
+			wp_redirect('themes.php?broken=true');
432 432
 			exit;
433 433
 		}
434 434
 	}
@@ -441,24 +441,24 @@  discard block
 block discarded – undo
441 441
 	 */
442 442
 	public function start_previewing_theme() {
443 443
 		// Bail if we're already previewing.
444
-		if ( $this->is_preview() ) {
444
+		if ($this->is_preview()) {
445 445
 			return;
446 446
 		}
447 447
 
448 448
 		$this->previewing = true;
449 449
 
450
-		if ( ! $this->is_theme_active() ) {
451
-			add_filter( 'template', array( $this, 'get_template' ) );
452
-			add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
453
-			add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
450
+		if ( ! $this->is_theme_active()) {
451
+			add_filter('template', array($this, 'get_template'));
452
+			add_filter('stylesheet', array($this, 'get_stylesheet'));
453
+			add_filter('pre_option_current_theme', array($this, 'current_theme'));
454 454
 
455 455
 			// @link: https://core.trac.wordpress.org/ticket/20027
456
-			add_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
457
-			add_filter( 'pre_option_template', array( $this, 'get_template' ) );
456
+			add_filter('pre_option_stylesheet', array($this, 'get_stylesheet'));
457
+			add_filter('pre_option_template', array($this, 'get_template'));
458 458
 
459 459
 			// Handle custom theme roots.
460
-			add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
461
-			add_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
460
+			add_filter('pre_option_stylesheet_root', array($this, 'get_stylesheet_root'));
461
+			add_filter('pre_option_template_root', array($this, 'get_template_root'));
462 462
 		}
463 463
 
464 464
 		/**
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 		 *
469 469
 		 * @param WP_Customize_Manager $this WP_Customize_Manager instance.
470 470
 		 */
471
-		do_action( 'start_previewing_theme', $this );
471
+		do_action('start_previewing_theme', $this);
472 472
 	}
473 473
 
474 474
 	/**
@@ -479,24 +479,24 @@  discard block
 block discarded – undo
479 479
 	 * @since 3.4.0
480 480
 	 */
481 481
 	public function stop_previewing_theme() {
482
-		if ( ! $this->is_preview() ) {
482
+		if ( ! $this->is_preview()) {
483 483
 			return;
484 484
 		}
485 485
 
486 486
 		$this->previewing = false;
487 487
 
488
-		if ( ! $this->is_theme_active() ) {
489
-			remove_filter( 'template', array( $this, 'get_template' ) );
490
-			remove_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
491
-			remove_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
488
+		if ( ! $this->is_theme_active()) {
489
+			remove_filter('template', array($this, 'get_template'));
490
+			remove_filter('stylesheet', array($this, 'get_stylesheet'));
491
+			remove_filter('pre_option_current_theme', array($this, 'current_theme'));
492 492
 
493 493
 			// @link: https://core.trac.wordpress.org/ticket/20027
494
-			remove_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
495
-			remove_filter( 'pre_option_template', array( $this, 'get_template' ) );
494
+			remove_filter('pre_option_stylesheet', array($this, 'get_stylesheet'));
495
+			remove_filter('pre_option_template', array($this, 'get_template'));
496 496
 
497 497
 			// Handle custom theme roots.
498
-			remove_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
499
-			remove_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
498
+			remove_filter('pre_option_stylesheet_root', array($this, 'get_stylesheet_root'));
499
+			remove_filter('pre_option_template_root', array($this, 'get_template_root'));
500 500
 		}
501 501
 
502 502
 		/**
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 		 *
507 507
 		 * @param WP_Customize_Manager $this WP_Customize_Manager instance.
508 508
 		 */
509
-		do_action( 'stop_previewing_theme', $this );
509
+		do_action('stop_previewing_theme', $this);
510 510
 	}
511 511
 
512 512
 	/**
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 	 * @return WP_Theme
518 518
 	 */
519 519
 	public function theme() {
520
-		if ( ! $this->theme ) {
520
+		if ( ! $this->theme) {
521 521
 			$this->theme = wp_get_theme();
522 522
 		}
523 523
 		return $this->theme;
@@ -604,9 +604,9 @@  discard block
 block discarded – undo
604 604
 		 *
605 605
 		 * @param WP_Customize_Manager $this WP_Customize_Manager instance.
606 606
 		 */
607
-		do_action( 'customize_register', $this );
607
+		do_action('customize_register', $this);
608 608
 
609
-		if ( $this->is_preview() && ! is_admin() )
609
+		if ($this->is_preview() && ! is_admin())
610 610
 			$this->customize_preview_init();
611 611
 	}
612 612
 
@@ -621,8 +621,8 @@  discard block
 block discarded – undo
621 621
 	 * @param $status
622 622
 	 * @return int
623 623
 	 */
624
-	public function wp_redirect_status( $status ) {
625
-		if ( $this->is_preview() && ! is_admin() )
624
+	public function wp_redirect_status($status) {
625
+		if ($this->is_preview() && ! is_admin())
626 626
 			return 200;
627 627
 
628 628
 		return $status;
@@ -637,15 +637,15 @@  discard block
 block discarded – undo
637 637
 	 * @return array
638 638
 	 */
639 639
 	public function unsanitized_post_values() {
640
-		if ( ! isset( $this->_post_values ) ) {
641
-			if ( isset( $_POST['customized'] ) ) {
642
-				$this->_post_values = json_decode( wp_unslash( $_POST['customized'] ), true );
640
+		if ( ! isset($this->_post_values)) {
641
+			if (isset($_POST['customized'])) {
642
+				$this->_post_values = json_decode(wp_unslash($_POST['customized']), true);
643 643
 			}
644
-			if ( empty( $this->_post_values ) ) { // if not isset or if JSON error
644
+			if (empty($this->_post_values)) { // if not isset or if JSON error
645 645
 				$this->_post_values = array();
646 646
 			}
647 647
 		}
648
-		if ( empty( $this->_post_values ) ) {
648
+		if (empty($this->_post_values)) {
649 649
 			return array();
650 650
 		} else {
651 651
 			return $this->_post_values;
@@ -662,10 +662,10 @@  discard block
 block discarded – undo
662 662
 	 * @param mixed $default value returned $setting has no post value (added in 4.2.0).
663 663
 	 * @return string|mixed $post_value Sanitized value or the $default provided
664 664
 	 */
665
-	public function post_value( $setting, $default = null ) {
665
+	public function post_value($setting, $default = null) {
666 666
 		$post_values = $this->unsanitized_post_values();
667
-		if ( array_key_exists( $setting->id, $post_values ) ) {
668
-			return $setting->sanitize( $post_values[ $setting->id ] );
667
+		if (array_key_exists($setting->id, $post_values)) {
668
+			return $setting->sanitize($post_values[$setting->id]);
669 669
 		} else {
670 670
 			return $default;
671 671
 		}
@@ -680,9 +680,9 @@  discard block
 block discarded – undo
680 680
 	 * @param string $setting_id ID for the WP_Customize_Setting instance.
681 681
 	 * @param mixed  $value      Post value.
682 682
 	 */
683
-	public function set_post_value( $setting_id, $value ) {
683
+	public function set_post_value($setting_id, $value) {
684 684
 		$this->unsanitized_post_values();
685
-		$this->_post_values[ $setting_id ] = $value;
685
+		$this->_post_values[$setting_id] = $value;
686 686
 
687 687
 		/**
688 688
 		 * Announce when a specific setting's unsanitized post value has been set.
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 		 * @param mixed                $value Unsanitized setting post value.
697 697
 		 * @param WP_Customize_Manager $this  WP_Customize_Manager instance.
698 698
 		 */
699
-		do_action( "customize_post_value_set_{$setting_id}", $value, $this );
699
+		do_action("customize_post_value_set_{$setting_id}", $value, $this);
700 700
 
701 701
 		/**
702 702
 		 * Announce when any setting's unsanitized post value has been set.
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 		 * @param mixed                $value      Unsanitized setting post value.
713 713
 		 * @param WP_Customize_Manager $this       WP_Customize_Manager instance.
714 714
 		 */
715
-		do_action( 'customize_post_value_set', $setting_id, $value, $this );
715
+		do_action('customize_post_value_set', $setting_id, $value, $this);
716 716
 	}
717 717
 
718 718
 	/**
@@ -721,20 +721,20 @@  discard block
 block discarded – undo
721 721
 	 * @since 3.4.0
722 722
 	 */
723 723
 	public function customize_preview_init() {
724
-		$this->nonce_tick = check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce' );
724
+		$this->nonce_tick = check_ajax_referer('preview-customize_'.$this->get_stylesheet(), 'nonce');
725 725
 
726 726
 		$this->prepare_controls();
727 727
 
728
-		wp_enqueue_script( 'customize-preview' );
729
-		add_action( 'wp', array( $this, 'customize_preview_override_404_status' ) );
730
-		add_action( 'wp_head', array( $this, 'customize_preview_base' ) );
731
-		add_action( 'wp_head', array( $this, 'customize_preview_html5' ) );
732
-		add_action( 'wp_head', array( $this, 'customize_preview_loading_style' ) );
733
-		add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
734
-		add_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 );
735
-		add_filter( 'wp_die_handler', array( $this, 'remove_preview_signature' ) );
728
+		wp_enqueue_script('customize-preview');
729
+		add_action('wp', array($this, 'customize_preview_override_404_status'));
730
+		add_action('wp_head', array($this, 'customize_preview_base'));
731
+		add_action('wp_head', array($this, 'customize_preview_html5'));
732
+		add_action('wp_head', array($this, 'customize_preview_loading_style'));
733
+		add_action('wp_footer', array($this, 'customize_preview_settings'), 20);
734
+		add_action('shutdown', array($this, 'customize_preview_signature'), 1000);
735
+		add_filter('wp_die_handler', array($this, 'remove_preview_signature'));
736 736
 
737
-		foreach ( $this->settings as $setting ) {
737
+		foreach ($this->settings as $setting) {
738 738
 			$setting->preview();
739 739
 		}
740 740
 
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 		 *
747 747
 		 * @param WP_Customize_Manager $this WP_Customize_Manager instance.
748 748
 		 */
749
-		do_action( 'customize_preview_init', $this );
749
+		do_action('customize_preview_init', $this);
750 750
 	}
751 751
 
752 752
 	/**
@@ -757,8 +757,8 @@  discard block
 block discarded – undo
757 757
 	 * @access public
758 758
 	 */
759 759
 	public function customize_preview_override_404_status() {
760
-		if ( is_404() ) {
761
-			status_header( 200 );
760
+		if (is_404()) {
761
+			status_header(200);
762 762
 		}
763 763
 	}
764 764
 
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 	 * @since 3.4.0
769 769
 	 */
770 770
 	public function customize_preview_base() {
771
-		?><base href="<?php echo home_url( '/' ); ?>" /><?php
771
+		?><base href="<?php echo home_url('/'); ?>" /><?php
772 772
 	}
773 773
 
774 774
 	/**
@@ -821,43 +821,43 @@  discard block
 block discarded – undo
821 821
 				'active'     => $this->is_theme_active(),
822 822
 			),
823 823
 			'url' => array(
824
-				'self' => empty( $_SERVER['REQUEST_URI'] ) ? home_url( '/' ) : esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
824
+				'self' => empty($_SERVER['REQUEST_URI']) ? home_url('/') : esc_url_raw(wp_unslash($_SERVER['REQUEST_URI'])),
825 825
 			),
826
-			'channel' => wp_unslash( $_POST['customize_messenger_channel'] ),
826
+			'channel' => wp_unslash($_POST['customize_messenger_channel']),
827 827
 			'activePanels' => array(),
828 828
 			'activeSections' => array(),
829 829
 			'activeControls' => array(),
830 830
 			'nonce' => $this->get_nonces(),
831 831
 			'l10n' => array(
832
-				'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
832
+				'shiftClickToEdit' => __('Shift-click to edit this element.'),
833 833
 			),
834
-			'_dirty' => array_keys( $this->unsanitized_post_values() ),
834
+			'_dirty' => array_keys($this->unsanitized_post_values()),
835 835
 		);
836 836
 
837
-		foreach ( $this->panels as $panel_id => $panel ) {
838
-			if ( $panel->check_capabilities() ) {
839
-				$settings['activePanels'][ $panel_id ] = $panel->active();
840
-				foreach ( $panel->sections as $section_id => $section ) {
841
-					if ( $section->check_capabilities() ) {
842
-						$settings['activeSections'][ $section_id ] = $section->active();
837
+		foreach ($this->panels as $panel_id => $panel) {
838
+			if ($panel->check_capabilities()) {
839
+				$settings['activePanels'][$panel_id] = $panel->active();
840
+				foreach ($panel->sections as $section_id => $section) {
841
+					if ($section->check_capabilities()) {
842
+						$settings['activeSections'][$section_id] = $section->active();
843 843
 					}
844 844
 				}
845 845
 			}
846 846
 		}
847
-		foreach ( $this->sections as $id => $section ) {
848
-			if ( $section->check_capabilities() ) {
849
-				$settings['activeSections'][ $id ] = $section->active();
847
+		foreach ($this->sections as $id => $section) {
848
+			if ($section->check_capabilities()) {
849
+				$settings['activeSections'][$id] = $section->active();
850 850
 			}
851 851
 		}
852
-		foreach ( $this->controls as $id => $control ) {
853
-			if ( $control->check_capabilities() ) {
854
-				$settings['activeControls'][ $id ] = $control->active();
852
+		foreach ($this->controls as $id => $control) {
853
+			if ($control->check_capabilities()) {
854
+				$settings['activeControls'][$id] = $control->active();
855 855
 			}
856 856
 		}
857 857
 
858 858
 		?>
859 859
 		<script type="text/javascript">
860
-			var _wpCustomizeSettings = <?php echo wp_json_encode( $settings ); ?>;
860
+			var _wpCustomizeSettings = <?php echo wp_json_encode($settings); ?>;
861 861
 			_wpCustomizeSettings.values = {};
862 862
 			(function( v ) {
863 863
 				<?php
@@ -866,12 +866,12 @@  discard block
 block discarded – undo
866 866
 				 * serialization in order to avoid a peak memory usage spike.
867 867
 				 * @todo We may not even need to export the values at all since the pane syncs them anyway.
868 868
 				 */
869
-				foreach ( $this->settings as $id => $setting ) {
870
-					if ( $setting->check_capabilities() ) {
869
+				foreach ($this->settings as $id => $setting) {
870
+					if ($setting->check_capabilities()) {
871 871
 						printf(
872 872
 							"v[%s] = %s;\n",
873
-							wp_json_encode( $id ),
874
-							wp_json_encode( $setting->js_value() )
873
+							wp_json_encode($id),
874
+							wp_json_encode($setting->js_value())
875 875
 						);
876 876
 					}
877 877
 				}
@@ -898,8 +898,8 @@  discard block
 block discarded – undo
898 898
 	 * @param mixed $return Value passed through for wp_die_handler filter.
899 899
 	 * @return mixed Value passed through for wp_die_handler filter.
900 900
 	 */
901
-	public function remove_preview_signature( $return = null ) {
902
-		remove_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 );
901
+	public function remove_preview_signature($return = null) {
902
+		remove_action('shutdown', array($this, 'customize_preview_signature'), 1000);
903 903
 
904 904
 		return $return;
905 905
 	}
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 	 * @return string Theme root.
946 946
 	 */
947 947
 	public function get_template_root() {
948
-		return get_raw_theme_root( $this->get_template(), true );
948
+		return get_raw_theme_root($this->get_template(), true);
949 949
 	}
950 950
 
951 951
 	/**
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 	 * @return string Theme root.
957 957
 	 */
958 958
 	public function get_stylesheet_root() {
959
-		return get_raw_theme_root( $this->get_stylesheet(), true );
959
+		return get_raw_theme_root($this->get_stylesheet(), true);
960 960
 	}
961 961
 
962 962
 	/**
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
 	 * @param $current_theme {@internal Parameter is not used}
968 968
 	 * @return string Theme name.
969 969
 	 */
970
-	public function current_theme( $current_theme ) {
970
+	public function current_theme($current_theme) {
971 971
 		return $this->theme()->display('Name');
972 972
 	}
973 973
 
@@ -977,22 +977,22 @@  discard block
 block discarded – undo
977 977
 	 * @since 3.4.0
978 978
 	 */
979 979
 	public function save() {
980
-		if ( ! $this->is_preview() ) {
981
-			wp_send_json_error( 'not_preview' );
980
+		if ( ! $this->is_preview()) {
981
+			wp_send_json_error('not_preview');
982 982
 		}
983 983
 
984
-		$action = 'save-customize_' . $this->get_stylesheet();
985
-		if ( ! check_ajax_referer( $action, 'nonce', false ) ) {
986
-			wp_send_json_error( 'invalid_nonce' );
984
+		$action = 'save-customize_'.$this->get_stylesheet();
985
+		if ( ! check_ajax_referer($action, 'nonce', false)) {
986
+			wp_send_json_error('invalid_nonce');
987 987
 		}
988 988
 
989 989
 		// Do we have to switch themes?
990
-		if ( ! $this->is_theme_active() ) {
990
+		if ( ! $this->is_theme_active()) {
991 991
 			// Temporarily stop previewing the theme to allow switch_themes()
992 992
 			// to operate properly.
993 993
 			$this->stop_previewing_theme();
994
-			switch_theme( $this->get_stylesheet() );
995
-			update_option( 'theme_switched_via_customizer', true );
994
+			switch_theme($this->get_stylesheet());
995
+			update_option('theme_switched_via_customizer', true);
996 996
 			$this->start_previewing_theme();
997 997
 		}
998 998
 
@@ -1004,9 +1004,9 @@  discard block
 block discarded – undo
1004 1004
 		 *
1005 1005
 		 * @param WP_Customize_Manager $this WP_Customize_Manager instance.
1006 1006
 		 */
1007
-		do_action( 'customize_save', $this );
1007
+		do_action('customize_save', $this);
1008 1008
 
1009
-		foreach ( $this->settings as $setting ) {
1009
+		foreach ($this->settings as $setting) {
1010 1010
 			$setting->save();
1011 1011
 		}
1012 1012
 
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
 		 *
1018 1018
 		 * @param WP_Customize_Manager $this WP_Customize_Manager instance.
1019 1019
 		 */
1020
-		do_action( 'customize_save_after', $this );
1020
+		do_action('customize_save_after', $this);
1021 1021
 
1022 1022
 		/**
1023 1023
 		 * Filter response data for a successful customize_save AJAX request.
@@ -1030,8 +1030,8 @@  discard block
 block discarded – undo
1030 1030
 		 *                                   event on `wp.customize`.
1031 1031
 		 * @param WP_Customize_Manager $this WP_Customize_Manager instance.
1032 1032
 		 */
1033
-		$response = apply_filters( 'customize_save_response', array(), $this );
1034
-		wp_send_json_success( $response );
1033
+		$response = apply_filters('customize_save_response', array(), $this);
1034
+		wp_send_json_success($response);
1035 1035
 	}
1036 1036
 
1037 1037
 	/**
@@ -1040,11 +1040,11 @@  discard block
 block discarded – undo
1040 1040
 	 * @since 4.2.0
1041 1041
 	 */
1042 1042
 	public function refresh_nonces() {
1043
-		if ( ! $this->is_preview() ) {
1044
-			wp_send_json_error( 'not_preview' );
1043
+		if ( ! $this->is_preview()) {
1044
+			wp_send_json_error('not_preview');
1045 1045
 		}
1046 1046
 
1047
-		wp_send_json_success( $this->get_nonces() );
1047
+		wp_send_json_success($this->get_nonces());
1048 1048
 	}
1049 1049
 
1050 1050
 	/**
@@ -1059,22 +1059,22 @@  discard block
 block discarded – undo
1059 1059
 	 *                                          constructor.
1060 1060
 	 * @return WP_Customize_Setting             The instance of the setting that was added.
1061 1061
 	 */
1062
-	public function add_setting( $id, $args = array() ) {
1063
-		if ( $id instanceof WP_Customize_Setting ) {
1062
+	public function add_setting($id, $args = array()) {
1063
+		if ($id instanceof WP_Customize_Setting) {
1064 1064
 			$setting = $id;
1065 1065
 		} else {
1066 1066
 			$class = 'WP_Customize_Setting';
1067 1067
 
1068 1068
 			/** This filter is documented in wp-includes/class-wp-customize-manager.php */
1069
-			$args = apply_filters( 'customize_dynamic_setting_args', $args, $id );
1069
+			$args = apply_filters('customize_dynamic_setting_args', $args, $id);
1070 1070
 
1071 1071
 			/** This filter is documented in wp-includes/class-wp-customize-manager.php */
1072
-			$class = apply_filters( 'customize_dynamic_setting_class', $class, $id, $args );
1072
+			$class = apply_filters('customize_dynamic_setting_class', $class, $id, $args);
1073 1073
 
1074
-			$setting = new $class( $this, $id, $args );
1074
+			$setting = new $class($this, $id, $args);
1075 1075
 		}
1076 1076
 
1077
-		$this->settings[ $setting->id ] = $setting;
1077
+		$this->settings[$setting->id] = $setting;
1078 1078
 		return $setting;
1079 1079
 	}
1080 1080
 
@@ -1093,11 +1093,11 @@  discard block
 block discarded – undo
1093 1093
 	 * @param array $setting_ids The setting IDs to add.
1094 1094
 	 * @return array The WP_Customize_Setting objects added.
1095 1095
 	 */
1096
-	public function add_dynamic_settings( $setting_ids ) {
1096
+	public function add_dynamic_settings($setting_ids) {
1097 1097
 		$new_settings = array();
1098
-		foreach ( $setting_ids as $setting_id ) {
1098
+		foreach ($setting_ids as $setting_id) {
1099 1099
 			// Skip settings already created
1100
-			if ( $this->get_setting( $setting_id ) ) {
1100
+			if ($this->get_setting($setting_id)) {
1101 1101
 				continue;
1102 1102
 			}
1103 1103
 
@@ -1116,8 +1116,8 @@  discard block
 block discarded – undo
1116 1116
 			 * @param false|array $setting_args The arguments to the WP_Customize_Setting constructor.
1117 1117
 			 * @param string      $setting_id   ID for dynamic setting, usually coming from `$_POST['customized']`.
1118 1118
 			 */
1119
-			$setting_args = apply_filters( 'customize_dynamic_setting_args', $setting_args, $setting_id );
1120
-			if ( false === $setting_args ) {
1119
+			$setting_args = apply_filters('customize_dynamic_setting_args', $setting_args, $setting_id);
1120
+			if (false === $setting_args) {
1121 1121
 				continue;
1122 1122
 			}
1123 1123
 
@@ -1130,11 +1130,11 @@  discard block
 block discarded – undo
1130 1130
 			 * @param string $setting_id    ID for dynamic setting, usually coming from `$_POST['customized']`.
1131 1131
 			 * @param array  $setting_args  WP_Customize_Setting or a subclass.
1132 1132
 			 */
1133
-			$setting_class = apply_filters( 'customize_dynamic_setting_class', $setting_class, $setting_id, $setting_args );
1133
+			$setting_class = apply_filters('customize_dynamic_setting_class', $setting_class, $setting_id, $setting_args);
1134 1134
 
1135
-			$setting = new $setting_class( $this, $setting_id, $setting_args );
1135
+			$setting = new $setting_class($this, $setting_id, $setting_args);
1136 1136
 
1137
-			$this->add_setting( $setting );
1137
+			$this->add_setting($setting);
1138 1138
 			$new_settings[] = $setting;
1139 1139
 		}
1140 1140
 		return $new_settings;
@@ -1148,9 +1148,9 @@  discard block
 block discarded – undo
1148 1148
 	 * @param string $id Customize Setting ID.
1149 1149
 	 * @return WP_Customize_Setting|void The setting, if set.
1150 1150
 	 */
1151
-	public function get_setting( $id ) {
1152
-		if ( isset( $this->settings[ $id ] ) ) {
1153
-			return $this->settings[ $id ];
1151
+	public function get_setting($id) {
1152
+		if (isset($this->settings[$id])) {
1153
+			return $this->settings[$id];
1154 1154
 		}
1155 1155
 	}
1156 1156
 
@@ -1161,8 +1161,8 @@  discard block
 block discarded – undo
1161 1161
 	 *
1162 1162
 	 * @param string $id Customize Setting ID.
1163 1163
 	 */
1164
-	public function remove_setting( $id ) {
1165
-		unset( $this->settings[ $id ] );
1164
+	public function remove_setting($id) {
1165
+		unset($this->settings[$id]);
1166 1166
 	}
1167 1167
 
1168 1168
 	/**
@@ -1177,14 +1177,14 @@  discard block
 block discarded – undo
1177 1177
 	 *
1178 1178
 	 * @return WP_Customize_Panel             The instance of the panel that was added.
1179 1179
 	 */
1180
-	public function add_panel( $id, $args = array() ) {
1181
-		if ( $id instanceof WP_Customize_Panel ) {
1180
+	public function add_panel($id, $args = array()) {
1181
+		if ($id instanceof WP_Customize_Panel) {
1182 1182
 			$panel = $id;
1183 1183
 		} else {
1184
-			$panel = new WP_Customize_Panel( $this, $id, $args );
1184
+			$panel = new WP_Customize_Panel($this, $id, $args);
1185 1185
 		}
1186 1186
 
1187
-		$this->panels[ $panel->id ] = $panel;
1187
+		$this->panels[$panel->id] = $panel;
1188 1188
 		return $panel;
1189 1189
 	}
1190 1190
 
@@ -1197,9 +1197,9 @@  discard block
 block discarded – undo
1197 1197
 	 * @param string $id Panel ID to get.
1198 1198
 	 * @return WP_Customize_Panel|void Requested panel instance, if set.
1199 1199
 	 */
1200
-	public function get_panel( $id ) {
1201
-		if ( isset( $this->panels[ $id ] ) ) {
1202
-			return $this->panels[ $id ];
1200
+	public function get_panel($id) {
1201
+		if (isset($this->panels[$id])) {
1202
+			return $this->panels[$id];
1203 1203
 		}
1204 1204
 	}
1205 1205
 
@@ -1211,18 +1211,18 @@  discard block
 block discarded – undo
1211 1211
 	 *
1212 1212
 	 * @param string $id Panel ID to remove.
1213 1213
 	 */
1214
-	public function remove_panel( $id ) {
1214
+	public function remove_panel($id) {
1215 1215
 		// Removing core components this way is _doing_it_wrong().
1216
-		if ( in_array( $id, $this->components, true ) ) {
1216
+		if (in_array($id, $this->components, true)) {
1217 1217
 			/* translators: 1: panel id, 2: link to 'customize_loaded_components' filter reference */
1218
-			$message = sprintf( __( 'Removing %1$s manually will cause PHP warnings. Use the %2$s filter instead.' ),
1218
+			$message = sprintf(__('Removing %1$s manually will cause PHP warnings. Use the %2$s filter instead.'),
1219 1219
 				$id,
1220
-				'<a href="' . esc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ) . '"><code>customize_loaded_components</code></a>'
1220
+				'<a href="'.esc_url('https://developer.wordpress.org/reference/hooks/customize_loaded_components/').'"><code>customize_loaded_components</code></a>'
1221 1221
 			);
1222 1222
 
1223
-			_doing_it_wrong( __METHOD__, $message, '4.5' );
1223
+			_doing_it_wrong(__METHOD__, $message, '4.5');
1224 1224
 		}
1225
-		unset( $this->panels[ $id ] );
1225
+		unset($this->panels[$id]);
1226 1226
 	}
1227 1227
 
1228 1228
 	/**
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
 	 *
1238 1238
 	 * @param string $panel Name of a custom panel which is a subclass of WP_Customize_Panel.
1239 1239
 	 */
1240
-	public function register_panel_type( $panel ) {
1240
+	public function register_panel_type($panel) {
1241 1241
 		$this->registered_panel_types[] = $panel;
1242 1242
 	}
1243 1243
 
@@ -1248,8 +1248,8 @@  discard block
 block discarded – undo
1248 1248
 	 * @access public
1249 1249
 	 */
1250 1250
 	public function render_panel_templates() {
1251
-		foreach ( $this->registered_panel_types as $panel_type ) {
1252
-			$panel = new $panel_type( $this, 'temp', array() );
1251
+		foreach ($this->registered_panel_types as $panel_type) {
1252
+			$panel = new $panel_type($this, 'temp', array());
1253 1253
 			$panel->print_template();
1254 1254
 		}
1255 1255
 	}
@@ -1266,14 +1266,14 @@  discard block
 block discarded – undo
1266 1266
 	 *
1267 1267
 	 * @return WP_Customize_Section             The instance of the section that was added.
1268 1268
 	 */
1269
-	public function add_section( $id, $args = array() ) {
1270
-		if ( $id instanceof WP_Customize_Section ) {
1269
+	public function add_section($id, $args = array()) {
1270
+		if ($id instanceof WP_Customize_Section) {
1271 1271
 			$section = $id;
1272 1272
 		} else {
1273
-			$section = new WP_Customize_Section( $this, $id, $args );
1273
+			$section = new WP_Customize_Section($this, $id, $args);
1274 1274
 		}
1275 1275
 
1276
-		$this->sections[ $section->id ] = $section;
1276
+		$this->sections[$section->id] = $section;
1277 1277
 		return $section;
1278 1278
 	}
1279 1279
 
@@ -1285,9 +1285,9 @@  discard block
 block discarded – undo
1285 1285
 	 * @param string $id Section ID.
1286 1286
 	 * @return WP_Customize_Section|void The section, if set.
1287 1287
 	 */
1288
-	public function get_section( $id ) {
1289
-		if ( isset( $this->sections[ $id ] ) )
1290
-			return $this->sections[ $id ];
1288
+	public function get_section($id) {
1289
+		if (isset($this->sections[$id]))
1290
+			return $this->sections[$id];
1291 1291
 	}
1292 1292
 
1293 1293
 	/**
@@ -1297,8 +1297,8 @@  discard block
 block discarded – undo
1297 1297
 	 *
1298 1298
 	 * @param string $id Section ID.
1299 1299
 	 */
1300
-	public function remove_section( $id ) {
1301
-		unset( $this->sections[ $id ] );
1300
+	public function remove_section($id) {
1301
+		unset($this->sections[$id]);
1302 1302
 	}
1303 1303
 
1304 1304
 	/**
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 	 *
1314 1314
 	 * @param string $section Name of a custom section which is a subclass of WP_Customize_Section.
1315 1315
 	 */
1316
-	public function register_section_type( $section ) {
1316
+	public function register_section_type($section) {
1317 1317
 		$this->registered_section_types[] = $section;
1318 1318
 	}
1319 1319
 
@@ -1324,8 +1324,8 @@  discard block
 block discarded – undo
1324 1324
 	 * @access public
1325 1325
 	 */
1326 1326
 	public function render_section_templates() {
1327
-		foreach ( $this->registered_section_types as $section_type ) {
1328
-			$section = new $section_type( $this, 'temp', array() );
1327
+		foreach ($this->registered_section_types as $section_type) {
1328
+			$section = new $section_type($this, 'temp', array());
1329 1329
 			$section->print_template();
1330 1330
 		}
1331 1331
 	}
@@ -1342,14 +1342,14 @@  discard block
 block discarded – undo
1342 1342
 	 *                                          constructor.
1343 1343
 	 * @return WP_Customize_Control             The instance of the control that was added.
1344 1344
 	 */
1345
-	public function add_control( $id, $args = array() ) {
1346
-		if ( $id instanceof WP_Customize_Control ) {
1345
+	public function add_control($id, $args = array()) {
1346
+		if ($id instanceof WP_Customize_Control) {
1347 1347
 			$control = $id;
1348 1348
 		} else {
1349
-			$control = new WP_Customize_Control( $this, $id, $args );
1349
+			$control = new WP_Customize_Control($this, $id, $args);
1350 1350
 		}
1351 1351
 
1352
-		$this->controls[ $control->id ] = $control;
1352
+		$this->controls[$control->id] = $control;
1353 1353
 		return $control;
1354 1354
 	}
1355 1355
 
@@ -1361,9 +1361,9 @@  discard block
 block discarded – undo
1361 1361
 	 * @param string $id ID of the control.
1362 1362
 	 * @return WP_Customize_Control|void The control object, if set.
1363 1363
 	 */
1364
-	public function get_control( $id ) {
1365
-		if ( isset( $this->controls[ $id ] ) )
1366
-			return $this->controls[ $id ];
1364
+	public function get_control($id) {
1365
+		if (isset($this->controls[$id]))
1366
+			return $this->controls[$id];
1367 1367
 	}
1368 1368
 
1369 1369
 	/**
@@ -1373,8 +1373,8 @@  discard block
 block discarded – undo
1373 1373
 	 *
1374 1374
 	 * @param string $id ID of the control.
1375 1375
 	 */
1376
-	public function remove_control( $id ) {
1377
-		unset( $this->controls[ $id ] );
1376
+	public function remove_control($id) {
1377
+		unset($this->controls[$id]);
1378 1378
 	}
1379 1379
 
1380 1380
 	/**
@@ -1388,7 +1388,7 @@  discard block
 block discarded – undo
1388 1388
 	 * @param string $control Name of a custom control which is a subclass of
1389 1389
 	 *                        {@see WP_Customize_Control}.
1390 1390
 	 */
1391
-	public function register_control_type( $control ) {
1391
+	public function register_control_type($control) {
1392 1392
 		$this->registered_control_types[] = $control;
1393 1393
 	}
1394 1394
 
@@ -1399,10 +1399,10 @@  discard block
 block discarded – undo
1399 1399
 	 * @access public
1400 1400
 	 */
1401 1401
 	public function render_control_templates() {
1402
-		foreach ( $this->registered_control_types as $control_type ) {
1403
-			$control = new $control_type( $this, 'temp', array(
1402
+		foreach ($this->registered_control_types as $control_type) {
1403
+			$control = new $control_type($this, 'temp', array(
1404 1404
 				'settings' => array(),
1405
-			) );
1405
+			));
1406 1406
 			$control->print_template();
1407 1407
 		}
1408 1408
 	}
@@ -1416,8 +1416,8 @@  discard block
 block discarded – undo
1416 1416
 	 * @param WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $b Object B.
1417 1417
 	 * @return int
1418 1418
 	 */
1419
-	protected function _cmp_priority( $a, $b ) {
1420
-		if ( $a->priority === $b->priority ) {
1419
+	protected function _cmp_priority($a, $b) {
1420
+		if ($a->priority === $b->priority) {
1421 1421
 			return $a->instance_number - $b->instance_number;
1422 1422
 		} else {
1423 1423
 			return $a->priority - $b->priority;
@@ -1436,58 +1436,58 @@  discard block
 block discarded – undo
1436 1436
 	public function prepare_controls() {
1437 1437
 
1438 1438
 		$controls = array();
1439
-		uasort( $this->controls, array( $this, '_cmp_priority' ) );
1439
+		uasort($this->controls, array($this, '_cmp_priority'));
1440 1440
 
1441
-		foreach ( $this->controls as $id => $control ) {
1442
-			if ( ! isset( $this->sections[ $control->section ] ) || ! $control->check_capabilities() ) {
1441
+		foreach ($this->controls as $id => $control) {
1442
+			if ( ! isset($this->sections[$control->section]) || ! $control->check_capabilities()) {
1443 1443
 				continue;
1444 1444
 			}
1445 1445
 
1446
-			$this->sections[ $control->section ]->controls[] = $control;
1447
-			$controls[ $id ] = $control;
1446
+			$this->sections[$control->section]->controls[] = $control;
1447
+			$controls[$id] = $control;
1448 1448
 		}
1449 1449
 		$this->controls = $controls;
1450 1450
 
1451 1451
 		// Prepare sections.
1452
-		uasort( $this->sections, array( $this, '_cmp_priority' ) );
1452
+		uasort($this->sections, array($this, '_cmp_priority'));
1453 1453
 		$sections = array();
1454 1454
 
1455
-		foreach ( $this->sections as $section ) {
1456
-			if ( ! $section->check_capabilities() ) {
1455
+		foreach ($this->sections as $section) {
1456
+			if ( ! $section->check_capabilities()) {
1457 1457
 				continue;
1458 1458
 			}
1459 1459
 
1460
-			usort( $section->controls, array( $this, '_cmp_priority' ) );
1460
+			usort($section->controls, array($this, '_cmp_priority'));
1461 1461
 
1462
-			if ( ! $section->panel ) {
1462
+			if ( ! $section->panel) {
1463 1463
 				// Top-level section.
1464
-				$sections[ $section->id ] = $section;
1464
+				$sections[$section->id] = $section;
1465 1465
 			} else {
1466 1466
 				// This section belongs to a panel.
1467
-				if ( isset( $this->panels [ $section->panel ] ) ) {
1468
-					$this->panels[ $section->panel ]->sections[ $section->id ] = $section;
1467
+				if (isset($this->panels [$section->panel])) {
1468
+					$this->panels[$section->panel]->sections[$section->id] = $section;
1469 1469
 				}
1470 1470
 			}
1471 1471
 		}
1472 1472
 		$this->sections = $sections;
1473 1473
 
1474 1474
 		// Prepare panels.
1475
-		uasort( $this->panels, array( $this, '_cmp_priority' ) );
1475
+		uasort($this->panels, array($this, '_cmp_priority'));
1476 1476
 		$panels = array();
1477 1477
 
1478
-		foreach ( $this->panels as $panel ) {
1479
-			if ( ! $panel->check_capabilities() ) {
1478
+		foreach ($this->panels as $panel) {
1479
+			if ( ! $panel->check_capabilities()) {
1480 1480
 				continue;
1481 1481
 			}
1482 1482
 
1483
-			uasort( $panel->sections, array( $this, '_cmp_priority' ) );
1484
-			$panels[ $panel->id ] = $panel;
1483
+			uasort($panel->sections, array($this, '_cmp_priority'));
1484
+			$panels[$panel->id] = $panel;
1485 1485
 		}
1486 1486
 		$this->panels = $panels;
1487 1487
 
1488 1488
 		// Sort panels and top-level sections together.
1489
-		$this->containers = array_merge( $this->panels, $this->sections );
1490
-		uasort( $this->containers, array( $this, '_cmp_priority' ) );
1489
+		$this->containers = array_merge($this->panels, $this->sections);
1490
+		uasort($this->containers, array($this, '_cmp_priority'));
1491 1491
 	}
1492 1492
 
1493 1493
 	/**
@@ -1496,7 +1496,7 @@  discard block
 block discarded – undo
1496 1496
 	 * @since 3.4.0
1497 1497
 	 */
1498 1498
 	public function enqueue_control_scripts() {
1499
-		foreach ( $this->controls as $control ) {
1499
+		foreach ($this->controls as $control) {
1500 1500
 			$control->enqueue();
1501 1501
 		}
1502 1502
 	}
@@ -1510,7 +1510,7 @@  discard block
 block discarded – undo
1510 1510
 	 * @return bool Whether the user agent is iOS.
1511 1511
 	 */
1512 1512
 	public function is_ios() {
1513
-		return wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] );
1513
+		return wp_is_mobile() && preg_match('/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT']);
1514 1514
 	}
1515 1515
 
1516 1516
 	/**
@@ -1522,14 +1522,14 @@  discard block
 block discarded – undo
1522 1522
 	 * @return string The template string for the document title.
1523 1523
 	 */
1524 1524
 	public function get_document_title_template() {
1525
-		if ( $this->is_theme_active() ) {
1525
+		if ($this->is_theme_active()) {
1526 1526
 			/* translators: %s: document title from the preview */
1527
-			$document_title_tmpl = __( 'Customize: %s' );
1527
+			$document_title_tmpl = __('Customize: %s');
1528 1528
 		} else {
1529 1529
 			/* translators: %s: document title from the preview */
1530
-			$document_title_tmpl = __( 'Live Preview: %s' );
1530
+			$document_title_tmpl = __('Live Preview: %s');
1531 1531
 		}
1532
-		$document_title_tmpl = html_entity_decode( $document_title_tmpl, ENT_QUOTES, 'UTF-8' ); // Because exported to JS and assigned to document.title.
1532
+		$document_title_tmpl = html_entity_decode($document_title_tmpl, ENT_QUOTES, 'UTF-8'); // Because exported to JS and assigned to document.title.
1533 1533
 		return $document_title_tmpl;
1534 1534
 	}
1535 1535
 
@@ -1543,8 +1543,8 @@  discard block
 block discarded – undo
1543 1543
 	 *
1544 1544
 	 * @param string $preview_url URL to be previewed.
1545 1545
 	 */
1546
-	public function set_preview_url( $preview_url ) {
1547
-		$this->preview_url = wp_validate_redirect( $preview_url, home_url( '/' ) );
1546
+	public function set_preview_url($preview_url) {
1547
+		$this->preview_url = wp_validate_redirect($preview_url, home_url('/'));
1548 1548
 	}
1549 1549
 
1550 1550
 	/**
@@ -1556,8 +1556,8 @@  discard block
 block discarded – undo
1556 1556
 	 * @return string URL being previewed.
1557 1557
 	 */
1558 1558
 	public function get_preview_url() {
1559
-		if ( empty( $this->preview_url ) ) {
1560
-			$preview_url = home_url( '/' );
1559
+		if (empty($this->preview_url)) {
1560
+			$preview_url = home_url('/');
1561 1561
 		} else {
1562 1562
 			$preview_url = $this->preview_url;
1563 1563
 		}
@@ -1574,9 +1574,9 @@  discard block
 block discarded – undo
1574 1574
 	 *
1575 1575
 	 * @param string $return_url URL for return link.
1576 1576
 	 */
1577
-	public function set_return_url( $return_url ) {
1578
-		$return_url = remove_query_arg( wp_removable_query_args(), $return_url );
1579
-		$return_url = wp_validate_redirect( $return_url );
1577
+	public function set_return_url($return_url) {
1578
+		$return_url = remove_query_arg(wp_removable_query_args(), $return_url);
1579
+		$return_url = wp_validate_redirect($return_url);
1580 1580
 		$this->return_url = $return_url;
1581 1581
 	}
1582 1582
 
@@ -1590,16 +1590,16 @@  discard block
 block discarded – undo
1590 1590
 	 */
1591 1591
 	public function get_return_url() {
1592 1592
 		$referer = wp_get_referer();
1593
-		$excluded_referer_basenames = array( 'customize.php', 'wp-login.php' );
1593
+		$excluded_referer_basenames = array('customize.php', 'wp-login.php');
1594 1594
 
1595
-		if ( $this->return_url ) {
1595
+		if ($this->return_url) {
1596 1596
 			$return_url = $this->return_url;
1597
-		} else if ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
1597
+		} else if ($referer && ! in_array(basename(parse_url($referer, PHP_URL_PATH)), $excluded_referer_basenames, true)) {
1598 1598
 			$return_url = $referer;
1599
-		} else if ( $this->preview_url ) {
1599
+		} else if ($this->preview_url) {
1600 1600
 			$return_url = $this->preview_url;
1601 1601
 		} else {
1602
-			$return_url = home_url( '/' );
1602
+			$return_url = home_url('/');
1603 1603
 		}
1604 1604
 		return $return_url;
1605 1605
 	}
@@ -1618,8 +1618,8 @@  discard block
 block discarded – undo
1618 1618
 	 *     @type string [$panel]    ID for panel to be autofocused.
1619 1619
 	 * }
1620 1620
 	 */
1621
-	public function set_autofocus( $autofocus ) {
1622
-		$this->autofocus = array_filter( wp_array_slice_assoc( $autofocus, array( 'panel', 'section', 'control' ) ), 'is_string' );
1621
+	public function set_autofocus($autofocus) {
1622
+		$this->autofocus = array_filter(wp_array_slice_assoc($autofocus, array('panel', 'section', 'control')), 'is_string');
1623 1623
 	}
1624 1624
 
1625 1625
 	/**
@@ -1648,8 +1648,8 @@  discard block
 block discarded – undo
1648 1648
 	 */
1649 1649
 	public function get_nonces() {
1650 1650
 		$nonces = array(
1651
-			'save' => wp_create_nonce( 'save-customize_' . $this->get_stylesheet() ),
1652
-			'preview' => wp_create_nonce( 'preview-customize_' . $this->get_stylesheet() ),
1651
+			'save' => wp_create_nonce('save-customize_'.$this->get_stylesheet()),
1652
+			'preview' => wp_create_nonce('preview-customize_'.$this->get_stylesheet()),
1653 1653
 		);
1654 1654
 
1655 1655
 		/**
@@ -1661,7 +1661,7 @@  discard block
 block discarded – undo
1661 1661
 		 *                                     preview actions.
1662 1662
 		 * @param WP_Customize_Manager $this   WP_Customize_Manager instance.
1663 1663
 		 */
1664
-		$nonces = apply_filters( 'customize_refresh_nonces', $nonces, $this );
1664
+		$nonces = apply_filters('customize_refresh_nonces', $nonces, $this);
1665 1665
 
1666 1666
 		return $nonces;
1667 1667
 	}
@@ -1681,13 +1681,13 @@  discard block
 block discarded – undo
1681 1681
 		 * using the customize_allowed_urls filter.
1682 1682
 		 */
1683 1683
 
1684
-		$allowed_urls = array( home_url( '/' ) );
1685
-		$admin_origin = parse_url( admin_url() );
1686
-		$home_origin  = parse_url( home_url() );
1687
-		$cross_domain = ( strtolower( $admin_origin['host'] ) !== strtolower( $home_origin['host'] ) );
1684
+		$allowed_urls = array(home_url('/'));
1685
+		$admin_origin = parse_url(admin_url());
1686
+		$home_origin  = parse_url(home_url());
1687
+		$cross_domain = (strtolower($admin_origin['host']) !== strtolower($home_origin['host']));
1688 1688
 
1689
-		if ( is_ssl() && ! $cross_domain ) {
1690
-			$allowed_urls[] = home_url( '/', 'https' );
1689
+		if (is_ssl() && ! $cross_domain) {
1690
+			$allowed_urls[] = home_url('/', 'https');
1691 1691
 		}
1692 1692
 
1693 1693
 		/**
@@ -1697,12 +1697,12 @@  discard block
 block discarded – undo
1697 1697
 		 *
1698 1698
 		 * @param array $allowed_urls An array of allowed URLs.
1699 1699
 		 */
1700
-		$allowed_urls = array_unique( apply_filters( 'customize_allowed_urls', $allowed_urls ) );
1700
+		$allowed_urls = array_unique(apply_filters('customize_allowed_urls', $allowed_urls));
1701 1701
 
1702
-		$login_url = add_query_arg( array(
1702
+		$login_url = add_query_arg(array(
1703 1703
 			'interim-login' => 1,
1704 1704
 			'customize-login' => 1,
1705
-		), wp_login_url() );
1705
+		), wp_login_url());
1706 1706
 
1707 1707
 		// Prepare Customizer settings to pass to JavaScript.
1708 1708
 		$settings = array(
@@ -1711,14 +1711,14 @@  discard block
 block discarded – undo
1711 1711
 				'active'     => $this->is_theme_active(),
1712 1712
 			),
1713 1713
 			'url'      => array(
1714
-				'preview'       => esc_url_raw( $this->get_preview_url() ),
1715
-				'parent'        => esc_url_raw( admin_url() ),
1716
-				'activated'     => esc_url_raw( home_url( '/' ) ),
1717
-				'ajax'          => esc_url_raw( admin_url( 'admin-ajax.php', 'relative' ) ),
1718
-				'allowed'       => array_map( 'esc_url_raw', $allowed_urls ),
1714
+				'preview'       => esc_url_raw($this->get_preview_url()),
1715
+				'parent'        => esc_url_raw(admin_url()),
1716
+				'activated'     => esc_url_raw(home_url('/')),
1717
+				'ajax'          => esc_url_raw(admin_url('admin-ajax.php', 'relative')),
1718
+				'allowed'       => array_map('esc_url_raw', $allowed_urls),
1719 1719
 				'isCrossDomain' => $cross_domain,
1720
-				'home'          => esc_url_raw( home_url( '/' ) ),
1721
-				'login'         => esc_url_raw( $login_url ),
1720
+				'home'          => esc_url_raw(home_url('/')),
1721
+				'login'         => esc_url_raw($login_url),
1722 1722
 			),
1723 1723
 			'browser'  => array(
1724 1724
 				'mobile' => wp_is_mobile(),
@@ -1730,23 +1730,23 @@  discard block
 block discarded – undo
1730 1730
 			'autofocus' => $this->get_autofocus(),
1731 1731
 			'documentTitleTmpl' => $this->get_document_title_template(),
1732 1732
 			'previewableDevices' => $this->get_previewable_devices(),
1733
-			'selectiveRefreshEnabled' => isset( $this->selective_refresh ),
1733
+			'selectiveRefreshEnabled' => isset($this->selective_refresh),
1734 1734
 		);
1735 1735
 
1736 1736
 		// Prepare Customize Section objects to pass to JavaScript.
1737
-		foreach ( $this->sections() as $id => $section ) {
1738
-			if ( $section->check_capabilities() ) {
1739
-				$settings['sections'][ $id ] = $section->json();
1737
+		foreach ($this->sections() as $id => $section) {
1738
+			if ($section->check_capabilities()) {
1739
+				$settings['sections'][$id] = $section->json();
1740 1740
 			}
1741 1741
 		}
1742 1742
 
1743 1743
 		// Prepare Customize Panel objects to pass to JavaScript.
1744
-		foreach ( $this->panels() as $panel_id => $panel ) {
1745
-			if ( $panel->check_capabilities() ) {
1746
-				$settings['panels'][ $panel_id ] = $panel->json();
1747
-				foreach ( $panel->sections as $section_id => $section ) {
1748
-					if ( $section->check_capabilities() ) {
1749
-						$settings['sections'][ $section_id ] = $section->json();
1744
+		foreach ($this->panels() as $panel_id => $panel) {
1745
+			if ($panel->check_capabilities()) {
1746
+				$settings['panels'][$panel_id] = $panel->json();
1747
+				foreach ($panel->sections as $section_id => $section) {
1748
+					if ($section->check_capabilities()) {
1749
+						$settings['sections'][$section_id] = $section->json();
1750 1750
 					}
1751 1751
 				}
1752 1752
 			}
@@ -1754,23 +1754,23 @@  discard block
 block discarded – undo
1754 1754
 
1755 1755
 		?>
1756 1756
 		<script type="text/javascript">
1757
-			var _wpCustomizeSettings = <?php echo wp_json_encode( $settings ); ?>;
1757
+			var _wpCustomizeSettings = <?php echo wp_json_encode($settings); ?>;
1758 1758
 			_wpCustomizeSettings.controls = {};
1759 1759
 			_wpCustomizeSettings.settings = {};
1760 1760
 			<?php
1761 1761
 
1762 1762
 			// Serialize settings one by one to improve memory usage.
1763 1763
 			echo "(function ( s ){\n";
1764
-			foreach ( $this->settings() as $setting ) {
1765
-				if ( $setting->check_capabilities() ) {
1764
+			foreach ($this->settings() as $setting) {
1765
+				if ($setting->check_capabilities()) {
1766 1766
 					printf(
1767 1767
 						"s[%s] = %s;\n",
1768
-						wp_json_encode( $setting->id ),
1769
-						wp_json_encode( array(
1768
+						wp_json_encode($setting->id),
1769
+						wp_json_encode(array(
1770 1770
 							'value'     => $setting->js_value(),
1771 1771
 							'transport' => $setting->transport,
1772 1772
 							'dirty'     => $setting->dirty,
1773
-						) )
1773
+						))
1774 1774
 					);
1775 1775
 				}
1776 1776
 			}
@@ -1778,12 +1778,12 @@  discard block
 block discarded – undo
1778 1778
 
1779 1779
 			// Serialize controls one by one to improve memory usage.
1780 1780
 			echo "(function ( c ){\n";
1781
-			foreach ( $this->controls() as $control ) {
1782
-				if ( $control->check_capabilities() ) {
1781
+			foreach ($this->controls() as $control) {
1782
+				if ($control->check_capabilities()) {
1783 1783
 					printf(
1784 1784
 						"c[%s] = %s;\n",
1785
-						wp_json_encode( $control->id ),
1786
-						wp_json_encode( $control->json() )
1785
+						wp_json_encode($control->id),
1786
+						wp_json_encode($control->json())
1787 1787
 					);
1788 1788
 				}
1789 1789
 			}
@@ -1804,14 +1804,14 @@  discard block
 block discarded – undo
1804 1804
 	public function get_previewable_devices() {
1805 1805
 		$devices = array(
1806 1806
 			'desktop' => array(
1807
-				'label' => __( 'Enter desktop preview mode' ),
1807
+				'label' => __('Enter desktop preview mode'),
1808 1808
 				'default' => true,
1809 1809
 			),
1810 1810
 			'tablet' => array(
1811
-				'label' => __( 'Enter tablet preview mode' ),
1811
+				'label' => __('Enter tablet preview mode'),
1812 1812
 			),
1813 1813
 			'mobile' => array(
1814
-				'label' => __( 'Enter mobile preview mode' ),
1814
+				'label' => __('Enter mobile preview mode'),
1815 1815
 			),
1816 1816
 		);
1817 1817
 
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
 		 *
1825 1825
 		 * @param array $devices List of devices with labels and default setting.
1826 1826
 		 */
1827
-		$devices = apply_filters( 'customize_previewable_devices', $devices );
1827
+		$devices = apply_filters('customize_previewable_devices', $devices);
1828 1828
 
1829 1829
 		return $devices;
1830 1830
 	}
@@ -1837,248 +1837,248 @@  discard block
 block discarded – undo
1837 1837
 	public function register_controls() {
1838 1838
 
1839 1839
 		/* Panel, Section, and Control Types */
1840
-		$this->register_panel_type( 'WP_Customize_Panel' );
1841
-		$this->register_section_type( 'WP_Customize_Section' );
1842
-		$this->register_section_type( 'WP_Customize_Sidebar_Section' );
1843
-		$this->register_control_type( 'WP_Customize_Color_Control' );
1844
-		$this->register_control_type( 'WP_Customize_Media_Control' );
1845
-		$this->register_control_type( 'WP_Customize_Upload_Control' );
1846
-		$this->register_control_type( 'WP_Customize_Image_Control' );
1847
-		$this->register_control_type( 'WP_Customize_Background_Image_Control' );
1848
-		$this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
1849
-		$this->register_control_type( 'WP_Customize_Site_Icon_Control' );
1850
-		$this->register_control_type( 'WP_Customize_Theme_Control' );
1840
+		$this->register_panel_type('WP_Customize_Panel');
1841
+		$this->register_section_type('WP_Customize_Section');
1842
+		$this->register_section_type('WP_Customize_Sidebar_Section');
1843
+		$this->register_control_type('WP_Customize_Color_Control');
1844
+		$this->register_control_type('WP_Customize_Media_Control');
1845
+		$this->register_control_type('WP_Customize_Upload_Control');
1846
+		$this->register_control_type('WP_Customize_Image_Control');
1847
+		$this->register_control_type('WP_Customize_Background_Image_Control');
1848
+		$this->register_control_type('WP_Customize_Cropped_Image_Control');
1849
+		$this->register_control_type('WP_Customize_Site_Icon_Control');
1850
+		$this->register_control_type('WP_Customize_Theme_Control');
1851 1851
 
1852 1852
 		/* Themes */
1853 1853
 
1854
-		$this->add_section( new WP_Customize_Themes_Section( $this, 'themes', array(
1855
-			'title'      => $this->theme()->display( 'Name' ),
1854
+		$this->add_section(new WP_Customize_Themes_Section($this, 'themes', array(
1855
+			'title'      => $this->theme()->display('Name'),
1856 1856
 			'capability' => 'switch_themes',
1857 1857
 			'priority'   => 0,
1858
-		) ) );
1858
+		)));
1859 1859
 
1860 1860
 		// Themes Setting (unused - the theme is considerably more fundamental to the Customizer experience).
1861
-		$this->add_setting( new WP_Customize_Filter_Setting( $this, 'active_theme', array(
1861
+		$this->add_setting(new WP_Customize_Filter_Setting($this, 'active_theme', array(
1862 1862
 			'capability' => 'switch_themes',
1863
-		) ) );
1863
+		)));
1864 1864
 
1865
-		require_once( ABSPATH . 'wp-admin/includes/theme.php' );
1865
+		require_once(ABSPATH.'wp-admin/includes/theme.php');
1866 1866
 
1867 1867
 		// Theme Controls.
1868 1868
 
1869 1869
 		// Add a control for the active/original theme.
1870
-		if ( ! $this->is_theme_active() ) {
1871
-			$themes = wp_prepare_themes_for_js( array( wp_get_theme( $this->original_stylesheet ) ) );
1872
-			$active_theme = current( $themes );
1870
+		if ( ! $this->is_theme_active()) {
1871
+			$themes = wp_prepare_themes_for_js(array(wp_get_theme($this->original_stylesheet)));
1872
+			$active_theme = current($themes);
1873 1873
 			$active_theme['isActiveTheme'] = true;
1874
-			$this->add_control( new WP_Customize_Theme_Control( $this, $active_theme['id'], array(
1874
+			$this->add_control(new WP_Customize_Theme_Control($this, $active_theme['id'], array(
1875 1875
 				'theme'    => $active_theme,
1876 1876
 				'section'  => 'themes',
1877 1877
 				'settings' => 'active_theme',
1878
-			) ) );
1878
+			)));
1879 1879
 		}
1880 1880
 
1881 1881
 		$themes = wp_prepare_themes_for_js();
1882
-		foreach ( $themes as $theme ) {
1883
-			if ( $theme['active'] || $theme['id'] === $this->original_stylesheet ) {
1882
+		foreach ($themes as $theme) {
1883
+			if ($theme['active'] || $theme['id'] === $this->original_stylesheet) {
1884 1884
 				continue;
1885 1885
 			}
1886 1886
 
1887
-			$theme_id = 'theme_' . $theme['id'];
1887
+			$theme_id = 'theme_'.$theme['id'];
1888 1888
 			$theme['isActiveTheme'] = false;
1889
-			$this->add_control( new WP_Customize_Theme_Control( $this, $theme_id, array(
1889
+			$this->add_control(new WP_Customize_Theme_Control($this, $theme_id, array(
1890 1890
 				'theme'    => $theme,
1891 1891
 				'section'  => 'themes',
1892 1892
 				'settings' => 'active_theme',
1893
-			) ) );
1893
+			)));
1894 1894
 		}
1895 1895
 
1896 1896
 		/* Site Identity */
1897 1897
 
1898
-		$this->add_section( 'title_tagline', array(
1899
-			'title'    => __( 'Site Identity' ),
1898
+		$this->add_section('title_tagline', array(
1899
+			'title'    => __('Site Identity'),
1900 1900
 			'priority' => 20,
1901
-		) );
1901
+		));
1902 1902
 
1903
-		$this->add_setting( 'blogname', array(
1904
-			'default'    => get_option( 'blogname' ),
1903
+		$this->add_setting('blogname', array(
1904
+			'default'    => get_option('blogname'),
1905 1905
 			'type'       => 'option',
1906 1906
 			'capability' => 'manage_options',
1907
-		) );
1907
+		));
1908 1908
 
1909
-		$this->add_control( 'blogname', array(
1910
-			'label'      => __( 'Site Title' ),
1909
+		$this->add_control('blogname', array(
1910
+			'label'      => __('Site Title'),
1911 1911
 			'section'    => 'title_tagline',
1912
-		) );
1912
+		));
1913 1913
 
1914
-		$this->add_setting( 'blogdescription', array(
1915
-			'default'    => get_option( 'blogdescription' ),
1914
+		$this->add_setting('blogdescription', array(
1915
+			'default'    => get_option('blogdescription'),
1916 1916
 			'type'       => 'option',
1917 1917
 			'capability' => 'manage_options',
1918
-		) );
1918
+		));
1919 1919
 
1920
-		$this->add_control( 'blogdescription', array(
1921
-			'label'      => __( 'Tagline' ),
1920
+		$this->add_control('blogdescription', array(
1921
+			'label'      => __('Tagline'),
1922 1922
 			'section'    => 'title_tagline',
1923
-		) );
1923
+		));
1924 1924
 
1925 1925
 		// Add a setting to hide header text if the theme doesn't support custom headers.
1926
-		if ( ! current_theme_supports( 'custom-header', 'header-text' ) ) {
1927
-			$this->add_setting( 'header_text', array(
1928
-				'theme_supports'    => array( 'custom-logo', 'header-text' ),
1926
+		if ( ! current_theme_supports('custom-header', 'header-text')) {
1927
+			$this->add_setting('header_text', array(
1928
+				'theme_supports'    => array('custom-logo', 'header-text'),
1929 1929
 				'default'           => 1,
1930 1930
 				'sanitize_callback' => 'absint',
1931
-			) );
1931
+			));
1932 1932
 
1933
-			$this->add_control( 'header_text', array(
1934
-				'label'    => __( 'Display Site Title and Tagline' ),
1933
+			$this->add_control('header_text', array(
1934
+				'label'    => __('Display Site Title and Tagline'),
1935 1935
 				'section'  => 'title_tagline',
1936 1936
 				'settings' => 'header_text',
1937 1937
 				'type'     => 'checkbox',
1938
-			) );
1938
+			));
1939 1939
 		}
1940 1940
 
1941
-		$this->add_setting( 'site_icon', array(
1941
+		$this->add_setting('site_icon', array(
1942 1942
 			'type'       => 'option',
1943 1943
 			'capability' => 'manage_options',
1944 1944
 			'transport'  => 'postMessage', // Previewed with JS in the Customizer controls window.
1945
-		) );
1945
+		));
1946 1946
 
1947
-		$this->add_control( new WP_Customize_Site_Icon_Control( $this, 'site_icon', array(
1948
-			'label'       => __( 'Site Icon' ),
1947
+		$this->add_control(new WP_Customize_Site_Icon_Control($this, 'site_icon', array(
1948
+			'label'       => __('Site Icon'),
1949 1949
 			'description' => sprintf(
1950 1950
 				/* translators: %s: site icon size in pixels */
1951
-				__( 'The Site Icon is used as a browser and app icon for your site. Icons must be square, and at least %s pixels wide and tall.' ),
1951
+				__('The Site Icon is used as a browser and app icon for your site. Icons must be square, and at least %s pixels wide and tall.'),
1952 1952
 				'<strong>512</strong>'
1953 1953
 			),
1954 1954
 			'section'     => 'title_tagline',
1955 1955
 			'priority'    => 60,
1956 1956
 			'height'      => 512,
1957 1957
 			'width'       => 512,
1958
-		) ) );
1958
+		)));
1959 1959
 
1960
-		$this->add_setting( 'custom_logo', array(
1961
-			'theme_supports' => array( 'custom-logo' ),
1960
+		$this->add_setting('custom_logo', array(
1961
+			'theme_supports' => array('custom-logo'),
1962 1962
 			'transport'      => 'postMessage',
1963
-		) );
1963
+		));
1964 1964
 
1965
-		$this->add_control( new WP_Customize_Media_Control( $this, 'custom_logo', array(
1966
-			'label'    => __( 'Logo' ),
1965
+		$this->add_control(new WP_Customize_Media_Control($this, 'custom_logo', array(
1966
+			'label'    => __('Logo'),
1967 1967
 			'section'  => 'title_tagline',
1968 1968
 			'priority' => 8,
1969 1969
 			'mime_type' => 'image',
1970 1970
 			'button_labels' => array(
1971
-				'select'       => __( 'Select logo' ),
1972
-				'change'       => __( 'Change logo' ),
1973
-				'remove'       => __( 'Remove' ),
1974
-				'default'      => __( 'Default' ),
1975
-				'placeholder'  => __( 'No logo selected' ),
1976
-				'frame_title'  => __( 'Select logo' ),
1977
-				'frame_button' => __( 'Choose logo' ),
1971
+				'select'       => __('Select logo'),
1972
+				'change'       => __('Change logo'),
1973
+				'remove'       => __('Remove'),
1974
+				'default'      => __('Default'),
1975
+				'placeholder'  => __('No logo selected'),
1976
+				'frame_title'  => __('Select logo'),
1977
+				'frame_button' => __('Choose logo'),
1978 1978
 			),
1979
-		) ) );
1979
+		)));
1980 1980
 
1981
-		if ( isset( $this->selective_refresh ) ) {
1982
-			$this->selective_refresh->add_partial( 'custom_logo', array(
1983
-				'settings'            => array( 'custom_logo' ),
1981
+		if (isset($this->selective_refresh)) {
1982
+			$this->selective_refresh->add_partial('custom_logo', array(
1983
+				'settings'            => array('custom_logo'),
1984 1984
 				'selector'            => '.custom-logo-link',
1985
-				'render_callback'     => array( $this, '_render_custom_logo_partial' ),
1985
+				'render_callback'     => array($this, '_render_custom_logo_partial'),
1986 1986
 				'container_inclusive' => true,
1987
-			) );
1987
+			));
1988 1988
 		}
1989 1989
 
1990 1990
 		/* Colors */
1991 1991
 
1992
-		$this->add_section( 'colors', array(
1993
-			'title'          => __( 'Colors' ),
1992
+		$this->add_section('colors', array(
1993
+			'title'          => __('Colors'),
1994 1994
 			'priority'       => 40,
1995
-		) );
1995
+		));
1996 1996
 
1997
-		$this->add_setting( 'header_textcolor', array(
1998
-			'theme_supports' => array( 'custom-header', 'header-text' ),
1999
-			'default'        => get_theme_support( 'custom-header', 'default-text-color' ),
1997
+		$this->add_setting('header_textcolor', array(
1998
+			'theme_supports' => array('custom-header', 'header-text'),
1999
+			'default'        => get_theme_support('custom-header', 'default-text-color'),
2000 2000
 
2001
-			'sanitize_callback'    => array( $this, '_sanitize_header_textcolor' ),
2001
+			'sanitize_callback'    => array($this, '_sanitize_header_textcolor'),
2002 2002
 			'sanitize_js_callback' => 'maybe_hash_hex_color',
2003
-		) );
2003
+		));
2004 2004
 
2005 2005
 		// Input type: checkbox
2006 2006
 		// With custom value
2007
-		$this->add_control( 'display_header_text', array(
2007
+		$this->add_control('display_header_text', array(
2008 2008
 			'settings' => 'header_textcolor',
2009
-			'label'    => __( 'Display Site Title and Tagline' ),
2009
+			'label'    => __('Display Site Title and Tagline'),
2010 2010
 			'section'  => 'title_tagline',
2011 2011
 			'type'     => 'checkbox',
2012 2012
 			'priority' => 40,
2013
-		) );
2013
+		));
2014 2014
 
2015
-		$this->add_control( new WP_Customize_Color_Control( $this, 'header_textcolor', array(
2016
-			'label'   => __( 'Header Text Color' ),
2015
+		$this->add_control(new WP_Customize_Color_Control($this, 'header_textcolor', array(
2016
+			'label'   => __('Header Text Color'),
2017 2017
 			'section' => 'colors',
2018
-		) ) );
2018
+		)));
2019 2019
 
2020 2020
 		// Input type: Color
2021 2021
 		// With sanitize_callback
2022
-		$this->add_setting( 'background_color', array(
2023
-			'default'        => get_theme_support( 'custom-background', 'default-color' ),
2022
+		$this->add_setting('background_color', array(
2023
+			'default'        => get_theme_support('custom-background', 'default-color'),
2024 2024
 			'theme_supports' => 'custom-background',
2025 2025
 
2026 2026
 			'sanitize_callback'    => 'sanitize_hex_color_no_hash',
2027 2027
 			'sanitize_js_callback' => 'maybe_hash_hex_color',
2028
-		) );
2028
+		));
2029 2029
 
2030
-		$this->add_control( new WP_Customize_Color_Control( $this, 'background_color', array(
2031
-			'label'   => __( 'Background Color' ),
2030
+		$this->add_control(new WP_Customize_Color_Control($this, 'background_color', array(
2031
+			'label'   => __('Background Color'),
2032 2032
 			'section' => 'colors',
2033
-		) ) );
2033
+		)));
2034 2034
 
2035 2035
 
2036 2036
 		/* Custom Header */
2037 2037
 
2038
-		$this->add_section( 'header_image', array(
2039
-			'title'          => __( 'Header Image' ),
2038
+		$this->add_section('header_image', array(
2039
+			'title'          => __('Header Image'),
2040 2040
 			'theme_supports' => 'custom-header',
2041 2041
 			'priority'       => 60,
2042
-		) );
2042
+		));
2043 2043
 
2044
-		$this->add_setting( new WP_Customize_Filter_Setting( $this, 'header_image', array(
2045
-			'default'        => get_theme_support( 'custom-header', 'default-image' ),
2044
+		$this->add_setting(new WP_Customize_Filter_Setting($this, 'header_image', array(
2045
+			'default'        => get_theme_support('custom-header', 'default-image'),
2046 2046
 			'theme_supports' => 'custom-header',
2047
-		) ) );
2047
+		)));
2048 2048
 
2049
-		$this->add_setting( new WP_Customize_Header_Image_Setting( $this, 'header_image_data', array(
2049
+		$this->add_setting(new WP_Customize_Header_Image_Setting($this, 'header_image_data', array(
2050 2050
 			// 'default'        => get_theme_support( 'custom-header', 'default-image' ),
2051 2051
 			'theme_supports' => 'custom-header',
2052
-		) ) );
2052
+		)));
2053 2053
 
2054
-		$this->add_control( new WP_Customize_Header_Image_Control( $this ) );
2054
+		$this->add_control(new WP_Customize_Header_Image_Control($this));
2055 2055
 
2056 2056
 		/* Custom Background */
2057 2057
 
2058
-		$this->add_section( 'background_image', array(
2059
-			'title'          => __( 'Background Image' ),
2058
+		$this->add_section('background_image', array(
2059
+			'title'          => __('Background Image'),
2060 2060
 			'theme_supports' => 'custom-background',
2061 2061
 			'priority'       => 80,
2062
-		) );
2062
+		));
2063 2063
 
2064
-		$this->add_setting( 'background_image', array(
2065
-			'default'        => get_theme_support( 'custom-background', 'default-image' ),
2064
+		$this->add_setting('background_image', array(
2065
+			'default'        => get_theme_support('custom-background', 'default-image'),
2066 2066
 			'theme_supports' => 'custom-background',
2067
-		) );
2067
+		));
2068 2068
 
2069
-		$this->add_setting( new WP_Customize_Background_Image_Setting( $this, 'background_image_thumb', array(
2069
+		$this->add_setting(new WP_Customize_Background_Image_Setting($this, 'background_image_thumb', array(
2070 2070
 			'theme_supports' => 'custom-background',
2071
-		) ) );
2071
+		)));
2072 2072
 
2073
-		$this->add_control( new WP_Customize_Background_Image_Control( $this ) );
2073
+		$this->add_control(new WP_Customize_Background_Image_Control($this));
2074 2074
 
2075
-		$this->add_setting( 'background_repeat', array(
2076
-			'default'        => get_theme_support( 'custom-background', 'default-repeat' ),
2075
+		$this->add_setting('background_repeat', array(
2076
+			'default'        => get_theme_support('custom-background', 'default-repeat'),
2077 2077
 			'theme_supports' => 'custom-background',
2078
-		) );
2078
+		));
2079 2079
 
2080
-		$this->add_control( 'background_repeat', array(
2081
-			'label'      => __( 'Background Repeat' ),
2080
+		$this->add_control('background_repeat', array(
2081
+			'label'      => __('Background Repeat'),
2082 2082
 			'section'    => 'background_image',
2083 2083
 			'type'       => 'radio',
2084 2084
 			'choices'    => array(
@@ -2087,15 +2087,15 @@  discard block
 block discarded – undo
2087 2087
 				'repeat-x'   => __('Tile Horizontally'),
2088 2088
 				'repeat-y'   => __('Tile Vertically'),
2089 2089
 			),
2090
-		) );
2090
+		));
2091 2091
 
2092
-		$this->add_setting( 'background_position_x', array(
2093
-			'default'        => get_theme_support( 'custom-background', 'default-position-x' ),
2092
+		$this->add_setting('background_position_x', array(
2093
+			'default'        => get_theme_support('custom-background', 'default-position-x'),
2094 2094
 			'theme_supports' => 'custom-background',
2095
-		) );
2095
+		));
2096 2096
 
2097
-		$this->add_control( 'background_position_x', array(
2098
-			'label'      => __( 'Background Position' ),
2097
+		$this->add_control('background_position_x', array(
2098
+			'label'      => __('Background Position'),
2099 2099
 			'section'    => 'background_image',
2100 2100
 			'type'       => 'radio',
2101 2101
 			'choices'    => array(
@@ -2103,28 +2103,28 @@  discard block
 block discarded – undo
2103 2103
 				'center'     => __('Center'),
2104 2104
 				'right'      => __('Right'),
2105 2105
 			),
2106
-		) );
2106
+		));
2107 2107
 
2108
-		$this->add_setting( 'background_attachment', array(
2109
-			'default'        => get_theme_support( 'custom-background', 'default-attachment' ),
2108
+		$this->add_setting('background_attachment', array(
2109
+			'default'        => get_theme_support('custom-background', 'default-attachment'),
2110 2110
 			'theme_supports' => 'custom-background',
2111
-		) );
2111
+		));
2112 2112
 
2113
-		$this->add_control( 'background_attachment', array(
2114
-			'label'      => __( 'Background Attachment' ),
2113
+		$this->add_control('background_attachment', array(
2114
+			'label'      => __('Background Attachment'),
2115 2115
 			'section'    => 'background_image',
2116 2116
 			'type'       => 'radio',
2117 2117
 			'choices'    => array(
2118 2118
 				'scroll'     => __('Scroll'),
2119 2119
 				'fixed'      => __('Fixed'),
2120 2120
 			),
2121
-		) );
2121
+		));
2122 2122
 
2123 2123
 		// If the theme is using the default background callback, we can update
2124 2124
 		// the background CSS using postMessage.
2125
-		if ( get_theme_support( 'custom-background', 'wp-head-callback' ) === '_custom_background_cb' ) {
2126
-			foreach ( array( 'color', 'image', 'position_x', 'repeat', 'attachment' ) as $prop ) {
2127
-				$this->get_setting( 'background_' . $prop )->transport = 'postMessage';
2125
+		if (get_theme_support('custom-background', 'wp-head-callback') === '_custom_background_cb') {
2126
+			foreach (array('color', 'image', 'position_x', 'repeat', 'attachment') as $prop) {
2127
+				$this->get_setting('background_'.$prop)->transport = 'postMessage';
2128 2128
 			}
2129 2129
 		}
2130 2130
 
@@ -2132,54 +2132,54 @@  discard block
 block discarded – undo
2132 2132
 		// #WP19627
2133 2133
 
2134 2134
 		// Replicate behavior from options-reading.php and hide front page options if there are no pages
2135
-		if ( get_pages() ) {
2136
-			$this->add_section( 'static_front_page', array(
2137
-				'title'          => __( 'Static Front Page' ),
2135
+		if (get_pages()) {
2136
+			$this->add_section('static_front_page', array(
2137
+				'title'          => __('Static Front Page'),
2138 2138
 			//	'theme_supports' => 'static-front-page',
2139 2139
 				'priority'       => 120,
2140
-				'description'    => __( 'Your theme supports a static front page.' ),
2141
-			) );
2140
+				'description'    => __('Your theme supports a static front page.'),
2141
+			));
2142 2142
 
2143
-			$this->add_setting( 'show_on_front', array(
2144
-				'default'        => get_option( 'show_on_front' ),
2143
+			$this->add_setting('show_on_front', array(
2144
+				'default'        => get_option('show_on_front'),
2145 2145
 				'capability'     => 'manage_options',
2146 2146
 				'type'           => 'option',
2147 2147
 			//	'theme_supports' => 'static-front-page',
2148
-			) );
2148
+			));
2149 2149
 
2150
-			$this->add_control( 'show_on_front', array(
2151
-				'label'   => __( 'Front page displays' ),
2150
+			$this->add_control('show_on_front', array(
2151
+				'label'   => __('Front page displays'),
2152 2152
 				'section' => 'static_front_page',
2153 2153
 				'type'    => 'radio',
2154 2154
 				'choices' => array(
2155
-					'posts' => __( 'Your latest posts' ),
2156
-					'page'  => __( 'A static page' ),
2155
+					'posts' => __('Your latest posts'),
2156
+					'page'  => __('A static page'),
2157 2157
 				),
2158
-			) );
2158
+			));
2159 2159
 
2160
-			$this->add_setting( 'page_on_front', array(
2160
+			$this->add_setting('page_on_front', array(
2161 2161
 				'type'       => 'option',
2162 2162
 				'capability' => 'manage_options',
2163 2163
 			//	'theme_supports' => 'static-front-page',
2164
-			) );
2164
+			));
2165 2165
 
2166
-			$this->add_control( 'page_on_front', array(
2167
-				'label'      => __( 'Front page' ),
2166
+			$this->add_control('page_on_front', array(
2167
+				'label'      => __('Front page'),
2168 2168
 				'section'    => 'static_front_page',
2169 2169
 				'type'       => 'dropdown-pages',
2170
-			) );
2170
+			));
2171 2171
 
2172
-			$this->add_setting( 'page_for_posts', array(
2172
+			$this->add_setting('page_for_posts', array(
2173 2173
 				'type'           => 'option',
2174 2174
 				'capability'     => 'manage_options',
2175 2175
 			//	'theme_supports' => 'static-front-page',
2176
-			) );
2176
+			));
2177 2177
 
2178
-			$this->add_control( 'page_for_posts', array(
2179
-				'label'      => __( 'Posts page' ),
2178
+			$this->add_control('page_for_posts', array(
2179
+				'label'      => __('Posts page'),
2180 2180
 				'section'    => 'static_front_page',
2181 2181
 				'type'       => 'dropdown-pages',
2182
-			) );
2182
+			));
2183 2183
 		}
2184 2184
 	}
2185 2185
 
@@ -2192,7 +2192,7 @@  discard block
 block discarded – undo
2192 2192
 	 * @see add_dynamic_settings()
2193 2193
 	 */
2194 2194
 	public function register_dynamic_settings() {
2195
-		$this->add_dynamic_settings( array_keys( $this->unsanitized_post_values() ) );
2195
+		$this->add_dynamic_settings(array_keys($this->unsanitized_post_values()));
2196 2196
 	}
2197 2197
 
2198 2198
 	/**
@@ -2206,13 +2206,13 @@  discard block
 block discarded – undo
2206 2206
 	 * @param string $color
2207 2207
 	 * @return mixed
2208 2208
 	 */
2209
-	public function _sanitize_header_textcolor( $color ) {
2210
-		if ( 'blank' === $color )
2209
+	public function _sanitize_header_textcolor($color) {
2210
+		if ('blank' === $color)
2211 2211
 			return 'blank';
2212 2212
 
2213
-		$color = sanitize_hex_color_no_hash( $color );
2214
-		if ( empty( $color ) )
2215
-			$color = get_theme_support( 'custom-header', 'default-text-color' );
2213
+		$color = sanitize_hex_color_no_hash($color);
2214
+		if (empty($color))
2215
+			$color = get_theme_support('custom-header', 'default-text-color');
2216 2216
 
2217 2217
 		return $color;
2218 2218
 	}
@@ -2249,12 +2249,12 @@  discard block
 block discarded – undo
2249 2249
  * @param string $color
2250 2250
  * @return string|void
2251 2251
  */
2252
-function sanitize_hex_color( $color ) {
2253
-	if ( '' === $color )
2252
+function sanitize_hex_color($color) {
2253
+	if ('' === $color)
2254 2254
 		return '';
2255 2255
 
2256 2256
 	// 3 or 6 hex digits, or the empty string.
2257
-	if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) )
2257
+	if (preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color))
2258 2258
 		return $color;
2259 2259
 }
2260 2260
 
@@ -2272,13 +2272,13 @@  discard block
 block discarded – undo
2272 2272
  * @param string $color
2273 2273
  * @return string|null
2274 2274
  */
2275
-function sanitize_hex_color_no_hash( $color ) {
2276
-	$color = ltrim( $color, '#' );
2275
+function sanitize_hex_color_no_hash($color) {
2276
+	$color = ltrim($color, '#');
2277 2277
 
2278
-	if ( '' === $color )
2278
+	if ('' === $color)
2279 2279
 		return '';
2280 2280
 
2281
-	return sanitize_hex_color( '#' . $color ) ? $color : null;
2281
+	return sanitize_hex_color('#'.$color) ? $color : null;
2282 2282
 }
2283 2283
 
2284 2284
 /**
@@ -2292,9 +2292,9 @@  discard block
 block discarded – undo
2292 2292
  * @param string $color
2293 2293
  * @return string
2294 2294
  */
2295
-function maybe_hash_hex_color( $color ) {
2296
-	if ( $unhashed = sanitize_hex_color_no_hash( $color ) )
2297
-		return '#' . $unhashed;
2295
+function maybe_hash_hex_color($color) {
2296
+	if ($unhashed = sanitize_hex_color_no_hash($color))
2297
+		return '#'.$unhashed;
2298 2298
 
2299 2299
 	return $color;
2300 2300
 }
Please login to merge, or discard this patch.
src/wp-includes/class-wp-editor.php 2 patches
Braces   +75 added lines, -52 removed lines patch added patch discarded remove patch
@@ -105,31 +105,36 @@  discard block
 block discarded – undo
105 105
 
106 106
 		self::$this_quicktags = (bool) $set['quicktags'];
107 107
 
108
-		if ( self::$this_tinymce )
109
-			self::$has_tinymce = true;
108
+		if ( self::$this_tinymce ) {
109
+					self::$has_tinymce = true;
110
+		}
110 111
 
111
-		if ( self::$this_quicktags )
112
-			self::$has_quicktags = true;
112
+		if ( self::$this_quicktags ) {
113
+					self::$has_quicktags = true;
114
+		}
113 115
 
114 116
 		if ( $set['dfw'] ) {
115 117
 			self::$old_dfw_compat = true;
116 118
 		}
117 119
 
118
-		if ( empty( $set['editor_height'] ) )
119
-			return $set;
120
+		if ( empty( $set['editor_height'] ) ) {
121
+					return $set;
122
+		}
120 123
 
121 124
 		if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) {
122 125
 			// A cookie (set when a user resizes the editor) overrides the height.
123 126
 			$cookie = (int) get_user_setting( 'ed_size' );
124 127
 
125
-			if ( $cookie )
126
-				$set['editor_height'] = $cookie;
128
+			if ( $cookie ) {
129
+							$set['editor_height'] = $cookie;
130
+			}
127 131
 		}
128 132
 
129
-		if ( $set['editor_height'] < 50 )
130
-			$set['editor_height'] = 50;
131
-		elseif ( $set['editor_height'] > 5000 )
132
-			$set['editor_height'] = 5000;
133
+		if ( $set['editor_height'] < 50 ) {
134
+					$set['editor_height'] = 50;
135
+		} elseif ( $set['editor_height'] > 5000 ) {
136
+					$set['editor_height'] = 5000;
137
+		}
133 138
 
134 139
 		return $set;
135 140
 	}
@@ -207,8 +212,9 @@  discard block
 block discarded – undo
207 212
 			if ( $set['media_buttons'] ) {
208 213
 				self::$has_medialib = true;
209 214
 
210
-				if ( ! function_exists( 'media_buttons' ) )
211
-					include( ABSPATH . 'wp-admin/includes/media.php' );
215
+				if ( ! function_exists( 'media_buttons' ) ) {
216
+									include( ABSPATH . 'wp-admin/includes/media.php' );
217
+				}
212 218
 
213 219
 				echo '<div id="wp-' . $editor_id_attr . '-media-buttons" class="wp-media-buttons">';
214 220
 
@@ -316,11 +322,13 @@  discard block
 block discarded – undo
316 322
 				'buttons' => ''
317 323
 			);
318 324
 
319
-			if ( is_array($set['quicktags']) )
320
-				$qtInit = array_merge($qtInit, $set['quicktags']);
325
+			if ( is_array($set['quicktags']) ) {
326
+							$qtInit = array_merge($qtInit, $set['quicktags']);
327
+			}
321 328
 
322
-			if ( empty($qtInit['buttons']) )
323
-				$qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
329
+			if ( empty($qtInit['buttons']) ) {
330
+							$qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
331
+			}
324 332
 
325 333
 			if ( $set['_content_editor_dfw'] ) {
326 334
 				$qtInit['buttons'] .= ',dfw';
@@ -475,14 +483,17 @@  discard block
 block discarded – undo
475 483
 								$path = str_replace( content_url(), '', $plugurl );
476 484
 								$path = WP_CONTENT_DIR . $path . '/langs/';
477 485
 
478
-								if ( function_exists('realpath') )
479
-									$path = trailingslashit( realpath($path) );
486
+								if ( function_exists('realpath') ) {
487
+																	$path = trailingslashit( realpath($path) );
488
+								}
480 489
 
481
-								if ( @is_file( $path . $mce_locale . '.js' ) )
482
-									$strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n";
490
+								if ( @is_file( $path . $mce_locale . '.js' ) ) {
491
+																	$strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n";
492
+								}
483 493
 
484
-								if ( @is_file( $path . $mce_locale . '_dlg.js' ) )
485
-									$strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n";
494
+								if ( @is_file( $path . $mce_locale . '_dlg.js' ) ) {
495
+																	$strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n";
496
+								}
486 497
 
487 498
 								if ( 'en' != $mce_locale && empty( $strings ) ) {
488 499
 									if ( @is_file( $path . 'en.js' ) ) {
@@ -496,8 +507,9 @@  discard block
 block discarded – undo
496 507
 									}
497 508
 								}
498 509
 
499
-								if ( ! empty( $strings ) )
500
-									$ext_plugins .= "\n" . $strings . "\n";
510
+								if ( ! empty( $strings ) ) {
511
+																	$ext_plugins .= "\n" . $strings . "\n";
512
+								}
501 513
 							}
502 514
 
503 515
 							$ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n";
@@ -577,8 +589,9 @@  discard block
 block discarded – undo
577 589
 				 */
578 590
 				$mce_css = trim( apply_filters( 'mce_css', implode( ',', $mce_css ) ), ' ,' );
579 591
 
580
-				if ( ! empty($mce_css) )
581
-					self::$first_init['content_css'] = $mce_css;
592
+				if ( ! empty($mce_css) ) {
593
+									self::$first_init['content_css'] = $mce_css;
594
+				}
582 595
 			}
583 596
 
584 597
 			if ( $set['teeny'] ) {
@@ -657,10 +670,11 @@  discard block
 block discarded – undo
657 670
 				$body_class .= ' post-type-' . sanitize_html_class( $post->post_type ) . ' post-status-' . sanitize_html_class( $post->post_status );
658 671
 				if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
659 672
 					$post_format = get_post_format( $post );
660
-					if ( $post_format && ! is_wp_error( $post_format ) )
661
-						$body_class .= ' post-format-' . sanitize_html_class( $post_format );
662
-					else
663
-						$body_class .= ' post-format-standard';
673
+					if ( $post_format && ! is_wp_error( $post_format ) ) {
674
+											$body_class .= ' post-format-' . sanitize_html_class( $post_format );
675
+					} else {
676
+											$body_class .= ' post-format-standard';
677
+					}
664 678
 				}
665 679
 			}
666 680
 
@@ -688,8 +702,9 @@  discard block
 block discarded – undo
688 702
 			// Merge with the first part of the init array
689 703
 			$mceInit = array_merge( self::$first_init, $mceInit );
690 704
 
691
-			if ( is_array( $set['tinymce'] ) )
692
-				$mceInit = array_merge( $mceInit, $set['tinymce'] );
705
+			if ( is_array( $set['tinymce'] ) ) {
706
+							$mceInit = array_merge( $mceInit, $set['tinymce'] );
707
+			}
693 708
 
694 709
 			/*
695 710
 			 * For people who really REALLY know what they're doing with TinyMCE
@@ -761,8 +776,9 @@  discard block
 block discarded – undo
761 776
 	 * @static
762 777
 	 */
763 778
 	public static function enqueue_scripts() {
764
-		if ( self::$has_tinymce )
765
-			wp_enqueue_script('editor');
779
+		if ( self::$has_tinymce ) {
780
+					wp_enqueue_script('editor');
781
+		}
766 782
 
767 783
 		if ( self::$has_quicktags ) {
768 784
 			wp_enqueue_script( 'quicktags' );
@@ -1131,8 +1147,9 @@  discard block
 block discarded – undo
1131 1147
 		$version = 'ver=' . $tinymce_version;
1132 1148
 		$tmce_on = !empty(self::$mce_settings);
1133 1149
 
1134
-		if ( ! isset($concatenate_scripts) )
1135
-			script_concat_settings();
1150
+		if ( ! isset($concatenate_scripts) ) {
1151
+					script_concat_settings();
1152
+		}
1136 1153
 
1137 1154
 		$compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
1138 1155
 			&& false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
@@ -1229,11 +1246,13 @@  discard block
 block discarded – undo
1229 1246
 		<script type="text/javascript">
1230 1247
 		<?php
1231 1248
 
1232
-		if ( self::$ext_plugins )
1233
-			echo self::$ext_plugins . "\n";
1249
+		if ( self::$ext_plugins ) {
1250
+					echo self::$ext_plugins . "\n";
1251
+		}
1234 1252
 
1235
-		if ( ! is_admin() )
1236
-			echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";';
1253
+		if ( ! is_admin() ) {
1254
+					echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";';
1255
+		}
1237 1256
 
1238 1257
 		?>
1239 1258
 
@@ -1268,8 +1287,9 @@  discard block
 block discarded – undo
1268 1287
 		</script>
1269 1288
 		<?php
1270 1289
 
1271
-		if ( in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) )
1272
-			self::wp_link_dialog();
1290
+		if ( in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) ) {
1291
+					self::wp_link_dialog();
1292
+		}
1273 1293
 
1274 1294
 		/**
1275 1295
 		 * Fires after any core TinyMCE editor instances are created.
@@ -1314,8 +1334,9 @@  discard block
 block discarded – undo
1314 1334
 
1315 1335
 		$args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1;
1316 1336
 
1317
-		if ( isset( $args['s'] ) )
1318
-			$query['s'] = $args['s'];
1337
+		if ( isset( $args['s'] ) ) {
1338
+					$query['s'] = $args['s'];
1339
+		}
1319 1340
 
1320 1341
 		$query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
1321 1342
 
@@ -1336,16 +1357,18 @@  discard block
 block discarded – undo
1336 1357
 		$get_posts = new WP_Query;
1337 1358
 		$posts = $get_posts->query( $query );
1338 1359
 		// Check if any posts were found.
1339
-		if ( ! $get_posts->post_count )
1340
-			return false;
1360
+		if ( ! $get_posts->post_count ) {
1361
+					return false;
1362
+		}
1341 1363
 
1342 1364
 		// Build results.
1343 1365
 		$results = array();
1344 1366
 		foreach ( $posts as $post ) {
1345
-			if ( 'post' == $post->post_type )
1346
-				$info = mysql2date( __( 'Y/m/d' ), $post->post_date );
1347
-			else
1348
-				$info = $pts[ $post->post_type ]->labels->singular_name;
1367
+			if ( 'post' == $post->post_type ) {
1368
+							$info = mysql2date( __( 'Y/m/d' ), $post->post_date );
1369
+			} else {
1370
+							$info = $pts[ $post->post_type ]->labels->singular_name;
1371
+			}
1349 1372
 
1350 1373
 			$results[] = array(
1351 1374
 				'ID' => $post->ID,
Please login to merge, or discard this patch.
Spacing   +490 added lines, -490 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 * }
63 63
 	 * @return array Parsed arguments array.
64 64
 	 */
65
-	public static function parse_settings( $editor_id, $settings ) {
65
+	public static function parse_settings($editor_id, $settings) {
66 66
 
67 67
 		/**
68 68
 		 * Filter the wp_editor() settings.
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 		 * @param array  $settings  Array of editor arguments.
75 75
 		 * @param string $editor_id ID for the current editor instance.
76 76
 		 */
77
-		$settings = apply_filters( 'wp_editor_settings', $settings, $editor_id );
77
+		$settings = apply_filters('wp_editor_settings', $settings, $editor_id);
78 78
 
79
-		$set = wp_parse_args( $settings, array(
79
+		$set = wp_parse_args($settings, array(
80 80
 			'wpautop'             => true,
81 81
 			'media_buttons'       => true,
82 82
 			'default_editor'      => '',
@@ -92,43 +92,43 @@  discard block
 block discarded – undo
92 92
 			'_content_editor_dfw' => false,
93 93
 			'tinymce'             => true,
94 94
 			'quicktags'           => true
95
-		) );
95
+		));
96 96
 
97
-		self::$this_tinymce = ( $set['tinymce'] && user_can_richedit() );
97
+		self::$this_tinymce = ($set['tinymce'] && user_can_richedit());
98 98
 
99
-		if ( self::$this_tinymce ) {
100
-			if ( false !== strpos( $editor_id, '[' ) ) {
99
+		if (self::$this_tinymce) {
100
+			if (false !== strpos($editor_id, '[')) {
101 101
 				self::$this_tinymce = false;
102
-				_deprecated_argument( 'wp_editor()', '3.9', 'TinyMCE editor IDs cannot have brackets.' );
102
+				_deprecated_argument('wp_editor()', '3.9', 'TinyMCE editor IDs cannot have brackets.');
103 103
 			}
104 104
 		}
105 105
 
106 106
 		self::$this_quicktags = (bool) $set['quicktags'];
107 107
 
108
-		if ( self::$this_tinymce )
108
+		if (self::$this_tinymce)
109 109
 			self::$has_tinymce = true;
110 110
 
111
-		if ( self::$this_quicktags )
111
+		if (self::$this_quicktags)
112 112
 			self::$has_quicktags = true;
113 113
 
114
-		if ( $set['dfw'] ) {
114
+		if ($set['dfw']) {
115 115
 			self::$old_dfw_compat = true;
116 116
 		}
117 117
 
118
-		if ( empty( $set['editor_height'] ) )
118
+		if (empty($set['editor_height']))
119 119
 			return $set;
120 120
 
121
-		if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) {
121
+		if ('content' === $editor_id && empty($set['tinymce']['wp_autoresize_on'])) {
122 122
 			// A cookie (set when a user resizes the editor) overrides the height.
123
-			$cookie = (int) get_user_setting( 'ed_size' );
123
+			$cookie = (int) get_user_setting('ed_size');
124 124
 
125
-			if ( $cookie )
125
+			if ($cookie)
126 126
 				$set['editor_height'] = $cookie;
127 127
 		}
128 128
 
129
-		if ( $set['editor_height'] < 50 )
129
+		if ($set['editor_height'] < 50)
130 130
 			$set['editor_height'] = 50;
131
-		elseif ( $set['editor_height'] > 5000 )
131
+		elseif ($set['editor_height'] > 5000)
132 132
 			$set['editor_height'] = 5000;
133 133
 
134 134
 		return $set;
@@ -142,75 +142,75 @@  discard block
 block discarded – undo
142 142
 	 * @param string $editor_id ID for the textarea and TinyMCE and Quicktags instances (can contain only ASCII letters and numbers).
143 143
 	 * @param array $settings See the _parse_settings() method for description.
144 144
 	 */
145
-	public static function editor( $content, $editor_id, $settings = array() ) {
146
-		$set = self::parse_settings( $editor_id, $settings );
147
-		$editor_class = ' class="' . trim( esc_attr( $set['editor_class'] ) . ' wp-editor-area' ) . '"';
148
-		$tabindex = $set['tabindex'] ? ' tabindex="' . (int) $set['tabindex'] . '"' : '';
145
+	public static function editor($content, $editor_id, $settings = array()) {
146
+		$set = self::parse_settings($editor_id, $settings);
147
+		$editor_class = ' class="'.trim(esc_attr($set['editor_class']).' wp-editor-area').'"';
148
+		$tabindex = $set['tabindex'] ? ' tabindex="'.(int) $set['tabindex'].'"' : '';
149 149
 		$default_editor = 'html';
150 150
 		$buttons = $autocomplete = '';
151
-		$editor_id_attr = esc_attr( $editor_id );
151
+		$editor_id_attr = esc_attr($editor_id);
152 152
 
153
-		if ( $set['drag_drop_upload'] ) {
153
+		if ($set['drag_drop_upload']) {
154 154
 			self::$drag_drop_upload = true;
155 155
 		}
156 156
 
157
-		if ( ! empty( $set['editor_height'] ) ) {
158
-			$height = ' style="height: ' . (int) $set['editor_height'] . 'px"';
157
+		if ( ! empty($set['editor_height'])) {
158
+			$height = ' style="height: '.(int) $set['editor_height'].'px"';
159 159
 		} else {
160
-			$height = ' rows="' . (int) $set['textarea_rows'] . '"';
160
+			$height = ' rows="'.(int) $set['textarea_rows'].'"';
161 161
 		}
162 162
 
163
-		if ( ! current_user_can( 'upload_files' ) ) {
163
+		if ( ! current_user_can('upload_files')) {
164 164
 			$set['media_buttons'] = false;
165 165
 		}
166 166
 
167
-		if ( self::$this_tinymce ) {
167
+		if (self::$this_tinymce) {
168 168
 			$autocomplete = ' autocomplete="off"';
169 169
 
170
-			if ( self::$this_quicktags ) {
170
+			if (self::$this_quicktags) {
171 171
 				$default_editor = $set['default_editor'] ? $set['default_editor'] : wp_default_editor();
172 172
 				// 'html' is used for the "Text" editor tab.
173
-				if ( 'html' !== $default_editor ) {
173
+				if ('html' !== $default_editor) {
174 174
 					$default_editor = 'tinymce';
175 175
 				}
176 176
 
177
-				$buttons .= '<button type="button" id="' . $editor_id_attr . '-tmce" class="wp-switch-editor switch-tmce"' .
178
-					' data-wp-editor-id="' . $editor_id_attr . '">' . __('Visual') . "</button>\n";
179
-				$buttons .= '<button type="button" id="' . $editor_id_attr . '-html" class="wp-switch-editor switch-html"' .
180
-					' data-wp-editor-id="' . $editor_id_attr . '">' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . "</button>\n";
177
+				$buttons .= '<button type="button" id="'.$editor_id_attr.'-tmce" class="wp-switch-editor switch-tmce"'.
178
+					' data-wp-editor-id="'.$editor_id_attr.'">'.__('Visual')."</button>\n";
179
+				$buttons .= '<button type="button" id="'.$editor_id_attr.'-html" class="wp-switch-editor switch-html"'.
180
+					' data-wp-editor-id="'.$editor_id_attr.'">'._x('Text', 'Name for the Text editor tab (formerly HTML)')."</button>\n";
181 181
 			} else {
182 182
 				$default_editor = 'tinymce';
183 183
 			}
184 184
 		}
185 185
 
186 186
 		$switch_class = 'html' === $default_editor ? 'html-active' : 'tmce-active';
187
-		$wrap_class = 'wp-core-ui wp-editor-wrap ' . $switch_class;
187
+		$wrap_class = 'wp-core-ui wp-editor-wrap '.$switch_class;
188 188
 
189
-		if ( $set['_content_editor_dfw'] ) {
189
+		if ($set['_content_editor_dfw']) {
190 190
 			$wrap_class .= ' has-dfw';
191 191
 		}
192 192
 
193
-		echo '<div id="wp-' . $editor_id_attr . '-wrap" class="' . $wrap_class . '">';
193
+		echo '<div id="wp-'.$editor_id_attr.'-wrap" class="'.$wrap_class.'">';
194 194
 
195
-		if ( self::$editor_buttons_css ) {
196
-			wp_print_styles( 'editor-buttons' );
195
+		if (self::$editor_buttons_css) {
196
+			wp_print_styles('editor-buttons');
197 197
 			self::$editor_buttons_css = false;
198 198
 		}
199 199
 
200
-		if ( ! empty( $set['editor_css'] ) ) {
201
-			echo $set['editor_css'] . "\n";
200
+		if ( ! empty($set['editor_css'])) {
201
+			echo $set['editor_css']."\n";
202 202
 		}
203 203
 
204
-		if ( ! empty( $buttons ) || $set['media_buttons'] ) {
205
-			echo '<div id="wp-' . $editor_id_attr . '-editor-tools" class="wp-editor-tools hide-if-no-js">';
204
+		if ( ! empty($buttons) || $set['media_buttons']) {
205
+			echo '<div id="wp-'.$editor_id_attr.'-editor-tools" class="wp-editor-tools hide-if-no-js">';
206 206
 
207
-			if ( $set['media_buttons'] ) {
207
+			if ($set['media_buttons']) {
208 208
 				self::$has_medialib = true;
209 209
 
210
-				if ( ! function_exists( 'media_buttons' ) )
211
-					include( ABSPATH . 'wp-admin/includes/media.php' );
210
+				if ( ! function_exists('media_buttons'))
211
+					include(ABSPATH.'wp-admin/includes/media.php');
212 212
 
213
-				echo '<div id="wp-' . $editor_id_attr . '-media-buttons" class="wp-media-buttons">';
213
+				echo '<div id="wp-'.$editor_id_attr.'-media-buttons" class="wp-media-buttons">';
214 214
 
215 215
 				/**
216 216
 				 * Fires after the default media button(s) are displayed.
@@ -219,24 +219,24 @@  discard block
 block discarded – undo
219 219
 				 *
220 220
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
221 221
 				 */
222
-				do_action( 'media_buttons', $editor_id );
222
+				do_action('media_buttons', $editor_id);
223 223
 				echo "</div>\n";
224 224
 			}
225 225
 
226
-			echo '<div class="wp-editor-tabs">' . $buttons . "</div>\n";
226
+			echo '<div class="wp-editor-tabs">'.$buttons."</div>\n";
227 227
 			echo "</div>\n";
228 228
 		}
229 229
 
230 230
 		$quicktags_toolbar = '';
231 231
 
232
-		if ( self::$this_quicktags ) {
233
-			if ( 'content' === $editor_id && ! empty( $GLOBALS['current_screen'] ) && $GLOBALS['current_screen']->base === 'post' ) {
232
+		if (self::$this_quicktags) {
233
+			if ('content' === $editor_id && ! empty($GLOBALS['current_screen']) && $GLOBALS['current_screen']->base === 'post') {
234 234
 				$toolbar_id = 'ed_toolbar';
235 235
 			} else {
236
-				$toolbar_id = 'qt_' . $editor_id_attr . '_toolbar';
236
+				$toolbar_id = 'qt_'.$editor_id_attr.'_toolbar';
237 237
 			}
238 238
 
239
-			$quicktags_toolbar = '<div id="' . $toolbar_id . '" class="quicktags-toolbar"></div>';
239
+			$quicktags_toolbar = '<div id="'.$toolbar_id.'" class="quicktags-toolbar"></div>';
240 240
 		}
241 241
 
242 242
 		/**
@@ -246,14 +246,14 @@  discard block
 block discarded – undo
246 246
 		 *
247 247
 		 * @param string $output Editor's HTML markup.
248 248
 		 */
249
-		$the_editor = apply_filters( 'the_editor', '<div id="wp-' . $editor_id_attr . '-editor-container" class="wp-editor-container">' .
250
-			$quicktags_toolbar .
251
-			'<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . esc_attr( $set['textarea_name'] ) . '" ' .
252
-			'id="' . $editor_id_attr . '">%s</textarea></div>' );
249
+		$the_editor = apply_filters('the_editor', '<div id="wp-'.$editor_id_attr.'-editor-container" class="wp-editor-container">'.
250
+			$quicktags_toolbar.
251
+			'<textarea'.$editor_class.$height.$tabindex.$autocomplete.' cols="40" name="'.esc_attr($set['textarea_name']).'" '.
252
+			'id="'.$editor_id_attr.'">%s</textarea></div>');
253 253
 
254 254
 		// Prepare the content for the Visual or Text editor, only when TinyMCE is used (back-compat).
255
-		if ( self::$this_tinymce ) {
256
-			add_filter( 'the_editor_content', 'format_for_editor', 10, 2 );
255
+		if (self::$this_tinymce) {
256
+			add_filter('the_editor_content', 'format_for_editor', 10, 2);
257 257
 		}
258 258
 
259 259
 		/**
@@ -265,31 +265,31 @@  discard block
 block discarded – undo
265 265
 		 * @param string $default_editor The default editor for the current user.
266 266
 		 *                               Either 'html' or 'tinymce'.
267 267
 		 */
268
-		$content = apply_filters( 'the_editor_content', $content, $default_editor );
268
+		$content = apply_filters('the_editor_content', $content, $default_editor);
269 269
 
270 270
 		// Remove the filter as the next editor on the same page may not need it.
271
-		if ( self::$this_tinymce ) {
272
-			remove_filter( 'the_editor_content', 'format_for_editor' );
271
+		if (self::$this_tinymce) {
272
+			remove_filter('the_editor_content', 'format_for_editor');
273 273
 		}
274 274
 
275 275
 		// Back-compat for the `htmledit_pre` and `richedit_pre` filters
276
-		if ( 'html' === $default_editor && has_filter( 'htmledit_pre' ) ) {
276
+		if ('html' === $default_editor && has_filter('htmledit_pre')) {
277 277
 			// TODO: needs _deprecated_filter(), use _deprecated_function() as substitute for now
278
-			_deprecated_function( 'add_filter( htmledit_pre )', '4.3.0', 'add_filter( format_for_editor )' );
279
-			$content = apply_filters( 'htmledit_pre', $content );
280
-		} elseif ( 'tinymce' === $default_editor && has_filter( 'richedit_pre' ) ) {
281
-			_deprecated_function( 'add_filter( richedit_pre )', '4.3.0', 'add_filter( format_for_editor )' );
282
-			$content = apply_filters( 'richedit_pre', $content );
278
+			_deprecated_function('add_filter( htmledit_pre )', '4.3.0', 'add_filter( format_for_editor )');
279
+			$content = apply_filters('htmledit_pre', $content);
280
+		} elseif ('tinymce' === $default_editor && has_filter('richedit_pre')) {
281
+			_deprecated_function('add_filter( richedit_pre )', '4.3.0', 'add_filter( format_for_editor )');
282
+			$content = apply_filters('richedit_pre', $content);
283 283
 		}
284 284
 
285
-		if ( false !== stripos( $content, 'textarea' ) ) {
286
-			$content = preg_replace( '%</textarea%i', '&lt;/textarea', $content );
285
+		if (false !== stripos($content, 'textarea')) {
286
+			$content = preg_replace('%</textarea%i', '&lt;/textarea', $content);
287 287
 		}
288 288
 
289
-		printf( $the_editor, $content );
289
+		printf($the_editor, $content);
290 290
 		echo "\n</div>\n\n";
291 291
 
292
-		self::editor_settings( $editor_id, $set );
292
+		self::editor_settings($editor_id, $set);
293 293
 	}
294 294
 
295 295
 	/**
@@ -304,30 +304,30 @@  discard block
 block discarded – undo
304 304
 	public static function editor_settings($editor_id, $set) {
305 305
 		global $wp_version, $tinymce_version;
306 306
 
307
-		if ( empty(self::$first_init) ) {
308
-			if ( is_admin() ) {
309
-				add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
310
-				add_action( 'admin_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );
307
+		if (empty(self::$first_init)) {
308
+			if (is_admin()) {
309
+				add_action('admin_print_footer_scripts', array(__CLASS__, 'editor_js'), 50);
310
+				add_action('admin_print_footer_scripts', array(__CLASS__, 'enqueue_scripts'), 1);
311 311
 			} else {
312
-				add_action( 'wp_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
313
-				add_action( 'wp_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );
312
+				add_action('wp_print_footer_scripts', array(__CLASS__, 'editor_js'), 50);
313
+				add_action('wp_print_footer_scripts', array(__CLASS__, 'enqueue_scripts'), 1);
314 314
 			}
315 315
 		}
316 316
 
317
-		if ( self::$this_quicktags ) {
317
+		if (self::$this_quicktags) {
318 318
 
319 319
 			$qtInit = array(
320 320
 				'id' => $editor_id,
321 321
 				'buttons' => ''
322 322
 			);
323 323
 
324
-			if ( is_array($set['quicktags']) )
324
+			if (is_array($set['quicktags']))
325 325
 				$qtInit = array_merge($qtInit, $set['quicktags']);
326 326
 
327
-			if ( empty($qtInit['buttons']) )
327
+			if (empty($qtInit['buttons']))
328 328
 				$qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
329 329
 
330
-			if ( $set['_content_editor_dfw'] ) {
330
+			if ($set['_content_editor_dfw']) {
331 331
 				$qtInit['buttons'] .= ',dfw';
332 332
 			}
333 333
 
@@ -339,26 +339,26 @@  discard block
 block discarded – undo
339 339
 			 * @param array  $qtInit    Quicktags settings.
340 340
 			 * @param string $editor_id The unique editor ID, e.g. 'content'.
341 341
 			 */
342
-			$qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id );
342
+			$qtInit = apply_filters('quicktags_settings', $qtInit, $editor_id);
343 343
 
344 344
 			self::$qt_settings[$editor_id] = $qtInit;
345 345
 
346
-			self::$qt_buttons = array_merge( self::$qt_buttons, explode(',', $qtInit['buttons']) );
346
+			self::$qt_buttons = array_merge(self::$qt_buttons, explode(',', $qtInit['buttons']));
347 347
 		}
348 348
 
349
-		if ( self::$this_tinymce ) {
349
+		if (self::$this_tinymce) {
350 350
 
351
-			if ( empty( self::$first_init ) ) {
352
-				self::$baseurl = includes_url( 'js/tinymce' );
351
+			if (empty(self::$first_init)) {
352
+				self::$baseurl = includes_url('js/tinymce');
353 353
 
354 354
 				$mce_locale = get_locale();
355
-				self::$mce_locale = $mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1
355
+				self::$mce_locale = $mce_locale = empty($mce_locale) ? 'en' : strtolower(substr($mce_locale, 0, 2)); // ISO 639-1
356 356
 
357 357
 				/** This filter is documented in wp-admin/includes/media.php */
358
-				$no_captions = (bool) apply_filters( 'disable_captions', '' );
358
+				$no_captions = (bool) apply_filters('disable_captions', '');
359 359
 				$ext_plugins = '';
360 360
 
361
-				if ( $set['teeny'] ) {
361
+				if ($set['teeny']) {
362 362
 
363 363
 					/**
364 364
 					 * Filter the list of teenyMCE plugins.
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 					 * @param array  $plugins   An array of teenyMCE plugins.
369 369
 					 * @param string $editor_id Unique editor identifier, e.g. 'content'.
370 370
 					 */
371
-					self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array( 'colorpicker', 'lists', 'fullscreen', 'image', 'wordpress', 'wpeditimage', 'wplink' ), $editor_id );
371
+					self::$plugins = $plugins = apply_filters('teeny_mce_plugins', array('colorpicker', 'lists', 'fullscreen', 'image', 'wordpress', 'wpeditimage', 'wplink'), $editor_id);
372 372
 				} else {
373 373
 
374 374
 					/**
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 					 *
389 389
 					 * @param array $external_plugins An array of external TinyMCE plugins.
390 390
 					 */
391
-					$mce_external_plugins = apply_filters( 'mce_external_plugins', array() );
391
+					$mce_external_plugins = apply_filters('mce_external_plugins', array());
392 392
 
393 393
 					$plugins = array(
394 394
 						'charmap',
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 						'wpembed',
413 413
 					);
414 414
 
415
-					if ( ! self::$has_medialib ) {
415
+					if ( ! self::$has_medialib) {
416 416
 						$plugins[] = 'image';
417 417
 					}
418 418
 
@@ -426,15 +426,15 @@  discard block
 block discarded – undo
426 426
 					 *
427 427
 					 * @param array $plugins An array of default TinyMCE plugins.
428 428
 					 */
429
-					$plugins = array_unique( apply_filters( 'tiny_mce_plugins', $plugins ) );
429
+					$plugins = array_unique(apply_filters('tiny_mce_plugins', $plugins));
430 430
 
431
-					if ( ( $key = array_search( 'spellchecker', $plugins ) ) !== false ) {
431
+					if (($key = array_search('spellchecker', $plugins)) !== false) {
432 432
 						// Remove 'spellchecker' from the internal plugins if added with 'tiny_mce_plugins' filter to prevent errors.
433 433
 						// It can be added with 'mce_external_plugins'.
434
-						unset( $plugins[$key] );
434
+						unset($plugins[$key]);
435 435
 					}
436 436
 
437
-					if ( ! empty( $mce_external_plugins ) ) {
437
+					if ( ! empty($mce_external_plugins)) {
438 438
 
439 439
 						/**
440 440
 						 * Filter the translations loaded for external TinyMCE 3.x plugins.
@@ -449,64 +449,64 @@  discard block
 block discarded – undo
449 449
 						 *
450 450
 						 * @param array $translations Translations for external TinyMCE plugins.
451 451
 						 */
452
-						$mce_external_languages = apply_filters( 'mce_external_languages', array() );
452
+						$mce_external_languages = apply_filters('mce_external_languages', array());
453 453
 
454 454
 						$loaded_langs = array();
455 455
 						$strings = '';
456 456
 
457
-						if ( ! empty( $mce_external_languages ) ) {
458
-							foreach ( $mce_external_languages as $name => $path ) {
459
-								if ( @is_file( $path ) && @is_readable( $path ) ) {
460
-									include_once( $path );
461
-									$ext_plugins .= $strings . "\n";
457
+						if ( ! empty($mce_external_languages)) {
458
+							foreach ($mce_external_languages as $name => $path) {
459
+								if (@is_file($path) && @is_readable($path)) {
460
+									include_once($path);
461
+									$ext_plugins .= $strings."\n";
462 462
 									$loaded_langs[] = $name;
463 463
 								}
464 464
 							}
465 465
 						}
466 466
 
467
-						foreach ( $mce_external_plugins as $name => $url ) {
468
-							if ( in_array( $name, $plugins, true ) ) {
469
-								unset( $mce_external_plugins[ $name ] );
467
+						foreach ($mce_external_plugins as $name => $url) {
468
+							if (in_array($name, $plugins, true)) {
469
+								unset($mce_external_plugins[$name]);
470 470
 								continue;
471 471
 							}
472 472
 
473
-							$url = set_url_scheme( $url );
474
-							$mce_external_plugins[ $name ] = $url;
475
-							$plugurl = dirname( $url );
473
+							$url = set_url_scheme($url);
474
+							$mce_external_plugins[$name] = $url;
475
+							$plugurl = dirname($url);
476 476
 							$strings = '';
477 477
 
478 478
 							// Try to load langs/[locale].js and langs/[locale]_dlg.js
479
-							if ( ! in_array( $name, $loaded_langs, true ) ) {
480
-								$path = str_replace( content_url(), '', $plugurl );
481
-								$path = WP_CONTENT_DIR . $path . '/langs/';
479
+							if ( ! in_array($name, $loaded_langs, true)) {
480
+								$path = str_replace(content_url(), '', $plugurl);
481
+								$path = WP_CONTENT_DIR.$path.'/langs/';
482 482
 
483
-								if ( function_exists('realpath') )
484
-									$path = trailingslashit( realpath($path) );
483
+								if (function_exists('realpath'))
484
+									$path = trailingslashit(realpath($path));
485 485
 
486
-								if ( @is_file( $path . $mce_locale . '.js' ) )
487
-									$strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n";
486
+								if (@is_file($path.$mce_locale.'.js'))
487
+									$strings .= @file_get_contents($path.$mce_locale.'.js')."\n";
488 488
 
489
-								if ( @is_file( $path . $mce_locale . '_dlg.js' ) )
490
-									$strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n";
489
+								if (@is_file($path.$mce_locale.'_dlg.js'))
490
+									$strings .= @file_get_contents($path.$mce_locale.'_dlg.js')."\n";
491 491
 
492
-								if ( 'en' != $mce_locale && empty( $strings ) ) {
493
-									if ( @is_file( $path . 'en.js' ) ) {
494
-										$str1 = @file_get_contents( $path . 'en.js' );
495
-										$strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n";
492
+								if ('en' != $mce_locale && empty($strings)) {
493
+									if (@is_file($path.'en.js')) {
494
+										$str1 = @file_get_contents($path.'en.js');
495
+										$strings .= preg_replace('/([\'"])en\./', '$1'.$mce_locale.'.', $str1, 1)."\n";
496 496
 									}
497 497
 
498
-									if ( @is_file( $path . 'en_dlg.js' ) ) {
499
-										$str2 = @file_get_contents( $path . 'en_dlg.js' );
500
-										$strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n";
498
+									if (@is_file($path.'en_dlg.js')) {
499
+										$str2 = @file_get_contents($path.'en_dlg.js');
500
+										$strings .= preg_replace('/([\'"])en\./', '$1'.$mce_locale.'.', $str2, 1)."\n";
501 501
 									}
502 502
 								}
503 503
 
504
-								if ( ! empty( $strings ) )
505
-									$ext_plugins .= "\n" . $strings . "\n";
504
+								if ( ! empty($strings))
505
+									$ext_plugins .= "\n".$strings."\n";
506 506
 							}
507 507
 
508
-							$ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n";
509
-							$ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n";
508
+							$ext_plugins .= 'tinyMCEPreInit.load_ext("'.$plugurl.'", "'.$mce_locale.'");'."\n";
509
+							$ext_plugins .= 'tinymce.PluginManager.load("'.$name.'", "'.$url.'");'."\n";
510 510
 						}
511 511
 					}
512 512
 				}
@@ -518,20 +518,20 @@  discard block
 block discarded – undo
518 518
 					'theme' => 'modern',
519 519
 					'skin' => 'lightgray',
520 520
 					'language' => self::$mce_locale,
521
-					'formats' => '{' .
522
-						'alignleft: [' .
523
-							'{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"left"}},' .
524
-							'{selector: "img,table,dl.wp-caption", classes: "alignleft"}' .
525
-						'],' .
526
-						'aligncenter: [' .
527
-							'{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"center"}},' .
528
-							'{selector: "img,table,dl.wp-caption", classes: "aligncenter"}' .
529
-						'],' .
530
-						'alignright: [' .
531
-							'{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"right"}},' .
532
-							'{selector: "img,table,dl.wp-caption", classes: "alignright"}' .
533
-						'],' .
534
-						'strikethrough: {inline: "del"}' .
521
+					'formats' => '{'.
522
+						'alignleft: ['.
523
+							'{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"left"}},'.
524
+							'{selector: "img,table,dl.wp-caption", classes: "alignleft"}'.
525
+						'],'.
526
+						'aligncenter: ['.
527
+							'{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"center"}},'.
528
+							'{selector: "img,table,dl.wp-caption", classes: "aligncenter"}'.
529
+						'],'.
530
+						'alignright: ['.
531
+							'{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"right"}},'.
532
+							'{selector: "img,table,dl.wp-caption", classes: "alignright"}'.
533
+						'],'.
534
+						'strikethrough: {inline: "del"}'.
535 535
 					'}',
536 536
 					'relative_urls' => false,
537 537
 					'remove_script_host' => false,
@@ -541,35 +541,35 @@  discard block
 block discarded – undo
541 541
 					'entities' => '38,amp,60,lt,62,gt',
542 542
 					'entity_encoding' => 'raw',
543 543
 					'keep_styles' => false,
544
-					'cache_suffix' => 'wp-mce-' . $tinymce_version,
544
+					'cache_suffix' => 'wp-mce-'.$tinymce_version,
545 545
 
546 546
 					// Limit the preview styles in the menu/toolbar
547 547
 					'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',
548 548
 
549 549
 					'end_container_on_empty_block' => true,
550 550
 					'wpeditimage_disable_captions' => $no_captions,
551
-					'wpeditimage_html5_captions' => current_theme_supports( 'html5', 'caption' ),
552
-					'plugins' => implode( ',', $plugins ),
553
-					'wp_lang_attr' => get_bloginfo( 'language' )
551
+					'wpeditimage_html5_captions' => current_theme_supports('html5', 'caption'),
552
+					'plugins' => implode(',', $plugins),
553
+					'wp_lang_attr' => get_bloginfo('language')
554 554
 				);
555 555
 
556
-				if ( ! empty( $mce_external_plugins ) ) {
557
-					self::$first_init['external_plugins'] = wp_json_encode( $mce_external_plugins );
556
+				if ( ! empty($mce_external_plugins)) {
557
+					self::$first_init['external_plugins'] = wp_json_encode($mce_external_plugins);
558 558
 				}
559 559
 
560 560
 				$suffix = SCRIPT_DEBUG ? '' : '.min';
561
-				$version = 'ver=' . $wp_version;
562
-				$dashicons = includes_url( "css/dashicons$suffix.css?$version" );
561
+				$version = 'ver='.$wp_version;
562
+				$dashicons = includes_url("css/dashicons$suffix.css?$version");
563 563
 
564 564
 				// WordPress default stylesheet and dashicons
565 565
 				$mce_css = array(
566 566
 					$dashicons,
567
-					self::$baseurl . '/skins/wordpress/wp-content.css?' . $version
567
+					self::$baseurl.'/skins/wordpress/wp-content.css?'.$version
568 568
 				);
569 569
 
570 570
 				$editor_styles = get_editor_stylesheets();
571
-				if ( ! empty( $editor_styles ) ) {
572
-					foreach ( $editor_styles as $style ) {
571
+				if ( ! empty($editor_styles)) {
572
+					foreach ($editor_styles as $style) {
573 573
 						$mce_css[] = $style;
574 574
 					}
575 575
 				}
@@ -581,13 +581,13 @@  discard block
 block discarded – undo
581 581
 				 *
582 582
 				 * @param string $stylesheets Comma-delimited list of stylesheets.
583 583
 				 */
584
-				$mce_css = trim( apply_filters( 'mce_css', implode( ',', $mce_css ) ), ' ,' );
584
+				$mce_css = trim(apply_filters('mce_css', implode(',', $mce_css)), ' ,');
585 585
 
586
-				if ( ! empty($mce_css) )
586
+				if ( ! empty($mce_css))
587 587
 					self::$first_init['content_css'] = $mce_css;
588 588
 			}
589 589
 
590
-			if ( $set['teeny'] ) {
590
+			if ($set['teeny']) {
591 591
 
592 592
 				/**
593 593
 				 * Filter the list of teenyMCE buttons (Text tab).
@@ -597,13 +597,13 @@  discard block
 block discarded – undo
597 597
 				 * @param array  $buttons   An array of teenyMCE buttons.
598 598
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
599 599
 				 */
600
-				$mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
600
+				$mce_buttons = apply_filters('teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id);
601 601
 				$mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
602 602
 			} else {
603
-				$mce_buttons = array( 'bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker' );
603
+				$mce_buttons = array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker');
604 604
 
605
-				if ( ! wp_is_mobile() ) {
606
-					if ( $set['_content_editor_dfw'] ) {
605
+				if ( ! wp_is_mobile()) {
606
+					if ($set['_content_editor_dfw']) {
607 607
 						$mce_buttons[] = 'dfw';
608 608
 					} else {
609 609
 						$mce_buttons[] = 'fullscreen';
@@ -620,11 +620,11 @@  discard block
 block discarded – undo
620 620
 				 * @param array  $buttons   First-row list of buttons.
621 621
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
622 622
 				 */
623
-				$mce_buttons = apply_filters( 'mce_buttons', $mce_buttons, $editor_id );
623
+				$mce_buttons = apply_filters('mce_buttons', $mce_buttons, $editor_id);
624 624
 
625
-				$mce_buttons_2 = array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo' );
625
+				$mce_buttons_2 = array('formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo');
626 626
 
627
-				if ( ! wp_is_mobile() ) {
627
+				if ( ! wp_is_mobile()) {
628 628
 					$mce_buttons_2[] = 'wp_help';
629 629
 				}
630 630
 
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 				 * @param array  $buttons   Second-row list of buttons.
637 637
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
638 638
 				 */
639
-				$mce_buttons_2 = apply_filters( 'mce_buttons_2', $mce_buttons_2, $editor_id );
639
+				$mce_buttons_2 = apply_filters('mce_buttons_2', $mce_buttons_2, $editor_id);
640 640
 
641 641
 				/**
642 642
 				 * Filter the third-row list of TinyMCE buttons (Visual tab).
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 				 * @param array  $buttons   Third-row list of buttons.
647 647
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
648 648
 				 */
649
-				$mce_buttons_3 = apply_filters( 'mce_buttons_3', array(), $editor_id );
649
+				$mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id);
650 650
 
651 651
 				/**
652 652
 				 * Filter the fourth-row list of TinyMCE buttons (Visual tab).
@@ -656,30 +656,30 @@  discard block
 block discarded – undo
656 656
 				 * @param array  $buttons   Fourth-row list of buttons.
657 657
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
658 658
 				 */
659
-				$mce_buttons_4 = apply_filters( 'mce_buttons_4', array(), $editor_id );
659
+				$mce_buttons_4 = apply_filters('mce_buttons_4', array(), $editor_id);
660 660
 			}
661 661
 
662 662
 			$body_class = $editor_id;
663 663
 
664
-			if ( $post = get_post() ) {
665
-				$body_class .= ' post-type-' . sanitize_html_class( $post->post_type ) . ' post-status-' . sanitize_html_class( $post->post_status );
666
-				if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
667
-					$post_format = get_post_format( $post );
668
-					if ( $post_format && ! is_wp_error( $post_format ) )
669
-						$body_class .= ' post-format-' . sanitize_html_class( $post_format );
664
+			if ($post = get_post()) {
665
+				$body_class .= ' post-type-'.sanitize_html_class($post->post_type).' post-status-'.sanitize_html_class($post->post_status);
666
+				if (post_type_supports($post->post_type, 'post-formats')) {
667
+					$post_format = get_post_format($post);
668
+					if ($post_format && ! is_wp_error($post_format))
669
+						$body_class .= ' post-format-'.sanitize_html_class($post_format);
670 670
 					else
671 671
 						$body_class .= ' post-format-standard';
672 672
 				}
673 673
 			}
674 674
 
675
-			$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
675
+			$body_class .= ' locale-'.sanitize_html_class(strtolower(str_replace('_', '-', get_locale())));
676 676
 
677
-			if ( !empty($set['tinymce']['body_class']) ) {
678
-				$body_class .= ' ' . $set['tinymce']['body_class'];
677
+			if ( ! empty($set['tinymce']['body_class'])) {
678
+				$body_class .= ' '.$set['tinymce']['body_class'];
679 679
 				unset($set['tinymce']['body_class']);
680 680
 			}
681 681
 
682
-			$mceInit = array (
682
+			$mceInit = array(
683 683
 				'selector' => "#$editor_id",
684 684
 				'resize' => 'vertical',
685 685
 				'menubar' => false,
@@ -694,10 +694,10 @@  discard block
 block discarded – undo
694 694
 			);
695 695
 
696 696
 			// Merge with the first part of the init array
697
-			$mceInit = array_merge( self::$first_init, $mceInit );
697
+			$mceInit = array_merge(self::$first_init, $mceInit);
698 698
 
699
-			if ( is_array( $set['tinymce'] ) )
700
-				$mceInit = array_merge( $mceInit, $set['tinymce'] );
699
+			if (is_array($set['tinymce']))
700
+				$mceInit = array_merge($mceInit, $set['tinymce']);
701 701
 
702 702
 			/*
703 703
 			 * For people who really REALLY know what they're doing with TinyMCE
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 			 * is to use the default cleanup by not specifying valid_elements,
708 708
 			 * as TinyMCE checks against the full set of HTML 5.0 elements and attributes.
709 709
 			 */
710
-			if ( $set['teeny'] ) {
710
+			if ($set['teeny']) {
711 711
 
712 712
 				/**
713 713
 				 * Filter the teenyMCE config before init.
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 				 * @param array  $mceInit   An array with teenyMCE config.
718 718
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
719 719
 				 */
720
-				$mceInit = apply_filters( 'teeny_mce_before_init', $mceInit, $editor_id );
720
+				$mceInit = apply_filters('teeny_mce_before_init', $mceInit, $editor_id);
721 721
 			} else {
722 722
 
723 723
 				/**
@@ -728,10 +728,10 @@  discard block
 block discarded – undo
728 728
 				 * @param array  $mceInit   An array with TinyMCE config.
729 729
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
730 730
 				 */
731
-				$mceInit = apply_filters( 'tiny_mce_before_init', $mceInit, $editor_id );
731
+				$mceInit = apply_filters('tiny_mce_before_init', $mceInit, $editor_id);
732 732
 			}
733 733
 
734
-			if ( empty( $mceInit['toolbar3'] ) && ! empty( $mceInit['toolbar4'] ) ) {
734
+			if (empty($mceInit['toolbar3']) && ! empty($mceInit['toolbar4'])) {
735 735
 				$mceInit['toolbar3'] = $mceInit['toolbar4'];
736 736
 				$mceInit['toolbar4'] = '';
737 737
 			}
@@ -749,19 +749,19 @@  discard block
 block discarded – undo
749 749
 	private static function _parse_init($init) {
750 750
 		$options = '';
751 751
 
752
-		foreach ( $init as $k => $v ) {
753
-			if ( is_bool($v) ) {
752
+		foreach ($init as $k => $v) {
753
+			if (is_bool($v)) {
754 754
 				$val = $v ? 'true' : 'false';
755
-				$options .= $k . ':' . $val . ',';
755
+				$options .= $k.':'.$val.',';
756 756
 				continue;
757
-			} elseif ( !empty($v) && is_string($v) && ( ('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v) ) ) {
758
-				$options .= $k . ':' . $v . ',';
757
+			} elseif ( ! empty($v) && is_string($v) && (('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v))) {
758
+				$options .= $k.':'.$v.',';
759 759
 				continue;
760 760
 			}
761
-			$options .= $k . ':"' . $v . '",';
761
+			$options .= $k.':"'.$v.'",';
762 762
 		}
763 763
 
764
-		return '{' . trim( $options, ' ,' ) . '}';
764
+		return '{'.trim($options, ' ,').'}';
765 765
 	}
766 766
 
767 767
 	/**
@@ -769,24 +769,24 @@  discard block
 block discarded – undo
769 769
 	 * @static
770 770
 	 */
771 771
 	public static function enqueue_scripts() {
772
-		if ( self::$has_tinymce )
772
+		if (self::$has_tinymce)
773 773
 			wp_enqueue_script('editor');
774 774
 
775
-		if ( self::$has_quicktags ) {
776
-			wp_enqueue_script( 'quicktags' );
777
-			wp_enqueue_style( 'buttons' );
775
+		if (self::$has_quicktags) {
776
+			wp_enqueue_script('quicktags');
777
+			wp_enqueue_style('buttons');
778 778
 		}
779 779
 
780
-		if ( in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true) ) {
780
+		if (in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true)) {
781 781
 			wp_enqueue_script('wplink');
782
-			wp_enqueue_script( 'jquery-ui-autocomplete' );
782
+			wp_enqueue_script('jquery-ui-autocomplete');
783 783
 		}
784 784
 
785
-		if ( self::$old_dfw_compat ) {
785
+		if (self::$old_dfw_compat) {
786 786
 			wp_enqueue_script('wp-fullscreen-stub');
787 787
 		}
788 788
 
789
-		if ( self::$has_medialib ) {
789
+		if (self::$has_medialib) {
790 790
 			add_thickbox();
791 791
 			wp_enqueue_script('media-upload');
792 792
 		}
@@ -799,10 +799,10 @@  discard block
 block discarded – undo
799 799
 		 * @param array $to_load An array containing boolean values whether TinyMCE
800 800
 		 *                       and Quicktags are being loaded.
801 801
 		 */
802
-		do_action( 'wp_enqueue_editor', array(
802
+		do_action('wp_enqueue_editor', array(
803 803
 			'tinymce'   => self::$has_tinymce,
804 804
 			'quicktags' => self::$has_quicktags,
805
-		) );
805
+		));
806 806
 	}
807 807
 
808 808
 	/**
@@ -814,261 +814,261 @@  discard block
 block discarded – undo
814 814
 	 * @param bool $json_only optional Whether to include the JavaScript calls to tinymce.addI18n() and tinymce.ScriptLoader.markDone().
815 815
 	 * @return string Translation object, JSON encoded.
816 816
 	 */
817
-	public static function wp_mce_translation( $mce_locale = '', $json_only = false ) {
817
+	public static function wp_mce_translation($mce_locale = '', $json_only = false) {
818 818
 
819 819
 		$mce_translation = array(
820 820
 			// Default TinyMCE strings
821
-			'New document' => __( 'New document' ),
822
-			'Formats' => _x( 'Formats', 'TinyMCE' ),
821
+			'New document' => __('New document'),
822
+			'Formats' => _x('Formats', 'TinyMCE'),
823 823
 
824
-			'Headings' => _x( 'Headings', 'TinyMCE' ),
825
-			'Heading 1' => __( 'Heading 1' ),
826
-			'Heading 2' => __( 'Heading 2' ),
827
-			'Heading 3' => __( 'Heading 3' ),
828
-			'Heading 4' => __( 'Heading 4' ),
829
-			'Heading 5' => __( 'Heading 5' ),
830
-			'Heading 6' => __( 'Heading 6' ),
824
+			'Headings' => _x('Headings', 'TinyMCE'),
825
+			'Heading 1' => __('Heading 1'),
826
+			'Heading 2' => __('Heading 2'),
827
+			'Heading 3' => __('Heading 3'),
828
+			'Heading 4' => __('Heading 4'),
829
+			'Heading 5' => __('Heading 5'),
830
+			'Heading 6' => __('Heading 6'),
831 831
 
832 832
 			/* translators: block tags */
833
-			'Blocks' => _x( 'Blocks', 'TinyMCE' ),
834
-			'Paragraph' => __( 'Paragraph' ),
835
-			'Blockquote' => __( 'Blockquote' ),
836
-			'Div' => _x( 'Div', 'HTML tag' ),
837
-			'Pre' => _x( 'Pre', 'HTML tag' ),
838
-			'Preformatted' => _x( 'Preformatted', 'HTML tag' ),
839
-			'Address' => _x( 'Address', 'HTML tag' ),
840
-
841
-			'Inline' => _x( 'Inline', 'HTML elements' ),
842
-			'Underline' => __( 'Underline' ),
843
-			'Strikethrough' => __( 'Strikethrough' ),
844
-			'Subscript' => __( 'Subscript' ),
845
-			'Superscript' => __( 'Superscript' ),
846
-			'Clear formatting' => __( 'Clear formatting' ),
847
-			'Bold' => __( 'Bold' ),
848
-			'Italic' => __( 'Italic' ),
849
-			'Code' => _x( 'Code', 'editor button' ),
850
-			'Source code' => __( 'Source code' ),
851
-			'Font Family' => __( 'Font Family' ),
852
-			'Font Sizes' => __( 'Font Sizes' ),
853
-
854
-			'Align center' => __( 'Align center' ),
855
-			'Align right' => __( 'Align right' ),
856
-			'Align left' => __( 'Align left' ),
857
-			'Justify' => __( 'Justify' ),
858
-			'Increase indent' => __( 'Increase indent' ),
859
-			'Decrease indent' => __( 'Decrease indent' ),
860
-
861
-			'Cut' => __( 'Cut' ),
862
-			'Copy' => __( 'Copy' ),
863
-			'Paste' => __( 'Paste' ),
864
-			'Select all' => __( 'Select all' ),
865
-			'Undo' => __( 'Undo' ),
866
-			'Redo' => __( 'Redo' ),
867
-
868
-			'Ok' => __( 'OK' ),
869
-			'Cancel' => __( 'Cancel' ),
870
-			'Close' => __( 'Close' ),
871
-			'Visual aids' => __( 'Visual aids' ),
872
-
873
-			'Bullet list' => __( 'Bulleted list' ),
874
-			'Numbered list' => __( 'Numbered list' ),
875
-			'Square' => _x( 'Square', 'list style' ),
876
-			'Default' => _x( 'Default', 'list style' ),
877
-			'Circle' => _x( 'Circle', 'list style' ),
878
-			'Disc' => _x('Disc', 'list style' ),
879
-			'Lower Greek' => _x( 'Lower Greek', 'list style' ),
880
-			'Lower Alpha' => _x( 'Lower Alpha', 'list style' ),
881
-			'Upper Alpha' => _x( 'Upper Alpha', 'list style' ),
882
-			'Upper Roman' => _x( 'Upper Roman', 'list style' ),
883
-			'Lower Roman' => _x( 'Lower Roman', 'list style' ),
833
+			'Blocks' => _x('Blocks', 'TinyMCE'),
834
+			'Paragraph' => __('Paragraph'),
835
+			'Blockquote' => __('Blockquote'),
836
+			'Div' => _x('Div', 'HTML tag'),
837
+			'Pre' => _x('Pre', 'HTML tag'),
838
+			'Preformatted' => _x('Preformatted', 'HTML tag'),
839
+			'Address' => _x('Address', 'HTML tag'),
840
+
841
+			'Inline' => _x('Inline', 'HTML elements'),
842
+			'Underline' => __('Underline'),
843
+			'Strikethrough' => __('Strikethrough'),
844
+			'Subscript' => __('Subscript'),
845
+			'Superscript' => __('Superscript'),
846
+			'Clear formatting' => __('Clear formatting'),
847
+			'Bold' => __('Bold'),
848
+			'Italic' => __('Italic'),
849
+			'Code' => _x('Code', 'editor button'),
850
+			'Source code' => __('Source code'),
851
+			'Font Family' => __('Font Family'),
852
+			'Font Sizes' => __('Font Sizes'),
853
+
854
+			'Align center' => __('Align center'),
855
+			'Align right' => __('Align right'),
856
+			'Align left' => __('Align left'),
857
+			'Justify' => __('Justify'),
858
+			'Increase indent' => __('Increase indent'),
859
+			'Decrease indent' => __('Decrease indent'),
860
+
861
+			'Cut' => __('Cut'),
862
+			'Copy' => __('Copy'),
863
+			'Paste' => __('Paste'),
864
+			'Select all' => __('Select all'),
865
+			'Undo' => __('Undo'),
866
+			'Redo' => __('Redo'),
867
+
868
+			'Ok' => __('OK'),
869
+			'Cancel' => __('Cancel'),
870
+			'Close' => __('Close'),
871
+			'Visual aids' => __('Visual aids'),
872
+
873
+			'Bullet list' => __('Bulleted list'),
874
+			'Numbered list' => __('Numbered list'),
875
+			'Square' => _x('Square', 'list style'),
876
+			'Default' => _x('Default', 'list style'),
877
+			'Circle' => _x('Circle', 'list style'),
878
+			'Disc' => _x('Disc', 'list style'),
879
+			'Lower Greek' => _x('Lower Greek', 'list style'),
880
+			'Lower Alpha' => _x('Lower Alpha', 'list style'),
881
+			'Upper Alpha' => _x('Upper Alpha', 'list style'),
882
+			'Upper Roman' => _x('Upper Roman', 'list style'),
883
+			'Lower Roman' => _x('Lower Roman', 'list style'),
884 884
 
885 885
 			// Anchor plugin
886
-			'Name' => _x( 'Name', 'Name of link anchor (TinyMCE)' ),
887
-			'Anchor' => _x( 'Anchor', 'Link anchor (TinyMCE)' ),
888
-			'Anchors' => _x( 'Anchors', 'Link anchors (TinyMCE)' ),
886
+			'Name' => _x('Name', 'Name of link anchor (TinyMCE)'),
887
+			'Anchor' => _x('Anchor', 'Link anchor (TinyMCE)'),
888
+			'Anchors' => _x('Anchors', 'Link anchors (TinyMCE)'),
889 889
 
890 890
 			// Fullpage plugin
891
-			'Document properties' => __( 'Document properties' ),
892
-			'Robots' => __( 'Robots' ),
893
-			'Title' => __( 'Title' ),
894
-			'Keywords' => __( 'Keywords' ),
895
-			'Encoding' => __( 'Encoding' ),
896
-			'Description' => __( 'Description' ),
897
-			'Author' => __( 'Author' ),
891
+			'Document properties' => __('Document properties'),
892
+			'Robots' => __('Robots'),
893
+			'Title' => __('Title'),
894
+			'Keywords' => __('Keywords'),
895
+			'Encoding' => __('Encoding'),
896
+			'Description' => __('Description'),
897
+			'Author' => __('Author'),
898 898
 
899 899
 			// Media, image plugins
900
-			'Insert/edit image' => __( 'Insert/edit image' ),
901
-			'General' => __( 'General' ),
902
-			'Advanced' => __( 'Advanced' ),
903
-			'Source' => __( 'Source' ),
904
-			'Border' => __( 'Border' ),
905
-			'Constrain proportions' => __( 'Constrain proportions' ),
906
-			'Vertical space' => __( 'Vertical space' ),
907
-			'Image description' => __( 'Image description' ),
908
-			'Style' => __( 'Style' ),
909
-			'Dimensions' => __( 'Dimensions' ),
910
-			'Insert image' => __( 'Insert image' ),
911
-			'Insert date/time' => __( 'Insert date/time' ),
912
-			'Insert/edit video' => __( 'Insert/edit video' ),
913
-			'Poster' => __( 'Poster' ),
914
-			'Alternative source' => __( 'Alternative source' ),
915
-			'Paste your embed code below:' => __( 'Paste your embed code below:' ),
916
-			'Insert video' => __( 'Insert video' ),
917
-			'Embed' => __( 'Embed' ),
900
+			'Insert/edit image' => __('Insert/edit image'),
901
+			'General' => __('General'),
902
+			'Advanced' => __('Advanced'),
903
+			'Source' => __('Source'),
904
+			'Border' => __('Border'),
905
+			'Constrain proportions' => __('Constrain proportions'),
906
+			'Vertical space' => __('Vertical space'),
907
+			'Image description' => __('Image description'),
908
+			'Style' => __('Style'),
909
+			'Dimensions' => __('Dimensions'),
910
+			'Insert image' => __('Insert image'),
911
+			'Insert date/time' => __('Insert date/time'),
912
+			'Insert/edit video' => __('Insert/edit video'),
913
+			'Poster' => __('Poster'),
914
+			'Alternative source' => __('Alternative source'),
915
+			'Paste your embed code below:' => __('Paste your embed code below:'),
916
+			'Insert video' => __('Insert video'),
917
+			'Embed' => __('Embed'),
918 918
 
919 919
 			// Each of these have a corresponding plugin
920
-			'Special character' => __( 'Special character' ),
921
-			'Right to left' => _x( 'Right to left', 'editor button' ),
922
-			'Left to right' => _x( 'Left to right', 'editor button' ),
923
-			'Emoticons' => __( 'Emoticons' ),
924
-			'Nonbreaking space' => __( 'Nonbreaking space' ),
925
-			'Page break' => __( 'Page break' ),
926
-			'Paste as text' => __( 'Paste as text' ),
927
-			'Preview' => __( 'Preview' ),
928
-			'Print' => __( 'Print' ),
929
-			'Save' => __( 'Save' ),
930
-			'Fullscreen' => __( 'Fullscreen' ),
931
-			'Horizontal line' => __( 'Horizontal line' ),
932
-			'Horizontal space' => __( 'Horizontal space' ),
933
-			'Restore last draft' => __( 'Restore last draft' ),
934
-			'Insert/edit link' => __( 'Insert/edit link' ),
935
-			'Remove link' => __( 'Remove link' ),
936
-
937
-			'Color' => __( 'Color' ),
938
-			'Custom color' => __( 'Custom color' ),
939
-			'Custom...' => _x( 'Custom...', 'label for custom color' ), // no ellipsis
940
-			'No color' => __( 'No color' ),
920
+			'Special character' => __('Special character'),
921
+			'Right to left' => _x('Right to left', 'editor button'),
922
+			'Left to right' => _x('Left to right', 'editor button'),
923
+			'Emoticons' => __('Emoticons'),
924
+			'Nonbreaking space' => __('Nonbreaking space'),
925
+			'Page break' => __('Page break'),
926
+			'Paste as text' => __('Paste as text'),
927
+			'Preview' => __('Preview'),
928
+			'Print' => __('Print'),
929
+			'Save' => __('Save'),
930
+			'Fullscreen' => __('Fullscreen'),
931
+			'Horizontal line' => __('Horizontal line'),
932
+			'Horizontal space' => __('Horizontal space'),
933
+			'Restore last draft' => __('Restore last draft'),
934
+			'Insert/edit link' => __('Insert/edit link'),
935
+			'Remove link' => __('Remove link'),
936
+
937
+			'Color' => __('Color'),
938
+			'Custom color' => __('Custom color'),
939
+			'Custom...' => _x('Custom...', 'label for custom color'), // no ellipsis
940
+			'No color' => __('No color'),
941 941
 
942 942
 			// Spelling, search/replace plugins
943
-			'Could not find the specified string.' => __( 'Could not find the specified string.' ),
944
-			'Replace' => _x( 'Replace', 'find/replace' ),
945
-			'Next' => _x( 'Next', 'find/replace' ),
943
+			'Could not find the specified string.' => __('Could not find the specified string.'),
944
+			'Replace' => _x('Replace', 'find/replace'),
945
+			'Next' => _x('Next', 'find/replace'),
946 946
 			/* translators: previous */
947
-			'Prev' => _x( 'Prev', 'find/replace' ),
948
-			'Whole words' => _x( 'Whole words', 'find/replace' ),
949
-			'Find and replace' => __( 'Find and replace' ),
950
-			'Replace with' => _x('Replace with', 'find/replace' ),
951
-			'Find' => _x( 'Find', 'find/replace' ),
952
-			'Replace all' => _x( 'Replace all', 'find/replace' ),
953
-			'Match case' => __( 'Match case' ),
954
-			'Spellcheck' => __( 'Check Spelling' ),
955
-			'Finish' => _x( 'Finish', 'spellcheck' ),
956
-			'Ignore all' => _x( 'Ignore all', 'spellcheck' ),
957
-			'Ignore' => _x( 'Ignore', 'spellcheck' ),
958
-			'Add to Dictionary' => __( 'Add to Dictionary' ),
947
+			'Prev' => _x('Prev', 'find/replace'),
948
+			'Whole words' => _x('Whole words', 'find/replace'),
949
+			'Find and replace' => __('Find and replace'),
950
+			'Replace with' => _x('Replace with', 'find/replace'),
951
+			'Find' => _x('Find', 'find/replace'),
952
+			'Replace all' => _x('Replace all', 'find/replace'),
953
+			'Match case' => __('Match case'),
954
+			'Spellcheck' => __('Check Spelling'),
955
+			'Finish' => _x('Finish', 'spellcheck'),
956
+			'Ignore all' => _x('Ignore all', 'spellcheck'),
957
+			'Ignore' => _x('Ignore', 'spellcheck'),
958
+			'Add to Dictionary' => __('Add to Dictionary'),
959 959
 
960 960
 			// TinyMCE tables
961
-			'Insert table' => __( 'Insert table' ),
962
-			'Delete table' => __( 'Delete table' ),
963
-			'Table properties' => __( 'Table properties' ),
964
-			'Row properties' => __( 'Table row properties' ),
965
-			'Cell properties' => __( 'Table cell properties' ),
966
-			'Border color' => __( 'Border color' ),
967
-
968
-			'Row' => __( 'Row' ),
969
-			'Rows' => __( 'Rows' ),
970
-			'Column' => _x( 'Column', 'table column' ),
971
-			'Cols' => _x( 'Cols', 'table columns' ),
972
-			'Cell' => _x( 'Cell', 'table cell' ),
973
-			'Header cell' => __( 'Header cell' ),
974
-			'Header' => _x( 'Header', 'table header' ),
975
-			'Body' => _x( 'Body', 'table body' ),
976
-			'Footer' => _x( 'Footer', 'table footer' ),
977
-
978
-			'Insert row before' => __( 'Insert row before' ),
979
-			'Insert row after' => __( 'Insert row after' ),
980
-			'Insert column before' => __( 'Insert column before' ),
981
-			'Insert column after' => __( 'Insert column after' ),
982
-			'Paste row before' => __( 'Paste table row before' ),
983
-			'Paste row after' => __( 'Paste table row after' ),
984
-			'Delete row' => __( 'Delete row' ),
985
-			'Delete column' => __( 'Delete column' ),
986
-			'Cut row' => __( 'Cut table row' ),
987
-			'Copy row' => __( 'Copy table row' ),
988
-			'Merge cells' => __( 'Merge table cells' ),
989
-			'Split cell' => __( 'Split table cell' ),
990
-
991
-			'Height' => __( 'Height' ),
992
-			'Width' => __( 'Width' ),
993
-			'Caption' => __( 'Caption' ),
994
-			'Alignment' => __( 'Alignment' ),
995
-			'H Align' => _x( 'H Align', 'horizontal table cell alignment' ),
996
-			'Left' => __( 'Left' ),
997
-			'Center' => __( 'Center' ),
998
-			'Right' => __( 'Right' ),
999
-			'None' => _x( 'None', 'table cell alignment attribute' ),
1000
-			'V Align' => _x( 'V Align', 'vertical table cell alignment' ),
1001
-			'Top' => __( 'Top' ),
1002
-			'Middle' => __( 'Middle' ),
1003
-			'Bottom' => __( 'Bottom' ),
1004
-
1005
-			'Row group' => __( 'Row group' ),
1006
-			'Column group' => __( 'Column group' ),
1007
-			'Row type' => __( 'Row type' ),
1008
-			'Cell type' => __( 'Cell type' ),
1009
-			'Cell padding' => __( 'Cell padding' ),
1010
-			'Cell spacing' => __( 'Cell spacing' ),
1011
-			'Scope' => _x( 'Scope', 'table cell scope attribute' ),
1012
-
1013
-			'Insert template' => _x( 'Insert template', 'TinyMCE' ),
1014
-			'Templates' => _x( 'Templates', 'TinyMCE' ),
1015
-
1016
-			'Background color' => __( 'Background color' ),
1017
-			'Text color' => __( 'Text color' ),
1018
-			'Show blocks' => _x( 'Show blocks', 'editor button' ),
1019
-			'Show invisible characters' => __( 'Show invisible characters' ),
961
+			'Insert table' => __('Insert table'),
962
+			'Delete table' => __('Delete table'),
963
+			'Table properties' => __('Table properties'),
964
+			'Row properties' => __('Table row properties'),
965
+			'Cell properties' => __('Table cell properties'),
966
+			'Border color' => __('Border color'),
967
+
968
+			'Row' => __('Row'),
969
+			'Rows' => __('Rows'),
970
+			'Column' => _x('Column', 'table column'),
971
+			'Cols' => _x('Cols', 'table columns'),
972
+			'Cell' => _x('Cell', 'table cell'),
973
+			'Header cell' => __('Header cell'),
974
+			'Header' => _x('Header', 'table header'),
975
+			'Body' => _x('Body', 'table body'),
976
+			'Footer' => _x('Footer', 'table footer'),
977
+
978
+			'Insert row before' => __('Insert row before'),
979
+			'Insert row after' => __('Insert row after'),
980
+			'Insert column before' => __('Insert column before'),
981
+			'Insert column after' => __('Insert column after'),
982
+			'Paste row before' => __('Paste table row before'),
983
+			'Paste row after' => __('Paste table row after'),
984
+			'Delete row' => __('Delete row'),
985
+			'Delete column' => __('Delete column'),
986
+			'Cut row' => __('Cut table row'),
987
+			'Copy row' => __('Copy table row'),
988
+			'Merge cells' => __('Merge table cells'),
989
+			'Split cell' => __('Split table cell'),
990
+
991
+			'Height' => __('Height'),
992
+			'Width' => __('Width'),
993
+			'Caption' => __('Caption'),
994
+			'Alignment' => __('Alignment'),
995
+			'H Align' => _x('H Align', 'horizontal table cell alignment'),
996
+			'Left' => __('Left'),
997
+			'Center' => __('Center'),
998
+			'Right' => __('Right'),
999
+			'None' => _x('None', 'table cell alignment attribute'),
1000
+			'V Align' => _x('V Align', 'vertical table cell alignment'),
1001
+			'Top' => __('Top'),
1002
+			'Middle' => __('Middle'),
1003
+			'Bottom' => __('Bottom'),
1004
+
1005
+			'Row group' => __('Row group'),
1006
+			'Column group' => __('Column group'),
1007
+			'Row type' => __('Row type'),
1008
+			'Cell type' => __('Cell type'),
1009
+			'Cell padding' => __('Cell padding'),
1010
+			'Cell spacing' => __('Cell spacing'),
1011
+			'Scope' => _x('Scope', 'table cell scope attribute'),
1012
+
1013
+			'Insert template' => _x('Insert template', 'TinyMCE'),
1014
+			'Templates' => _x('Templates', 'TinyMCE'),
1015
+
1016
+			'Background color' => __('Background color'),
1017
+			'Text color' => __('Text color'),
1018
+			'Show blocks' => _x('Show blocks', 'editor button'),
1019
+			'Show invisible characters' => __('Show invisible characters'),
1020 1020
 
1021 1021
 			/* translators: word count */
1022
-			'Words: {0}' => sprintf( __( 'Words: %s' ), '{0}' ),
1023
-			'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' => __( 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' ) . "\n\n" . __( 'If you&#8217;re looking to paste rich content from Microsoft Word, try turning this option off. The editor will clean up text pasted from Word automatically.' ),
1024
-			'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' => __( 'Rich Text Area. Press Alt-Shift-H for help' ),
1025
-			'You have unsaved changes are you sure you want to navigate away?' => __( 'The changes you made will be lost if you navigate away from this page.' ),
1026
-			'Your browser doesn\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' => __( 'Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser&#8217;s edit menu instead.' ),
1022
+			'Words: {0}' => sprintf(__('Words: %s'), '{0}'),
1023
+			'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' => __('Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.')."\n\n".__('If you&#8217;re looking to paste rich content from Microsoft Word, try turning this option off. The editor will clean up text pasted from Word automatically.'),
1024
+			'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' => __('Rich Text Area. Press Alt-Shift-H for help'),
1025
+			'You have unsaved changes are you sure you want to navigate away?' => __('The changes you made will be lost if you navigate away from this page.'),
1026
+			'Your browser doesn\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' => __('Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser&#8217;s edit menu instead.'),
1027 1027
 
1028 1028
 			// TinyMCE menus
1029
-			'Insert' => _x( 'Insert', 'TinyMCE menu' ),
1030
-			'File' => _x( 'File', 'TinyMCE menu' ),
1031
-			'Edit' => _x( 'Edit', 'TinyMCE menu' ),
1032
-			'Tools' => _x( 'Tools', 'TinyMCE menu' ),
1033
-			'View' => _x( 'View', 'TinyMCE menu' ),
1034
-			'Table' => _x( 'Table', 'TinyMCE menu' ),
1035
-			'Format' => _x( 'Format', 'TinyMCE menu' ),
1029
+			'Insert' => _x('Insert', 'TinyMCE menu'),
1030
+			'File' => _x('File', 'TinyMCE menu'),
1031
+			'Edit' => _x('Edit', 'TinyMCE menu'),
1032
+			'Tools' => _x('Tools', 'TinyMCE menu'),
1033
+			'View' => _x('View', 'TinyMCE menu'),
1034
+			'Table' => _x('Table', 'TinyMCE menu'),
1035
+			'Format' => _x('Format', 'TinyMCE menu'),
1036 1036
 
1037 1037
 			// WordPress strings
1038
-			'Toolbar Toggle' => __( 'Toolbar Toggle' ),
1039
-			'Insert Read More tag' => __( 'Insert Read More tag' ),
1040
-			'Insert Page Break tag' => __( 'Insert Page Break tag' ),
1041
-			'Read more...' => __( 'Read more...' ), // Title on the placeholder inside the editor (no ellipsis)
1042
-			'Distraction-free writing mode' => __( 'Distraction-free writing mode' ),
1043
-			'No alignment' => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar
1044
-			'Remove' => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar
1045
-			'Edit ' => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar
1046
-			'Paste URL or type to search' => __( 'Paste URL or type to search' ), // Placeholder for the inline link dialog
1047
-			'Link options'  => __( 'Link options' ),
1038
+			'Toolbar Toggle' => __('Toolbar Toggle'),
1039
+			'Insert Read More tag' => __('Insert Read More tag'),
1040
+			'Insert Page Break tag' => __('Insert Page Break tag'),
1041
+			'Read more...' => __('Read more...'), // Title on the placeholder inside the editor (no ellipsis)
1042
+			'Distraction-free writing mode' => __('Distraction-free writing mode'),
1043
+			'No alignment' => __('No alignment'), // Tooltip for the 'alignnone' button in the image toolbar
1044
+			'Remove' => __('Remove'), // Tooltip for the 'remove' button in the image toolbar
1045
+			'Edit ' => __('Edit'), // Tooltip for the 'edit' button in the image toolbar
1046
+			'Paste URL or type to search' => __('Paste URL or type to search'), // Placeholder for the inline link dialog
1047
+			'Link options'  => __('Link options'),
1048 1048
 
1049 1049
 			// Shortcuts help modal
1050
-			'Keyboard Shortcuts' => __( 'Keyboard Shortcuts' ),
1051
-			'Default shortcuts,' => __( 'Default shortcuts,' ),
1052
-			'Additional shortcuts,' => __( 'Additional shortcuts,' ),
1053
-			'Focus shortcuts:' => __( 'Focus shortcuts:' ),
1054
-			'Inline toolbar (when an image, link or preview is selected)' => __( 'Inline toolbar (when an image, link or preview is selected)' ),
1055
-			'Editor menu (when enabled)' => __( 'Editor menu (when enabled)' ),
1056
-			'Editor toolbar' => __( 'Editor toolbar' ),
1057
-			'Elements path' => __( 'Elements path' ),
1058
-			'Ctrl + Alt + letter:' => __( 'Ctrl + Alt + letter:' ),
1059
-			'Shift + Alt + letter:' => __( 'Shift + Alt + letter:' ),
1060
-			'Cmd + letter:' => __( 'Cmd + letter:' ),
1061
-			'Ctrl + letter:' => __( 'Ctrl + letter:' ),
1062
-			'Letter' => __( 'Letter' ),
1063
-			'Action' => __( 'Action' ),
1050
+			'Keyboard Shortcuts' => __('Keyboard Shortcuts'),
1051
+			'Default shortcuts,' => __('Default shortcuts,'),
1052
+			'Additional shortcuts,' => __('Additional shortcuts,'),
1053
+			'Focus shortcuts:' => __('Focus shortcuts:'),
1054
+			'Inline toolbar (when an image, link or preview is selected)' => __('Inline toolbar (when an image, link or preview is selected)'),
1055
+			'Editor menu (when enabled)' => __('Editor menu (when enabled)'),
1056
+			'Editor toolbar' => __('Editor toolbar'),
1057
+			'Elements path' => __('Elements path'),
1058
+			'Ctrl + Alt + letter:' => __('Ctrl + Alt + letter:'),
1059
+			'Shift + Alt + letter:' => __('Shift + Alt + letter:'),
1060
+			'Cmd + letter:' => __('Cmd + letter:'),
1061
+			'Ctrl + letter:' => __('Ctrl + letter:'),
1062
+			'Letter' => __('Letter'),
1063
+			'Action' => __('Action'),
1064 1064
 			'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' =>
1065
-				__( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ),
1065
+				__('To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.'),
1066 1066
 			'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' =>
1067
-				__( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ),
1067
+				__('When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.'),
1068 1068
 			'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' =>
1069
-				__( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ),
1069
+				__('The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.'),
1070 1070
 			'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' =>
1071
-				__( 'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' ),
1071
+				__('The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.'),
1072 1072
 		);
1073 1073
 
1074 1074
 		/**
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
 		 *	Url
1083 1083
 		 */
1084 1084
 
1085
-		if ( ! $mce_locale ) {
1085
+		if ( ! $mce_locale) {
1086 1086
 			$mce_locale = self::$mce_locale;
1087 1087
 		}
1088 1088
 
@@ -1094,32 +1094,32 @@  discard block
 block discarded – undo
1094 1094
 		 * @param array  $mce_translation Key/value pairs of strings.
1095 1095
 		 * @param string $mce_locale      Locale.
1096 1096
 		 */
1097
-		$mce_translation = apply_filters( 'wp_mce_translation', $mce_translation, $mce_locale );
1097
+		$mce_translation = apply_filters('wp_mce_translation', $mce_translation, $mce_locale);
1098 1098
 
1099
-		foreach ( $mce_translation as $key => $value ) {
1099
+		foreach ($mce_translation as $key => $value) {
1100 1100
 			// Remove strings that are not translated.
1101
-			if ( $key === $value ) {
1102
-				unset( $mce_translation[$key] );
1101
+			if ($key === $value) {
1102
+				unset($mce_translation[$key]);
1103 1103
 				continue;
1104 1104
 			}
1105 1105
 
1106
-			if ( false !== strpos( $value, '&' ) ) {
1107
-				$mce_translation[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );
1106
+			if (false !== strpos($value, '&')) {
1107
+				$mce_translation[$key] = html_entity_decode($value, ENT_QUOTES, 'UTF-8');
1108 1108
 			}
1109 1109
 		}
1110 1110
 
1111 1111
 		// Set direction
1112
-		if ( is_rtl() ) {
1112
+		if (is_rtl()) {
1113 1113
 			$mce_translation['_dir'] = 'rtl';
1114 1114
 		}
1115 1115
 
1116
-		if ( $json_only ) {
1117
-			return wp_json_encode( $mce_translation );
1116
+		if ($json_only) {
1117
+			return wp_json_encode($mce_translation);
1118 1118
 		}
1119 1119
 
1120
-		$baseurl = self::$baseurl ? self::$baseurl : includes_url( 'js/tinymce' );
1120
+		$baseurl = self::$baseurl ? self::$baseurl : includes_url('js/tinymce');
1121 1121
 
1122
-		return "tinymce.addI18n( '$mce_locale', " . wp_json_encode( $mce_translation ) . ");\n" .
1122
+		return "tinymce.addI18n( '$mce_locale', ".wp_json_encode($mce_translation).");\n".
1123 1123
 			"tinymce.ScriptLoader.markDone( '$baseurl/langs/$mce_locale.js' );\n";
1124 1124
 	}
1125 1125
 
@@ -1141,38 +1141,38 @@  discard block
 block discarded – undo
1141 1141
 		 * These plugins can be refreshed by appending query string to the URL passed to "mce_external_plugins" filter.
1142 1142
 		 * If the plugin has a popup dialog, a query string can be added to the button action that opens it (in the plugin's code).
1143 1143
 		 */
1144
-		$version = 'ver=' . $tinymce_version;
1145
-		$tmce_on = !empty(self::$mce_settings);
1144
+		$version = 'ver='.$tinymce_version;
1145
+		$tmce_on = ! empty(self::$mce_settings);
1146 1146
 
1147
-		if ( ! isset($concatenate_scripts) )
1147
+		if ( ! isset($concatenate_scripts))
1148 1148
 			script_concat_settings();
1149 1149
 
1150 1150
 		$compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
1151 1151
 			&& false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
1152 1152
 
1153 1153
 		$mceInit = $qtInit = '';
1154
-		if ( $tmce_on ) {
1155
-			foreach ( self::$mce_settings as $editor_id => $init ) {
1156
-				$options = self::_parse_init( $init );
1154
+		if ($tmce_on) {
1155
+			foreach (self::$mce_settings as $editor_id => $init) {
1156
+				$options = self::_parse_init($init);
1157 1157
 				$mceInit .= "'$editor_id':{$options},";
1158 1158
 			}
1159
-			$mceInit = '{' . trim($mceInit, ',') . '}';
1159
+			$mceInit = '{'.trim($mceInit, ',').'}';
1160 1160
 		} else {
1161 1161
 			$mceInit = '{}';
1162 1162
 		}
1163 1163
 
1164
-		if ( !empty(self::$qt_settings) ) {
1165
-			foreach ( self::$qt_settings as $editor_id => $init ) {
1166
-				$options = self::_parse_init( $init );
1164
+		if ( ! empty(self::$qt_settings)) {
1165
+			foreach (self::$qt_settings as $editor_id => $init) {
1166
+				$options = self::_parse_init($init);
1167 1167
 				$qtInit .= "'$editor_id':{$options},";
1168 1168
 			}
1169
-			$qtInit = '{' . trim($qtInit, ',') . '}';
1169
+			$qtInit = '{'.trim($qtInit, ',').'}';
1170 1170
 		} else {
1171 1171
 			$qtInit = '{}';
1172 1172
 		}
1173 1173
 
1174 1174
 		$ref = array(
1175
-			'plugins' => implode( ',', self::$plugins ),
1175
+			'plugins' => implode(',', self::$plugins),
1176 1176
 			'theme' => 'modern',
1177 1177
 			'language' => self::$mce_locale
1178 1178
 		);
@@ -1186,7 +1186,7 @@  discard block
 block discarded – undo
1186 1186
 		 *
1187 1187
 		 * @param array $mce_settings TinyMCE settings array.
1188 1188
 		 */
1189
-		do_action( 'before_wp_tiny_mce', self::$mce_settings );
1189
+		do_action('before_wp_tiny_mce', self::$mce_settings);
1190 1190
 		?>
1191 1191
 
1192 1192
 		<script type="text/javascript">
@@ -1195,14 +1195,14 @@  discard block
 block discarded – undo
1195 1195
 			suffix: "<?php echo $suffix; ?>",
1196 1196
 			<?php
1197 1197
 
1198
-			if ( self::$drag_drop_upload ) {
1198
+			if (self::$drag_drop_upload) {
1199 1199
 				echo 'dragDropUpload: true,';
1200 1200
 			}
1201 1201
 
1202 1202
 			?>
1203 1203
 			mceInit: <?php echo $mceInit; ?>,
1204 1204
 			qtInit: <?php echo $qtInit; ?>,
1205
-			ref: <?php echo self::_parse_init( $ref ); ?>,
1205
+			ref: <?php echo self::_parse_init($ref); ?>,
1206 1206
 			load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
1207 1207
 		};
1208 1208
 		</script>
@@ -1210,19 +1210,19 @@  discard block
 block discarded – undo
1210 1210
 
1211 1211
 		$baseurl = self::$baseurl;
1212 1212
 		// Load tinymce.js when running from /src, else load wp-tinymce.js.gz (production) or tinymce.min.js (SCRIPT_DEBUG)
1213
-		$mce_suffix = false !== strpos( $wp_version, '-src' ) ? '' : '.min';
1213
+		$mce_suffix = false !== strpos($wp_version, '-src') ? '' : '.min';
1214 1214
 
1215
-		if ( $tmce_on ) {
1216
-			if ( $compressed ) {
1215
+		if ($tmce_on) {
1216
+			if ($compressed) {
1217 1217
 				echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&amp;$version'></script>\n";
1218 1218
 			} else {
1219 1219
 				echo "<script type='text/javascript' src='{$baseurl}/tinymce{$mce_suffix}.js?$version'></script>\n";
1220 1220
 				echo "<script type='text/javascript' src='{$baseurl}/plugins/compat3x/plugin{$suffix}.js?$version'></script>\n";
1221 1221
 			}
1222 1222
 
1223
-			echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n";
1223
+			echo "<script type='text/javascript'>\n".self::wp_mce_translation()."</script>\n";
1224 1224
 
1225
-			if ( self::$ext_plugins ) {
1225
+			if (self::$ext_plugins) {
1226 1226
 				// Load the old-format English strings to prevent unsightly labels in old style popups
1227 1227
 				echo "<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?$version'></script>\n";
1228 1228
 			}
@@ -1236,17 +1236,17 @@  discard block
 block discarded – undo
1236 1236
 		 *
1237 1237
 		 * @param array $mce_settings TinyMCE settings array.
1238 1238
 		 */
1239
-		do_action( 'wp_tiny_mce_init', self::$mce_settings );
1239
+		do_action('wp_tiny_mce_init', self::$mce_settings);
1240 1240
 
1241 1241
 		?>
1242 1242
 		<script type="text/javascript">
1243 1243
 		<?php
1244 1244
 
1245
-		if ( self::$ext_plugins )
1246
-			echo self::$ext_plugins . "\n";
1245
+		if (self::$ext_plugins)
1246
+			echo self::$ext_plugins."\n";
1247 1247
 
1248
-		if ( ! is_admin() )
1249
-			echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";';
1248
+		if ( ! is_admin())
1249
+			echo 'var ajaxurl = "'.admin_url('admin-ajax.php', 'relative').'";';
1250 1250
 
1251 1251
 		?>
1252 1252
 
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
 		</script>
1282 1282
 		<?php
1283 1283
 
1284
-		if ( in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) )
1284
+		if (in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true))
1285 1285
 			self::wp_link_dialog();
1286 1286
 
1287 1287
 		/**
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 		 *
1292 1292
 		 * @param array $mce_settings TinyMCE settings array.
1293 1293
 		 */
1294
-		do_action( 'after_wp_tiny_mce', self::$mce_settings );
1294
+		do_action('after_wp_tiny_mce', self::$mce_settings);
1295 1295
 	}
1296 1296
 
1297 1297
 	/**
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
 	 * @global int $content_width
1301 1301
 	 */
1302 1302
 	public static function wp_fullscreen_html() {
1303
-		_deprecated_function( __FUNCTION__, '4.3' );
1303
+		_deprecated_function(__FUNCTION__, '4.3');
1304 1304
 	}
1305 1305
 
1306 1306
 	/**
@@ -1312,9 +1312,9 @@  discard block
 block discarded – undo
1312 1312
 	 * @param array $args Optional. Accepts 'pagenum' and 's' (search) arguments.
1313 1313
 	 * @return false|array Results.
1314 1314
 	 */
1315
-	public static function wp_link_query( $args = array() ) {
1316
-		$pts = get_post_types( array( 'public' => true ), 'objects' );
1317
-		$pt_names = array_keys( $pts );
1315
+	public static function wp_link_query($args = array()) {
1316
+		$pts = get_post_types(array('public' => true), 'objects');
1317
+		$pt_names = array_keys($pts);
1318 1318
 
1319 1319
 		$query = array(
1320 1320
 			'post_type' => $pt_names,
@@ -1325,12 +1325,12 @@  discard block
 block discarded – undo
1325 1325
 			'posts_per_page' => 20,
1326 1326
 		);
1327 1327
 
1328
-		$args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1;
1328
+		$args['pagenum'] = isset($args['pagenum']) ? absint($args['pagenum']) : 1;
1329 1329
 
1330
-		if ( isset( $args['s'] ) )
1330
+		if (isset($args['s']))
1331 1331
 			$query['s'] = $args['s'];
1332 1332
 
1333
-		$query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
1333
+		$query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ($args['pagenum'] - 1) : 0;
1334 1334
 
1335 1335
 		/**
1336 1336
 		 * Filter the link query arguments.
@@ -1343,27 +1343,27 @@  discard block
 block discarded – undo
1343 1343
 		 *
1344 1344
 		 * @param array $query An array of WP_Query arguments.
1345 1345
 		 */
1346
-		$query = apply_filters( 'wp_link_query_args', $query );
1346
+		$query = apply_filters('wp_link_query_args', $query);
1347 1347
 
1348 1348
 		// Do main query.
1349 1349
 		$get_posts = new WP_Query;
1350
-		$posts = $get_posts->query( $query );
1350
+		$posts = $get_posts->query($query);
1351 1351
 		// Check if any posts were found.
1352
-		if ( ! $get_posts->post_count )
1352
+		if ( ! $get_posts->post_count)
1353 1353
 			return false;
1354 1354
 
1355 1355
 		// Build results.
1356 1356
 		$results = array();
1357
-		foreach ( $posts as $post ) {
1358
-			if ( 'post' == $post->post_type )
1359
-				$info = mysql2date( __( 'Y/m/d' ), $post->post_date );
1357
+		foreach ($posts as $post) {
1358
+			if ('post' == $post->post_type)
1359
+				$info = mysql2date(__('Y/m/d'), $post->post_date);
1360 1360
 			else
1361
-				$info = $pts[ $post->post_type ]->labels->singular_name;
1361
+				$info = $pts[$post->post_type]->labels->singular_name;
1362 1362
 
1363 1363
 			$results[] = array(
1364 1364
 				'ID' => $post->ID,
1365
-				'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
1366
-				'permalink' => get_permalink( $post->ID ),
1365
+				'title' => trim(esc_html(strip_tags(get_the_title($post)))),
1366
+				'permalink' => get_permalink($post->ID),
1367 1367
 				'info' => $info,
1368 1368
 			);
1369 1369
 		}
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
 		 * }
1391 1391
 		 * @param array $query  An array of WP_Query arguments.
1392 1392
 		 */
1393
-		return apply_filters( 'wp_link_query', $results, $query );
1393
+		return apply_filters('wp_link_query', $results, $query);
1394 1394
 	}
1395 1395
 
1396 1396
 	/**
@@ -1406,31 +1406,31 @@  discard block
 block discarded – undo
1406 1406
 		<div id="wp-link-backdrop" style="display: none"></div>
1407 1407
 		<div id="wp-link-wrap" class="wp-core-ui" style="display: none" role="dialog" aria-labelledby="link-modal-title">
1408 1408
 		<form id="wp-link" tabindex="-1">
1409
-		<?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?>
1410
-		<h1 id="link-modal-title"><?php _e( 'Insert/edit link' ) ?></h1>
1411
-		<button type="button" id="wp-link-close"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
1409
+		<?php wp_nonce_field('internal-linking', '_ajax_linking_nonce', false); ?>
1410
+		<h1 id="link-modal-title"><?php _e('Insert/edit link') ?></h1>
1411
+		<button type="button" id="wp-link-close"><span class="screen-reader-text"><?php _e('Close'); ?></span></button>
1412 1412
 		<div id="link-selector">
1413 1413
 			<div id="link-options">
1414 1414
 				<div>
1415
-					<label><span><?php _e( 'URL' ); ?></span>
1416
-					<input id="wp-link-url" type="text" role="combobox" aria-autocomplete="list" aria-expanded="false" placeholder="<?php _e( 'Paste URL or type to search' ); ?>" /></label>
1415
+					<label><span><?php _e('URL'); ?></span>
1416
+					<input id="wp-link-url" type="text" role="combobox" aria-autocomplete="list" aria-expanded="false" placeholder="<?php _e('Paste URL or type to search'); ?>" /></label>
1417 1417
 				</div>
1418 1418
 				<div class="wp-link-text-field">
1419
-					<label><span><?php _e( 'Link Text' ); ?></span>
1419
+					<label><span><?php _e('Link Text'); ?></span>
1420 1420
 					<input id="wp-link-text" type="text" /></label>
1421 1421
 				</div>
1422 1422
 				<div class="link-target">
1423 1423
 					<label><span></span>
1424
-					<input type="checkbox" id="wp-link-target" /> <?php _e( 'Open link in a new tab' ); ?></label>
1424
+					<input type="checkbox" id="wp-link-target" /> <?php _e('Open link in a new tab'); ?></label>
1425 1425
 				</div>
1426 1426
 			</div>
1427 1427
 		</div>
1428 1428
 		<div class="submitbox">
1429 1429
 			<div id="wp-link-cancel">
1430
-				<button type="button" class="button"><?php _e( 'Cancel' ); ?></button>
1430
+				<button type="button" class="button"><?php _e('Cancel'); ?></button>
1431 1431
 			</div>
1432 1432
 			<div id="wp-link-update">
1433
-				<input type="submit" value="<?php esc_attr_e( 'Add Link' ); ?>" class="button button-primary" id="wp-link-submit" name="wp-link-submit">
1433
+				<input type="submit" value="<?php esc_attr_e('Add Link'); ?>" class="button button-primary" id="wp-link-submit" name="wp-link-submit">
1434 1434
 			</div>
1435 1435
 		</div>
1436 1436
 		</form>
Please login to merge, or discard this patch.