Index: src/wp-includes/admin-bar.php
===================================================================
--- src/wp-includes/admin-bar.php	(revision 40901)
+++ src/wp-includes/admin-bar.php	(working copy)
@@ -23,8 +23,9 @@
 function _wp_admin_bar_init() {
 	global $wp_admin_bar;
 
-	if ( ! is_admin_bar_showing() )
+	if ( ! is_admin_bar_showing() ) {
 		return false;
+	}
 
 	/* Load the admin bar class code ready for instantiation */
 	require_once( ABSPATH . WPINC . '/class-wp-admin-bar.php' );
@@ -39,10 +40,10 @@
 	 * @param string $wp_admin_bar_class Admin bar class to use. Default 'WP_Admin_Bar'.
 	 */
 	$admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
-	if ( class_exists( $admin_bar_class ) )
+	if ( class_exists( $admin_bar_class ) ) {
 		$wp_admin_bar = new $admin_bar_class;
-	else
-		return false;
+	} else { return false;
+	}
 
 	$wp_admin_bar->initialize();
 	$wp_admin_bar->add_menus();
@@ -68,8 +69,9 @@
 function wp_admin_bar_render() {
 	global $wp_admin_bar;
 
-	if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) )
+	if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) ) {
 		return;
+	}
 
 	/**
 	 * Load all necessary admin bar items.
@@ -135,7 +137,7 @@
 		$wp_admin_bar->add_menu( array(
 			'parent' => 'wp-logo',
 			'id'     => 'about',
-			'title'  => __('About WordPress'),
+			'title'  => __( 'About WordPress' ),
 			'href'   => $about_url,
 		) );
 	}
@@ -144,32 +146,32 @@
 	$wp_admin_bar->add_menu( array(
 		'parent'    => 'wp-logo-external',
 		'id'        => 'wporg',
-		'title'     => __('WordPress.org'),
-		'href'      => __('https://wordpress.org/'),
+		'title'     => __( 'WordPress.org' ),
+		'href'      => __( 'https://wordpress.org/' ),
 	) );
 
 	// Add codex link
 	$wp_admin_bar->add_menu( array(
 		'parent'    => 'wp-logo-external',
 		'id'        => 'documentation',
-		'title'     => __('Documentation'),
-		'href'      => __('https://codex.wordpress.org/'),
+		'title'     => __( 'Documentation' ),
+		'href'      => __( 'https://codex.wordpress.org/' ),
 	) );
 
 	// Add forums link
 	$wp_admin_bar->add_menu( array(
 		'parent'    => 'wp-logo-external',
 		'id'        => 'support-forums',
-		'title'     => __('Support Forums'),
-		'href'      => __('https://wordpress.org/support/'),
+		'title'     => __( 'Support Forums' ),
+		'href'      => __( 'https://wordpress.org/support/' ),
 	) );
 
 	// Add feedback link
 	$wp_admin_bar->add_menu( array(
 		'parent'    => 'wp-logo-external',
 		'id'        => 'feedback',
-		'title'     => __('Feedback'),
-		'href'      => __('https://wordpress.org/support/forum/requests-and-feedback'),
+		'title'     => __( 'Feedback' ),
+		'href'      => __( 'https://wordpress.org/support/forum/requests-and-feedback' ),
 	) );
 }
 
@@ -201,8 +203,9 @@
 	$user_id      = get_current_user_id();
 	$current_user = wp_get_current_user();
 
-	if ( ! $user_id )
+	if ( ! $user_id ) {
 		return;
+	}
 
 	if ( current_user_can( 'read' ) ) {
 		$profile_url = get_edit_profile_url( $user_id );
@@ -239,8 +242,9 @@
 	$user_id      = get_current_user_id();
 	$current_user = wp_get_current_user();
 
-	if ( ! $user_id )
+	if ( ! $user_id ) {
 		return;
+	}
 
 	if ( current_user_can( 'read' ) ) {
 		$profile_url = get_edit_profile_url( $user_id );
@@ -258,8 +262,9 @@
 	$user_info  = get_avatar( $user_id, 64 );
 	$user_info .= "<span class='display-name'>{$current_user->display_name}</span>";
 
-	if ( $current_user->display_name !== $current_user->user_login )
+	if ( $current_user->display_name !== $current_user->user_login ) {
 		$user_info .= "<span class='username'>{$current_user->user_login}</span>";
+	}
 
 	$wp_admin_bar->add_menu( array(
 		'parent' => 'user-actions',
@@ -297,15 +302,16 @@
  */
 function wp_admin_bar_site_menu( $wp_admin_bar ) {
 	// Don't show for logged out users.
-	if ( ! is_user_logged_in() )
+	if ( ! is_user_logged_in() ) {
 		return;
+	}
 
 	// Show only when the user is a member of this site, or they're a super admin.
 	if ( ! is_user_member_of_blog() && ! current_user_can( 'manage_network' ) ) {
 		return;
 	}
 
-	$blogname = get_bloginfo('name');
+	$blogname = get_bloginfo( 'name' );
 
 	if ( ! $blogname ) {
 		$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
@@ -346,8 +352,7 @@
 				'href'   => network_admin_url( 'site-info.php?id=' . get_current_blog_id() ),
 			) );
 		}
-
-	} else if ( current_user_can( 'read' ) ) {
+	} elseif ( current_user_can( 'read' ) ) {
 		// We're on the front end, link to the Dashboard.
 		$wp_admin_bar->add_menu( array(
 			'parent' => 'site-name',
@@ -389,7 +394,9 @@
 
 	$customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() );
 	if ( is_customize_preview() ) {
-		$customize_url = add_query_arg( array( 'changeset_uuid' => $wp_customize->changeset_uuid() ), $customize_url );
+		$customize_url = add_query_arg( array(
+			'changeset_uuid' => $wp_customize->changeset_uuid(),
+		), $customize_url );
 	}
 
 	$wp_admin_bar->add_menu( array(
@@ -412,8 +419,9 @@
  */
 function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
 	// Don't show for logged out users or single site mode.
-	if ( ! is_user_logged_in() || ! is_multisite() )
+	if ( ! is_user_logged_in() || ! is_multisite() ) {
 		return;
+	}
 
 	// Show only when the user has at least one site, or they're a super admin.
 	if ( count( $wp_admin_bar->user->blogs ) < 1 && ! current_user_can( 'manage_network' ) ) {
@@ -441,7 +449,7 @@
 		$wp_admin_bar->add_menu( array(
 			'parent' => 'my-sites-super-admin',
 			'id'     => 'network-admin',
-			'title'  => __('Network Admin'),
+			'title'  => __( 'Network Admin' ),
 			'href'   => network_admin_url(),
 		) );
 
@@ -496,7 +504,7 @@
 				'href'   => network_admin_url( 'settings.php' ),
 			) );
 		}
-	}
+	}// End if().
 
 	// Add site links
 	$wp_admin_bar->add_group( array(
@@ -560,7 +568,7 @@
 		) );
 
 		restore_current_blog();
-	}
+	}// End foreach().
 }
 
 /**
@@ -574,8 +582,9 @@
 	$short = wp_get_shortlink( 0, 'query' );
 	$id = 'get-shortlink';
 
-	if ( empty( $short ) )
+	if ( empty( $short ) ) {
 		return;
+	}
 
 	$html = '<input class="shortlink-input" type="text" readonly="readonly" value="' . esc_attr( $short ) . '" />';
 
@@ -583,7 +592,9 @@
 		'id' => $id,
 		'title' => __( 'Shortlink' ),
 		'href' => $short,
-		'meta' => array( 'html' => $html ),
+		'meta' => array(
+			'html' => $html,
+		),
 	) );
 }
 
@@ -609,75 +620,73 @@
 			&& ( $post_type_object = get_post_type_object( $post->post_type ) )
 			&& current_user_can( 'read_post', $post->ID )
 			&& ( $post_type_object->public )
-			&& ( $post_type_object->show_in_admin_bar ) )
-		{
+			&& ( $post_type_object->show_in_admin_bar ) ) {
 			if ( 'draft' == $post->post_status ) {
 				$preview_link = get_preview_post_link( $post );
 				$wp_admin_bar->add_menu( array(
 					'id' => 'preview',
 					'title' => $post_type_object->labels->view_item,
 					'href' => esc_url( $preview_link ),
-					'meta' => array( 'target' => 'wp-preview-' . $post->ID ),
+					'meta' => array(
+						'target' => 'wp-preview-' . $post->ID,
+					),
 				) );
 			} else {
 				$wp_admin_bar->add_menu( array(
 					'id' => 'view',
 					'title' => $post_type_object->labels->view_item,
-					'href' => get_permalink( $post->ID )
+					'href' => get_permalink( $post->ID ),
 				) );
 			}
 		} elseif ( 'edit' == $current_screen->base
- 			&& ( $post_type_object = get_post_type_object( $current_screen->post_type ) )
- 			&& ( $post_type_object->public )
- 			&& ( $post_type_object->show_in_admin_bar )
- 			&& ( get_post_type_archive_link( $post_type_object->name ) )
-			&& ! ( 'post' === $post_type_object->name && 'posts' === get_option( 'show_on_front' ) ) )
- 		{
- 			$wp_admin_bar->add_node( array(
- 				'id' => 'archive',
- 				'title' => $post_type_object->labels->view_items,
- 				'href' => get_post_type_archive_link( $current_screen->post_type )
- 			) );
+			 && ( $post_type_object = get_post_type_object( $current_screen->post_type ) )
+			 && ( $post_type_object->public )
+			 && ( $post_type_object->show_in_admin_bar )
+			 && ( get_post_type_archive_link( $post_type_object->name ) )
+			&& ! ( 'post' === $post_type_object->name && 'posts' === get_option( 'show_on_front' ) ) ) {
+			 $wp_admin_bar->add_node( array(
+				 'id' => 'archive',
+				 'title' => $post_type_object->labels->view_items,
+				 'href' => get_post_type_archive_link( $current_screen->post_type ),
+			 ) );
 		} elseif ( 'term' == $current_screen->base
 			&& isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag )
 			&& ( $tax = get_taxonomy( $tag->taxonomy ) )
-			&& $tax->public )
-		{
+			&& $tax->public ) {
 			$wp_admin_bar->add_menu( array(
 				'id' => 'view',
 				'title' => $tax->labels->view_item,
-				'href' => get_term_link( $tag )
+				'href' => get_term_link( $tag ),
 			) );
-		}
+		}// End if().
 	} else {
 		$current_object = $wp_the_query->get_queried_object();
 
-		if ( empty( $current_object ) )
+		if ( empty( $current_object ) ) {
 			return;
+		}
 
 		if ( ! empty( $current_object->post_type )
 			&& ( $post_type_object = get_post_type_object( $current_object->post_type ) )
 			&& current_user_can( 'edit_post', $current_object->ID )
 			&& $post_type_object->show_in_admin_bar
-			&& $edit_post_link = get_edit_post_link( $current_object->ID ) )
-		{
+			&& $edit_post_link = get_edit_post_link( $current_object->ID ) ) {
 			$wp_admin_bar->add_menu( array(
 				'id' => 'edit',
 				'title' => $post_type_object->labels->edit_item,
-				'href' => $edit_post_link
+				'href' => $edit_post_link,
 			) );
 		} elseif ( ! empty( $current_object->taxonomy )
 			&& ( $tax = get_taxonomy( $current_object->taxonomy ) )
 			&& current_user_can( 'edit_term', $current_object->term_id )
-			&& $edit_term_link = get_edit_term_link( $current_object->term_id, $current_object->taxonomy ) )
-		{
+			&& $edit_term_link = get_edit_term_link( $current_object->term_id, $current_object->taxonomy ) ) {
 			$wp_admin_bar->add_menu( array(
 				'id' => 'edit',
 				'title' => $tax->labels->edit_item,
-				'href' => $edit_term_link
+				'href' => $edit_term_link,
 			) );
 		}
-	}
+	}// End if().
 }
 
 /**
@@ -690,40 +699,49 @@
 function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
 	$actions = array();
 
-	$cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' );
+	$cpts = (array) get_post_types( array(
+		'show_in_admin_bar' => true,
+	), 'objects' );
 
-	if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->create_posts ) )
-		$actions[ 'post-new.php' ] = array( $cpts['post']->labels->name_admin_bar, 'new-post' );
+	if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->create_posts ) ) {
+		$actions['post-new.php'] = array( $cpts['post']->labels->name_admin_bar, 'new-post' );
+	}
 
-	if ( isset( $cpts['attachment'] ) && current_user_can( 'upload_files' ) )
-		$actions[ 'media-new.php' ] = array( $cpts['attachment']->labels->name_admin_bar, 'new-media' );
+	if ( isset( $cpts['attachment'] ) && current_user_can( 'upload_files' ) ) {
+		$actions['media-new.php'] = array( $cpts['attachment']->labels->name_admin_bar, 'new-media' );
+	}
 
-	if ( current_user_can( 'manage_links' ) )
-		$actions[ 'link-add.php' ] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' );
+	if ( current_user_can( 'manage_links' ) ) {
+		$actions['link-add.php'] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' );
+	}
 
-	if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->create_posts ) )
-		$actions[ 'post-new.php?post_type=page' ] = array( $cpts['page']->labels->name_admin_bar, 'new-page' );
+	if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->create_posts ) ) {
+		$actions['post-new.php?post_type=page'] = array( $cpts['page']->labels->name_admin_bar, 'new-page' );
+	}
 
 	unset( $cpts['post'], $cpts['page'], $cpts['attachment'] );
 
 	// Add any additional custom post types.
 	foreach ( $cpts as $cpt ) {
-		if ( ! current_user_can( $cpt->cap->create_posts ) )
+		if ( ! current_user_can( $cpt->cap->create_posts ) ) {
 			continue;
+		}
 
 		$key = 'post-new.php?post_type=' . $cpt->name;
 		$actions[ $key ] = array( $cpt->labels->name_admin_bar, 'new-' . $cpt->name );
 	}
 	// Avoid clash with parent node and a 'content' post type.
-	if ( isset( $actions['post-new.php?post_type=content'] ) )
+	if ( isset( $actions['post-new.php?post_type=content'] ) ) {
 		$actions['post-new.php?post_type=content'][1] = 'add-new-content';
+	}
 
 	if ( current_user_can( 'create_users' ) || ( is_multisite() && current_user_can( 'promote_users' ) ) ) {
-		$actions[ 'user-new.php' ] = array( _x( 'User', 'add new from admin bar' ), 'new-user' );
+		$actions['user-new.php'] = array( _x( 'User', 'add new from admin bar' ), 'new-user' );
 	}
 
-	if ( ! $actions )
+	if ( ! $actions ) {
 		return;
+	}
 
 	$title = '<span class="ab-icon"></span><span class="ab-label">' . _x( 'New', 'admin bar menu group label' ) . '</span>';
 
@@ -740,7 +758,7 @@
 			'parent'    => 'new-content',
 			'id'        => $id,
 			'title'     => $title,
-			'href'      => admin_url( $link )
+			'href'      => admin_url( $link ),
 		) );
 	}
 }
@@ -753,8 +771,9 @@
  * @param WP_Admin_Bar $wp_admin_bar
  */
 function wp_admin_bar_comments_menu( $wp_admin_bar ) {
-	if ( !current_user_can('edit_posts') )
+	if ( ! current_user_can( 'edit_posts' ) ) {
 		return;
+	}
 
 	$awaiting_mod = wp_count_comments();
 	$awaiting_mod = $awaiting_mod->moderated;
@@ -767,7 +786,7 @@
 	$wp_admin_bar->add_menu( array(
 		'id'    => 'comments',
 		'title' => $icon . $title,
-		'href'  => admin_url('edit-comments.php'),
+		'href'  => admin_url( 'edit-comments.php' ),
 	) );
 }
 
@@ -779,7 +798,10 @@
  * @param WP_Admin_Bar $wp_admin_bar
  */
 function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
-	$wp_admin_bar->add_group( array( 'parent' => 'site-name', 'id' => 'appearance' ) );
+	$wp_admin_bar->add_group( array(
+		'parent' => 'site-name',
+		'id' => 'appearance',
+	) );
 
 	if ( current_user_can( 'switch_themes' ) ) {
 		$wp_admin_bar->add_menu( array(
@@ -794,7 +816,7 @@
 		return;
 	}
 
-	if ( current_theme_supports( 'widgets' )  ) {
+	if ( current_theme_supports( 'widgets' ) ) {
 		$wp_admin_bar->add_menu( array(
 			'parent' => 'appearance',
 			'id'     => 'widgets',
@@ -803,8 +825,14 @@
 		) );
 	}
 
-	if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
-		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) );
+	if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
+		$wp_admin_bar->add_menu( array(
+			'parent' => 'appearance',
+			'id' => 'menus',
+			'title' => __( 'Menus' ),
+			'href' => admin_url( 'nav-menus.php' ),
+		) );
+	}
 
 	if ( current_theme_supports( 'custom-background' ) ) {
 		$wp_admin_bar->add_menu( array(
@@ -843,8 +871,9 @@
 
 	$update_data = wp_get_update_data();
 
-	if ( !$update_data['counts']['total'] )
+	if ( ! $update_data['counts']['total'] ) {
 		return;
+	}
 
 	$title = '<span class="ab-icon"></span><span class="ab-label">' . number_format_i18n( $update_data['counts']['total'] ) . '</span>';
 	$title .= '<span class="screen-reader-text">' . $update_data['title'] . '</span>';
@@ -867,13 +896,14 @@
  * @param WP_Admin_Bar $wp_admin_bar
  */
 function wp_admin_bar_search_menu( $wp_admin_bar ) {
-	if ( is_admin() )
+	if ( is_admin() ) {
 		return;
+	}
 
 	$form  = '<form action="' . esc_url( home_url( '/' ) ) . '" method="get" id="adminbarsearch">';
 	$form .= '<input class="adminbar-input" name="s" id="adminbar-search" type="text" value="" maxlength="150" />';
 	$form .= '<label for="adminbar-search" class="screen-reader-text">' . __( 'Search' ) . '</label>';
-	$form .= '<input type="submit" class="adminbar-button" value="' . __('Search') . '"/>';
+	$form .= '<input type="submit" class="adminbar-button" value="' . __( 'Search' ) . '"/>';
 	$form .= '</form>';
 
 	$wp_admin_bar->add_menu( array(
@@ -883,7 +913,7 @@
 		'meta'   => array(
 			'class'    => 'admin-bar-search',
 			'tabindex' => -1,
-		)
+		),
 	) );
 }
 
@@ -916,7 +946,8 @@
  *
  * @since 3.1.0
  */
-function wp_admin_bar_header() { ?>
+function wp_admin_bar_header() {
+	?>
 <style type="text/css" media="print">#wpadminbar { display:none; }</style>
 <?php
 }
@@ -926,7 +957,8 @@
  *
  * @since 3.1.0
  */
-function _admin_bar_bump_cb() { ?>
+function _admin_bar_bump_cb() {
+	?>
 <style type="text/css" media="screen">
 	html { margin-top: 32px !important; }
 	* html body { margin-top: 32px !important; }
@@ -969,16 +1001,18 @@
 	global $show_admin_bar, $pagenow;
 
 	// For all these types of requests, we never want an admin bar.
-	if ( defined('XMLRPC_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') )
+	if ( defined( 'XMLRPC_REQUEST' ) || defined( 'DOING_AJAX' ) || defined( 'IFRAME_REQUEST' ) ) {
 		return false;
+	}
 
 	if ( is_embed() ) {
 		return false;
 	}
 
 	// Integrated into the admin.
-	if ( is_admin() )
+	if ( is_admin() ) {
 		return true;
+	}
 
 	if ( ! isset( $show_admin_bar ) ) {
 		if ( ! is_user_logged_in() || 'wp-login.php' == $pagenow ) {
@@ -1016,8 +1050,9 @@
  */
 function _get_admin_bar_pref( $context = 'front', $user = 0 ) {
 	$pref = get_user_option( "show_admin_bar_{$context}", $user );
-	if ( false === $pref )
+	if ( false === $pref ) {
 		return true;
+	}
 
 	return 'true' === $pref;
 }
Index: src/wp-includes/author-template.php
===================================================================
--- src/wp-includes/author-template.php	(revision 40901)
+++ src/wp-includes/author-template.php	(working copy)
@@ -20,11 +20,12 @@
  * @param string $deprecated Deprecated.
  * @return string|null The author's display name.
  */
-function get_the_author($deprecated = '') {
+function get_the_author( $deprecated = '' ) {
 	global $authordata;
 
-	if ( !empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '2.1.0' );
+	}
 
 	/**
 	 * Filters the display name of the current post's author.
@@ -33,7 +34,7 @@
 	 *
 	 * @param string $authordata->display_name The author's display name.
 	 */
-	return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
+	return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null );
 }
 
 /**
@@ -84,8 +85,8 @@
  * @return string|void The author's display name.
  */
 function get_the_modified_author() {
-	if ( $last_id = get_post_meta( get_post()->ID, '_edit_last', true) ) {
-		$last_user = get_userdata($last_id);
+	if ( $last_id = get_post_meta( get_post()->ID, '_edit_last', true ) ) {
+		$last_user = get_userdata( $last_id );
 
 		/**
 		 * Filters the display name of the author who last edited the current post.
@@ -94,7 +95,7 @@
 		 *
 		 * @param string $last_user->display_name The author's display name.
 		 */
-		return apply_filters('the_modified_author', $last_user->display_name);
+		return apply_filters( 'the_modified_author', $last_user->display_name );
 	}
 }
 
@@ -131,8 +132,9 @@
 		$authordata = get_userdata( $user_id );
 	}
 
-	if ( in_array( $field, array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ) ) )
+	if ( in_array( $field, array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ) ) ) {
 		$field = 'user_' . $field;
+	}
 
 	$value = isset( $authordata->$field ) ? $authordata->$field : '';
 
@@ -189,9 +191,9 @@
  *                     else the result of get_the_author().
  */
 function get_the_author_link() {
-	if ( get_the_author_meta('url') ) {
+	if ( get_the_author_meta( 'url' ) ) {
 		return sprintf( '<a href="%1$s" title="%2$s" rel="author external">%3$s</a>',
-			esc_url( get_the_author_meta('url') ),
+			esc_url( get_the_author_meta( 'url' ) ),
 			/* translators: %s: author's display name */
 			esc_attr( sprintf( __( 'Visit %s&#8217;s website' ), get_the_author() ) ),
 			get_the_author()
@@ -305,16 +307,17 @@
 	$auth_ID = (int) $author_id;
 	$link = $wp_rewrite->get_author_permastruct();
 
-	if ( empty($link) ) {
+	if ( empty( $link ) ) {
 		$file = home_url( '/' );
 		$link = $file . '?author=' . $auth_ID;
 	} else {
 		if ( '' == $author_nicename ) {
-			$user = get_userdata($author_id);
-			if ( !empty($user->user_nicename) )
+			$user = get_userdata( $author_id );
+			if ( ! empty( $user->user_nicename ) ) {
 				$author_nicename = $user->user_nicename;
+			}
 		}
-		$link = str_replace('%author%', $author_nicename, $link);
+		$link = str_replace( '%author%', $author_nicename, $link );
 		$link = home_url( user_trailingslashit( $link ) );
 	}
 
@@ -371,11 +374,21 @@
 	global $wpdb;
 
 	$defaults = array(
-		'orderby' => 'name', 'order' => 'ASC', 'number' => '',
-		'optioncount' => false, 'exclude_admin' => true,
-		'show_fullname' => false, 'hide_empty' => true,
-		'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true,
-		'style' => 'list', 'html' => true, 'exclude' => '', 'include' => ''
+		'orderby' => 'name',
+	'order' => 'ASC',
+	'number' => '',
+		'optioncount' => false,
+	'exclude_admin' => true,
+		'show_fullname' => false,
+	'hide_empty' => true,
+		'feed' => '',
+	'feed_image' => '',
+	'feed_type' => '',
+	'echo' => true,
+		'style' => 'list',
+	'html' => true,
+	'exclude' => '',
+	'include' => '',
 	);
 
 	$args = wp_parse_args( $args, $defaults );
@@ -387,8 +400,8 @@
 	$authors = get_users( $query_args );
 
 	$author_count = array();
-	foreach ( (array) $wpdb->get_results( "SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author" ) as $row ) {
-		$author_count[$row->post_author] = $row->count;
+	foreach ( (array) $wpdb->get_results( "SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE " . get_private_posts_cap_sql( 'post' ) . ' GROUP BY post_author' ) as $row ) {
+		$author_count[ $row->post_author ] = $row->count;
 	}
 	foreach ( $authors as $author_id ) {
 		$author = get_userdata( $author_id );
@@ -397,7 +410,7 @@
 			continue;
 		}
 
-		$posts = isset( $author_count[$author->ID] ) ? $author_count[$author->ID] : 0;
+		$posts = isset( $author_count[ $author->ID ] ) ? $author_count[ $author->ID ] : 0;
 
 		if ( ! $posts && $args['hide_empty'] ) {
 			continue;
@@ -456,12 +469,12 @@
 		}
 
 		if ( $args['optioncount'] ) {
-			$link .= ' ('. $posts . ')';
+			$link .= ' (' . $posts . ')';
 		}
 
 		$return .= $link;
 		$return .= ( 'list' == $args['style'] ) ? '</li>' : ', ';
-	}
+	}// End foreach().
 
 	$return = rtrim( $return, ', ' );
 
@@ -486,7 +499,7 @@
 	global $wpdb;
 
 	if ( false === ( $is_multi_author = get_transient( 'is_multi_author' ) ) ) {
-		$rows = (array) $wpdb->get_col("SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 2");
+		$rows = (array) $wpdb->get_col( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 2" );
 		$is_multi_author = 1 < count( $rows ) ? 1 : 0;
 		set_transient( 'is_multi_author', $is_multi_author );
 	}
Index: src/wp-includes/bookmark-template.php
===================================================================
--- src/wp-includes/bookmark-template.php	(revision 40901)
+++ src/wp-includes/bookmark-template.php	(working copy)
@@ -50,10 +50,16 @@
  */
 function _walk_bookmarks( $bookmarks, $args = '' ) {
 	$defaults = array(
-		'show_updated' => 0, 'show_description' => 0,
-		'show_images' => 1, 'show_name' => 0,
-		'before' => '<li>', 'after' => '</li>', 'between' => "\n",
-		'show_rating' => 0, 'link_before' => '', 'link_after' => ''
+		'show_updated' => 0,
+	'show_description' => 0,
+		'show_images' => 1,
+	'show_name' => 0,
+		'before' => '<li>',
+	'after' => '</li>',
+	'between' => "\n",
+		'show_rating' => 0,
+	'link_before' => '',
+	'link_after' => '',
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -74,13 +80,13 @@
 		}
 		$desc = esc_attr( sanitize_bookmark_field( 'link_description', $bookmark->link_description, $bookmark->link_id, 'display' ) );
 		$name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) );
- 		$title = $desc;
+		 $title = $desc;
 
 		if ( $r['show_updated'] ) {
 			if ( '00' != substr( $bookmark->link_updated_f, 0, 2 ) ) {
 				$title .= ' (';
 				$title .= sprintf(
-					__('Last updated: %s'),
+					__( 'Last updated: %s' ),
 					date(
 						get_option( 'links_updated_date_format' ),
 						$bookmark->link_updated_f + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS )
@@ -96,7 +102,7 @@
 		}
 		$rel = $bookmark->link_rel;
 		if ( '' != $rel ) {
-			$rel = ' rel="' . esc_attr($rel) . '"';
+			$rel = ' rel="' . esc_attr( $rel ) . '"';
 		}
 		$target = $bookmark->link_target;
 		if ( '' != $target ) {
@@ -110,7 +116,7 @@
 			if ( strpos( $bookmark->link_image, 'http' ) === 0 ) {
 				$output .= "<img src=\"$bookmark->link_image\" $alt $title />";
 			} else { // If it's a relative path
-				$output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title />";
+				$output .= '<img src="' . get_option( 'siteurl' ) . "$bookmark->link_image\" $alt $title />";
 			}
 			if ( $r['show_name'] ) {
 				$output .= " $name";
@@ -140,7 +146,7 @@
 			);
 		}
 		$output .= $r['after'] . "\n";
-	} // end while
+	} // End foreach().
 
 	return $output;
 }
@@ -199,15 +205,24 @@
  */
 function wp_list_bookmarks( $args = '' ) {
 	$defaults = array(
-		'orderby' => 'name', 'order' => 'ASC',
-		'limit' => -1, 'category' => '', 'exclude_category' => '',
-		'category_name' => '', 'hide_invisible' => 1,
-		'show_updated' => 0, 'echo' => 1,
-		'categorize' => 1, 'title_li' => __('Bookmarks'),
-		'title_before' => '<h2>', 'title_after' => '</h2>',
-		'category_orderby' => 'name', 'category_order' => 'ASC',
-		'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">',
-		'category_after' => '</li>'
+		'orderby' => 'name',
+	'order' => 'ASC',
+		'limit' => -1,
+	'category' => '',
+	'exclude_category' => '',
+		'category_name' => '',
+	'hide_invisible' => 1,
+		'show_updated' => 0,
+	'echo' => 1,
+		'categorize' => 1,
+	'title_li' => __( 'Bookmarks' ),
+		'title_before' => '<h2>',
+	'title_after' => '</h2>',
+		'category_orderby' => 'name',
+	'category_order' => 'ASC',
+		'class' => 'linkcat',
+	'category_before' => '<li id="%id" class="%class">',
+		'category_after' => '</li>',
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -217,8 +232,8 @@
 	if ( ! is_array( $r['class'] ) ) {
 		$r['class'] = explode( ' ', $r['class'] );
 	}
- 	$r['class'] = array_map( 'sanitize_html_class', $r['class'] );
- 	$r['class'] = trim( join( ' ', $r['class'] ) );
+	 $r['class'] = array_map( 'sanitize_html_class', $r['class'] );
+	 $r['class'] = trim( join( ' ', $r['class'] ) );
 
 	if ( $r['categorize'] ) {
 		$cats = get_terms( 'link_category', array(
@@ -227,7 +242,7 @@
 			'exclude' => $r['exclude_category'],
 			'orderby' => $r['category_orderby'],
 			'order' => $r['category_order'],
-			'hierarchical' => 0
+			'hierarchical' => 0,
 		) );
 		if ( empty( $cats ) ) {
 			$r['categorize'] = false;
@@ -237,7 +252,9 @@
 	if ( $r['categorize'] ) {
 		// Split the bookmarks into ul's for each category
 		foreach ( (array) $cats as $cat ) {
-			$params = array_merge( $r, array( 'category' => $cat->term_id ) );
+			$params = array_merge( $r, array(
+				'category' => $cat->term_id,
+			) );
 			$bookmarks = get_bookmarks( $params );
 			if ( empty( $bookmarks ) ) {
 				continue;
@@ -272,7 +289,7 @@
 			if ( ! empty( $r['title_li'] ) ) {
 				$output .= str_replace(
 					array( '%id', '%class' ),
-					array( "linkcat-" . $r['category'], $r['class'] ),
+					array( 'linkcat-' . $r['category'], $r['class'] ),
 					$r['category_before']
 				);
 				$output .= $r['title_before'];
@@ -286,7 +303,7 @@
 				$output .= _walk_bookmarks( $bookmarks, $r );
 			}
 		}
-	}
+	}// End if().
 
 	/**
 	 * Filters the bookmarks list before it is echoed or returned.
Index: src/wp-includes/bookmark.php
===================================================================
--- src/wp-includes/bookmark.php	(revision 40901)
+++ src/wp-includes/bookmark.php	(working copy)
@@ -19,40 +19,43 @@
  * @param string $filter Optional, default is 'raw'.
  * @return array|object|null Type returned depends on $output value.
  */
-function get_bookmark($bookmark, $output = OBJECT, $filter = 'raw') {
+function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) {
 	global $wpdb;
 
-	if ( empty($bookmark) ) {
-		if ( isset($GLOBALS['link']) )
+	if ( empty( $bookmark ) ) {
+		if ( isset( $GLOBALS['link'] ) ) {
 			$_bookmark = & $GLOBALS['link'];
-		else
-			$_bookmark = null;
-	} elseif ( is_object($bookmark) ) {
-		wp_cache_add($bookmark->link_id, $bookmark, 'bookmark');
+		} else { $_bookmark = null;
+		}
+	} elseif ( is_object( $bookmark ) ) {
+		wp_cache_add( $bookmark->link_id, $bookmark, 'bookmark' );
 		$_bookmark = $bookmark;
 	} else {
-		if ( isset($GLOBALS['link']) && ($GLOBALS['link']->link_id == $bookmark) ) {
+		if ( isset( $GLOBALS['link'] ) && ($GLOBALS['link']->link_id == $bookmark) ) {
 			$_bookmark = & $GLOBALS['link'];
-		} elseif ( ! $_bookmark = wp_cache_get($bookmark, 'bookmark') ) {
-			$_bookmark = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark));
+		} elseif ( ! $_bookmark = wp_cache_get( $bookmark, 'bookmark' ) ) {
+			$_bookmark = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark ) );
 			if ( $_bookmark ) {
-				$_bookmark->link_category = array_unique( wp_get_object_terms( $_bookmark->link_id, 'link_category', array( 'fields' => 'ids' ) ) );
+				$_bookmark->link_category = array_unique( wp_get_object_terms( $_bookmark->link_id, 'link_category', array(
+					'fields' => 'ids',
+				) ) );
 				wp_cache_add( $_bookmark->link_id, $_bookmark, 'bookmark' );
 			}
 		}
 	}
 
-	if ( ! $_bookmark )
+	if ( ! $_bookmark ) {
 		return $_bookmark;
+	}
 
-	$_bookmark = sanitize_bookmark($_bookmark, $filter);
+	$_bookmark = sanitize_bookmark( $_bookmark, $filter );
 
 	if ( $output == OBJECT ) {
 		return $_bookmark;
 	} elseif ( $output == ARRAY_A ) {
-		return get_object_vars($_bookmark);
+		return get_object_vars( $_bookmark );
 	} elseif ( $output == ARRAY_N ) {
-		return array_values(get_object_vars($_bookmark));
+		return array_values( get_object_vars( $_bookmark ) );
 	} else {
 		return $_bookmark;
 	}
@@ -72,16 +75,19 @@
 	$bookmark = (int) $bookmark;
 	$bookmark = get_bookmark( $bookmark );
 
-	if ( is_wp_error($bookmark) )
+	if ( is_wp_error( $bookmark ) ) {
 		return $bookmark;
+	}
 
-	if ( !is_object($bookmark) )
+	if ( ! is_object( $bookmark ) ) {
 		return '';
+	}
 
-	if ( !isset($bookmark->$field) )
+	if ( ! isset( $bookmark->$field ) ) {
 		return '';
+	}
 
-	return sanitize_bookmark_field($field, $bookmark->$field, $bookmark->link_id, $context);
+	return sanitize_bookmark_field( $field, $bookmark->$field, $bookmark->link_id, $context );
 }
 
 /**
@@ -119,11 +125,16 @@
 	global $wpdb;
 
 	$defaults = array(
-		'orderby' => 'name', 'order' => 'ASC',
-		'limit' => -1, 'category' => '',
-		'category_name' => '', 'hide_invisible' => 1,
-		'show_updated' => 0, 'include' => '',
-		'exclude' => '', 'search' => ''
+		'orderby' => 'name',
+	'order' => 'ASC',
+		'limit' => -1,
+	'category' => '',
+		'category_name' => '',
+	'hide_invisible' => 1,
+		'show_updated' => 0,
+	'include' => '',
+		'exclude' => '',
+	'search' => '',
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -172,7 +183,7 @@
 			}
 		}
 	}
-	if (! empty( $inclusions ) ) {
+	if ( ! empty( $inclusions ) ) {
 		$inclusions .= ')';
 	}
 
@@ -194,7 +205,7 @@
 	}
 
 	if ( ! empty( $r['category_name'] ) ) {
-		if ( $r['category'] = get_term_by('name', $r['category_name'], 'link_category') ) {
+		if ( $r['category'] = get_term_by( 'name', $r['category_name'], 'link_category' ) ) {
 			$r['category'] = $r['category']->term_id;
 		} else {
 			$cache[ $key ] = array();
@@ -207,14 +218,14 @@
 	$search = '';
 	if ( ! empty( $r['search'] ) ) {
 		$like = '%' . $wpdb->esc_like( $r['search'] ) . '%';
-		$search = $wpdb->prepare(" AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ", $like, $like, $like );
+		$search = $wpdb->prepare( ' AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ', $like, $like, $like );
 	}
 
 	$category_query = '';
 	$join = '';
 	if ( ! empty( $r['category'] ) ) {
 		$incategories = preg_split( '/[\s,]+/', $r['category'] );
-		if ( count($incategories) ) {
+		if ( count( $incategories ) ) {
 			foreach ( $incategories as $incat ) {
 				if ( empty( $category_query ) ) {
 					$category_query = ' AND ( tt.term_id = ' . intval( $incat ) . ' ';
@@ -230,7 +241,7 @@
 	}
 
 	if ( $r['show_updated'] ) {
-		$recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated ";
+		$recently_updated_test = ', IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated ';
 	} else {
 		$recently_updated_test = '';
 	}
@@ -241,7 +252,7 @@
 	$length = '';
 	switch ( $orderby ) {
 		case 'length':
-			$length = ", CHAR_LENGTH(link_name) AS length";
+			$length = ', CHAR_LENGTH(link_name) AS length';
 			break;
 		case 'rand':
 			$orderby = 'rand()';
@@ -306,12 +317,25 @@
  *		fields
  * @return stdClass|array Same type as $bookmark but with fields sanitized.
  */
-function sanitize_bookmark($bookmark, $context = 'display') {
-	$fields = array('link_id', 'link_url', 'link_name', 'link_image', 'link_target', 'link_category',
-		'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_updated',
-		'link_rel', 'link_notes', 'link_rss', );
+function sanitize_bookmark( $bookmark, $context = 'display' ) {
+	$fields = array(
+	'link_id',
+	'link_url',
+	'link_name',
+	'link_image',
+	'link_target',
+	'link_category',
+		'link_description',
+	'link_visible',
+	'link_owner',
+	'link_rating',
+	'link_updated',
+		'link_rel',
+	'link_notes',
+	'link_rss',
+	);
 
-	if ( is_object($bookmark) ) {
+	if ( is_object( $bookmark ) ) {
 		$do_object = true;
 		$link_id = $bookmark->link_id;
 	} else {
@@ -321,11 +345,13 @@
 
 	foreach ( $fields as $field ) {
 		if ( $do_object ) {
-			if ( isset($bookmark->$field) )
-				$bookmark->$field = sanitize_bookmark_field($field, $bookmark->$field, $link_id, $context);
+			if ( isset( $bookmark->$field ) ) {
+				$bookmark->$field = sanitize_bookmark_field( $field, $bookmark->$field, $link_id, $context );
+			}
 		} else {
-			if ( isset($bookmark[$field]) )
-				$bookmark[$field] = sanitize_bookmark_field($field, $bookmark[$field], $link_id, $context);
+			if ( isset( $bookmark[ $field ] ) ) {
+				$bookmark[ $field ] = sanitize_bookmark_field( $field, $bookmark[ $field ], $link_id, $context );
+			}
 		}
 	}
 
@@ -358,28 +384,30 @@
  */
 function sanitize_bookmark_field( $field, $value, $bookmark_id, $context ) {
 	switch ( $field ) {
-	case 'link_id' : // ints
-	case 'link_rating' :
-		$value = (int) $value;
+		case 'link_id' : // ints
+		case 'link_rating' :
+			$value = (int) $value;
 		break;
-	case 'link_category' : // array( ints )
-		$value = array_map('absint', (array) $value);
-		// We return here so that the categories aren't filtered.
-		// The 'link_category' filter is for the name of a link category, not an array of a link's link categories
+		case 'link_category' : // array( ints )
+			$value = array_map( 'absint', (array) $value );
+			// We return here so that the categories aren't filtered.
+			// The 'link_category' filter is for the name of a link category, not an array of a link's link categories
 		return $value;
 
-	case 'link_visible' : // bool stored as Y|N
-		$value = preg_replace('/[^YNyn]/', '', $value);
+		case 'link_visible' : // bool stored as Y|N
+			$value = preg_replace( '/[^YNyn]/', '', $value );
 		break;
-	case 'link_target' : // "enum"
-		$targets = array('_top', '_blank');
-		if ( ! in_array($value, $targets) )
-			$value = '';
+		case 'link_target' : // "enum"
+			$targets = array( '_top', '_blank' );
+			if ( ! in_array( $value, $targets ) ) {
+				$value = '';
+			}
 		break;
 	}
 
-	if ( 'raw' == $context )
+	if ( 'raw' == $context ) {
 		return $value;
+	}
 
 	if ( 'edit' == $context ) {
 		/** This filter is documented in wp-includes/post.php */
@@ -388,7 +416,7 @@
 		if ( 'link_notes' == $field ) {
 			$value = esc_html( $value ); // textarea_escaped
 		} else {
-			$value = esc_attr($value);
+			$value = esc_attr( $value );
 		}
 	} elseif ( 'db' == $context ) {
 		/** This filter is documented in wp-includes/post.php */
@@ -417,5 +445,5 @@
 function clean_bookmark_cache( $bookmark_id ) {
 	wp_cache_delete( $bookmark_id, 'bookmark' );
 	wp_cache_delete( 'get_bookmarks', 'bookmark' );
-	clean_object_term_cache( $bookmark_id, 'link');
+	clean_object_term_cache( $bookmark_id, 'link' );
 }
Index: src/wp-includes/cache.php
===================================================================
--- src/wp-includes/cache.php	(revision 40901)
+++ src/wp-includes/cache.php	(working copy)
@@ -81,7 +81,7 @@
 function wp_cache_delete( $key, $group = '' ) {
 	global $wp_object_cache;
 
-	return $wp_object_cache->delete($key, $group);
+	return $wp_object_cache->delete( $key, $group );
 }
 
 /**
@@ -412,18 +412,22 @@
 	 * @return bool False if cache key and group already exist, true on success
 	 */
 	public function add( $key, $data, $group = 'default', $expire = 0 ) {
-		if ( wp_suspend_cache_addition() )
+		if ( wp_suspend_cache_addition() ) {
 			return false;
+		}
 
-		if ( empty( $group ) )
+		if ( empty( $group ) ) {
 			$group = 'default';
+		}
 
 		$id = $key;
-		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) )
+		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
 			$id = $this->blog_prefix . $key;
+		}
 
-		if ( $this->_exists( $id, $group ) )
+		if ( $this->_exists( $id, $group ) ) {
 			return false;
+		}
 
 		return $this->set( $key, $data, $group, (int) $expire );
 	}
@@ -455,24 +459,29 @@
 	 * @return false|int False on failure, the item's new value on success.
 	 */
 	public function decr( $key, $offset = 1, $group = 'default' ) {
-		if ( empty( $group ) )
+		if ( empty( $group ) ) {
 			$group = 'default';
+		}
 
-		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) )
+		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
 			$key = $this->blog_prefix . $key;
+		}
 
-		if ( ! $this->_exists( $key, $group ) )
+		if ( ! $this->_exists( $key, $group ) ) {
 			return false;
+		}
 
-		if ( ! is_numeric( $this->cache[ $group ][ $key ] ) )
+		if ( ! is_numeric( $this->cache[ $group ][ $key ] ) ) {
 			$this->cache[ $group ][ $key ] = 0;
+		}
 
 		$offset = (int) $offset;
 
 		$this->cache[ $group ][ $key ] -= $offset;
 
-		if ( $this->cache[ $group ][ $key ] < 0 )
+		if ( $this->cache[ $group ][ $key ] < 0 ) {
 			$this->cache[ $group ][ $key ] = 0;
+		}
 
 		return $this->cache[ $group ][ $key ];
 	}
@@ -491,16 +500,19 @@
 	 * @return bool False if the contents weren't deleted and true on success.
 	 */
 	public function delete( $key, $group = 'default', $deprecated = false ) {
-		if ( empty( $group ) )
+		if ( empty( $group ) ) {
 			$group = 'default';
+		}
 
-		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) )
+		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
 			$key = $this->blog_prefix . $key;
+		}
 
-		if ( ! $this->_exists( $key, $group ) )
+		if ( ! $this->_exists( $key, $group ) ) {
 			return false;
+		}
 
-		unset( $this->cache[$group][$key] );
+		unset( $this->cache[ $group ][ $key ] );
 		return true;
 	}
 
@@ -539,19 +551,21 @@
 	 * @return false|mixed False on failure to retrieve contents or the cache contents on success.
 	 */
 	public function get( $key, $group = 'default', $force = false, &$found = null ) {
-		if ( empty( $group ) )
+		if ( empty( $group ) ) {
 			$group = 'default';
+		}
 
-		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) )
+		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
 			$key = $this->blog_prefix . $key;
+		}
 
 		if ( $this->_exists( $key, $group ) ) {
 			$found = true;
 			$this->cache_hits += 1;
-			if ( is_object($this->cache[$group][$key]) )
-				return clone $this->cache[$group][$key];
-			else
-				return $this->cache[$group][$key];
+			if ( is_object( $this->cache[ $group ][ $key ] ) ) {
+				return clone $this->cache[ $group ][ $key ];
+			} else { return $this->cache[ $group ][ $key ];
+			}
 		}
 
 		$found = false;
@@ -571,24 +585,29 @@
 	 * @return false|int False on failure, the item's new value on success.
 	 */
 	public function incr( $key, $offset = 1, $group = 'default' ) {
-		if ( empty( $group ) )
+		if ( empty( $group ) ) {
 			$group = 'default';
+		}
 
-		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) )
+		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
 			$key = $this->blog_prefix . $key;
+		}
 
-		if ( ! $this->_exists( $key, $group ) )
+		if ( ! $this->_exists( $key, $group ) ) {
 			return false;
+		}
 
-		if ( ! is_numeric( $this->cache[ $group ][ $key ] ) )
+		if ( ! is_numeric( $this->cache[ $group ][ $key ] ) ) {
 			$this->cache[ $group ][ $key ] = 0;
+		}
 
 		$offset = (int) $offset;
 
 		$this->cache[ $group ][ $key ] += $offset;
 
-		if ( $this->cache[ $group ][ $key ] < 0 )
+		if ( $this->cache[ $group ][ $key ] < 0 ) {
 			$this->cache[ $group ][ $key ] = 0;
+		}
 
 		return $this->cache[ $group ][ $key ];
 	}
@@ -608,15 +627,18 @@
 	 * @return bool False if not exists, true if contents were replaced.
 	 */
 	public function replace( $key, $data, $group = 'default', $expire = 0 ) {
-		if ( empty( $group ) )
+		if ( empty( $group ) ) {
 			$group = 'default';
+		}
 
 		$id = $key;
-		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) )
+		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
 			$id = $this->blog_prefix . $key;
+		}
 
-		if ( ! $this->_exists( $id, $group ) )
+		if ( ! $this->_exists( $id, $group ) ) {
 			return false;
+		}
 
 		return $this->set( $key, $data, $group, (int) $expire );
 	}
@@ -635,8 +657,9 @@
 
 		// Clear out non-global caches since the blog ID has changed.
 		foreach ( array_keys( $this->cache ) as $group ) {
-			if ( ! isset( $this->global_groups[ $group ] ) )
+			if ( ! isset( $this->global_groups[ $group ] ) ) {
 				unset( $this->cache[ $group ] );
+			}
 		}
 	}
 
@@ -662,16 +685,19 @@
 	 * @return true Always returns true.
 	 */
 	public function set( $key, $data, $group = 'default', $expire = 0 ) {
-		if ( empty( $group ) )
+		if ( empty( $group ) ) {
 			$group = 'default';
+		}
 
-		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) )
+		if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
 			$key = $this->blog_prefix . $key;
+		}
 
-		if ( is_object( $data ) )
+		if ( is_object( $data ) ) {
 			$data = clone $data;
+		}
 
-		$this->cache[$group][$key] = $data;
+		$this->cache[ $group ][ $key ] = $data;
 		return true;
 	}
 
@@ -685,12 +711,12 @@
 	 * @access public
 	 */
 	public function stats() {
-		echo "<p>";
+		echo '<p>';
 		echo "<strong>Cache Hits:</strong> {$this->cache_hits}<br />";
 		echo "<strong>Cache Misses:</strong> {$this->cache_misses}<br />";
-		echo "</p>";
+		echo '</p>';
 		echo '<ul>';
-		foreach ($this->cache as $group => $cache) {
+		foreach ( $this->cache as $group => $cache ) {
 			echo "<li><strong>Group:</strong> $group - ( " . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
 		}
 		echo '</ul>';
@@ -732,8 +758,7 @@
 	 */
 	public function __construct() {
 		$this->multisite = is_multisite();
-		$this->blog_prefix =  $this->multisite ? get_current_blog_id() . ':' : '';
-
+		$this->blog_prefix = $this->multisite ? get_current_blog_id() . ':' : '';
 
 		/**
 		 * @todo This should be moved to the PHP4 style constructor, PHP5
Index: src/wp-includes/canonical.php
===================================================================
--- src/wp-includes/canonical.php	(revision 40901)
+++ src/wp-includes/canonical.php	(working copy)
@@ -55,7 +55,7 @@
 		}
 	}
 
-	if ( is_trackback() || is_search() || is_admin() || is_preview() || is_robots() || ( $is_IIS && !iis7_supports_permalinks() ) ) {
+	if ( is_trackback() || is_search() || is_admin() || is_preview() || is_robots() || ( $is_IIS && ! iis7_supports_permalinks() ) ) {
 		return;
 	}
 
@@ -66,7 +66,7 @@
 		$requested_url .= $_SERVER['REQUEST_URI'];
 	}
 
-	$original = @parse_url($requested_url);
+	$original = @parse_url( $requested_url );
 	if ( false === $original ) {
 		return;
 	}
@@ -75,10 +75,12 @@
 	$redirect_url = false;
 
 	// Notice fixing
-	if ( !isset($redirect['path']) )
+	if ( ! isset( $redirect['path'] ) ) {
 		$redirect['path'] = '';
-	if ( !isset($redirect['query']) )
+	}
+	if ( ! isset( $redirect['query'] ) ) {
 		$redirect['query'] = '';
+	}
 
 	// If the original URL ended with non-breaking spaces, they were almost
 	// certainly inserted by accident. Let's remove them, so the reader doesn't
@@ -92,21 +94,23 @@
 
 	if ( is_feed() && ( $id = get_query_var( 'p' ) ) ) {
 		if ( $redirect_url = get_post_comments_feed_link( $id, get_query_var( 'feed' ) ) ) {
-			$redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type', 'feed'), $redirect_url );
+			$redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type', 'feed' ), $redirect_url );
 			$redirect['path'] = parse_url( $redirect_url, PHP_URL_PATH );
 		}
 	}
 
-	if ( is_singular() && 1 > $wp_query->post_count && ($id = get_query_var('p')) ) {
+	if ( is_singular() && 1 > $wp_query->post_count && ($id = get_query_var( 'p' )) ) {
 
-		$vars = $wpdb->get_results( $wpdb->prepare("SELECT post_type, post_parent FROM $wpdb->posts WHERE ID = %d", $id) );
+		$vars = $wpdb->get_results( $wpdb->prepare( "SELECT post_type, post_parent FROM $wpdb->posts WHERE ID = %d", $id ) );
 
-		if ( isset($vars[0]) && $vars = $vars[0] ) {
-			if ( 'revision' == $vars->post_type && $vars->post_parent > 0 )
+		if ( isset( $vars[0] ) && $vars = $vars[0] ) {
+			if ( 'revision' == $vars->post_type && $vars->post_parent > 0 ) {
 				$id = $vars->post_parent;
+			}
 
-			if ( $redirect_url = get_permalink($id) )
+			if ( $redirect_url = get_permalink( $id ) ) {
 				$redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url );
+			}
 		}
 	}
 
@@ -114,11 +118,11 @@
 	if ( is_404() ) {
 
 		// Redirect ?page_id, ?p=, ?attachment_id= to their respective url's
-		$id = max( get_query_var('p'), get_query_var('page_id'), get_query_var('attachment_id') );
-		if ( $id && $redirect_post = get_post($id) ) {
-			$post_type_obj = get_post_type_object($redirect_post->post_type);
+		$id = max( get_query_var( 'p' ), get_query_var( 'page_id' ), get_query_var( 'attachment_id' ) );
+		if ( $id && $redirect_post = get_post( $id ) ) {
+			$post_type_obj = get_post_type_object( $redirect_post->post_type );
 			if ( $post_type_obj->public && 'auto-draft' != $redirect_post->post_status ) {
-				$redirect_url = get_permalink($redirect_post);
+				$redirect_url = get_permalink( $redirect_post );
 				$redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url );
 			}
 		}
@@ -149,8 +153,7 @@
 			$redirect['query'] = remove_query_arg( 'page', $redirect['query'] );
 			$redirect_url = get_permalink( $wp_query->post->ID );
 		}
-
-	} elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) {
+	} elseif ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) {
 		// rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101
 		if ( is_attachment() &&
 			! array_diff( array_keys( $wp->query_vars ), array( 'attachment', 'attachment_id' ) ) &&
@@ -163,62 +166,71 @@
 			} else {
 				$redirect_url = get_attachment_link();
 			}
-		} elseif ( is_single() && !empty($_GET['p']) && ! $redirect_url ) {
-			if ( $redirect_url = get_permalink(get_query_var('p')) )
-				$redirect['query'] = remove_query_arg(array('p', 'post_type'), $redirect['query']);
-		} elseif ( is_single() && !empty($_GET['name'])  && ! $redirect_url ) {
-			if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) )
-				$redirect['query'] = remove_query_arg('name', $redirect['query']);
-		} elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) {
-			if ( $redirect_url = get_permalink(get_query_var('page_id')) )
-				$redirect['query'] = remove_query_arg('page_id', $redirect['query']);
-		} elseif ( is_page() && !is_feed() && 'page' == get_option('show_on_front') && get_queried_object_id() == get_option('page_on_front')  && ! $redirect_url ) {
-			$redirect_url = home_url('/');
-		} elseif ( is_home() && !empty($_GET['page_id']) && 'page' == get_option('show_on_front') && get_query_var('page_id') == get_option('page_for_posts')  && ! $redirect_url ) {
-			if ( $redirect_url = get_permalink(get_option('page_for_posts')) )
-				$redirect['query'] = remove_query_arg('page_id', $redirect['query']);
-		} elseif ( !empty($_GET['m']) && ( is_year() || is_month() || is_day() ) ) {
-			$m = get_query_var('m');
-			switch ( strlen($m) ) {
+		} elseif ( is_single() && ! empty( $_GET['p'] ) && ! $redirect_url ) {
+			if ( $redirect_url = get_permalink( get_query_var( 'p' ) ) ) {
+				$redirect['query'] = remove_query_arg( array( 'p', 'post_type' ), $redirect['query'] );
+			}
+		} elseif ( is_single() && ! empty( $_GET['name'] )  && ! $redirect_url ) {
+			if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) ) {
+				$redirect['query'] = remove_query_arg( 'name', $redirect['query'] );
+			}
+		} elseif ( is_page() && ! empty( $_GET['page_id'] ) && ! $redirect_url ) {
+			if ( $redirect_url = get_permalink( get_query_var( 'page_id' ) ) ) {
+				$redirect['query'] = remove_query_arg( 'page_id', $redirect['query'] );
+			}
+		} elseif ( is_page() && ! is_feed() && 'page' == get_option( 'show_on_front' ) && get_queried_object_id() == get_option( 'page_on_front' )  && ! $redirect_url ) {
+			$redirect_url = home_url( '/' );
+		} elseif ( is_home() && ! empty( $_GET['page_id'] ) && 'page' == get_option( 'show_on_front' ) && get_query_var( 'page_id' ) == get_option( 'page_for_posts' )  && ! $redirect_url ) {
+			if ( $redirect_url = get_permalink( get_option( 'page_for_posts' ) ) ) {
+				$redirect['query'] = remove_query_arg( 'page_id', $redirect['query'] );
+			}
+		} elseif ( ! empty( $_GET['m'] ) && ( is_year() || is_month() || is_day() ) ) {
+			$m = get_query_var( 'm' );
+			switch ( strlen( $m ) ) {
 				case 4: // Yearly
-					$redirect_url = get_year_link($m);
+					$redirect_url = get_year_link( $m );
 					break;
 				case 6: // Monthly
-					$redirect_url = get_month_link( substr($m, 0, 4), substr($m, 4, 2) );
+					$redirect_url = get_month_link( substr( $m, 0, 4 ), substr( $m, 4, 2 ) );
 					break;
 				case 8: // Daily
-					$redirect_url = get_day_link(substr($m, 0, 4), substr($m, 4, 2), substr($m, 6, 2));
+					$redirect_url = get_day_link( substr( $m, 0, 4 ), substr( $m, 4, 2 ), substr( $m, 6, 2 ) );
 					break;
 			}
-			if ( $redirect_url )
-				$redirect['query'] = remove_query_arg('m', $redirect['query']);
-		// now moving on to non ?m=X year/month/day links
-		} elseif ( is_day() && get_query_var('year') && get_query_var('monthnum') && !empty($_GET['day']) ) {
-			if ( $redirect_url = get_day_link(get_query_var('year'), get_query_var('monthnum'), get_query_var('day')) )
-				$redirect['query'] = remove_query_arg(array('year', 'monthnum', 'day'), $redirect['query']);
-		} elseif ( is_month() && get_query_var('year') && !empty($_GET['monthnum']) ) {
-			if ( $redirect_url = get_month_link(get_query_var('year'), get_query_var('monthnum')) )
-				$redirect['query'] = remove_query_arg(array('year', 'monthnum'), $redirect['query']);
-		} elseif ( is_year() && !empty($_GET['year']) ) {
-			if ( $redirect_url = get_year_link(get_query_var('year')) )
-				$redirect['query'] = remove_query_arg('year', $redirect['query']);
-		} elseif ( is_author() && !empty($_GET['author']) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
-			$author = get_userdata(get_query_var('author'));
+			if ( $redirect_url ) {
+				$redirect['query'] = remove_query_arg( 'm', $redirect['query'] );
+			}
+		} elseif ( is_day() && get_query_var( 'year' ) && get_query_var( 'monthnum' ) && ! empty( $_GET['day'] ) ) {
+			if ( $redirect_url = get_day_link( get_query_var( 'year' ), get_query_var( 'monthnum' ), get_query_var( 'day' ) ) ) {
+				$redirect['query'] = remove_query_arg( array( 'year', 'monthnum', 'day' ), $redirect['query'] );
+			}
+		} elseif ( is_month() && get_query_var( 'year' ) && ! empty( $_GET['monthnum'] ) ) {
+			if ( $redirect_url = get_month_link( get_query_var( 'year' ), get_query_var( 'monthnum' ) ) ) {
+				$redirect['query'] = remove_query_arg( array( 'year', 'monthnum' ), $redirect['query'] );
+			}
+		} elseif ( is_year() && ! empty( $_GET['year'] ) ) {
+			if ( $redirect_url = get_year_link( get_query_var( 'year' ) ) ) {
+				$redirect['query'] = remove_query_arg( 'year', $redirect['query'] );
+			}
+		} elseif ( is_author() && ! empty( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
+			$author = get_userdata( get_query_var( 'author' ) );
 			if ( ( false !== $author ) && $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_author = %d AND $wpdb->posts.post_status = 'publish' LIMIT 1", $author->ID ) ) ) {
-				if ( $redirect_url = get_author_posts_url($author->ID, $author->user_nicename) )
-					$redirect['query'] = remove_query_arg('author', $redirect['query']);
+				if ( $redirect_url = get_author_posts_url( $author->ID, $author->user_nicename ) ) {
+					$redirect['query'] = remove_query_arg( 'author', $redirect['query'] );
+				}
 			}
 		} elseif ( is_category() || is_tag() || is_tax() ) { // Terms (Tags/categories)
 
 			$term_count = 0;
-			foreach ( $wp_query->tax_query->queried_terms as $tax_query )
+			foreach ( $wp_query->tax_query->queried_terms as $tax_query ) {
 				$term_count += count( $tax_query['terms'] );
+			}
 
 			$obj = $wp_query->get_queried_object();
-			if ( $term_count <= 1 && !empty($obj->term_id) && ( $tax_url = get_term_link((int)$obj->term_id, $obj->taxonomy) ) && !is_wp_error($tax_url) ) {
-				if ( !empty($redirect['query']) ) {
+			if ( $term_count <= 1 && ! empty( $obj->term_id ) && ( $tax_url = get_term_link( (int) $obj->term_id, $obj->taxonomy ) ) && ! is_wp_error( $tax_url ) ) {
+				if ( ! empty( $redirect['query'] ) ) {
 					// Strip taxonomy query vars off the url.
-					$qv_remove = array( 'term', 'taxonomy');
+					$qv_remove = array( 'term', 'taxonomy' );
 					if ( is_category() ) {
 						$qv_remove[] = 'category_name';
 						$qv_remove[] = 'cat';
@@ -227,44 +239,45 @@
 						$qv_remove[] = 'tag_id';
 					} else { // Custom taxonomies will have a custom query var, remove those too:
 						$tax_obj = get_taxonomy( $obj->taxonomy );
-						if ( false !== $tax_obj->query_var )
+						if ( false !== $tax_obj->query_var ) {
 							$qv_remove[] = $tax_obj->query_var;
+						}
 					}
 
-					$rewrite_vars = array_diff( array_keys($wp_query->query), array_keys($_GET) );
+					$rewrite_vars = array_diff( array_keys( $wp_query->query ), array_keys( $_GET ) );
 
-					if ( !array_diff($rewrite_vars, array_keys($_GET))  ) { // Check to see if all the Query vars are coming from the rewrite, none are set via $_GET
-						$redirect['query'] = remove_query_arg($qv_remove, $redirect['query']); //Remove all of the per-tax qv's
+					if ( ! array_diff( $rewrite_vars, array_keys( $_GET ) ) ) { // Check to see if all the Query vars are coming from the rewrite, none are set via $_GET
+						$redirect['query'] = remove_query_arg( $qv_remove, $redirect['query'] ); //Remove all of the per-tax qv's
 
 						// Create the destination url for this taxonomy
-						$tax_url = parse_url($tax_url);
-						if ( ! empty($tax_url['query']) ) { // Taxonomy accessible via ?taxonomy=..&term=.. or any custom qv..
-							parse_str($tax_url['query'], $query_vars);
-							$redirect['query'] = add_query_arg($query_vars, $redirect['query']);
+						$tax_url = parse_url( $tax_url );
+						if ( ! empty( $tax_url['query'] ) ) { // Taxonomy accessible via ?taxonomy=..&term=.. or any custom qv..
+							parse_str( $tax_url['query'], $query_vars );
+							$redirect['query'] = add_query_arg( $query_vars, $redirect['query'] );
 						} else { // Taxonomy is accessible via a "pretty-URL"
 							$redirect['path'] = $tax_url['path'];
 						}
-
 					} else { // Some query vars are set via $_GET. Unset those from $_GET that exist via the rewrite
 						foreach ( $qv_remove as $_qv ) {
-							if ( isset($rewrite_vars[$_qv]) )
-								$redirect['query'] = remove_query_arg($_qv, $redirect['query']);
+							if ( isset( $rewrite_vars[ $_qv ] ) ) {
+								$redirect['query'] = remove_query_arg( $_qv, $redirect['query'] );
+							}
 						}
 					}
-				}
-
-			}
-		} elseif ( is_single() && strpos($wp_rewrite->permalink_structure, '%category%') !== false && $cat = get_query_var( 'category_name' ) ) {
+				}// End if().
+			}// End if().
+		} elseif ( is_single() && strpos( $wp_rewrite->permalink_structure, '%category%' ) !== false && $cat = get_query_var( 'category_name' ) ) {
 			$category = get_category_by_path( $cat );
 			if ( ( ! $category || is_wp_error( $category ) ) || ! has_term( $category->term_id, 'category', $wp_query->get_queried_object_id() ) ) {
-				$redirect_url = get_permalink($wp_query->get_queried_object_id());
+				$redirect_url = get_permalink( $wp_query->get_queried_object_id() );
 			}
-		}
+		}// End if().
 
-		// Post Paging
-		if ( is_singular() && get_query_var('page') ) {
-			if ( !$redirect_url )
+			// Post Paging
+		if ( is_singular() && get_query_var( 'page' ) ) {
+			if ( ! $redirect_url ) {
 				$redirect_url = get_permalink( get_queried_object_id() );
+			}
 
 			$page = get_query_var( 'page' );
 			if ( $page > 1 ) {
@@ -274,36 +287,37 @@
 					$redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( $page, 'single_paged' );
 				}
 			}
-			$redirect['query'] = remove_query_arg( 'page', $redirect['query'] );
+				$redirect['query'] = remove_query_arg( 'page', $redirect['query'] );
 		}
 
-		// paging and feeds
-		if ( get_query_var('paged') || is_feed() || get_query_var('cpage') ) {
+			// paging and feeds
+		if ( get_query_var( 'paged' ) || is_feed() || get_query_var( 'cpage' ) ) {
 			while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+(/+)?$#", $redirect['path'] ) ) {
 				// Strip off paging and feed
-				$redirect['path'] = preg_replace("#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing paging
-				$redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path']); // strip off feed endings
-				$redirect['path'] = preg_replace("#/{$wp_rewrite->comments_pagination_base}-[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing comment paging
+				$redirect['path'] = preg_replace( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path'] ); // strip off any existing paging
+				$redirect['path'] = preg_replace( '#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path'] ); // strip off feed endings
+				$redirect['path'] = preg_replace( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+?(/+)?$#", '/', $redirect['path'] ); // strip off any existing comment paging
 			}
 
 			$addl_path = '';
-			if ( is_feed() && in_array( get_query_var('feed'), $wp_rewrite->feeds ) ) {
-				$addl_path = !empty( $addl_path ) ? trailingslashit($addl_path) : '';
-				if ( !is_singular() && get_query_var( 'withcomments' ) )
+			if ( is_feed() && in_array( get_query_var( 'feed' ), $wp_rewrite->feeds ) ) {
+				$addl_path = ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '';
+				if ( ! is_singular() && get_query_var( 'withcomments' ) ) {
 					$addl_path .= 'comments/';
-				if ( ( 'rss' == get_default_feed() && 'feed' == get_query_var('feed') ) || 'rss' == get_query_var('feed') )
+				}
+				if ( ( 'rss' == get_default_feed() && 'feed' == get_query_var( 'feed' ) ) || 'rss' == get_query_var( 'feed' ) ) {
 					$addl_path .= user_trailingslashit( 'feed/' . ( ( get_default_feed() == 'rss2' ) ? '' : 'rss2' ), 'feed' );
-				else
-					$addl_path .= user_trailingslashit( 'feed/' . ( ( get_default_feed() ==  get_query_var('feed') || 'feed' == get_query_var('feed') ) ? '' : get_query_var('feed') ), 'feed' );
+				} else { $addl_path .= user_trailingslashit( 'feed/' . ( ( get_default_feed() == get_query_var( 'feed' ) || 'feed' == get_query_var( 'feed' ) ) ? '' : get_query_var( 'feed' ) ), 'feed' );
+				}
 				$redirect['query'] = remove_query_arg( 'feed', $redirect['query'] );
-			} elseif ( is_feed() && 'old' == get_query_var('feed') ) {
+			} elseif ( is_feed() && 'old' == get_query_var( 'feed' ) ) {
 				$old_feed_files = array(
-					'wp-atom.php'         => 'atom',
-					'wp-commentsrss2.php' => 'comments_rss2',
-					'wp-feed.php'         => get_default_feed(),
-					'wp-rdf.php'          => 'rdf',
-					'wp-rss.php'          => 'rss2',
-					'wp-rss2.php'         => 'rss2',
+				'wp-atom.php'         => 'atom',
+				'wp-commentsrss2.php' => 'comments_rss2',
+				'wp-feed.php'         => get_default_feed(),
+				'wp-rdf.php'          => 'rdf',
+				'wp-rss.php'          => 'rss2',
+				'wp-rss2.php'         => 'rss2',
 				);
 				if ( isset( $old_feed_files[ basename( $redirect['path'] ) ] ) ) {
 					$redirect_url = get_feed_link( $old_feed_files[ basename( $redirect['path'] ) ] );
@@ -312,14 +326,14 @@
 				}
 			}
 
-			if ( get_query_var('paged') > 0 ) {
-				$paged = get_query_var('paged');
+			if ( get_query_var( 'paged' ) > 0 ) {
+				$paged = get_query_var( 'paged' );
 				$redirect['query'] = remove_query_arg( 'paged', $redirect['query'] );
-				if ( !is_feed() ) {
-					if ( $paged > 1 && !is_single() ) {
-						$addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit("$wp_rewrite->pagination_base/$paged", 'paged');
-					} elseif ( !is_single() ) {
-						$addl_path = !empty( $addl_path ) ? trailingslashit($addl_path) : '';
+				if ( ! is_feed() ) {
+					if ( $paged > 1 && ! is_single() ) {
+						$addl_path = ( ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '' ) . user_trailingslashit( "$wp_rewrite->pagination_base/$paged", 'paged' );
+					} elseif ( ! is_single() ) {
+						$addl_path = ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '';
 					}
 				} elseif ( $paged > 1 ) {
 					$redirect['query'] = add_query_arg( 'paged', $paged, $redirect['query'] );
@@ -327,20 +341,22 @@
 			}
 
 			if ( get_option( 'page_comments' ) && (
-				( 'newest' == get_option( 'default_comments_page' ) && get_query_var( 'cpage' ) > 0 ) ||
-				( 'newest' != get_option( 'default_comments_page' ) && get_query_var( 'cpage' ) > 1 )
+			( 'newest' == get_option( 'default_comments_page' ) && get_query_var( 'cpage' ) > 0 ) ||
+			( 'newest' != get_option( 'default_comments_page' ) && get_query_var( 'cpage' ) > 1 )
 			) ) {
-				$addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . get_query_var('cpage'), 'commentpaged' );
+				$addl_path = ( ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '' ) . user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . get_query_var( 'cpage' ), 'commentpaged' );
 				$redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] );
 			}
 
-			$redirect['path'] = user_trailingslashit( preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/?$|', '/', $redirect['path']) ); // strip off trailing /index.php/
-			if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($redirect['path'], '/' . $wp_rewrite->index . '/') === false )
-				$redirect['path'] = trailingslashit($redirect['path']) . $wp_rewrite->index . '/';
-			if ( !empty( $addl_path ) )
-				$redirect['path'] = trailingslashit($redirect['path']) . $addl_path;
+			$redirect['path'] = user_trailingslashit( preg_replace( '|/' . preg_quote( $wp_rewrite->index, '|' ) . '/?$|', '/', $redirect['path'] ) ); // strip off trailing /index.php/
+			if ( ! empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos( $redirect['path'], '/' . $wp_rewrite->index . '/' ) === false ) {
+				$redirect['path'] = trailingslashit( $redirect['path'] ) . $wp_rewrite->index . '/';
+			}
+			if ( ! empty( $addl_path ) ) {
+				$redirect['path'] = trailingslashit( $redirect['path'] ) . $addl_path;
+			}
 			$redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . $redirect['path'];
-		}
+		}// End if().
 
 		if ( 'wp-register.php' == basename( $redirect['path'] ) ) {
 			if ( is_multisite() ) {
@@ -353,53 +369,57 @@
 			wp_redirect( $redirect_url, 301 );
 			die();
 		}
-	}
+	}// End if().
 
 	// tack on any additional query vars
 	$redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] );
-	if ( $redirect_url && !empty($redirect['query']) ) {
+	if ( $redirect_url && ! empty( $redirect['query'] ) ) {
 		parse_str( $redirect['query'], $_parsed_query );
-		$redirect = @parse_url($redirect_url);
+		$redirect = @parse_url( $redirect_url );
 
 		if ( ! empty( $_parsed_query['name'] ) && ! empty( $redirect['query'] ) ) {
 			parse_str( $redirect['query'], $_parsed_redirect_query );
 
-			if ( empty( $_parsed_redirect_query['name'] ) )
+			if ( empty( $_parsed_redirect_query['name'] ) ) {
 				unset( $_parsed_query['name'] );
+			}
 		}
 
 		$_parsed_query = rawurlencode_deep( $_parsed_query );
 		$redirect_url = add_query_arg( $_parsed_query, $redirect_url );
 	}
 
-	if ( $redirect_url )
-		$redirect = @parse_url($redirect_url);
+	if ( $redirect_url ) {
+		$redirect = @parse_url( $redirect_url );
+	}
 
 	// www.example.com vs example.com
-	$user_home = @parse_url(home_url());
-	if ( !empty($user_home['host']) )
+	$user_home = @parse_url( home_url() );
+	if ( ! empty( $user_home['host'] ) ) {
 		$redirect['host'] = $user_home['host'];
-	if ( empty($user_home['path']) )
+	}
+	if ( empty( $user_home['path'] ) ) {
 		$user_home['path'] = '/';
+	}
 
 	// Handle ports
-	if ( !empty($user_home['port']) )
+	if ( ! empty( $user_home['port'] ) ) {
 		$redirect['port'] = $user_home['port'];
-	else
-		unset($redirect['port']);
+	} else { unset( $redirect['port'] );
+	}
 
 	// trailing /index.php
-	$redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']);
+	$redirect['path'] = preg_replace( '|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path'] );
 
 	// Remove trailing spaces from the path
 	$redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] );
 
-	if ( !empty( $redirect['query'] ) ) {
+	if ( ! empty( $redirect['query'] ) ) {
 		// Remove trailing spaces from certain terminating query string args
 		$redirect['query'] = preg_replace( '#((p|page_id|cat|tag)=[^&]*?)(%20| )+$#', '$1', $redirect['query'] );
 
 		// Clean up empty query strings
-		$redirect['query'] = trim(preg_replace( '#(^|&)(p|page_id|cat|tag)=?(&|$)#', '&', $redirect['query']), '&');
+		$redirect['query'] = trim( preg_replace( '#(^|&)(p|page_id|cat|tag)=?(&|$)#', '&', $redirect['query'] ), '&' );
 
 		// Redirect obsolete feeds
 		$redirect['query'] = preg_replace( '#(^|&)feed=rss(&|$)#', '$1feed=rss2$2', $redirect['query'] );
@@ -409,65 +429,75 @@
 	}
 
 	// strip /index.php/ when we're not using PATHINFO permalinks
-	if ( !$wp_rewrite->using_index_permalinks() )
+	if ( ! $wp_rewrite->using_index_permalinks() ) {
 		$redirect['path'] = str_replace( '/' . $wp_rewrite->index . '/', '/', $redirect['path'] );
+	}
 
 	// trailing slashes
-	if ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() && !is_404() && (!is_front_page() || ( is_front_page() && (get_query_var('paged') > 1) ) ) ) {
+	if ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() && ! is_404() && ( ! is_front_page() || ( is_front_page() && (get_query_var( 'paged' ) > 1) ) ) ) {
 		$user_ts_type = '';
-		if ( get_query_var('paged') > 0 ) {
+		if ( get_query_var( 'paged' ) > 0 ) {
 			$user_ts_type = 'paged';
 		} else {
-			foreach ( array('single', 'category', 'page', 'day', 'month', 'year', 'home') as $type ) {
+			foreach ( array( 'single', 'category', 'page', 'day', 'month', 'year', 'home' ) as $type ) {
 				$func = 'is_' . $type;
-				if ( call_user_func($func) ) {
+				if ( call_user_func( $func ) ) {
 					$user_ts_type = $type;
 					break;
 				}
 			}
 		}
-		$redirect['path'] = user_trailingslashit($redirect['path'], $user_ts_type);
+		$redirect['path'] = user_trailingslashit( $redirect['path'], $user_ts_type );
 	} elseif ( is_front_page() ) {
-		$redirect['path'] = trailingslashit($redirect['path']);
+		$redirect['path'] = trailingslashit( $redirect['path'] );
 	}
 
 	// Strip multiple slashes out of the URL
-	if ( strpos($redirect['path'], '//') > -1 )
-		$redirect['path'] = preg_replace('|/+|', '/', $redirect['path']);
+	if ( strpos( $redirect['path'], '//' ) > -1 ) {
+		$redirect['path'] = preg_replace( '|/+|', '/', $redirect['path'] );
+	}
 
 	// Always trailing slash the Front Page URL
-	if ( trailingslashit( $redirect['path'] ) == trailingslashit( $user_home['path'] ) )
-		$redirect['path'] = trailingslashit($redirect['path']);
+	if ( trailingslashit( $redirect['path'] ) == trailingslashit( $user_home['path'] ) ) {
+		$redirect['path'] = trailingslashit( $redirect['path'] );
+	}
 
 	// Ignore differences in host capitalization, as this can lead to infinite redirects
 	// Only redirect no-www <=> yes-www
-	if ( strtolower($original['host']) == strtolower($redirect['host']) ||
-		( strtolower($original['host']) != 'www.' . strtolower($redirect['host']) && 'www.' . strtolower($original['host']) != strtolower($redirect['host']) ) )
+	if ( strtolower( $original['host'] ) == strtolower( $redirect['host'] ) ||
+		( strtolower( $original['host'] ) != 'www.' . strtolower( $redirect['host'] ) && 'www.' . strtolower( $original['host'] ) != strtolower( $redirect['host'] ) ) ) {
 		$redirect['host'] = $original['host'];
+	}
 
 	$compare_original = array( $original['host'], $original['path'] );
 
-	if ( !empty( $original['port'] ) )
+	if ( ! empty( $original['port'] ) ) {
 		$compare_original[] = $original['port'];
+	}
 
-	if ( !empty( $original['query'] ) )
+	if ( ! empty( $original['query'] ) ) {
 		$compare_original[] = $original['query'];
+	}
 
 	$compare_redirect = array( $redirect['host'], $redirect['path'] );
 
-	if ( !empty( $redirect['port'] ) )
+	if ( ! empty( $redirect['port'] ) ) {
 		$compare_redirect[] = $redirect['port'];
+	}
 
-	if ( !empty( $redirect['query'] ) )
+	if ( ! empty( $redirect['query'] ) ) {
 		$compare_redirect[] = $redirect['query'];
+	}
 
 	if ( $compare_original !== $compare_redirect ) {
 		$redirect_url = $redirect['scheme'] . '://' . $redirect['host'];
-		if ( !empty($redirect['port']) )
+		if ( ! empty( $redirect['port'] ) ) {
 			$redirect_url .= ':' . $redirect['port'];
+		}
 		$redirect_url .= $redirect['path'];
-		if ( !empty($redirect['query']) )
+		if ( ! empty( $redirect['query'] ) ) {
 			$redirect_url .= '?' . $redirect['query'];
+		}
 	}
 
 	if ( ! $redirect_url || $redirect_url == $requested_url ) {
@@ -475,8 +505,8 @@
 	}
 
 	// Hex encoded octets are case-insensitive.
-	if ( false !== strpos($requested_url, '%') ) {
-		if ( !function_exists('lowercase_octets') ) {
+	if ( false !== strpos( $requested_url, '%' ) ) {
+		if ( ! function_exists( 'lowercase_octets' ) ) {
 			/**
 			 * Converts the first hex-encoded octet match to lowercase.
 			 *
@@ -486,11 +516,11 @@
 			 * @param array $matches Hex-encoded octet matches for the requested URL.
 			 * @return string Lowercased version of the first match.
 			 */
-			function lowercase_octets($matches) {
+			function lowercase_octets( $matches ) {
 				return strtolower( $matches[0] );
 			}
 		}
-		$requested_url = preg_replace_callback('|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url);
+		$requested_url = preg_replace_callback( '|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url );
 	}
 
 	/**
@@ -512,8 +542,8 @@
 
 	if ( $do_redirect ) {
 		// protect against chained redirects
-		if ( !redirect_canonical($redirect_url, false) ) {
-			wp_redirect($redirect_url, 301);
+		if ( ! redirect_canonical( $redirect_url, false ) ) {
+			wp_redirect( $redirect_url, 301 );
 			exit();
 		} else {
 			// Debug
@@ -537,13 +567,14 @@
  * @param string $url
  * @return string The altered query string
  */
-function _remove_qs_args_if_not_in_url( $query_string, Array $args_to_check, $url ) {
+function _remove_qs_args_if_not_in_url( $query_string, array $args_to_check, $url ) {
 	$parsed_url = @parse_url( $url );
 	if ( ! empty( $parsed_url['query'] ) ) {
 		parse_str( $parsed_url['query'], $parsed_query );
 		foreach ( $args_to_check as $qv ) {
-			if ( !isset( $parsed_query[$qv] ) )
+			if ( ! isset( $parsed_query[ $qv ] ) ) {
 				$query_string = remove_query_arg( $qv, $query_string );
+			}
 		}
 	} else {
 		$query_string = remove_query_arg( $args_to_check, $query_string );
@@ -588,31 +619,37 @@
 function redirect_guess_404_permalink() {
 	global $wpdb;
 
-	if ( get_query_var('name') ) {
-		$where = $wpdb->prepare("post_name LIKE %s", $wpdb->esc_like( get_query_var('name') ) . '%');
+	if ( get_query_var( 'name' ) ) {
+		$where = $wpdb->prepare( 'post_name LIKE %s', $wpdb->esc_like( get_query_var( 'name' ) ) . '%' );
 
 		// if any of post_type, year, monthnum, or day are set, use them to refine the query
-		if ( get_query_var('post_type') )
-			$where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type'));
-		else
-			$where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')";
-
-		if ( get_query_var('year') )
-			$where .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var('year'));
-		if ( get_query_var('monthnum') )
-			$where .= $wpdb->prepare(" AND MONTH(post_date) = %d", get_query_var('monthnum'));
-		if ( get_query_var('day') )
-			$where .= $wpdb->prepare(" AND DAYOFMONTH(post_date) = %d", get_query_var('day'));
+		if ( get_query_var( 'post_type' ) ) {
+			$where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) );
+		} else { $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array(
+				'public' => true,
+		) ) ) . "')";
+		}
+
+		if ( get_query_var( 'year' ) ) {
+			$where .= $wpdb->prepare( ' AND YEAR(post_date) = %d', get_query_var( 'year' ) );
+		}
+		if ( get_query_var( 'monthnum' ) ) {
+			$where .= $wpdb->prepare( ' AND MONTH(post_date) = %d', get_query_var( 'monthnum' ) );
+		}
+		if ( get_query_var( 'day' ) ) {
+			$where .= $wpdb->prepare( ' AND DAYOFMONTH(post_date) = %d', get_query_var( 'day' ) );
+		}
 
-		$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE $where AND post_status = 'publish'");
-		if ( ! $post_id )
+		$post_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE $where AND post_status = 'publish'" );
+		if ( ! $post_id ) {
 			return false;
-		if ( get_query_var( 'feed' ) )
+		}
+		if ( get_query_var( 'feed' ) ) {
 			return get_post_comments_feed_link( $post_id, get_query_var( 'feed' ) );
-		elseif ( get_query_var( 'page' ) && 1 < get_query_var( 'page' ) )
+		} elseif ( get_query_var( 'page' ) && 1 < get_query_var( 'page' ) ) {
 			return trailingslashit( get_permalink( $post_id ) ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' );
-		else
-			return get_permalink( $post_id );
+		} else { return get_permalink( $post_id );
+		}
 	}
 
 	return false;
@@ -630,8 +667,9 @@
  */
 function wp_redirect_admin_locations() {
 	global $wp_rewrite;
-	if ( ! ( is_404() && $wp_rewrite->using_permalinks() ) )
+	if ( ! ( is_404() && $wp_rewrite->using_permalinks() ) ) {
 		return;
+	}
 
 	$admins = array(
 		home_url( 'wp-admin', 'relative' ),
Index: src/wp-includes/capabilities.php
===================================================================
--- src/wp-includes/capabilities.php	(revision 40901)
+++ src/wp-includes/capabilities.php	(working copy)
@@ -31,474 +31,479 @@
 	$caps = array();
 
 	switch ( $cap ) {
-	case 'remove_user':
-		// In multisite the user must be a super admin to remove themselves.
-		if ( isset( $args[0] ) && $user_id == $args[0] && ! is_super_admin( $user_id ) ) {
-			$caps[] = 'do_not_allow';
-		} else {
-			$caps[] = 'remove_users';
-		}
-		break;
-	case 'promote_user':
-	case 'add_users':
-		$caps[] = 'promote_users';
-		break;
-	case 'edit_user':
-	case 'edit_users':
-		// Allow user to edit itself
-		if ( 'edit_user' == $cap && isset( $args[0] ) && $user_id == $args[0] )
-			break;
-
-		// In multisite the user must have manage_network_users caps. If editing a super admin, the user must be a super admin.
-		if ( is_multisite() && ( ( ! is_super_admin( $user_id ) && 'edit_user' === $cap && is_super_admin( $args[0] ) ) || ! user_can( $user_id, 'manage_network_users' ) ) ) {
-			$caps[] = 'do_not_allow';
-		} else {
-			$caps[] = 'edit_users'; // edit_user maps to edit_users.
-		}
+		case 'remove_user':
+			// In multisite the user must be a super admin to remove themselves.
+			if ( isset( $args[0] ) && $user_id == $args[0] && ! is_super_admin( $user_id ) ) {
+				$caps[] = 'do_not_allow';
+			} else {
+				$caps[] = 'remove_users';
+			}
 		break;
-	case 'delete_post':
-	case 'delete_page':
-		$post = get_post( $args[0] );
-		if ( ! $post ) {
-			$caps[] = 'do_not_allow';
-			break;
-		}
+		case 'promote_user':
+		case 'add_users':
+			$caps[] = 'promote_users';
+		break;
+		case 'edit_user':
+		case 'edit_users':
+			// Allow user to edit itself
+			if ( 'edit_user' == $cap && isset( $args[0] ) && $user_id == $args[0] ) {
+				break;
+			}
 
-		if ( 'revision' == $post->post_type ) {
-			$post = get_post( $post->post_parent );
+			// In multisite the user must have manage_network_users caps. If editing a super admin, the user must be a super admin.
+			if ( is_multisite() && ( ( ! is_super_admin( $user_id ) && 'edit_user' === $cap && is_super_admin( $args[0] ) ) || ! user_can( $user_id, 'manage_network_users' ) ) ) {
+				$caps[] = 'do_not_allow';
+			} else {
+				$caps[] = 'edit_users'; // edit_user maps to edit_users.
+			}
+		break;
+		case 'delete_post':
+		case 'delete_page':
+			$post = get_post( $args[0] );
 			if ( ! $post ) {
 				$caps[] = 'do_not_allow';
 				break;
 			}
-		}
 
-		if ( ( get_option( 'page_for_posts' ) == $post->ID ) || ( get_option( 'page_on_front' ) == $post->ID ) ) {
-			$caps[] = 'manage_options';
-			break;
-		}
+			if ( 'revision' == $post->post_type ) {
+				$post = get_post( $post->post_parent );
+				if ( ! $post ) {
+					$caps[] = 'do_not_allow';
+					break;
+				}
+			}
 
-		$post_type = get_post_type_object( $post->post_type );
-		if ( ! $post_type ) {
-			/* translators: 1: post type, 2: capability name */
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
-			$caps[] = 'edit_others_posts';
-			break;
-		}
+			if ( ( get_option( 'page_for_posts' ) == $post->ID ) || ( get_option( 'page_on_front' ) == $post->ID ) ) {
+				$caps[] = 'manage_options';
+				break;
+			}
 
-		if ( ! $post_type->map_meta_cap ) {
-			$caps[] = $post_type->cap->$cap;
-			// Prior to 3.1 we would re-call map_meta_cap here.
-			if ( 'delete_post' == $cap )
-				$cap = $post_type->cap->$cap;
-			break;
-		}
+			$post_type = get_post_type_object( $post->post_type );
+			if ( ! $post_type ) {
+				/* translators: 1: post type, 2: capability name */
+				_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
+				$caps[] = 'edit_others_posts';
+				break;
+			}
 
-		// If the post author is set and the user is the author...
-		if ( $post->post_author && $user_id == $post->post_author ) {
-			// If the post is published or scheduled...
-			if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {
-				$caps[] = $post_type->cap->delete_published_posts;
-			} elseif ( 'trash' == $post->post_status ) {
-				$status = get_post_meta( $post->ID, '_wp_trash_meta_status', true );
-				if ( in_array( $status, array( 'publish', 'future' ), true ) ) {
+			if ( ! $post_type->map_meta_cap ) {
+				$caps[] = $post_type->cap->$cap;
+				// Prior to 3.1 we would re-call map_meta_cap here.
+				if ( 'delete_post' == $cap ) {
+					$cap = $post_type->cap->$cap;
+				}
+				break;
+			}
+
+			// If the post author is set and the user is the author...
+			if ( $post->post_author && $user_id == $post->post_author ) {
+				// If the post is published or scheduled...
+				if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {
 					$caps[] = $post_type->cap->delete_published_posts;
+				} elseif ( 'trash' == $post->post_status ) {
+					$status = get_post_meta( $post->ID, '_wp_trash_meta_status', true );
+					if ( in_array( $status, array( 'publish', 'future' ), true ) ) {
+						$caps[] = $post_type->cap->delete_published_posts;
+					} else {
+						$caps[] = $post_type->cap->delete_posts;
+					}
 				} else {
+					// If the post is draft...
 					$caps[] = $post_type->cap->delete_posts;
 				}
 			} else {
-				// If the post is draft...
-				$caps[] = $post_type->cap->delete_posts;
-			}
-		} else {
-			// The user is trying to edit someone else's post.
-			$caps[] = $post_type->cap->delete_others_posts;
-			// The post is published or scheduled, extra cap required.
-			if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {
-				$caps[] = $post_type->cap->delete_published_posts;
-			} elseif ( 'private' == $post->post_status ) {
-				$caps[] = $post_type->cap->delete_private_posts;
+				// The user is trying to edit someone else's post.
+				$caps[] = $post_type->cap->delete_others_posts;
+				// The post is published or scheduled, extra cap required.
+				if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {
+					$caps[] = $post_type->cap->delete_published_posts;
+				} elseif ( 'private' == $post->post_status ) {
+					$caps[] = $post_type->cap->delete_private_posts;
+				}
 			}
-		}
 		break;
 		// edit_post breaks down to edit_posts, edit_published_posts, or
 		// edit_others_posts
-	case 'edit_post':
-	case 'edit_page':
-		$post = get_post( $args[0] );
-		if ( ! $post ) {
-			$caps[] = 'do_not_allow';
-			break;
-		}
-
-		if ( 'revision' == $post->post_type ) {
-			$post = get_post( $post->post_parent );
+		case 'edit_post':
+		case 'edit_page':
+			$post = get_post( $args[0] );
 			if ( ! $post ) {
 				$caps[] = 'do_not_allow';
 				break;
 			}
-		}
 
-		$post_type = get_post_type_object( $post->post_type );
-		if ( ! $post_type ) {
-			/* translators: 1: post type, 2: capability name */
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
-			$caps[] = 'edit_others_posts';
-			break;
-		}
+			if ( 'revision' == $post->post_type ) {
+				$post = get_post( $post->post_parent );
+				if ( ! $post ) {
+					$caps[] = 'do_not_allow';
+					break;
+				}
+			}
 
-		if ( ! $post_type->map_meta_cap ) {
-			$caps[] = $post_type->cap->$cap;
-			// Prior to 3.1 we would re-call map_meta_cap here.
-			if ( 'edit_post' == $cap )
-				$cap = $post_type->cap->$cap;
-			break;
-		}
+			$post_type = get_post_type_object( $post->post_type );
+			if ( ! $post_type ) {
+				/* translators: 1: post type, 2: capability name */
+				_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
+				$caps[] = 'edit_others_posts';
+				break;
+			}
 
-		// If the post author is set and the user is the author...
-		if ( $post->post_author && $user_id == $post->post_author ) {
-			// If the post is published or scheduled...
-			if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {
-				$caps[] = $post_type->cap->edit_published_posts;
-			} elseif ( 'trash' == $post->post_status ) {
-				$status = get_post_meta( $post->ID, '_wp_trash_meta_status', true );
-				if ( in_array( $status, array( 'publish', 'future' ), true ) ) {
+			if ( ! $post_type->map_meta_cap ) {
+				$caps[] = $post_type->cap->$cap;
+				// Prior to 3.1 we would re-call map_meta_cap here.
+				if ( 'edit_post' == $cap ) {
+					$cap = $post_type->cap->$cap;
+				}
+				break;
+			}
+
+			// If the post author is set and the user is the author...
+			if ( $post->post_author && $user_id == $post->post_author ) {
+				// If the post is published or scheduled...
+				if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {
 					$caps[] = $post_type->cap->edit_published_posts;
+				} elseif ( 'trash' == $post->post_status ) {
+					$status = get_post_meta( $post->ID, '_wp_trash_meta_status', true );
+					if ( in_array( $status, array( 'publish', 'future' ), true ) ) {
+						$caps[] = $post_type->cap->edit_published_posts;
+					} else {
+						$caps[] = $post_type->cap->edit_posts;
+					}
 				} else {
+					// If the post is draft...
 					$caps[] = $post_type->cap->edit_posts;
 				}
 			} else {
-				// If the post is draft...
-				$caps[] = $post_type->cap->edit_posts;
-			}
-		} else {
-			// The user is trying to edit someone else's post.
-			$caps[] = $post_type->cap->edit_others_posts;
-			// The post is published or scheduled, extra cap required.
-			if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {
-				$caps[] = $post_type->cap->edit_published_posts;
-			} elseif ( 'private' == $post->post_status ) {
-				$caps[] = $post_type->cap->edit_private_posts;
+				// The user is trying to edit someone else's post.
+				$caps[] = $post_type->cap->edit_others_posts;
+				// The post is published or scheduled, extra cap required.
+				if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {
+					$caps[] = $post_type->cap->edit_published_posts;
+				} elseif ( 'private' == $post->post_status ) {
+					$caps[] = $post_type->cap->edit_private_posts;
+				}
 			}
-		}
 		break;
-	case 'read_post':
-	case 'read_page':
-		$post = get_post( $args[0] );
-		if ( ! $post ) {
-			$caps[] = 'do_not_allow';
-			break;
-		}
-
-		if ( 'revision' == $post->post_type ) {
-			$post = get_post( $post->post_parent );
+		case 'read_post':
+		case 'read_page':
+			$post = get_post( $args[0] );
 			if ( ! $post ) {
 				$caps[] = 'do_not_allow';
 				break;
 			}
-		}
 
-		$post_type = get_post_type_object( $post->post_type );
-		if ( ! $post_type ) {
-			/* translators: 1: post type, 2: capability name */
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
-			$caps[] = 'edit_others_posts';
-			break;
-		}
+			if ( 'revision' == $post->post_type ) {
+				$post = get_post( $post->post_parent );
+				if ( ! $post ) {
+					$caps[] = 'do_not_allow';
+					break;
+				}
+			}
 
-		if ( ! $post_type->map_meta_cap ) {
-			$caps[] = $post_type->cap->$cap;
-			// Prior to 3.1 we would re-call map_meta_cap here.
-			if ( 'read_post' == $cap )
-				$cap = $post_type->cap->$cap;
-			break;
-		}
+			$post_type = get_post_type_object( $post->post_type );
+			if ( ! $post_type ) {
+				/* translators: 1: post type, 2: capability name */
+				_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
+				$caps[] = 'edit_others_posts';
+				break;
+			}
 
-		$status_obj = get_post_status_object( $post->post_status );
-		if ( $status_obj->public ) {
-			$caps[] = $post_type->cap->read;
-			break;
-		}
+			if ( ! $post_type->map_meta_cap ) {
+				$caps[] = $post_type->cap->$cap;
+				// Prior to 3.1 we would re-call map_meta_cap here.
+				if ( 'read_post' == $cap ) {
+					$cap = $post_type->cap->$cap;
+				}
+				break;
+			}
 
-		if ( $post->post_author && $user_id == $post->post_author ) {
-			$caps[] = $post_type->cap->read;
-		} elseif ( $status_obj->private ) {
-			$caps[] = $post_type->cap->read_private_posts;
-		} else {
-			$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
-		}
+			$status_obj = get_post_status_object( $post->post_status );
+			if ( $status_obj->public ) {
+				$caps[] = $post_type->cap->read;
+				break;
+			}
+
+			if ( $post->post_author && $user_id == $post->post_author ) {
+				$caps[] = $post_type->cap->read;
+			} elseif ( $status_obj->private ) {
+				$caps[] = $post_type->cap->read_private_posts;
+			} else {
+				$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
+			}
 		break;
-	case 'publish_post':
-		$post = get_post( $args[0] );
-		if ( ! $post ) {
-			$caps[] = 'do_not_allow';
-			break;
-		}
+		case 'publish_post':
+			$post = get_post( $args[0] );
+			if ( ! $post ) {
+				$caps[] = 'do_not_allow';
+				break;
+			}
 
-		$post_type = get_post_type_object( $post->post_type );
-		if ( ! $post_type ) {
-			/* translators: 1: post type, 2: capability name */
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
-			$caps[] = 'edit_others_posts';
-			break;
-		}
+			$post_type = get_post_type_object( $post->post_type );
+			if ( ! $post_type ) {
+				/* translators: 1: post type, 2: capability name */
+				_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
+				$caps[] = 'edit_others_posts';
+				break;
+			}
 
-		$caps[] = $post_type->cap->publish_posts;
+			$caps[] = $post_type->cap->publish_posts;
 		break;
-	case 'edit_post_meta':
-	case 'delete_post_meta':
-	case 'add_post_meta':
-	case 'edit_comment_meta':
-	case 'delete_comment_meta':
-	case 'add_comment_meta':
-	case 'edit_term_meta':
-	case 'delete_term_meta':
-	case 'add_term_meta':
-	case 'edit_user_meta':
-	case 'delete_user_meta':
-	case 'add_user_meta':
-		list( $_, $object_type, $_ ) = explode( '_', $cap );
-		$object_id = (int) $args[0];
-
-		switch ( $object_type ) {
-			case 'post':
-				$post = get_post( $object_id );
-				if ( ! $post ) {
+		case 'edit_post_meta':
+		case 'delete_post_meta':
+		case 'add_post_meta':
+		case 'edit_comment_meta':
+		case 'delete_comment_meta':
+		case 'add_comment_meta':
+		case 'edit_term_meta':
+		case 'delete_term_meta':
+		case 'add_term_meta':
+		case 'edit_user_meta':
+		case 'delete_user_meta':
+		case 'add_user_meta':
+			list( $_, $object_type, $_ ) = explode( '_', $cap );
+			$object_id = (int) $args[0];
+
+			switch ( $object_type ) {
+				case 'post':
+					$post = get_post( $object_id );
+					if ( ! $post ) {
+						break;
+					}
+
+					$sub_type = get_post_type( $post );
 					break;
-				}
 
-				$sub_type = get_post_type( $post );
-				break;
+				case 'comment':
+					$comment = get_comment( $object_id );
+					if ( ! $comment ) {
+						break;
+					}
 
-			case 'comment':
-				$comment = get_comment( $object_id );
-				if ( ! $comment ) {
+					$sub_type = empty( $comment->comment_type ) ? 'comment' : $comment->comment_type;
 					break;
-				}
 
-				$sub_type = empty( $comment->comment_type ) ? 'comment' : $comment->comment_type;
-				break;
+				case 'term':
+					$term = get_term( $object_id );
+					if ( ! $term ) {
+						break;
+					}
 
-			case 'term':
-				$term = get_term( $object_id );
-				if ( ! $term ) {
+					$sub_type = $term->taxonomy;
 					break;
-				}
 
-				$sub_type = $term->taxonomy;
-				break;
+				case 'user':
+					$user = get_user_by( 'id', $object_id );
+					if ( ! $user ) {
+						break;
+					}
 
-			case 'user':
-				$user = get_user_by( 'id', $object_id );
-				if ( ! $user ) {
+					$sub_type = 'user';
 					break;
-				}
+			}// End switch().
 
-				$sub_type = 'user';
+			if ( empty( $sub_type ) ) {
+				$caps[] = 'do_not_allow';
 				break;
-		}
-
-		if ( empty( $sub_type ) ) {
-			$caps[] = 'do_not_allow';
-			break;
-		}
+			}
 
-		$caps = map_meta_cap( "edit_{$object_type}", $user_id, $object_id );
+			$caps = map_meta_cap( "edit_{$object_type}", $user_id, $object_id );
 
-		$meta_key = isset( $args[1] ) ? $args[1] : false;
+			$meta_key = isset( $args[1] ) ? $args[1] : false;
 
-		$has_filter = has_filter( "auth_{$object_type}_meta_{$meta_key}" ) || has_filter( "auth_{$object_type}_{$sub_type}_meta_{$meta_key}" );
-		if ( $meta_key && $has_filter ) {
-			/** This filter is documented in wp-includes/meta.php */
-			$allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", false, $meta_key, $object_id, $user_id, $cap, $caps );
+			$has_filter = has_filter( "auth_{$object_type}_meta_{$meta_key}" ) || has_filter( "auth_{$object_type}_{$sub_type}_meta_{$meta_key}" );
+			if ( $meta_key && $has_filter ) {
+				/** This filter is documented in wp-includes/meta.php */
+				$allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", false, $meta_key, $object_id, $user_id, $cap, $caps );
 
-			/** This filter is documented in wp-includes/meta.php */
-			$allowed = apply_filters( "auth_{$object_type}_{$sub_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );
+				/** This filter is documented in wp-includes/meta.php */
+				$allowed = apply_filters( "auth_{$object_type}_{$sub_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );
 
-			if ( ! $allowed ) {
+				if ( ! $allowed ) {
+					$caps[] = $cap;
+				}
+			} elseif ( $meta_key && is_protected_meta( $meta_key, $object_type ) ) {
 				$caps[] = $cap;
 			}
-		} elseif ( $meta_key && is_protected_meta( $meta_key, $object_type ) ) {
-			$caps[] = $cap;
-		}
 		break;
-	case 'edit_comment':
-		$comment = get_comment( $args[0] );
-		if ( ! $comment ) {
-			$caps[] = 'do_not_allow';
-			break;
-		}
+		case 'edit_comment':
+			$comment = get_comment( $args[0] );
+			if ( ! $comment ) {
+				$caps[] = 'do_not_allow';
+				break;
+			}
 
-		$post = get_post( $comment->comment_post_ID );
+			$post = get_post( $comment->comment_post_ID );
 
-		/*
-		 * If the post doesn't exist, we have an orphaned comment.
-		 * Fall back to the edit_posts capability, instead.
-		 */
-		if ( $post ) {
-			$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
-		} else {
-			$caps = map_meta_cap( 'edit_posts', $user_id );
-		}
-		break;
-	case 'unfiltered_upload':
-		if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin( $user_id ) )  )
-			$caps[] = $cap;
-		else
-			$caps[] = 'do_not_allow';
+			/*
+			 * If the post doesn't exist, we have an orphaned comment.
+			 * Fall back to the edit_posts capability, instead.
+			 */
+			if ( $post ) {
+				$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
+			} else {
+				$caps = map_meta_cap( 'edit_posts', $user_id );
+			}
 		break;
-	case 'edit_css' :
-	case 'unfiltered_html' :
-		// Disallow unfiltered_html for all users, even admins and super admins.
-		if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML )
-			$caps[] = 'do_not_allow';
-		elseif ( is_multisite() && ! is_super_admin( $user_id ) )
-			$caps[] = 'do_not_allow';
-		else
-			$caps[] = 'unfiltered_html';
-		break;
-	case 'edit_files':
-	case 'edit_plugins':
-	case 'edit_themes':
-		// Disallow the file editors.
-		if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
-			$caps[] = 'do_not_allow';
-		elseif ( ! wp_is_file_mod_allowed( 'capability_edit_themes' ) )
-			$caps[] = 'do_not_allow';
-		elseif ( is_multisite() && ! is_super_admin( $user_id ) )
-			$caps[] = 'do_not_allow';
-		else
-			$caps[] = $cap;
+		case 'unfiltered_upload':
+			if ( defined( 'ALLOW_UNFILTERED_UPLOADS' ) && ALLOW_UNFILTERED_UPLOADS && ( ! is_multisite() || is_super_admin( $user_id ) ) ) {
+				$caps[] = $cap;
+			} else { $caps[] = 'do_not_allow';
+			}
 		break;
-	case 'update_plugins':
-	case 'delete_plugins':
-	case 'install_plugins':
-	case 'upload_plugins':
-	case 'update_themes':
-	case 'delete_themes':
-	case 'install_themes':
-	case 'upload_themes':
-	case 'update_core':
-		// Disallow anything that creates, deletes, or updates core, plugin, or theme files.
-		// Files in uploads are excepted.
-		if ( ! wp_is_file_mod_allowed( 'capability_update_core' ) ) {
-			$caps[] = 'do_not_allow';
-		} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
-			$caps[] = 'do_not_allow';
-		} elseif ( 'upload_themes' === $cap ) {
-			$caps[] = 'install_themes';
-		} elseif ( 'upload_plugins' === $cap ) {
-			$caps[] = 'install_plugins';
-		} else {
-			$caps[] = $cap;
-		}
+		case 'edit_css' :
+		case 'unfiltered_html' :
+			// Disallow unfiltered_html for all users, even admins and super admins.
+			if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ) {
+				$caps[] = 'do_not_allow';
+			} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
+				$caps[] = 'do_not_allow';
+			} else { $caps[] = 'unfiltered_html';
+			}
 		break;
-	case 'activate_plugins':
-		$caps[] = $cap;
-		if ( is_multisite() ) {
-			// update_, install_, and delete_ are handled above with is_super_admin().
-			$menu_perms = get_site_option( 'menu_items', array() );
-			if ( empty( $menu_perms['plugins'] ) )
-				$caps[] = 'manage_network_plugins';
-		}
+		case 'edit_files':
+		case 'edit_plugins':
+		case 'edit_themes':
+			// Disallow the file editors.
+			if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) {
+				$caps[] = 'do_not_allow';
+			} elseif ( ! wp_is_file_mod_allowed( 'capability_edit_themes' ) ) {
+				$caps[] = 'do_not_allow';
+			} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
+				$caps[] = 'do_not_allow';
+			} else { $caps[] = $cap;
+			}
 		break;
-	case 'delete_user':
-	case 'delete_users':
-		// If multisite only super admins can delete users.
-		if ( is_multisite() && ! is_super_admin( $user_id ) )
-			$caps[] = 'do_not_allow';
-		else
-			$caps[] = 'delete_users'; // delete_user maps to delete_users.
+		case 'update_plugins':
+		case 'delete_plugins':
+		case 'install_plugins':
+		case 'upload_plugins':
+		case 'update_themes':
+		case 'delete_themes':
+		case 'install_themes':
+		case 'upload_themes':
+		case 'update_core':
+			// Disallow anything that creates, deletes, or updates core, plugin, or theme files.
+			// Files in uploads are excepted.
+			if ( ! wp_is_file_mod_allowed( 'capability_update_core' ) ) {
+				$caps[] = 'do_not_allow';
+			} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
+				$caps[] = 'do_not_allow';
+			} elseif ( 'upload_themes' === $cap ) {
+				$caps[] = 'install_themes';
+			} elseif ( 'upload_plugins' === $cap ) {
+				$caps[] = 'install_plugins';
+			} else {
+				$caps[] = $cap;
+			}
 		break;
-	case 'create_users':
-		if ( !is_multisite() )
+		case 'activate_plugins':
 			$caps[] = $cap;
-		elseif ( is_super_admin( $user_id ) || get_site_option( 'add_new_users' ) )
-			$caps[] = $cap;
-		else
-			$caps[] = 'do_not_allow';
+			if ( is_multisite() ) {
+				// update_, install_, and delete_ are handled above with is_super_admin().
+				$menu_perms = get_site_option( 'menu_items', array() );
+				if ( empty( $menu_perms['plugins'] ) ) {
+					$caps[] = 'manage_network_plugins';
+				}
+			}
 		break;
-	case 'manage_links' :
-		if ( get_option( 'link_manager_enabled' ) )
-			$caps[] = $cap;
-		else
-			$caps[] = 'do_not_allow';
+		case 'delete_user':
+		case 'delete_users':
+			// If multisite only super admins can delete users.
+			if ( is_multisite() && ! is_super_admin( $user_id ) ) {
+				$caps[] = 'do_not_allow';
+			} else { $caps[] = 'delete_users'; // End if().
+			}
 		break;
-	case 'customize' :
-		$caps[] = 'edit_theme_options';
+		case 'create_users':
+			if ( ! is_multisite() ) {
+				$caps[] = $cap;
+			} elseif ( is_super_admin( $user_id ) || get_site_option( 'add_new_users' ) ) {
+				$caps[] = $cap;
+			} else { $caps[] = 'do_not_allow';
+			}
 		break;
-	case 'delete_site':
-		if ( is_multisite() ) {
-			$caps[] = 'manage_options';
-		} else {
-			$caps[] = 'do_not_allow';
-		}
+		case 'manage_links' :
+			if ( get_option( 'link_manager_enabled' ) ) {
+				$caps[] = $cap;
+			} else { $caps[] = 'do_not_allow';
+			}
 		break;
-	case 'edit_term':
-	case 'delete_term':
-	case 'assign_term':
-		$term_id = (int) $args[0];
-		$term = get_term( $term_id );
-		if ( ! $term || is_wp_error( $term ) ) {
-			$caps[] = 'do_not_allow';
-			break;
-		}
+		case 'customize' :
+			$caps[] = 'edit_theme_options';
+		break;
+		case 'delete_site':
+			if ( is_multisite() ) {
+				$caps[] = 'manage_options';
+			} else {
+				$caps[] = 'do_not_allow';
+			}
+		break;
+		case 'edit_term':
+		case 'delete_term':
+		case 'assign_term':
+			$term_id = (int) $args[0];
+			$term = get_term( $term_id );
+			if ( ! $term || is_wp_error( $term ) ) {
+				$caps[] = 'do_not_allow';
+				break;
+			}
 
-		$tax = get_taxonomy( $term->taxonomy );
-		if ( ! $tax ) {
-			$caps[] = 'do_not_allow';
-			break;
-		}
+			$tax = get_taxonomy( $term->taxonomy );
+			if ( ! $tax ) {
+				$caps[] = 'do_not_allow';
+				break;
+			}
 
-		if ( 'delete_term' === $cap && ( $term->term_id == get_option( 'default_' . $term->taxonomy ) ) ) {
-			$caps[] = 'do_not_allow';
-			break;
-		}
+			if ( 'delete_term' === $cap && ( $term->term_id == get_option( 'default_' . $term->taxonomy ) ) ) {
+				$caps[] = 'do_not_allow';
+				break;
+			}
 
-		$taxo_cap = $cap . 's';
+			$taxo_cap = $cap . 's';
 
-		$caps = map_meta_cap( $tax->cap->$taxo_cap, $user_id, $term_id );
+			$caps = map_meta_cap( $tax->cap->$taxo_cap, $user_id, $term_id );
 
 		break;
-	case 'manage_post_tags':
-	case 'edit_categories':
-	case 'edit_post_tags':
-	case 'delete_categories':
-	case 'delete_post_tags':
-		$caps[] = 'manage_categories';
-		break;
-	case 'assign_categories':
-	case 'assign_post_tags':
-		$caps[] = 'edit_posts';
-		break;
-	case 'create_sites':
-	case 'delete_sites':
-	case 'manage_network':
-	case 'manage_sites':
-	case 'manage_network_users':
-	case 'manage_network_plugins':
-	case 'manage_network_themes':
-	case 'manage_network_options':
-	case 'upgrade_network':
-		$caps[] = $cap;
-		break;
-	case 'setup_network':
-		if ( is_multisite() ) {
-			$caps[] = 'manage_network_options';
-		} else {
-			$caps[] = 'manage_options';
-		}
+		case 'manage_post_tags':
+		case 'edit_categories':
+		case 'edit_post_tags':
+		case 'delete_categories':
+		case 'delete_post_tags':
+			$caps[] = 'manage_categories';
+		break;
+		case 'assign_categories':
+		case 'assign_post_tags':
+			$caps[] = 'edit_posts';
+		break;
+		case 'create_sites':
+		case 'delete_sites':
+		case 'manage_network':
+		case 'manage_sites':
+		case 'manage_network_users':
+		case 'manage_network_plugins':
+		case 'manage_network_themes':
+		case 'manage_network_options':
+		case 'upgrade_network':
+			$caps[] = $cap;
 		break;
-	default:
-		// Handle meta capabilities for custom post types.
-		global $post_type_meta_caps;
-		if ( isset( $post_type_meta_caps[ $cap ] ) ) {
-			$args = array_merge( array( $post_type_meta_caps[ $cap ], $user_id ), $args );
-			return call_user_func_array( 'map_meta_cap', $args );
-		}
+		case 'setup_network':
+			if ( is_multisite() ) {
+				$caps[] = 'manage_network_options';
+			} else {
+				$caps[] = 'manage_options';
+			}
+		break;
+		default:
+			// Handle meta capabilities for custom post types.
+			global $post_type_meta_caps;
+			if ( isset( $post_type_meta_caps[ $cap ] ) ) {
+				$args = array_merge( array( $post_type_meta_caps[ $cap ], $user_id ), $args );
+				return call_user_func_array( 'map_meta_cap', $args );
+			}
 
-		// If no meta caps match, return the original cap.
-		$caps[] = $cap;
-	}
+			// If no meta caps match, return the original cap.
+			$caps[] = $cap;
+	}// End switch().
 
 	/**
 	 * Filters a user's capabilities depending on specific context and/or privilege.
@@ -538,8 +543,9 @@
 function current_user_can( $capability ) {
 	$current_user = wp_get_current_user();
 
-	if ( empty( $current_user ) )
+	if ( empty( $current_user ) ) {
 		return false;
+	}
 
 	$args = array_slice( func_get_args(), 1 );
 	$args = array_merge( array( $capability ), $args );
@@ -590,13 +596,15 @@
  * @return bool
  */
 function author_can( $post, $capability ) {
-	if ( !$post = get_post($post) )
+	if ( ! $post = get_post( $post ) ) {
 		return false;
+	}
 
 	$author = get_userdata( $post->post_author );
 
-	if ( ! $author )
+	if ( ! $author ) {
 		return false;
+	}
 
 	$args = array_slice( func_get_args(), 2 );
 	$args = array_merge( array( $capability ), $args );
@@ -614,11 +622,13 @@
  * @return bool
  */
 function user_can( $user, $capability ) {
-	if ( ! is_object( $user ) )
+	if ( ! is_object( $user ) ) {
 		$user = get_userdata( $user );
+	}
 
-	if ( ! $user || ! $user->exists() )
+	if ( ! $user || ! $user->exists() ) {
 		return false;
+	}
 
 	$args = array_slice( func_get_args(), 2 );
 	$args = array_merge( array( $capability ), $args );
@@ -696,10 +706,10 @@
 function get_super_admins() {
 	global $super_admins;
 
-	if ( isset($super_admins) )
+	if ( isset( $super_admins ) ) {
 		return $super_admins;
-	else
-		return get_site_option( 'site_admins', array('admin') );
+	} else { return get_site_option( 'site_admins', array( 'admin' ) );
+	}
 }
 
 /**
@@ -711,21 +721,24 @@
  * @return bool True if the user is a site admin.
  */
 function is_super_admin( $user_id = false ) {
-	if ( ! $user_id || $user_id == get_current_user_id() )
+	if ( ! $user_id || $user_id == get_current_user_id() ) {
 		$user = wp_get_current_user();
-	else
-		$user = get_userdata( $user_id );
+	} else { $user = get_userdata( $user_id );
+	}
 
-	if ( ! $user || ! $user->exists() )
+	if ( ! $user || ! $user->exists() ) {
 		return false;
+	}
 
 	if ( is_multisite() ) {
 		$super_admins = get_super_admins();
-		if ( is_array( $super_admins ) && in_array( $user->user_login, $super_admins ) )
+		if ( is_array( $super_admins ) && in_array( $user->user_login, $super_admins ) ) {
 			return true;
+		}
 	} else {
-		if ( $user->has_cap('delete_users') )
+		if ( $user->has_cap( 'delete_users' ) ) {
 			return true;
+		}
 	}
 
 	return false;
@@ -810,7 +823,7 @@
 	$user = get_userdata( $user_id );
 	if ( $user && 0 !== strcasecmp( $user->user_email, get_site_option( 'admin_email' ) ) ) {
 		if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) {
-			unset( $super_admins[$key] );
+			unset( $super_admins[ $key ] );
 			update_site_option( 'site_admins', $super_admins );
 
 			/**
Index: src/wp-includes/category-template.php
===================================================================
--- src/wp-includes/category-template.php	(revision 40901)
+++ src/wp-includes/category-template.php	(working copy)
@@ -17,13 +17,15 @@
  * @return string Link on success, empty string if category does not exist.
  */
 function get_category_link( $category ) {
-	if ( ! is_object( $category ) )
+	if ( ! is_object( $category ) ) {
 		$category = (int) $category;
+	}
 
 	$category = get_term_link( $category, 'category' );
 
-	if ( is_wp_error( $category ) )
+	if ( is_wp_error( $category ) ) {
 		return '';
+	}
 
 	return $category;
 }
@@ -73,13 +75,14 @@
  */
 function get_the_category( $id = false ) {
 	$categories = get_the_terms( $id, 'category' );
-	if ( ! $categories || is_wp_error( $categories ) )
+	if ( ! $categories || is_wp_error( $categories ) ) {
 		$categories = array();
+	}
 
 	$categories = array_values( $categories );
 
 	foreach ( array_keys( $categories ) as $key ) {
-		_make_cat_compat( $categories[$key] );
+		_make_cat_compat( $categories[ $key ] );
 	}
 
 	/**
@@ -106,8 +109,9 @@
 	$cat_ID = (int) $cat_ID;
 	$category = get_term( $cat_ID, 'category' );
 
-	if ( is_wp_error( $category ) )
+	if ( is_wp_error( $category ) ) {
 		return $category;
+	}
 
 	return ( $category ) ? $category->name : '';
 }
@@ -157,46 +161,51 @@
 			$thelist .= "\n\t<li>";
 			switch ( strtolower( $parents ) ) {
 				case 'multiple':
-					if ( $category->parent )
+					if ( $category->parent ) {
 						$thelist .= get_category_parents( $category->parent, true, $separator );
-					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" ' . $rel . '>' . $category->name.'</a></li>';
+					}
+					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" ' . $rel . '>' . $category->name . '</a></li>';
 					break;
 				case 'single':
 					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '"  ' . $rel . '>';
-					if ( $category->parent )
+					if ( $category->parent ) {
 						$thelist .= get_category_parents( $category->parent, false, $separator );
-					$thelist .= $category->name.'</a></li>';
+					}
+					$thelist .= $category->name . '</a></li>';
 					break;
 				case '':
 				default:
-					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" ' . $rel . '>' . $category->name.'</a></li>';
+					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" ' . $rel . '>' . $category->name . '</a></li>';
 			}
 		}
 		$thelist .= '</ul>';
 	} else {
 		$i = 0;
 		foreach ( $categories as $category ) {
-			if ( 0 < $i )
+			if ( 0 < $i ) {
 				$thelist .= $separator;
+			}
 			switch ( strtolower( $parents ) ) {
 				case 'multiple':
-					if ( $category->parent )
+					if ( $category->parent ) {
 						$thelist .= get_category_parents( $category->parent, true, $separator );
-					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" ' . $rel . '>' . $category->name.'</a>';
+					}
+					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" ' . $rel . '>' . $category->name . '</a>';
 					break;
 				case 'single':
 					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" ' . $rel . '>';
-					if ( $category->parent )
+					if ( $category->parent ) {
 						$thelist .= get_category_parents( $category->parent, false, $separator );
+					}
 					$thelist .= "$category->name</a>";
 					break;
 				case '':
 				default:
-					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" ' . $rel . '>' . $category->name.'</a>';
+					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" ' . $rel . '>' . $category->name . '</a>';
 			}
 			++$i;
 		}
-	}
+	}// End if().
 
 	/**
 	 * Filters the category or list of categories.
@@ -230,8 +239,9 @@
  * @return bool True if the current post is in any of the given categories.
  */
 function in_category( $category, $post = null ) {
-	if ( empty( $category ) )
+	if ( empty( $category ) ) {
 		return false;
+	}
 
 	return has_category( $category, $post );
 }
@@ -409,7 +419,7 @@
 
 			/** This filter is documented in wp-includes/category-template.php */
 			$show_option_all = apply_filters( 'list_cats', $r['show_option_all'] );
-			$selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : '';
+			$selected = ( '0' === strval( $r['selected'] ) ) ? " selected='selected'" : '';
 			$output .= "\t<option value='0'$selected>$show_option_all</option>\n";
 		}
 
@@ -527,8 +537,9 @@
 
 	$r = wp_parse_args( $args, $defaults );
 
-	if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] )
+	if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
 		$r['pad_counts'] = true;
+	}
 
 	// Descendants of exclusions should be excluded too.
 	if ( true == $r['hierarchical'] ) {
@@ -546,8 +557,9 @@
 		$r['exclude'] = '';
 	}
 
-	if ( ! isset( $r['class'] ) )
+	if ( ! isset( $r['class'] ) ) {
 		$r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy'];
+	}
 
 	if ( ! taxonomy_exists( $r['taxonomy'] ) ) {
 		return false;
@@ -619,7 +631,7 @@
 			$depth = -1; // Flat.
 		}
 		$output .= walk_category_tree( $categories, $depth, $r );
-	}
+	}// End if().
 
 	if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) {
 		$output .= '</ul></li>';
@@ -679,25 +691,41 @@
  */
 function wp_tag_cloud( $args = '' ) {
 	$defaults = array(
-		'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
-		'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC',
-		'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'post_type' => '', 'echo' => true,
+		'smallest' => 8,
+	'largest' => 22,
+	'unit' => 'pt',
+	'number' => 45,
+		'format' => 'flat',
+	'separator' => "\n",
+	'orderby' => 'name',
+	'order' => 'ASC',
+		'exclude' => '',
+	'include' => '',
+	'link' => 'view',
+	'taxonomy' => 'post_tag',
+	'post_type' => '',
+	'echo' => true,
 		'show_count' => 0,
 	);
 	$args = wp_parse_args( $args, $defaults );
 
-	$tags = get_terms( $args['taxonomy'], array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags
+	$tags = get_terms( $args['taxonomy'], array_merge( $args, array(
+		'orderby' => 'count',
+		'order' => 'DESC',
+	) ) ); // Always query top tags
 
-	if ( empty( $tags ) || is_wp_error( $tags ) )
+	if ( empty( $tags ) || is_wp_error( $tags ) ) {
 		return;
+	}
 
 	foreach ( $tags as $key => $tag ) {
-		if ( 'edit' == $args['link'] )
+		if ( 'edit' == $args['link'] ) {
 			$link = get_edit_term_link( $tag->term_id, $tag->taxonomy, $args['post_type'] );
-		else
-			$link = get_term_link( intval($tag->term_id), $tag->taxonomy );
-		if ( is_wp_error( $link ) )
+		} else { $link = get_term_link( intval( $tag->term_id ), $tag->taxonomy );
+		}
+		if ( is_wp_error( $link ) ) {
 			return;
+		}
 
 		$tags[ $key ]->link = $link;
 		$tags[ $key ]->id = $tag->term_id;
@@ -715,8 +743,9 @@
 	 */
 	$return = apply_filters( 'wp_tag_cloud', $return, $args );
 
-	if ( 'array' == $args['format'] || empty($args['echo']) )
+	if ( 'array' == $args['format'] || empty( $args['echo'] ) ) {
 		return $return;
+	}
 
 	echo $return;
 }
@@ -730,7 +759,7 @@
  * @return int Scaled count.
  */
 function default_topic_count_scale( $count ) {
-	return round(log10($count + 1) * 100);
+	return round( log10( $count + 1 ) * 100 );
 }
 
 /**
@@ -781,10 +810,18 @@
  */
 function wp_generate_tag_cloud( $tags, $args = '' ) {
 	$defaults = array(
-		'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 0,
-		'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC',
-		'topic_count_text' => null, 'topic_count_text_callback' => null,
-		'topic_count_scale_callback' => 'default_topic_count_scale', 'filter' => 1,
+		'smallest' => 8,
+	'largest' => 22,
+	'unit' => 'pt',
+	'number' => 0,
+		'format' => 'flat',
+	'separator' => "\n",
+	'orderby' => 'name',
+	'order' => 'ASC',
+		'topic_count_text' => null,
+	'topic_count_text_callback' => null,
+		'topic_count_scale_callback' => 'default_topic_count_scale',
+	'filter' => 1,
 		'show_count' => 0,
 	);
 
@@ -848,8 +885,9 @@
 		}
 	}
 
-	if ( $args['number'] > 0 )
+	if ( $args['number'] > 0 ) {
 		$tags = array_slice( $tags, 0, $args['number'] );
+	}
 
 	$counts = array();
 	$real_counts = array(); // For the alt tag
@@ -860,11 +898,13 @@
 
 	$min_count = min( $counts );
 	$spread = max( $counts ) - $min_count;
-	if ( $spread <= 0 )
+	if ( $spread <= 0 ) {
 		$spread = 1;
+	}
 	$font_spread = $args['largest'] - $args['smallest'];
-	if ( $font_spread < 0 )
+	if ( $font_spread < 0 ) {
 		$font_spread = 1;
+	}
 	$font_step = $font_spread / $spread;
 
 	$aria_label = false;
@@ -975,10 +1015,8 @@
 		 * @param array        $args   An array of wp_generate_tag_cloud() arguments.
 		 */
 		return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args );
+	} else { 		return $return;
 	}
-
-	else
-		return $return;
 }
 
 /**
@@ -1070,13 +1108,15 @@
  * @return string Link on success, empty string if tag does not exist.
  */
 function get_tag_link( $tag ) {
-	if ( ! is_object( $tag ) )
+	if ( ! is_object( $tag ) ) {
 		$tag = (int) $tag;
+	}
 
 	$tag = get_term_link( $tag, 'post_tag' );
 
-	if ( is_wp_error( $tag ) )
+	if ( is_wp_error( $tag ) ) {
 		return '';
+	}
 
 	return $tag;
 }
@@ -1140,8 +1180,9 @@
  * @param string $after Optional. After list.
  */
 function the_tags( $before = null, $sep = ', ', $after = '' ) {
-	if ( null === $before )
-		$before = __('Tags: ');
+	if ( null === $before ) {
+		$before = __( 'Tags: ' );
+	}
 
 	$the_tags = get_the_tag_list( $before, $sep, $after );
 
@@ -1194,8 +1235,9 @@
  *                              or the post does not exist, WP_Error on failure.
  */
 function get_the_terms( $post, $taxonomy ) {
-	if ( ! $post = get_post( $post ) )
+	if ( ! $post = get_post( $post ) ) {
 		return false;
+	}
 
 	$terms = get_object_term_cache( $post->ID, $taxonomy );
 	if ( false === $terms ) {
@@ -1217,8 +1259,9 @@
 	 */
 	$terms = apply_filters( 'get_the_terms', $terms, $post->ID, $taxonomy );
 
-	if ( empty( $terms ) )
+	if ( empty( $terms ) ) {
 		return false;
+	}
 
 	return $terms;
 }
@@ -1238,11 +1281,13 @@
 function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = '' ) {
 	$terms = get_the_terms( $id, $taxonomy );
 
-	if ( is_wp_error( $terms ) )
+	if ( is_wp_error( $terms ) ) {
 		return $terms;
+	}
 
-	if ( empty( $terms ) )
+	if ( empty( $terms ) ) {
 		return false;
+	}
 
 	$links = array();
 
@@ -1349,8 +1394,9 @@
 function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
 	$term_list = get_the_term_list( $id, $taxonomy, $before, $sep, $after );
 
-	if ( is_wp_error( $term_list ) )
+	if ( is_wp_error( $term_list ) ) {
 		return false;
+	}
 
 	/**
 	 * Filters the list of terms to display.
@@ -1415,14 +1461,16 @@
  * @return bool True if the current post has any of the given tags (or any tag, if no tag specified).
  */
 function has_term( $term = '', $taxonomy = '', $post = null ) {
-	$post = get_post($post);
+	$post = get_post( $post );
 
-	if ( !$post )
+	if ( ! $post ) {
 		return false;
+	}
 
 	$r = is_object_in_term( $post->ID, $taxonomy, $term );
-	if ( is_wp_error( $r ) )
+	if ( is_wp_error( $r ) ) {
 		return false;
+	}
 
 	return $r;
 }
Index: src/wp-includes/category.php
===================================================================
--- src/wp-includes/category.php	(revision 40901)
+++ src/wp-includes/category.php	(working copy)
@@ -24,7 +24,9 @@
  * @return array List of categories.
  */
 function get_categories( $args = '' ) {
-	$defaults = array( 'taxonomy' => 'category' );
+	$defaults = array(
+		'taxonomy' => 'category',
+	);
 	$args = wp_parse_args( $args, $defaults );
 
 	$taxonomy = $args['taxonomy'];
@@ -40,7 +42,7 @@
 	$taxonomy = apply_filters( 'get_categories_taxonomy', $taxonomy, $args );
 
 	// Back compat
-	if ( isset($args['type']) && 'link' == $args['type'] ) {
+	if ( isset( $args['type'] ) && 'link' == $args['type'] ) {
 		_deprecated_argument( __FUNCTION__, '3.0.0',
 			/* translators: 1: "type => link", 2: "taxonomy => link_category" */
 			sprintf( __( '%1$s is deprecated. Use %2$s instead.' ),
@@ -91,8 +93,9 @@
 function get_category( $category, $output = OBJECT, $filter = 'raw' ) {
 	$category = get_term( $category, 'category', $output, $filter );
 
-	if ( is_wp_error( $category ) )
+	if ( is_wp_error( $category ) ) {
 		return $category;
+	}
 
 	_make_cat_compat( $category );
 
@@ -130,7 +133,10 @@
 	foreach ( (array) $category_paths as $pathdir ) {
 		$full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title( $pathdir );
 	}
-	$categories = get_terms( 'category', array('get' => 'all', 'slug' => $leaf_path) );
+	$categories = get_terms( 'category', array(
+		'get' => 'all',
+		'slug' => $leaf_path,
+	) );
 
 	if ( empty( $categories ) ) {
 		return;
@@ -170,10 +176,11 @@
  * @param string $slug The category slug.
  * @return object Category data object
  */
-function get_category_by_slug( $slug  ) {
+function get_category_by_slug( $slug ) {
 	$category = get_term_by( 'slug', $slug, 'category' );
-	if ( $category )
+	if ( $category ) {
 		_make_cat_compat( $category );
+	}
 
 	return $category;
 }
@@ -188,8 +195,9 @@
  */
 function get_cat_ID( $cat_name ) {
 	$cat = get_term_by( 'name', $cat_name, 'category' );
-	if ( $cat )
+	if ( $cat ) {
 		return $cat->term_id;
+	}
 	return 0;
 }
 
@@ -204,8 +212,9 @@
 function get_cat_name( $cat_id ) {
 	$cat_id = (int) $cat_id;
 	$category = get_term( $cat_id, 'category' );
-	if ( ! $category || is_wp_error( $category ) )
+	if ( ! $category || is_wp_error( $category ) ) {
 		return '';
+	}
 	return $category->name;
 }
 
Index: src/wp-includes/class-feed.php
===================================================================
--- src/wp-includes/class-feed.php	(revision 40901)
+++ src/wp-includes/class-feed.php	(working copy)
@@ -15,4 +15,4 @@
 require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' );
 require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
 require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
-require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' );
\ No newline at end of file
+require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' );
Index: src/wp-includes/class-http.php
===================================================================
--- src/wp-includes/class-http.php	(revision 40901)
+++ src/wp-includes/class-http.php	(working copy)
@@ -208,8 +208,9 @@
 		$args = wp_parse_args( $args );
 
 		// By default, Head requests do not cause redirections.
-		if ( isset($args['method']) && 'HEAD' == $args['method'] )
+		if ( isset( $args['method'] ) && 'HEAD' == $args['method'] ) {
 			$defaults['redirection'] = 0;
+		}
 
 		$r = wp_parse_args( $args, $defaults );
 		/**
@@ -223,8 +224,9 @@
 		$r = apply_filters( 'http_request_args', $r, $url );
 
 		// The transports decrement this, store a copy of the original value for loop purposes.
-		if ( ! isset( $r['_redirection'] ) )
+		if ( ! isset( $r['_redirection'] ) ) {
 			$r['_redirection'] = $r['redirection'];
+		}
 
 		/**
 		 * Filters whether to preempt an HTTP request's return value.
@@ -246,8 +248,9 @@
 		 */
 		$pre = apply_filters( 'pre_http_request', false, $r, $url );
 
-		if ( false !== $pre )
+		if ( false !== $pre ) {
 			return $pre;
+		}
 
 		if ( function_exists( 'wp_kses_bad_protocol' ) ) {
 			if ( $r['reject_unsafe_urls'] ) {
@@ -261,7 +264,7 @@
 		$arrURL = @parse_url( $url );
 
 		if ( empty( $url ) || empty( $arrURL['scheme'] ) ) {
-			return new WP_Error('http_request_failed', __('A valid URL was not provided.'));
+			return new WP_Error( 'http_request_failed', __( 'A valid URL was not provided.' ) );
 		}
 
 		if ( $this->block_request( $url ) ) {
@@ -376,8 +379,7 @@
 
 			// Add the original object to the array.
 			$response['http_response'] = $http_response;
-		}
-		catch ( Requests_Exception $e ) {
+		} catch ( Requests_Exception $e ) {
 			$response = new WP_Error( 'http_request_failed', $e->getMessage() );
 		}
 
@@ -481,7 +483,7 @@
 	 */
 	public static function validate_redirects( $location ) {
 		if ( ! wp_http_validate_url( $location ) ) {
-			throw new Requests_Exception( __('A valid URL was not provided.'), 'wp_http.redirect_failed_validation' );
+			throw new Requests_Exception( __( 'A valid URL was not provided.' ), 'wp_http.redirect_failed_validation' );
 		}
 	}
 
@@ -519,8 +521,9 @@
 			$class = 'WP_Http_' . $transport;
 
 			// Check to see if this transport is a possibility, calls the transport statically.
-			if ( !call_user_func( array( $class, 'test' ), $args, $url ) )
+			if ( ! call_user_func( array( $class, 'test' ), $args, $url ) ) {
 				continue;
+			}
 
 			return $class;
 		}
@@ -549,20 +552,23 @@
 		static $transports = array();
 
 		$class = $this->_get_first_available_transport( $args, $url );
-		if ( !$class )
+		if ( ! $class ) {
 			return new WP_Error( 'http_failure', __( 'There are no HTTP transports available which can complete the requested request.' ) );
+		}
 
 		// Transport claims to support request, instantiate it and give it a whirl.
-		if ( empty( $transports[$class] ) )
-			$transports[$class] = new $class;
+		if ( empty( $transports[ $class ] ) ) {
+			$transports[ $class ] = new $class;
+		}
 
-		$response = $transports[$class]->request( $url, $args );
+		$response = $transports[ $class ]->request( $url, $args );
 
 		/** This action is documented in wp-includes/class-http.php */
 		do_action( 'http_api_debug', $response, 'response', $class, $args, $url );
 
-		if ( is_wp_error( $response ) )
+		if ( is_wp_error( $response ) ) {
 			return $response;
+		}
 
 		/**
 		 * Filters the HTTP API response immediately before the response is returned.
@@ -588,10 +594,12 @@
 	 * @param string|array $args Optional. Override the defaults.
 	 * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
 	 */
-	public function post($url, $args = array()) {
-		$defaults = array('method' => 'POST');
+	public function post( $url, $args = array() ) {
+		$defaults = array(
+			'method' => 'POST',
+		);
 		$r = wp_parse_args( $args, $defaults );
-		return $this->request($url, $r);
+		return $this->request( $url, $r );
 	}
 
 	/**
@@ -606,10 +614,12 @@
 	 * @param string|array $args Optional. Override the defaults.
 	 * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
 	 */
-	public function get($url, $args = array()) {
-		$defaults = array('method' => 'GET');
+	public function get( $url, $args = array() ) {
+		$defaults = array(
+			'method' => 'GET',
+		);
 		$r = wp_parse_args( $args, $defaults );
-		return $this->request($url, $r);
+		return $this->request( $url, $r );
 	}
 
 	/**
@@ -624,10 +634,12 @@
 	 * @param string|array $args Optional. Override the defaults.
 	 * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
 	 */
-	public function head($url, $args = array()) {
-		$defaults = array('method' => 'HEAD');
+	public function head( $url, $args = array() ) {
+		$defaults = array(
+			'method' => 'HEAD',
+		);
 		$r = wp_parse_args( $args, $defaults );
-		return $this->request($url, $r);
+		return $this->request( $url, $r );
 	}
 
 	/**
@@ -640,10 +652,13 @@
 	 * @param string $strResponse The full response string
 	 * @return array Array with 'headers' and 'body' keys.
 	 */
-	public static function processResponse($strResponse) {
-		$res = explode("\r\n\r\n", $strResponse, 2);
+	public static function processResponse( $strResponse ) {
+		$res = explode( "\r\n\r\n", $strResponse, 2 );
 
-		return array('headers' => $res[0], 'body' => isset($res[1]) ? $res[1] : '');
+		return array(
+			'headers' => $res[0],
+			'body' => isset( $res[1] ) ? $res[1] : '',
+		);
 	}
 
 	/**
@@ -663,27 +678,30 @@
 	 */
 	public static function processHeaders( $headers, $url = '' ) {
 		// Split headers, one per array element.
-		if ( is_string($headers) ) {
+		if ( is_string( $headers ) ) {
 			// Tolerate line terminator: CRLF = LF (RFC 2616 19.3).
-			$headers = str_replace("\r\n", "\n", $headers);
+			$headers = str_replace( "\r\n", "\n", $headers );
 			/*
 			 * Unfold folded header fields. LWS = [CRLF] 1*( SP | HT ) <US-ASCII SP, space (32)>,
 			 * <US-ASCII HT, horizontal-tab (9)> (RFC 2616 2.2).
 			 */
-			$headers = preg_replace('/\n[ \t]/', ' ', $headers);
+			$headers = preg_replace( '/\n[ \t]/', ' ', $headers );
 			// Create the headers array.
-			$headers = explode("\n", $headers);
+			$headers = explode( "\n", $headers );
 		}
 
-		$response = array('code' => 0, 'message' => '');
+		$response = array(
+			'code' => 0,
+			'message' => '',
+		);
 
 		/*
 		 * If a redirection has taken place, The headers for each page request may have been passed.
 		 * In this case, determine the final HTTP header and parse from there.
 		 */
-		for ( $i = count($headers)-1; $i >= 0; $i-- ) {
-			if ( !empty($headers[$i]) && false === strpos($headers[$i], ':') ) {
-				$headers = array_splice($headers, $i);
+		for ( $i = count( $headers ) -1; $i >= 0; $i-- ) {
+			if ( ! empty( $headers[ $i ] ) && false === strpos( $headers[ $i ], ':' ) ) {
+				$headers = array_splice( $headers, $i );
 				break;
 			}
 		}
@@ -691,36 +709,43 @@
 		$cookies = array();
 		$newheaders = array();
 		foreach ( (array) $headers as $tempheader ) {
-			if ( empty($tempheader) )
+			if ( empty( $tempheader ) ) {
 				continue;
+			}
 
-			if ( false === strpos($tempheader, ':') ) {
-				$stack = explode(' ', $tempheader, 3);
+			if ( false === strpos( $tempheader, ':' ) ) {
+				$stack = explode( ' ', $tempheader, 3 );
 				$stack[] = '';
 				list( , $response['code'], $response['message']) = $stack;
 				continue;
 			}
 
-			list($key, $value) = explode(':', $tempheader, 2);
+			list($key, $value) = explode( ':', $tempheader, 2 );
 
 			$key = strtolower( $key );
 			$value = trim( $value );
 
 			if ( isset( $newheaders[ $key ] ) ) {
-				if ( ! is_array( $newheaders[ $key ] ) )
-					$newheaders[$key] = array( $newheaders[ $key ] );
+				if ( ! is_array( $newheaders[ $key ] ) ) {
+					$newheaders[ $key ] = array( $newheaders[ $key ] );
+				}
 				$newheaders[ $key ][] = $value;
 			} else {
 				$newheaders[ $key ] = $value;
 			}
-			if ( 'set-cookie' == $key )
+			if ( 'set-cookie' == $key ) {
 				$cookies[] = new WP_Http_Cookie( $value, $url );
+			}
 		}
 
 		// Cast the Response Code to an int
 		$response['code'] = intval( $response['code'] );
 
-		return array('response' => $response, 'headers' => $newheaders, 'cookies' => $cookies);
+		return array(
+			'response' => $response,
+			'headers' => $newheaders,
+			'cookies' => $cookies,
+		);
 	}
 
 	/**
@@ -737,11 +762,15 @@
 	 * @param array $r Full array of args passed into ::request()
 	 */
 	public static function buildCookieHeader( &$r ) {
-		if ( ! empty($r['cookies']) ) {
+		if ( ! empty( $r['cookies'] ) ) {
 			// Upgrade any name => value cookie pairs to WP_HTTP_Cookie instances.
 			foreach ( $r['cookies'] as $name => $value ) {
-				if ( ! is_object( $value ) )
-					$r['cookies'][ $name ] = new WP_Http_Cookie( array( 'name' => $name, 'value' => $value ) );
+				if ( ! is_object( $value ) ) {
+					$r['cookies'][ $name ] = new WP_Http_Cookie( array(
+						'name' => $name,
+						'value' => $value,
+					) );
+				}
 			}
 
 			$cookies_header = '';
@@ -770,8 +799,9 @@
 	 */
 	public static function chunkTransferDecode( $body ) {
 		// The body is not chunked encoded or is malformed.
-		if ( ! preg_match( '/^([0-9a-f]+)[^\r\n]*\r\n/i', trim( $body ) ) )
+		if ( ! preg_match( '/^([0-9a-f]+)[^\r\n]*\r\n/i', trim( $body ) ) ) {
 			return $body;
+		}
 
 		$parsed_body = '';
 
@@ -780,8 +810,9 @@
 
 		while ( true ) {
 			$has_chunk = (bool) preg_match( '/^([0-9a-f]+)[^\r\n]*\r\n/i', $body, $match );
-			if ( ! $has_chunk || empty( $match[1] ) )
+			if ( ! $has_chunk || empty( $match[1] ) ) {
 				return $body_original;
+			}
 
 			$length = hexdec( $match[1] );
 			$chunk_length = strlen( $match[0] );
@@ -793,8 +824,9 @@
 			$body = substr( $body, $length + $chunk_length );
 
 			// End of the document.
-			if ( '0' === trim( $body ) )
+			if ( '0' === trim( $body ) ) {
 				return $parsed_body;
+			}
 		}
 	}
 
@@ -820,16 +852,18 @@
 	 * @param string $uri URI of url.
 	 * @return bool True to block, false to allow.
 	 */
-	public function block_request($uri) {
+	public function block_request( $uri ) {
 		// We don't need to block requests, because nothing is blocked.
-		if ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL )
+		if ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL ) {
 			return false;
+		}
 
-		$check = parse_url($uri);
-		if ( ! $check )
+		$check = parse_url( $uri );
+		if ( ! $check ) {
 			return true;
+		}
 
-		$home = parse_url( get_option('siteurl') );
+		$home = parse_url( get_option( 'siteurl' ) );
 
 		// Don't block requests back to ourselves by default.
 		if ( 'localhost' == $check['host'] || ( isset( $home['host'] ) && $home['host'] == $check['host'] ) ) {
@@ -844,26 +878,28 @@
 			return apply_filters( 'block_local_requests', false );
 		}
 
-		if ( !defined('WP_ACCESSIBLE_HOSTS') )
+		if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) ) {
 			return true;
+		}
 
 		static $accessible_hosts = null;
 		static $wildcard_regex = array();
 		if ( null === $accessible_hosts ) {
-			$accessible_hosts = preg_split('|,\s*|', WP_ACCESSIBLE_HOSTS);
+			$accessible_hosts = preg_split( '|,\s*|', WP_ACCESSIBLE_HOSTS );
 
-			if ( false !== strpos(WP_ACCESSIBLE_HOSTS, '*') ) {
+			if ( false !== strpos( WP_ACCESSIBLE_HOSTS, '*' ) ) {
 				$wildcard_regex = array();
-				foreach ( $accessible_hosts as $host )
+				foreach ( $accessible_hosts as $host ) {
 					$wildcard_regex[] = str_replace( '\*', '.+', preg_quote( $host, '/' ) );
-				$wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
+				}
+				$wildcard_regex = '/^(' . implode( '|', $wildcard_regex ) . ')$/i';
 			}
 		}
 
-		if ( !empty($wildcard_regex) )
-			return !preg_match($wildcard_regex, $check['host']);
-		else
-			return !in_array( $check['host'], $accessible_hosts ); //Inverse logic, If it's in the array, then we can't access it.
+		if ( ! empty( $wildcard_regex ) ) {
+			return ! preg_match( $wildcard_regex, $check['host'] );
+		} else { return ! in_array( $check['host'], $accessible_hosts ); // End if().
+		}
 
 	}
 
@@ -898,8 +934,9 @@
 	 * @return string An Absolute URL, in a failure condition where the URL cannot be parsed, the relative URL will be returned.
 	 */
 	public static function make_absolute_url( $maybe_relative_path, $url ) {
-		if ( empty( $url ) )
+		if ( empty( $url ) ) {
 			return $maybe_relative_path;
+		}
 
 		if ( ! $url_parts = wp_parse_url( $url ) ) {
 			return $maybe_relative_path;
@@ -919,12 +956,14 @@
 		// Schemeless URL's will make it this far, so we check for a host in the relative url and convert it to a protocol-url
 		if ( isset( $relative_url_parts['host'] ) ) {
 			$absolute_path .= $relative_url_parts['host'];
-			if ( isset( $relative_url_parts['port'] ) )
+			if ( isset( $relative_url_parts['port'] ) ) {
 				$absolute_path .= ':' . $relative_url_parts['port'];
+			}
 		} else {
 			$absolute_path .= $url_parts['host'];
-			if ( isset( $url_parts['port'] ) )
+			if ( isset( $url_parts['port'] ) ) {
 				$absolute_path .= ':' . $url_parts['port'];
+			}
 		}
 
 		// Start off with the Absolute URL path.
@@ -934,7 +973,7 @@
 		if ( ! empty( $relative_url_parts['path'] ) && '/' == $relative_url_parts['path'][0] ) {
 			$path = $relative_url_parts['path'];
 
-		// Else it's a relative path.
+			// Else it's a relative path.
 		} elseif ( ! empty( $relative_url_parts['path'] ) ) {
 			// Strip off any file components from the absolute path.
 			$path = substr( $path, 0, strrpos( $path, '/' ) + 1 );
@@ -952,8 +991,9 @@
 		}
 
 		// Add the Query string.
-		if ( ! empty( $relative_url_parts['query'] ) )
+		if ( ! empty( $relative_url_parts['query'] ) ) {
 			$path .= '?' . $relative_url_parts['query'];
+		}
 
 		return $absolute_path . '/' . ltrim( $path, '/' );
 	}
@@ -972,36 +1012,42 @@
 	 */
 	public static function handle_redirects( $url, $args, $response ) {
 		// If no redirects are present, or, redirects were not requested, perform no action.
-		if ( ! isset( $response['headers']['location'] ) || 0 === $args['_redirection'] )
+		if ( ! isset( $response['headers']['location'] ) || 0 === $args['_redirection'] ) {
 			return false;
+		}
 
 		// Only perform redirections on redirection http codes.
-		if ( $response['response']['code'] > 399 || $response['response']['code'] < 300 )
+		if ( $response['response']['code'] > 399 || $response['response']['code'] < 300 ) {
 			return false;
+		}
 
 		// Don't redirect if we've run out of redirects.
-		if ( $args['redirection']-- <= 0 )
-			return new WP_Error( 'http_request_failed', __('Too many redirects.') );
+		if ( $args['redirection']-- <= 0 ) {
+			return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
+		}
 
 		$redirect_location = $response['headers']['location'];
 
 		// If there were multiple Location headers, use the last header specified.
-		if ( is_array( $redirect_location ) )
+		if ( is_array( $redirect_location ) ) {
 			$redirect_location = array_pop( $redirect_location );
+		}
 
 		$redirect_location = WP_Http::make_absolute_url( $redirect_location, $url );
 
 		// POST requests should not POST to a redirected location.
 		if ( 'POST' == $args['method'] ) {
-			if ( in_array( $response['response']['code'], array( 302, 303 ) ) )
+			if ( in_array( $response['response']['code'], array( 302, 303 ) ) ) {
 				$args['method'] = 'GET';
+			}
 		}
 
 		// Include valid cookies in the redirect process.
 		if ( ! empty( $response['cookies'] ) ) {
 			foreach ( $response['cookies'] as $cookie ) {
-				if ( $cookie->test( $redirect_location ) )
+				if ( $cookie->test( $redirect_location ) ) {
 					$args['cookies'][] = $cookie;
+				}
 			}
 		}
 
@@ -1025,11 +1071,13 @@
 	 * @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure
 	 */
 	public static function is_ip_address( $maybe_ip ) {
-		if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) )
+		if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) ) {
 			return 4;
+		}
 
-		if ( false !== strpos( $maybe_ip, ':' ) && preg_match( '/^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i', trim( $maybe_ip, ' []' ) ) )
+		if ( false !== strpos( $maybe_ip, ':' ) && preg_match( '/^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i', trim( $maybe_ip, ' []' ) ) ) {
 			return 6;
+		}
 
 		return false;
 	}
Index: src/wp-includes/class-oembed.php
===================================================================
--- src/wp-includes/class-oembed.php	(revision 40901)
+++ src/wp-includes/class-oembed.php	(working copy)
@@ -55,60 +55,60 @@
 	public function __construct() {
 		$host = urlencode( home_url() );
 		$providers = array(
-			'#https?://((m|www)\.)?youtube\.com/watch.*#i'             => array( 'https://www.youtube.com/oembed',                            true  ),
-			'#https?://((m|www)\.)?youtube\.com/playlist.*#i'          => array( 'https://www.youtube.com/oembed',                            true  ),
-			'#https?://youtu\.be/.*#i'                                 => array( 'https://www.youtube.com/oembed',                            true  ),
-			'#https?://(.+\.)?vimeo\.com/.*#i'                         => array( 'https://vimeo.com/api/oembed.{format}',                     true  ),
-			'#https?://(www\.)?dailymotion\.com/.*#i'                  => array( 'https://www.dailymotion.com/services/oembed',               true  ),
-			'#https?://dai\.ly/.*#i'                                   => array( 'https://www.dailymotion.com/services/oembed',               true  ),
-			'#https?://(www\.)?flickr\.com/.*#i'                       => array( 'https://www.flickr.com/services/oembed/',                   true  ),
-			'#https?://flic\.kr/.*#i'                                  => array( 'https://www.flickr.com/services/oembed/',                   true  ),
-			'#https?://(.+\.)?smugmug\.com/.*#i'                       => array( 'https://api.smugmug.com/services/oembed/',                  true  ),
-			'#https?://(www\.)?hulu\.com/watch/.*#i'                   => array( 'http://www.hulu.com/api/oembed.{format}',                   true  ),
+			'#https?://((m|www)\.)?youtube\.com/watch.*#i'             => array( 'https://www.youtube.com/oembed',                            true ),
+			'#https?://((m|www)\.)?youtube\.com/playlist.*#i'          => array( 'https://www.youtube.com/oembed',                            true ),
+			'#https?://youtu\.be/.*#i'                                 => array( 'https://www.youtube.com/oembed',                            true ),
+			'#https?://(.+\.)?vimeo\.com/.*#i'                         => array( 'https://vimeo.com/api/oembed.{format}',                     true ),
+			'#https?://(www\.)?dailymotion\.com/.*#i'                  => array( 'https://www.dailymotion.com/services/oembed',               true ),
+			'#https?://dai\.ly/.*#i'                                   => array( 'https://www.dailymotion.com/services/oembed',               true ),
+			'#https?://(www\.)?flickr\.com/.*#i'                       => array( 'https://www.flickr.com/services/oembed/',                   true ),
+			'#https?://flic\.kr/.*#i'                                  => array( 'https://www.flickr.com/services/oembed/',                   true ),
+			'#https?://(.+\.)?smugmug\.com/.*#i'                       => array( 'https://api.smugmug.com/services/oembed/',                  true ),
+			'#https?://(www\.)?hulu\.com/watch/.*#i'                   => array( 'http://www.hulu.com/api/oembed.{format}',                   true ),
 			'http://i*.photobucket.com/albums/*'                       => array( 'http://api.photobucket.com/oembed',                         false ),
 			'http://gi*.photobucket.com/groups/*'                      => array( 'http://api.photobucket.com/oembed',                         false ),
-			'#https?://(www\.)?scribd\.com/doc/.*#i'                   => array( 'https://www.scribd.com/services/oembed',                    true  ),
-			'#https?://wordpress\.tv/.*#i'                             => array( 'https://wordpress.tv/oembed/',                              true  ),
-			'#https?://(.+\.)?polldaddy\.com/.*#i'                     => array( 'https://polldaddy.com/oembed/',                             true  ),
-			'#https?://poll\.fm/.*#i'                                  => array( 'https://polldaddy.com/oembed/',                             true  ),
-			'#https?://(www\.)?funnyordie\.com/videos/.*#i'            => array( 'http://www.funnyordie.com/oembed',                          true  ),
-			'#https?://(www\.)?twitter\.com/\w{1,15}/status(es)?/.*#i' => array( 'https://publish.twitter.com/oembed',                        true  ),
-			'#https?://(www\.)?twitter\.com/\w{1,15}$#i'               => array( 'https://publish.twitter.com/oembed',                        true  ),
-			'#https?://(www\.)?twitter\.com/\w{1,15}/likes$#i'         => array( 'https://publish.twitter.com/oembed',                        true  ),
-			'#https?://(www\.)?twitter\.com/\w{1,15}/lists/.*#i'       => array( 'https://publish.twitter.com/oembed',                        true  ),
-			'#https?://(www\.)?twitter\.com/\w{1,15}/timelines/.*#i'   => array( 'https://publish.twitter.com/oembed',                        true  ),
-			'#https?://(www\.)?twitter\.com/i/moments/.*#i'            => array( 'https://publish.twitter.com/oembed',                        true  ),
-			'#https?://vine\.co/v/.*#i'                                => array( 'https://vine.co/oembed.{format}',                           true  ),
-			'#https?://(www\.)?soundcloud\.com/.*#i'                   => array( 'https://soundcloud.com/oembed',                             true  ),
-			'#https?://(.+?\.)?slideshare\.net/.*#i'                   => array( 'https://www.slideshare.net/api/oembed/2',                   true  ),
-			'#https?://(www\.)?instagr(\.am|am\.com)/p/.*#i'           => array( 'https://api.instagram.com/oembed',                          true  ),
-			'#https?://(open|play)\.spotify\.com/.*#i'                 => array( 'https://embed.spotify.com/oembed/',                         true  ),
-			'#https?://(.+\.)?imgur\.com/.*#i'                         => array( 'http://api.imgur.com/oembed',                               true  ),
-			'#https?://(www\.)?meetu(\.ps|p\.com)/.*#i'                => array( 'https://api.meetup.com/oembed',                             true  ),
-			'#https?://(www\.)?issuu\.com/.+/docs/.+#i'                => array( 'https://issuu.com/oembed_wp',                               true  ),
-			'#https?://(www\.)?collegehumor\.com/video/.*#i'           => array( 'http://www.collegehumor.com/oembed.{format}',               true  ),
-			'#https?://(www\.)?mixcloud\.com/.*#i'                     => array( 'https://www.mixcloud.com/oembed',                           true  ),
-			'#https?://(www\.|embed\.)?ted\.com/talks/.*#i'            => array( 'https://www.ted.com/services/v1/oembed.{format}',           true  ),
-			'#https?://(www\.)?(animoto|video214)\.com/play/.*#i'      => array( 'https://animoto.com/oembeds/create',                        true  ),
-			'#https?://(.+)\.tumblr\.com/post/.*#i'                    => array( 'https://www.tumblr.com/oembed/1.0',                         true  ),
-			'#https?://(www\.)?kickstarter\.com/projects/.*#i'         => array( 'https://www.kickstarter.com/services/oembed',               true  ),
-			'#https?://kck\.st/.*#i'                                   => array( 'https://www.kickstarter.com/services/oembed',               true  ),
-			'#https?://cloudup\.com/.*#i'                              => array( 'https://cloudup.com/oembed',                                true  ),
-			'#https?://(www\.)?reverbnation\.com/.*#i'                 => array( 'https://www.reverbnation.com/oembed',                       true  ),
-			'#https?://videopress\.com/v/.*#'                          => array( 'https://public-api.wordpress.com/oembed/?for=' . $host,     true  ),
-			'#https?://(www\.)?reddit\.com/r/[^/]+/comments/.*#i'      => array( 'https://www.reddit.com/oembed',                             true  ),
-			'#https?://(www\.)?speakerdeck\.com/.*#i'                  => array( 'https://speakerdeck.com/oembed.{format}',                   true  ),
-			'#https?://www\.facebook\.com/.*/posts/.*#i'               => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true  ),
-			'#https?://www\.facebook\.com/.*/activity/.*#i'            => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true  ),
-			'#https?://www\.facebook\.com/.*/photos/.*#i'              => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true  ),
-			'#https?://www\.facebook\.com/photo(s/|\.php).*#i'         => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true  ),
-			'#https?://www\.facebook\.com/permalink\.php.*#i'          => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true  ),
-			'#https?://www\.facebook\.com/media/.*#i'                  => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true  ),
-			'#https?://www\.facebook\.com/questions/.*#i'              => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true  ),
-			'#https?://www\.facebook\.com/notes/.*#i'                  => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true  ),
-			'#https?://www\.facebook\.com/.*/videos/.*#i'              => array( 'https://www.facebook.com/plugins/video/oembed.json/',       true  ),
-			'#https?://www\.facebook\.com/video\.php.*#i'              => array( 'https://www.facebook.com/plugins/video/oembed.json/',       true  ),
-			'#https?://(www\.)?screencast\.com/.*#i'                   => array( 'https://api.screencast.com/external/oembed',                true  ),
+			'#https?://(www\.)?scribd\.com/doc/.*#i'                   => array( 'https://www.scribd.com/services/oembed',                    true ),
+			'#https?://wordpress\.tv/.*#i'                             => array( 'https://wordpress.tv/oembed/',                              true ),
+			'#https?://(.+\.)?polldaddy\.com/.*#i'                     => array( 'https://polldaddy.com/oembed/',                             true ),
+			'#https?://poll\.fm/.*#i'                                  => array( 'https://polldaddy.com/oembed/',                             true ),
+			'#https?://(www\.)?funnyordie\.com/videos/.*#i'            => array( 'http://www.funnyordie.com/oembed',                          true ),
+			'#https?://(www\.)?twitter\.com/\w{1,15}/status(es)?/.*#i' => array( 'https://publish.twitter.com/oembed',                        true ),
+			'#https?://(www\.)?twitter\.com/\w{1,15}$#i'               => array( 'https://publish.twitter.com/oembed',                        true ),
+			'#https?://(www\.)?twitter\.com/\w{1,15}/likes$#i'         => array( 'https://publish.twitter.com/oembed',                        true ),
+			'#https?://(www\.)?twitter\.com/\w{1,15}/lists/.*#i'       => array( 'https://publish.twitter.com/oembed',                        true ),
+			'#https?://(www\.)?twitter\.com/\w{1,15}/timelines/.*#i'   => array( 'https://publish.twitter.com/oembed',                        true ),
+			'#https?://(www\.)?twitter\.com/i/moments/.*#i'            => array( 'https://publish.twitter.com/oembed',                        true ),
+			'#https?://vine\.co/v/.*#i'                                => array( 'https://vine.co/oembed.{format}',                           true ),
+			'#https?://(www\.)?soundcloud\.com/.*#i'                   => array( 'https://soundcloud.com/oembed',                             true ),
+			'#https?://(.+?\.)?slideshare\.net/.*#i'                   => array( 'https://www.slideshare.net/api/oembed/2',                   true ),
+			'#https?://(www\.)?instagr(\.am|am\.com)/p/.*#i'           => array( 'https://api.instagram.com/oembed',                          true ),
+			'#https?://(open|play)\.spotify\.com/.*#i'                 => array( 'https://embed.spotify.com/oembed/',                         true ),
+			'#https?://(.+\.)?imgur\.com/.*#i'                         => array( 'http://api.imgur.com/oembed',                               true ),
+			'#https?://(www\.)?meetu(\.ps|p\.com)/.*#i'                => array( 'https://api.meetup.com/oembed',                             true ),
+			'#https?://(www\.)?issuu\.com/.+/docs/.+#i'                => array( 'https://issuu.com/oembed_wp',                               true ),
+			'#https?://(www\.)?collegehumor\.com/video/.*#i'           => array( 'http://www.collegehumor.com/oembed.{format}',               true ),
+			'#https?://(www\.)?mixcloud\.com/.*#i'                     => array( 'https://www.mixcloud.com/oembed',                           true ),
+			'#https?://(www\.|embed\.)?ted\.com/talks/.*#i'            => array( 'https://www.ted.com/services/v1/oembed.{format}',           true ),
+			'#https?://(www\.)?(animoto|video214)\.com/play/.*#i'      => array( 'https://animoto.com/oembeds/create',                        true ),
+			'#https?://(.+)\.tumblr\.com/post/.*#i'                    => array( 'https://www.tumblr.com/oembed/1.0',                         true ),
+			'#https?://(www\.)?kickstarter\.com/projects/.*#i'         => array( 'https://www.kickstarter.com/services/oembed',               true ),
+			'#https?://kck\.st/.*#i'                                   => array( 'https://www.kickstarter.com/services/oembed',               true ),
+			'#https?://cloudup\.com/.*#i'                              => array( 'https://cloudup.com/oembed',                                true ),
+			'#https?://(www\.)?reverbnation\.com/.*#i'                 => array( 'https://www.reverbnation.com/oembed',                       true ),
+			'#https?://videopress\.com/v/.*#'                          => array( 'https://public-api.wordpress.com/oembed/?for=' . $host,     true ),
+			'#https?://(www\.)?reddit\.com/r/[^/]+/comments/.*#i'      => array( 'https://www.reddit.com/oembed',                             true ),
+			'#https?://(www\.)?speakerdeck\.com/.*#i'                  => array( 'https://speakerdeck.com/oembed.{format}',                   true ),
+			'#https?://www\.facebook\.com/.*/posts/.*#i'               => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true ),
+			'#https?://www\.facebook\.com/.*/activity/.*#i'            => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true ),
+			'#https?://www\.facebook\.com/.*/photos/.*#i'              => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true ),
+			'#https?://www\.facebook\.com/photo(s/|\.php).*#i'         => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true ),
+			'#https?://www\.facebook\.com/permalink\.php.*#i'          => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true ),
+			'#https?://www\.facebook\.com/media/.*#i'                  => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true ),
+			'#https?://www\.facebook\.com/questions/.*#i'              => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true ),
+			'#https?://www\.facebook\.com/notes/.*#i'                  => array( 'https://www.facebook.com/plugins/post/oembed.json/',        true ),
+			'#https?://www\.facebook\.com/.*/videos/.*#i'              => array( 'https://www.facebook.com/plugins/video/oembed.json/',       true ),
+			'#https?://www\.facebook\.com/video\.php.*#i'              => array( 'https://www.facebook.com/plugins/video/oembed.json/',       true ),
+			'#https?://(www\.)?screencast\.com/.*#i'                   => array( 'https://api.screencast.com/external/oembed',                true ),
 		);
 
 		if ( ! empty( self::$early_providers['add'] ) ) {
@@ -204,7 +204,7 @@
 		$this->providers = apply_filters( 'oembed_providers', $providers );
 
 		// Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop().
-		add_filter( 'oembed_dataparse', array($this, '_strip_newlines'), 10, 3 );
+		add_filter( 'oembed_dataparse', array( $this, '_strip_newlines' ), 10, 3 );
 	}
 
 	/**
@@ -241,14 +241,15 @@
 
 		$provider = false;
 
-		if ( !isset($args['discover']) )
+		if ( ! isset( $args['discover'] ) ) {
 			$args['discover'] = true;
+		}
 
 		foreach ( $this->providers as $matchmask => $data ) {
 			list( $providerurl, $regex ) = $data;
 
 			// Turn the asterisk-type provider URLs into regex
-			if ( !$regex ) {
+			if ( ! $regex ) {
 				$matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';
 				$matchmask = preg_replace( '|^#http\\\://|', '#https?\://', $matchmask );
 			}
@@ -259,8 +260,9 @@
 			}
 		}
 
-		if ( !$provider && $args['discover'] )
+		if ( ! $provider && $args['discover'] ) {
 			$provider = $this->discover( $url );
+		}
 
 		return $provider;
 	}
@@ -455,7 +457,7 @@
 			// Do a quick check
 			$tagfound = false;
 			foreach ( $linktypes as $linktype => $format ) {
-				if ( stripos($html, $linktype) ) {
+				if ( stripos( $html, $linktype ) ) {
 					$tagfound = true;
 					break;
 				}
@@ -465,24 +467,25 @@
 				foreach ( $links[1] as $link ) {
 					$atts = shortcode_parse_atts( $link );
 
-					if ( !empty($atts['type']) && !empty($linktypes[$atts['type']]) && !empty($atts['href']) ) {
-						$providers[$linktypes[$atts['type']]] = htmlspecialchars_decode( $atts['href'] );
+					if ( ! empty( $atts['type'] ) && ! empty( $linktypes[ $atts['type'] ] ) && ! empty( $atts['href'] ) ) {
+						$providers[ $linktypes[ $atts['type'] ] ] = htmlspecialchars_decode( $atts['href'] );
 
 						// Stop here if it's JSON (that's all we need)
-						if ( 'json' == $linktypes[$atts['type']] )
+						if ( 'json' == $linktypes[ $atts['type'] ] ) {
 							break;
+						}
 					}
 				}
 			}
-		}
+		}// End if().
 
 		// JSON is preferred to XML
-		if ( !empty($providers['json']) )
+		if ( ! empty( $providers['json'] ) ) {
 			return $providers['json'];
-		elseif ( !empty($providers['xml']) )
+		} elseif ( ! empty( $providers['xml'] ) ) {
 			return $providers['xml'];
-		else
-			return false;
+		} else { return false;
+		}
 	}
 
 	/**
@@ -501,7 +504,7 @@
 
 		$provider = add_query_arg( 'maxwidth', (int) $args['width'], $provider );
 		$provider = add_query_arg( 'maxheight', (int) $args['height'], $provider );
-		$provider = add_query_arg( 'url', urlencode($url), $provider );
+		$provider = add_query_arg( 'url', urlencode( $url ), $provider );
 
 		/**
 		 * Filters the oEmbed URL to be fetched.
@@ -516,8 +519,9 @@
 
 		foreach ( array( 'json', 'xml' ) as $format ) {
 			$result = $this->_fetch_with_format( $provider, $format );
-			if ( is_wp_error( $result ) && 'not-implemented' == $result->get_error_code() )
+			if ( is_wp_error( $result ) && 'not-implemented' == $result->get_error_code() ) {
 				continue;
+			}
 			return ( $result && ! is_wp_error( $result ) ) ? $result : false;
 		}
 		return false;
@@ -540,10 +544,12 @@
 		$args = apply_filters( 'oembed_remote_get_args', array(), $provider_url_with_args );
 
 		$response = wp_safe_remote_get( $provider_url_with_args, $args );
-		if ( 501 == wp_remote_retrieve_response_code( $response ) )
+		if ( 501 == wp_remote_retrieve_response_code( $response ) ) {
 			return new WP_Error( 'not-implemented' );
-		if ( ! $body = wp_remote_retrieve_body( $response ) )
+		}
+		if ( ! $body = wp_remote_retrieve_body( $response ) ) {
 			return false;
+		}
 		$parse_method = "_parse_$format";
 		return $this->$parse_method( $body );
 	}
@@ -572,8 +578,9 @@
 	 * @return object|false
 	 */
 	private function _parse_xml( $response_body ) {
-		if ( ! function_exists( 'libxml_disable_entity_loader' ) )
+		if ( ! function_exists( 'libxml_disable_entity_loader' ) ) {
 			return false;
+		}
 
 		$loader = libxml_disable_entity_loader( true );
 		$errors = libxml_use_internal_errors( true );
@@ -596,25 +603,30 @@
 	 * @return stdClass|false
 	 */
 	private function _parse_xml_body( $response_body ) {
-		if ( ! function_exists( 'simplexml_import_dom' ) || ! class_exists( 'DOMDocument', false ) )
+		if ( ! function_exists( 'simplexml_import_dom' ) || ! class_exists( 'DOMDocument', false ) ) {
 			return false;
+		}
 
 		$dom = new DOMDocument;
 		$success = $dom->loadXML( $response_body );
-		if ( ! $success )
+		if ( ! $success ) {
 			return false;
+		}
 
-		if ( isset( $dom->doctype ) )
+		if ( isset( $dom->doctype ) ) {
 			return false;
+		}
 
 		foreach ( $dom->childNodes as $child ) {
-			if ( XML_DOCUMENT_TYPE_NODE === $child->nodeType )
+			if ( XML_DOCUMENT_TYPE_NODE === $child->nodeType ) {
 				return false;
+			}
 		}
 
 		$xml = simplexml_import_dom( $dom );
-		if ( ! $xml )
+		if ( ! $xml ) {
 			return false;
+		}
 
 		$return = new stdClass;
 		foreach ( $xml as $key => $value ) {
@@ -635,31 +647,36 @@
 	 * @return false|string False on error, otherwise the HTML needed to embed.
 	 */
 	public function data2html( $data, $url ) {
-		if ( ! is_object( $data ) || empty( $data->type ) )
+		if ( ! is_object( $data ) || empty( $data->type ) ) {
 			return false;
+		}
 
 		$return = false;
 
 		switch ( $data->type ) {
 			case 'photo':
-				if ( empty( $data->url ) || empty( $data->width ) || empty( $data->height ) )
+				if ( empty( $data->url ) || empty( $data->width ) || empty( $data->height ) ) {
 					break;
-				if ( ! is_string( $data->url ) || ! is_numeric( $data->width ) || ! is_numeric( $data->height ) )
+				}
+				if ( ! is_string( $data->url ) || ! is_numeric( $data->width ) || ! is_numeric( $data->height ) ) {
 					break;
+				}
 
 				$title = ! empty( $data->title ) && is_string( $data->title ) ? $data->title : '';
-				$return = '<a href="' . esc_url( $url ) . '"><img src="' . esc_url( $data->url ) . '" alt="' . esc_attr($title) . '" width="' . esc_attr($data->width) . '" height="' . esc_attr($data->height) . '" /></a>';
+				$return = '<a href="' . esc_url( $url ) . '"><img src="' . esc_url( $data->url ) . '" alt="' . esc_attr( $title ) . '" width="' . esc_attr( $data->width ) . '" height="' . esc_attr( $data->height ) . '" /></a>';
 				break;
 
 			case 'video':
 			case 'rich':
-				if ( ! empty( $data->html ) && is_string( $data->html ) )
+				if ( ! empty( $data->html ) && is_string( $data->html ) ) {
 					$return = $data->html;
+				}
 				break;
 
 			case 'link':
-				if ( ! empty( $data->title ) && is_string( $data->title ) )
+				if ( ! empty( $data->title ) && is_string( $data->title ) ) {
 					$return = '<a href="' . esc_url( $url ) . '">' . esc_html( $data->title ) . '</a>';
+				}
 				break;
 
 			default:
Index: src/wp-includes/class-walker-category-dropdown.php
===================================================================
--- src/wp-includes/class-walker-category-dropdown.php	(revision 40901)
+++ src/wp-includes/class-walker-category-dropdown.php	(working copy)
@@ -37,7 +37,10 @@
 	 *
 	 * @see Walker::$db_fields
 	 */
-	public $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
+	public $db_fields = array(
+		'parent' => 'parent',
+		'id' => 'term_id',
+	);
 
 	/**
 	 * Starts the element output.
@@ -55,7 +58,7 @@
 	 * @param int    $id       Optional. ID of the current category. Default 0 (unused).
 	 */
 	public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
-		$pad = str_repeat('&nbsp;', $depth * 3);
+		$pad = str_repeat( '&nbsp;', $depth * 3 );
 
 		/** This filter is documented in wp-includes/category-template.php */
 		$cat_name = apply_filters( 'list_cats', $category->name, $category );
@@ -66,15 +69,17 @@
 			$value_field = 'term_id';
 		}
 
-		$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . "\"";
+		$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . '"';
 
 		// Type-juggling causes false matches, so we force everything to a string.
-		if ( (string) $category->{$value_field} === (string) $args['selected'] )
+		if ( (string) $category->{$value_field} === (string) $args['selected'] ) {
 			$output .= ' selected="selected"';
+		}
 		$output .= '>';
-		$output .= $pad.$cat_name;
-		if ( $args['show_count'] )
-			$output .= '&nbsp;&nbsp;('. number_format_i18n( $category->count ) .')';
+		$output .= $pad . $cat_name;
+		if ( $args['show_count'] ) {
+			$output .= '&nbsp;&nbsp;(' . number_format_i18n( $category->count ) . ')';
+		}
 		$output .= "</option>\n";
 	}
 }
Index: src/wp-includes/class-walker-category.php
===================================================================
--- src/wp-includes/class-walker-category.php	(revision 40901)
+++ src/wp-includes/class-walker-category.php	(working copy)
@@ -37,7 +37,10 @@
 	 * @see Walker::$db_fields
 	 * @todo Decouple this
 	 */
-	public $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
+	public $db_fields = array(
+		'parent' => 'parent',
+		'id' => 'term_id',
+	);
 
 	/**
 	 * Starts the list before the elements are added.
@@ -53,10 +56,11 @@
 	 *                       value is 'list'. See wp_list_categories(). Default empty array.
 	 */
 	public function start_lvl( &$output, $depth = 0, $args = array() ) {
-		if ( 'list' != $args['style'] )
+		if ( 'list' != $args['style'] ) {
 			return;
+		}
 
-		$indent = str_repeat("\t", $depth);
+		$indent = str_repeat( "\t", $depth );
 		$output .= "$indent<ul class='children'>\n";
 	}
 
@@ -74,10 +78,11 @@
 	 *                       value is 'list'. See wp_list_categories(). Default empty array.
 	 */
 	public function end_lvl( &$output, $depth = 0, $args = array() ) {
-		if ( 'list' != $args['style'] )
+		if ( 'list' != $args['style'] ) {
 			return;
+		}
 
-		$indent = str_repeat("\t", $depth);
+		$indent = str_repeat( "\t", $depth );
 		$output .= "$indent</ul>\n";
 	}
 
@@ -134,7 +139,7 @@
 			$link .= '<a href="' . esc_url( get_term_feed_link( $category->term_id, $category->taxonomy, $args['feed_type'] ) ) . '"';
 
 			if ( empty( $args['feed'] ) ) {
-				$alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"';
+				$alt = ' alt="' . sprintf( __( 'Feed for all posts filed under %s' ), $cat_name ) . '"';
 			} else {
 				$alt = ' alt="' . $args['feed'] . '"';
 				$name = $args['feed'];
@@ -180,7 +185,7 @@
 					}
 					while ( $_current_term->parent ) {
 						if ( $category->term_id == $_current_term->parent ) {
-							$css_classes[] =  'current-cat-ancestor';
+							$css_classes[] = 'current-cat-ancestor';
 							break;
 						}
 						$_current_term = get_term( $_current_term->parent, $category->taxonomy );
@@ -202,13 +207,13 @@
 			 */
 			$css_classes = implode( ' ', apply_filters( 'category_css_class', $css_classes, $category, $depth, $args ) );
 
-			$output .=  ' class="' . $css_classes . '"';
+			$output .= ' class="' . $css_classes . '"';
 			$output .= ">$link\n";
 		} elseif ( isset( $args['separator'] ) ) {
 			$output .= "\t$link" . $args['separator'] . "\n";
 		} else {
 			$output .= "\t$link<br />\n";
-		}
+		}// End if().
 	}
 
 	/**
@@ -226,8 +231,9 @@
 	 *                       to output. See wp_list_categories(). Default empty array.
 	 */
 	public function end_el( &$output, $page, $depth = 0, $args = array() ) {
-		if ( 'list' != $args['style'] )
+		if ( 'list' != $args['style'] ) {
 			return;
+		}
 
 		$output .= "</li>\n";
 	}
Index: src/wp-includes/class-walker-comment.php
===================================================================
--- src/wp-includes/class-walker-comment.php	(revision 40901)
+++ src/wp-includes/class-walker-comment.php	(working copy)
@@ -37,7 +37,10 @@
 	 * @see Walker::$db_fields
 	 * @todo Decouple this
 	 */
-	public $db_fields = array ('parent' => 'comment_parent', 'id' => 'comment_ID');
+	public $db_fields = array(
+		'parent' => 'comment_parent',
+		'id' => 'comment_ID',
+	);
 
 	/**
 	 * Starts the list before the elements are added.
@@ -131,8 +134,9 @@
 	 * @param string     $output            Used to append additional content. Passed by reference.
 	 */
 	public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
-		if ( !$element )
+		if ( ! $element ) {
 			return;
+		}
 
 		$id_field = $this->db_fields['id'];
 		$id = $element->$id_field;
@@ -144,9 +148,10 @@
 		 * and display them at this level. This is to prevent them being orphaned to the end
 		 * of the list.
 		 */
-		if ( $max_depth <= $depth + 1 && isset( $children_elements[$id]) ) {
-			foreach ( $children_elements[ $id ] as $child )
+		if ( $max_depth <= $depth + 1 && isset( $children_elements[ $id ] ) ) {
+			foreach ( $children_elements[ $id ] as $child ) {
 				$this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output );
+			}
 
 			unset( $children_elements[ $id ] );
 		}
@@ -175,7 +180,7 @@
 		$GLOBALS['comment_depth'] = $depth;
 		$GLOBALS['comment'] = $comment;
 
-		if ( !empty( $args['callback'] ) ) {
+		if ( ! empty( $args['callback'] ) ) {
 			ob_start();
 			call_user_func( $args['callback'], $comment, $args, $depth );
 			$output .= ob_get_clean();
@@ -212,16 +217,16 @@
 	 * @param array      $args    Optional. An array of arguments. Default empty array.
 	 */
 	public function end_el( &$output, $comment, $depth = 0, $args = array() ) {
-		if ( !empty( $args['end-callback'] ) ) {
+		if ( ! empty( $args['end-callback'] ) ) {
 			ob_start();
 			call_user_func( $args['end-callback'], $comment, $args, $depth );
 			$output .= ob_get_clean();
 			return;
 		}
-		if ( 'div' == $args['style'] )
+		if ( 'div' == $args['style'] ) {
 			$output .= "</div><!-- #comment-## -->\n";
-		else
-			$output .= "</li><!-- #comment-## -->\n";
+		} else { $output .= "</li><!-- #comment-## -->\n";
+		}
 	}
 
 	/**
@@ -272,7 +277,7 @@
 		<div id="div-comment-<?php comment_ID(); ?>" class="comment-body">
 		<?php endif; ?>
 		<div class="comment-author vcard">
-			<?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?>
+			<?php if ( 0 != $args['avatar_size'] ) { echo get_avatar( $comment, $args['avatar_size'] );} ?>
 			<?php
 				/* translators: %s: comment author link */
 				printf( __( '%s <span class="says">says:</span>' ),
@@ -292,7 +297,11 @@
 			?>
 		</div>
 
-		<?php comment_text( $comment, array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
+		<?php comment_text( $comment, array_merge( $args, array(
+			'add_below' => $add_below,
+			'depth' => $depth,
+			'max_depth' => $args['max_depth'],
+		) ) ); ?>
 
 		<?php
 		comment_reply_link( array_merge( $args, array(
@@ -300,7 +309,7 @@
 			'depth'     => $depth,
 			'max_depth' => $args['max_depth'],
 			'before'    => '<div class="reply">',
-			'after'     => '</div>'
+			'after'     => '</div>',
 		) ) );
 		?>
 
@@ -329,7 +338,7 @@
 			<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
 				<footer class="comment-meta">
 					<div class="comment-author vcard">
-						<?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?>
+						<?php if ( 0 != $args['avatar_size'] ) { echo get_avatar( $comment, $args['avatar_size'] );} ?>
 						<?php
 							/* translators: %s: comment author link */
 							printf( __( '%s <span class="says">says:</span>' ),
@@ -365,7 +374,7 @@
 					'depth'     => $depth,
 					'max_depth' => $args['max_depth'],
 					'before'    => '<div class="reply">',
-					'after'     => '</div>'
+					'after'     => '</div>',
 				) ) );
 				?>
 			</article><!-- .comment-body -->
Index: src/wp-includes/class-walker-nav-menu.php
===================================================================
--- src/wp-includes/class-walker-nav-menu.php	(revision 40901)
+++ src/wp-includes/class-walker-nav-menu.php	(working copy)
@@ -163,10 +163,10 @@
 		 * @param stdClass $args    An object of wp_nav_menu() arguments.
 		 * @param int      $depth   Depth of menu item. Used for padding.
 		 */
-		$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args, $depth );
+		$id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth );
 		$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
 
-		$output .= $indent . '<li' . $id . $class_names .'>';
+		$output .= $indent . '<li' . $id . $class_names . '>';
 
 		$atts = array();
 		$atts['title']  = ! empty( $item->attr_title ) ? $item->attr_title : '';
@@ -218,7 +218,7 @@
 		$title = apply_filters( 'nav_menu_item_title', $title, $item, $args, $depth );
 
 		$item_output = $args->before;
-		$item_output .= '<a'. $attributes .'>';
+		$item_output .= '<a' . $attributes . '>';
 		$item_output .= $args->link_before . $title . $args->link_after;
 		$item_output .= '</a>';
 		$item_output .= $args->after;
Index: src/wp-includes/class-walker-page-dropdown.php
===================================================================
--- src/wp-includes/class-walker-page-dropdown.php	(revision 40901)
+++ src/wp-includes/class-walker-page-dropdown.php	(working copy)
@@ -37,7 +37,10 @@
 	 * @see Walker::$db_fields
 	 * @todo Decouple this
 	 */
-	public $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
+	public $db_fields = array(
+		'parent' => 'post_parent',
+		'id' => 'ID',
+	);
 
 	/**
 	 * Starts the element output.
@@ -57,15 +60,16 @@
 	 * @param int     $id     Optional. ID of the current page. Default 0 (unused).
 	 */
 	public function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) {
-		$pad = str_repeat('&nbsp;', $depth * 3);
+		$pad = str_repeat( '&nbsp;', $depth * 3 );
 
 		if ( ! isset( $args['value_field'] ) || ! isset( $page->{$args['value_field']} ) ) {
 			$args['value_field'] = 'ID';
 		}
 
-		$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $page->{$args['value_field']} ) . "\"";
-		if ( $page->ID == $args['selected'] )
+		$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $page->{$args['value_field']} ) . '"';
+		if ( $page->ID == $args['selected'] ) {
 			$output .= ' selected="selected"';
+		}
 		$output .= '>';
 
 		$title = $page->post_title;
Index: src/wp-includes/class-walker-page.php
===================================================================
--- src/wp-includes/class-walker-page.php	(revision 40901)
+++ src/wp-includes/class-walker-page.php	(working copy)
@@ -132,7 +132,7 @@
 			} elseif ( $_current_page && $page->ID == $_current_page->post_parent ) {
 				$css_class[] = 'current_page_parent';
 			}
-		} elseif ( $page->ID == get_option('page_for_posts') ) {
+		} elseif ( $page->ID == get_option( 'page_for_posts' ) ) {
 			$css_class[] = 'current_page_parent';
 		}
 
@@ -206,7 +206,7 @@
 			}
 
 			$date_format = empty( $args['date_format'] ) ? '' : $args['date_format'];
-			$output .= " " . mysql2date( $date_format, $time );
+			$output .= ' ' . mysql2date( $date_format, $time );
 		}
 	}
 
Index: src/wp-includes/class-wp-admin-bar.php
===================================================================
--- src/wp-includes/class-wp-admin-bar.php	(revision 40901)
+++ src/wp-includes/class-wp-admin-bar.php	(working copy)
@@ -46,7 +46,7 @@
 				$this->user->domain = empty( $this->user->active_blog ) ? user_admin_url() : trailingslashit( get_home_url( $this->user->active_blog->blog_id ) );
 				$this->user->account_domain = $this->user->domain;
 			} else {
-				$this->user->active_blog = $this->user->blogs[get_current_blog_id()];
+				$this->user->active_blog = $this->user->blogs[ get_current_blog_id() ];
 				$this->user->domain = trailingslashit( home_url() );
 				$this->user->account_domain = $this->user->domain;
 			}
@@ -65,10 +65,11 @@
 			$header_callback = $admin_bar_args[0]['callback'];
 		}
 
-		if ( empty($header_callback) )
+		if ( empty( $header_callback ) ) {
 			$header_callback = '_admin_bar_bump_cb';
+		}
 
-		add_action('wp_head', $header_callback);
+		add_action( 'wp_head', $header_callback );
 
 		wp_enqueue_script( 'admin-bar' );
 		wp_enqueue_style( 'admin-bar' );
@@ -116,16 +117,21 @@
 	 */
 	public function add_node( $args ) {
 		// Shim for old method signature: add_node( $parent_id, $menu_obj, $args )
-		if ( func_num_args() >= 3 && is_string( func_get_arg(0) ) )
-			$args = array_merge( array( 'parent' => func_get_arg(0) ), func_get_arg(2) );
+		if ( func_num_args() >= 3 && is_string( func_get_arg( 0 ) ) ) {
+			$args = array_merge( array(
+				'parent' => func_get_arg( 0 ),
+			), func_get_arg( 2 ) );
+		}
 
-		if ( is_object( $args ) )
+		if ( is_object( $args ) ) {
 			$args = get_object_vars( $args );
+		}
 
 		// Ensure we have a valid title.
 		if ( empty( $args['id'] ) ) {
-			if ( empty( $args['title'] ) )
+			if ( empty( $args['title'] ) ) {
 				return;
+			}
 
 			_doing_it_wrong( __METHOD__, __( 'The menu ID should not be empty.' ), '3.3.0' );
 			// Deprecated: Generate an ID from the title.
@@ -142,12 +148,14 @@
 		);
 
 		// If the node already exists, keep any data that isn't provided.
-		if ( $maybe_defaults = $this->get_node( $args['id'] ) )
+		if ( $maybe_defaults = $this->get_node( $args['id'] ) ) {
 			$defaults = get_object_vars( $maybe_defaults );
+		}
 
 		// Do the same for 'meta' items.
-		if ( ! empty( $defaults['meta'] ) && ! empty( $args['meta'] ) )
+		if ( ! empty( $defaults['meta'] ) && ! empty( $args['meta'] ) ) {
 			$args['meta'] = wp_parse_args( $args['meta'], $defaults['meta'] );
+		}
 
 		$args = wp_parse_args( $args, $defaults );
 
@@ -179,8 +187,9 @@
 	 * @return object Node.
 	 */
 	final public function get_node( $id ) {
-		if ( $node = $this->_get_node( $id ) )
+		if ( $node = $this->_get_node( $id ) ) {
 			return clone $node;
+		}
 	}
 
 	/**
@@ -188,22 +197,26 @@
 	 * @return object|void
 	 */
 	final protected function _get_node( $id ) {
-		if ( $this->bound )
+		if ( $this->bound ) {
 			return;
+		}
 
-		if ( empty( $id ) )
+		if ( empty( $id ) ) {
 			$id = 'root';
+		}
 
-		if ( isset( $this->nodes[ $id ] ) )
+		if ( isset( $this->nodes[ $id ] ) ) {
 			return $this->nodes[ $id ];
+		}
 	}
 
 	/**
 	 * @return array|void
 	 */
 	final public function get_nodes() {
-		if ( ! $nodes = $this->_get_nodes() )
+		if ( ! $nodes = $this->_get_nodes() ) {
 			return;
+		}
 
 		foreach ( $nodes as &$node ) {
 			$node = clone $node;
@@ -215,8 +228,9 @@
 	 * @return array|void
 	 */
 	final protected function _get_nodes() {
-		if ( $this->bound )
+		if ( $this->bound ) {
 			return;
+		}
 
 		return $this->nodes;
 	}
@@ -262,16 +276,18 @@
 	 */
 	public function render() {
 		$root = $this->_bind();
-		if ( $root )
+		if ( $root ) {
 			$this->_render( $root );
+		}
 	}
 
 	/**
 	 * @return object|void
 	 */
 	final protected function _bind() {
-		if ( $this->bound )
+		if ( $this->bound ) {
 			return;
+		}
 
 		// Add the root node.
 		// Clear it first, just in case. Don't mess with The Root.
@@ -288,13 +304,15 @@
 			unset( $node->group );
 
 			// The Root wants your orphans. No lonely items allowed.
-			if ( ! $node->parent )
+			if ( ! $node->parent ) {
 				$node->parent = 'root';
+			}
 		}
 
 		foreach ( $this->_get_nodes() as $node ) {
-			if ( 'root' == $node->id )
+			if ( 'root' == $node->id ) {
 				continue;
+			}
 
 			// Fetch the parent node. If it isn't registered, ignore the node.
 			if ( ! $parent = $this->_get_node( $node->parent ) ) {
@@ -305,10 +323,10 @@
 			$group_class = ( $node->parent == 'root' ) ? 'ab-top-menu' : 'ab-submenu';
 
 			if ( $node->type == 'group' ) {
-				if ( empty( $node->meta['class'] ) )
+				if ( empty( $node->meta['class'] ) ) {
 					$node->meta['class'] = $group_class;
-				else
-					$node->meta['class'] .= ' ' . $group_class;
+				} else { $node->meta['class'] .= ' ' . $group_class;
+				}
 			}
 
 			// Items in items aren't allowed. Wrap nested items in 'default' groups.
@@ -337,8 +355,8 @@
 				}
 				$parent = $default;
 
-			// Groups in groups aren't allowed. Add a special 'container' node.
-			// The container will invisibly wrap both groups.
+				// Groups in groups aren't allowed. Add a special 'container' node.
+				// The container will invisibly wrap both groups.
 			} elseif ( $parent->type == 'group' && $node->type == 'group' ) {
 				$container_id = $parent->id . '-container';
 				$container    = $this->_get_node( $container_id );
@@ -366,24 +384,24 @@
 						$container->parent = $grandparent->id;
 
 						$index = array_search( $parent, $grandparent->children, true );
-						if ( $index === false )
+						if ( $index === false ) {
 							$grandparent->children[] = $container;
-						else
-							array_splice( $grandparent->children, $index, 1, array( $container ) );
+						} else { array_splice( $grandparent->children, $index, 1, array( $container ) );
+						}
 					}
 
 					$parent->parent = $container->id;
 				}
 
 				$parent = $container;
-			}
+			}// End if().
 
 			// Update the parent ID (it might have changed).
 			$node->parent = $parent->id;
 
 			// Add the node to the tree.
 			$parent->children[] = $node;
-		}
+		}// End foreach().
 
 		$root = $this->_get_node( 'root' );
 		$this->bound = true;
@@ -402,12 +420,13 @@
 		// We have to do this here since admin bar shows on the front end.
 		$class = 'nojq nojs';
 		if ( $is_IE ) {
-			if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 7' ) )
+			if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 7' ) ) {
 				$class .= ' ie7';
-			elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 8' ) )
+			} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 8' ) ) {
 				$class .= ' ie8';
-			elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 9' ) )
+			} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 9' ) ) {
 				$class .= ' ie9';
+			}
 		} elseif ( wp_is_mobile() ) {
 			$class .= ' mobile';
 		}
@@ -420,10 +439,10 @@
 			<div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e( 'Toolbar' ); ?>" tabindex="0">
 				<?php foreach ( $root->children as $group ) {
 					$this->_render_group( $group );
-				} ?>
+} ?>
 			</div>
 			<?php if ( is_user_logged_in() ) : ?>
-			<a class="screen-reader-shortcut" href="<?php echo esc_url( wp_logout_url() ); ?>"><?php _e('Log Out'); ?></a>
+			<a class="screen-reader-shortcut" href="<?php echo esc_url( wp_logout_url() ); ?>"><?php _e( 'Log Out' ); ?></a>
 			<?php endif; ?>
 		</div>
 
@@ -434,13 +453,14 @@
 	 * @param object $node
 	 */
 	final protected function _render_container( $node ) {
-		if ( $node->type != 'container' || empty( $node->children ) )
+		if ( $node->type != 'container' || empty( $node->children ) ) {
 			return;
+		}
 
 		?><div id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>" class="ab-group-container"><?php
-			foreach ( $node->children as $group ) {
-				$this->_render_group( $group );
-			}
+foreach ( $node->children as $group ) {
+	$this->_render_group( $group );
+}
 		?></div><?php
 	}
 
@@ -452,18 +472,19 @@
 			$this->_render_container( $node );
 			return;
 		}
-		if ( $node->type != 'group' || empty( $node->children ) )
+		if ( $node->type != 'group' || empty( $node->children ) ) {
 			return;
+		}
 
-		if ( ! empty( $node->meta['class'] ) )
+		if ( ! empty( $node->meta['class'] ) ) {
 			$class = ' class="' . esc_attr( trim( $node->meta['class'] ) ) . '"';
-		else
-			$class = '';
+		} else { $class = '';
+		}
 
 		?><ul id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $class; ?>><?php
-			foreach ( $node->children as $item ) {
-				$this->_render_item( $item );
-			}
+foreach ( $node->children as $item ) {
+	$this->_render_item( $item );
+}
 		?></ul><?php
 	}
 
@@ -471,8 +492,9 @@
 	 * @param object $node
 	 */
 	final protected function _render_item( $node ) {
-		if ( $node->type != 'item' )
+		if ( $node->type != 'item' ) {
 			return;
+		}
 
 		$is_parent = ! empty( $node->children );
 		$has_link  = ! empty( $node->href );
@@ -488,46 +510,48 @@
 			$aria_attributes .= ' aria-haspopup="true"';
 		}
 
-		if ( ! empty( $node->meta['class'] ) )
+		if ( ! empty( $node->meta['class'] ) ) {
 			$menuclass .= $node->meta['class'];
+		}
 
-		if ( $menuclass )
+		if ( $menuclass ) {
 			$menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"';
+		}
 
 		?>
 
 		<li id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $menuclass; ?>><?php
-			if ( $has_link ):
-				?><a class="ab-item"<?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php
-					if ( ! empty( $node->meta['onclick'] ) ) :
-						?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php
-					endif;
-				if ( ! empty( $node->meta['target'] ) ) :
-					?> target="<?php echo esc_attr( $node->meta['target'] ); ?>"<?php
-				endif;
-				if ( ! empty( $node->meta['title'] ) ) :
-					?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
-				endif;
-				if ( ! empty( $node->meta['rel'] ) ) :
-					?> rel="<?php echo esc_attr( $node->meta['rel'] ); ?>"<?php
-				endif;
-				if ( ! empty( $node->meta['lang'] ) ) :
-					?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php
-				endif;
-				if ( ! empty( $node->meta['dir'] ) ) :
-					?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php
-				endif;
-				?>><?php
-			else:
+		if ( $has_link ) :
+			?><a class="ab-item"<?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php
+if ( ! empty( $node->meta['onclick'] ) ) :
+	?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php
+			endif;
+if ( ! empty( $node->meta['target'] ) ) :
+	?> target="<?php echo esc_attr( $node->meta['target'] ); ?>"<?php
+		endif;
+if ( ! empty( $node->meta['title'] ) ) :
+	?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
+		endif;
+if ( ! empty( $node->meta['rel'] ) ) :
+	?> rel="<?php echo esc_attr( $node->meta['rel'] ); ?>"<?php
+		endif;
+if ( ! empty( $node->meta['lang'] ) ) :
+	?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php
+		endif;
+if ( ! empty( $node->meta['dir'] ) ) :
+	?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php
+		endif;
+			?>><?php
+			else :
 				?><div class="ab-item ab-empty-item"<?php echo $aria_attributes;
-				if ( ! empty( $node->meta['title'] ) ) :
-					?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
+if ( ! empty( $node->meta['title'] ) ) :
+	?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
 				endif;
-				if ( ! empty( $node->meta['lang'] ) ) :
-					?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php
+if ( ! empty( $node->meta['lang'] ) ) :
+	?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php
 				endif;
-				if ( ! empty( $node->meta['dir'] ) ) :
-					?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php
+if ( ! empty( $node->meta['dir'] ) ) :
+	?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php
 				endif;
 				?>><?php
 			endif;
@@ -536,20 +560,21 @@
 
 			if ( $has_link ) :
 				?></a><?php
-			else:
+			else :
 				?></div><?php
 			endif;
 
 			if ( $is_parent ) :
 				?><div class="ab-sub-wrapper"><?php
-					foreach ( $node->children as $group ) {
-						$this->_render_group( $group );
-					}
+foreach ( $node->children as $group ) {
+	$this->_render_group( $group );
+}
 				?></div><?php
 			endif;
 
-			if ( ! empty( $node->meta['html'] ) )
+			if ( ! empty( $node->meta['html'] ) ) {
 				echo $node->meta['html'];
+			}
 
 			?>
 		</li><?php
Index: src/wp-includes/class-wp-ajax-response.php
===================================================================
--- src/wp-includes/class-wp-ajax-response.php	(revision 40901)
+++ src/wp-includes/class-wp-ajax-response.php	(working copy)
@@ -23,8 +23,9 @@
 	 * @param string|array $args Optional. Will be passed to add() method.
 	 */
 	public function __construct( $args = '' ) {
-		if ( !empty($args) )
-			$this->add($args);
+		if ( ! empty( $args ) ) {
+			$this->add( $args );
+		}
 	}
 
 	/**
@@ -64,10 +65,13 @@
 	 */
 	public function add( $args = '' ) {
 		$defaults = array(
-			'what' => 'object', 'action' => false,
-			'id' => '0', 'old_id' => false,
+			'what' => 'object',
+		'action' => false,
+			'id' => '0',
+		'old_id' => false,
 			'position' => 1,
-			'data' => '', 'supplemental' => array()
+			'data' => '',
+		'supplemental' => array(),
 		);
 
 		$r = wp_parse_args( $args, $defaults );
@@ -87,7 +91,7 @@
 		$response = '';
 		if ( is_wp_error( $data ) ) {
 			foreach ( (array) $data->get_error_codes() as $code ) {
-				$response .= "<wp_error code='$code'><![CDATA[" . $data->get_error_message( $code ) . "]]></wp_error>";
+				$response .= "<wp_error code='$code'><![CDATA[" . $data->get_error_message( $code ) . ']]></wp_error>';
 				if ( ! $error_data = $data->get_error_data( $code ) ) {
 					continue;
 				}
@@ -107,7 +111,7 @@
 					}
 				}
 
-				$response .= "</wp_error_data>";
+				$response .= '</wp_error_data>';
 			}
 		} else {
 			$response = "<response_data><![CDATA[$data]]></response_data>";
@@ -126,11 +130,11 @@
 		}
 		$x = '';
 		$x .= "<response action='{$action}_$id'>"; // The action attribute in the xml output is formatted like a nonce action
-		$x .=	"<$what id='$id' " . ( false === $old_id ? '' : "old_id='$old_id' " ) . "position='$position'>";
-		$x .=		$response;
-		$x .=		$s;
-		$x .=	"</$what>";
-		$x .= "</response>";
+		$x .= "<$what id='$id' " . ( false === $old_id ? '' : "old_id='$old_id' " ) . "position='$position'>";
+		$x .= $response;
+		$x .= $s;
+		$x .= "</$what>";
+		$x .= '</response>';
 
 		$this->responses[] = $x;
 		return $x;
@@ -146,12 +150,13 @@
 	public function send() {
 		header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );
 		echo "<?xml version='1.0' encoding='" . get_option( 'blog_charset' ) . "' standalone='yes'?><wp_ajax>";
-		foreach ( (array) $this->responses as $response )
+		foreach ( (array) $this->responses as $response ) {
 			echo $response;
+		}
 		echo '</wp_ajax>';
-		if ( wp_doing_ajax() )
+		if ( wp_doing_ajax() ) {
 			wp_die();
-		else
-			die();
+		} else { die();
+		}
 	}
 }
Index: src/wp-includes/class-wp-comment-query.php
===================================================================
--- src/wp-includes/class-wp-comment-query.php	(revision 40901)
+++ src/wp-includes/class-wp-comment-query.php	(working copy)
@@ -251,7 +251,7 @@
 	 *                                                   The parameter is ignored (forced to `false`) when
 	 *                                                   `$fields` is 'ids' or 'counts'. Accepts 'threaded',
 	 *                                                   'flat', or false. Default: false.
- 	 *     @type string       $cache_domain              Unique cache key to be produced when this query is stored in
+	  *     @type string       $cache_domain              Unique cache key to be produced when this query is stored in
 	 *                                                   an object cache. Default is 'core'.
 	 *     @type bool         $update_comment_meta_cache Whether to prime the metadata cache for found comments.
 	 *                                                   Default true.
@@ -395,7 +395,6 @@
 		$key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) );
 		$last_changed = wp_cache_get_last_changed( 'comment' );
 
-
 		$cache_key   = "get_comments:$key:$last_changed";
 		$cache_value = wp_cache_get( $cache_key, 'comment' );
 		if ( false === $cache_value ) {
@@ -511,7 +510,7 @@
 						break;
 
 					default :
-						$status_clauses[] = $wpdb->prepare( "comment_approved = %s", $status );
+						$status_clauses[] = $wpdb->prepare( 'comment_approved = %s', $status );
 						break;
 				}
 			}
@@ -536,7 +535,7 @@
 				if ( is_numeric( $unapproved_identifier ) ) {
 					$approved_clauses[] = $wpdb->prepare( "( user_id = %d AND comment_approved = '0' )", $unapproved_identifier );
 
-				// Otherwise we match against email addresses.
+					// Otherwise we match against email addresses.
 				} else {
 					$approved_clauses[] = $wpdb->prepare( "( comment_author_email = %s AND comment_approved = '0' )", $unapproved_identifier );
 				}
@@ -636,7 +635,7 @@
 			$orderby = implode( ', ', $orderby_array );
 		} else {
 			$orderby = "$wpdb->comments.comment_date_gmt $order";
-		}
+		}// End if().
 
 		$number = absint( $this->query_vars['number'] );
 		$offset = absint( $this->query_vars['offset'] );
@@ -737,7 +736,7 @@
 
 			if ( ! empty( $comment_types[ $operator ] ) ) {
 				$types_sql = implode( ', ', $comment_types[ $operator ] );
-				$this->sql_clauses['where']['comment_type__' . strtolower( str_replace( ' ', '_', $operator ) ) ] = "comment_type $operator ($types_sql)";
+				$this->sql_clauses['where'][ 'comment_type__' . strtolower( str_replace( ' ', '_', $operator ) ) ] = "comment_type $operator ($types_sql)";
 			}
 		}
 
@@ -798,7 +797,7 @@
 				$join_posts_table = true;
 
 				$esses = array_fill( 0, count( $q_values ), '%s' );
-				$this->sql_clauses['where'][ $field_name ] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ")", $q_values );
+				$this->sql_clauses['where'][ $field_name ] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ')', $q_values );
 			}
 		}
 
@@ -859,12 +858,12 @@
 		 */
 		$clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
 
-		$fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
-		$join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
-		$where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
-		$orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
-		$limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
-		$groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
+		$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
+		$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
+		$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
+		$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
+		$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
+		$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
 
 		$this->filtered_where_clause = $where;
 
@@ -1022,7 +1021,7 @@
 					$threaded_comments[ $_c->comment_ID ] = $_c;
 					$ref[ $_c->comment_ID ] = $threaded_comments[ $_c->comment_ID ];
 
-				// Otherwise, set it as a child of its parent.
+					// Otherwise, set it as a child of its parent.
 				} else {
 
 					$ref[ $_c->comment_parent ]->add_child( $_c );
@@ -1065,7 +1064,7 @@
 			$searches[] = $wpdb->prepare( "$col LIKE %s", $like );
 		}
 
-		return ' AND (' . implode(' OR ', $searches) . ')';
+		return ' AND (' . implode( ' OR ', $searches ) . ')';
 	}
 
 	/**
@@ -1123,7 +1122,7 @@
 
 			if ( isset( $meta_query_clauses[ $orderby ] ) ) {
 				$meta_clause = $meta_query_clauses[ $orderby ];
-				$parsed = sprintf( "CAST(%s.meta_value AS %s)", esc_sql( $meta_clause['alias'] ), esc_sql( $meta_clause['cast'] ) );
+				$parsed = sprintf( 'CAST(%s.meta_value AS %s)', esc_sql( $meta_clause['alias'] ), esc_sql( $meta_clause['cast'] ) );
 			} else {
 				$parsed = "$wpdb->comments.$orderby";
 			}
Index: src/wp-includes/class-wp-customize-control.php
===================================================================
--- src/wp-includes/class-wp-customize-control.php	(revision 40901)
+++ src/wp-includes/class-wp-customize-control.php	(working copy)
@@ -247,7 +247,7 @@
 			foreach ( $this->settings as $key => $setting ) {
 				$settings[ $key ] = $this->manager->get_setting( $setting );
 			}
-		} else if ( is_string( $this->settings ) ) {
+		} elseif ( is_string( $this->settings ) ) {
 			$this->setting = $this->manager->get_setting( $this->settings );
 			$settings['default'] = $this->setting;
 		}
@@ -402,8 +402,9 @@
 	 * @uses WP_Customize_Control::render()
 	 */
 	final public function maybe_render() {
-		if ( ! $this->check_capabilities() )
+		if ( ! $this->check_capabilities() ) {
 			return;
+		}
 
 		/**
 		 * Fires just before the current Customizer control is rendered.
@@ -452,8 +453,9 @@
 	 * @return string Data link parameter, if $setting_key is a valid setting, empty string otherwise.
 	 */
 	public function get_link( $setting_key = 'default' ) {
-		if ( ! isset( $this->settings[ $setting_key ] ) )
+		if ( ! isset( $this->settings[ $setting_key ] ) ) {
 			return '';
+		}
 
 		return 'data-customize-setting-link="' . esc_attr( $this->settings[ $setting_key ]->id ) . '"';
 	}
@@ -494,11 +496,12 @@
 	 * @since 3.4.0
 	 */
 	protected function render_content() {
-		switch( $this->type ) {
+		switch ( $this->type ) {
 			case 'checkbox':
 				?>
 				<label>
-					<input type="checkbox" value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); checked( $this->value() ); ?> />
+					<input type="checkbox" value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link();
+					checked( $this->value() ); ?> />
 					<?php echo esc_html( $this->label ); ?>
 					<?php if ( ! empty( $this->description ) ) : ?>
 						<span class="description customize-control-description"><?php echo $this->description; ?></span>
@@ -507,8 +510,9 @@
 				<?php
 				break;
 			case 'radio':
-				if ( empty( $this->choices ) )
+				if ( empty( $this->choices ) ) {
 					return;
+				}
 
 				$name = '_customize-radio-' . $this->id;
 
@@ -522,29 +526,32 @@
 				foreach ( $this->choices as $value => $label ) :
 					?>
 					<label>
-						<input type="radio" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" <?php $this->link(); checked( $this->value(), $value ); ?> />
+						<input type="radio" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" <?php $this->link();
+						checked( $this->value(), $value ); ?> />
 						<?php echo esc_html( $label ); ?><br/>
 					</label>
 					<?php
 				endforeach;
 				break;
 			case 'select':
-				if ( empty( $this->choices ) )
+				if ( empty( $this->choices ) ) {
 					return;
+				}
 
 				?>
 				<label>
 					<?php if ( ! empty( $this->label ) ) : ?>
 						<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
 					<?php endif;
-					if ( ! empty( $this->description ) ) : ?>
+if ( ! empty( $this->description ) ) : ?>
 						<span class="description customize-control-description"><?php echo $this->description; ?></span>
 					<?php endif; ?>
 
 					<select <?php $this->link(); ?>>
 						<?php
-						foreach ( $this->choices as $value => $label )
+						foreach ( $this->choices as $value => $label ) {
 							echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>';
+						}
 						?>
 					</select>
 				</label>
@@ -556,7 +563,7 @@
 					<?php if ( ! empty( $this->label ) ) : ?>
 						<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
 					<?php endif;
-					if ( ! empty( $this->description ) ) : ?>
+if ( ! empty( $this->description ) ) : ?>
 						<span class="description customize-control-description"><?php echo $this->description; ?></span>
 					<?php endif; ?>
 					<textarea rows="5" <?php $this->input_attrs(); ?> <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea>
@@ -569,7 +576,7 @@
 				<?php if ( ! empty( $this->label ) ) : ?>
 					<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
 				<?php endif;
-				if ( ! empty( $this->description ) ) : ?>
+if ( ! empty( $this->description ) ) : ?>
 					<span class="description customize-control-description"><?php echo $this->description; ?></span>
 				<?php endif; ?>
 
@@ -632,14 +639,14 @@
 					<?php if ( ! empty( $this->label ) ) : ?>
 						<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
 					<?php endif;
-					if ( ! empty( $this->description ) ) : ?>
+if ( ! empty( $this->description ) ) : ?>
 						<span class="description customize-control-description"><?php echo $this->description; ?></span>
 					<?php endif; ?>
 					<input type="<?php echo esc_attr( $this->type ); ?>" <?php $this->input_attrs(); ?> value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); ?> />
 				</label>
 				<?php
 				break;
-		}
+		}// End switch().
 	}
 
 	/**
Index: src/wp-includes/class-wp-customize-manager.php
===================================================================
--- src/wp-includes/class-wp-customize-manager.php	(revision 40901)
+++ src/wp-includes/class-wp-customize-manager.php	(working copy)
@@ -985,7 +985,7 @@
 				$this->set_post_value( $setting_id, $sidebar_widget_ids );
 				$this->pending_starter_content_settings_ids[] = $setting_id;
 			}
-		}
+		}// End foreach().
 
 		$starter_content_auto_draft_post_ids = array();
 		if ( ! empty( $changeset_data['nav_menus_created_posts']['value'] ) ) {
@@ -1120,9 +1120,9 @@
 				}
 
 				$attachment_ids[ $symbol ] = $attachment_id;
-			}
+			}// End foreach().
 			$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, array_values( $attachment_ids ) );
-		}
+		}// End if().
 
 		// Posts & pages.
 		if ( ! empty( $posts ) ) {
@@ -1163,7 +1163,7 @@
 			}
 
 			$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, wp_list_pluck( $posts, 'ID' ) );
-		}
+		}// End if().
 
 		// The nav_menus_created_posts setting is why nav_menus component is dependency for adding posts.
 		if ( ! empty( $this->nav_menus ) && ! empty( $starter_content_auto_draft_post_ids ) ) {
@@ -1245,7 +1245,7 @@
 				$this->set_post_value( $setting_id, $nav_menu_term_id );
 				$this->pending_starter_content_settings_ids[] = $setting_id;
 			}
-		}
+		}// End foreach().
 
 		// Options.
 		foreach ( $options as $name => $value ) {
@@ -1368,7 +1368,7 @@
 			$attachment['file_name'] = $file_name;
 			$attachment['file_path'] = $file_path;
 			$prepared_attachments[ $symbol ] = $attachment;
-		}
+		}// End foreach().
 		return $prepared_attachments;
 	}
 
@@ -1979,7 +1979,7 @@
 	 * @return string Theme name.
 	 */
 	public function current_theme( $current_theme ) {
-		return $this->theme()->display('Name');
+		return $this->theme()->display( 'Name' );
 	}
 
 	/**
@@ -2047,7 +2047,7 @@
 				$validity = new WP_Error( 'invalid_value', __( 'Invalid value.' ) );
 			}
 			$validities[ $setting_id ] = $validity;
-		}
+		}// End foreach().
 		return $validities;
 	}
 
@@ -2441,7 +2441,7 @@
 					unset( $data[ $changeset_setting_id ]['starter_content'] );
 				}
 			}
-		}
+		}// End foreach().
 
 		$filter_context = array(
 			'uuid' => $this->changeset_uuid(),
@@ -2910,7 +2910,7 @@
 
 			$this->add_setting( $setting );
 			$new_settings[] = $setting;
-		}
+		}// End foreach().
 		return $new_settings;
 	}
 
@@ -3079,8 +3079,9 @@
 	 * @return WP_Customize_Section|void The section, if set.
 	 */
 	public function get_section( $id ) {
-		if ( isset( $this->sections[ $id ] ) )
+		if ( isset( $this->sections[ $id ] ) ) {
 			return $this->sections[ $id ];
+		}
 	}
 
 	/**
@@ -3173,8 +3174,9 @@
 	 * @return WP_Customize_Control|void The control object, if set.
 	 */
 	public function get_control( $id ) {
-		if ( isset( $this->controls[ $id ] ) )
+		if ( isset( $this->controls[ $id ] ) ) {
 			return $this->controls[ $id ];
+		}
 	}
 
 	/**
@@ -3286,7 +3288,6 @@
 				continue;
 			}
 
-
 			$section->controls = wp_list_sort( $section->controls, array(
 				'priority'        => 'ASC',
 				'instance_number' => 'ASC',
@@ -3499,9 +3500,9 @@
 
 		if ( $this->return_url ) {
 			$return_url = $this->return_url;
-		} else if ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
+		} elseif ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
 			$return_url = $referer;
-		} else if ( $this->preview_url ) {
+		} elseif ( $this->preview_url ) {
 			$return_url = $this->preview_url;
 		} else {
 			$return_url = home_url( '/' );
@@ -3966,7 +3967,7 @@
 			$title = __( 'Header Image' );
 			$description = '';
 			$control_description = '';
-		}
+		}// End if().
 
 		$this->add_section( 'header_image', array(
 			'title'          => $title,
@@ -4144,7 +4145,6 @@
 			'type'     => 'checkbox',
 		) );
 
-
 		// If the theme is using the default background callback, we can update
 		// the background CSS using postMessage.
 		if ( get_theme_support( 'custom-background', 'wp-head-callback' ) === '_custom_background_cb' ) {
@@ -4283,12 +4283,14 @@
 	 * @return mixed
 	 */
 	public function _sanitize_header_textcolor( $color ) {
-		if ( 'blank' === $color )
+		if ( 'blank' === $color ) {
 			return 'blank';
+		}
 
 		$color = sanitize_hex_color_no_hash( $color );
-		if ( empty( $color ) )
+		if ( empty( $color ) ) {
 			$color = get_theme_support( 'custom-header', 'default-text-color' );
+		}
 
 		return $color;
 	}
Index: src/wp-includes/class-wp-customize-nav-menus.php
===================================================================
--- src/wp-includes/class-wp-customize-nav-menus.php	(revision 40901)
+++ src/wp-includes/class-wp-customize-nav-menus.php	(working copy)
@@ -128,7 +128,9 @@
 			$all_items[ $item_type['type'] . ':' . $item_type['object'] ] = $items;
 		}
 
-		wp_send_json_success( array( 'items' => $all_items ) );
+		wp_send_json_success( array(
+			'items' => $all_items,
+		) );
 	}
 
 	/**
@@ -237,7 +239,7 @@
 					'url'        => get_term_link( intval( $term->term_id ), $term->taxonomy ),
 				);
 			}
-		}
+		}// End if().
 
 		/**
 		 * Filters the available menu items.
@@ -277,12 +279,19 @@
 		}
 
 		$s = sanitize_text_field( wp_unslash( $_POST['search'] ) );
-		$items = $this->search_available_items_query( array( 'pagenum' => $p, 's' => $s ) );
+		$items = $this->search_available_items_query( array(
+			'pagenum' => $p,
+			's' => $s,
+		) );
 
 		if ( empty( $items ) ) {
-			wp_send_json_error( array( 'message' => __( 'No results found.' ) ) );
+			wp_send_json_error( array(
+				'message' => __( 'No results found.' ),
+			) );
 		} else {
-			wp_send_json_success( array( 'items' => $items ) );
+			wp_send_json_success( array(
+				'items' => $items,
+			) );
 		}
 	}
 
@@ -300,7 +309,9 @@
 	public function search_available_items_query( $args = array() ) {
 		$items = array();
 
-		$post_type_objects = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
+		$post_type_objects = get_post_types( array(
+			'show_in_nav_menus' => true,
+		), 'objects' );
 		$query = array(
 			'post_type'              => array_keys( $post_type_objects ),
 			'suppress_filters'       => true,
@@ -356,7 +367,9 @@
 		}
 
 		// Query taxonomy terms.
-		$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'names' );
+		$taxonomies = get_taxonomies( array(
+			'show_in_nav_menus' => true,
+		), 'names' );
 		$terms = get_terms( $taxonomies, array(
 			'name__like' => $args['s'],
 			'number'     => 20,
@@ -592,7 +605,9 @@
 			'description' => $description,
 		) );
 
-		$choices = array( '0' => __( '&mdash; Select &mdash;' ) );
+		$choices = array(
+			'0' => __( '&mdash; Select &mdash;' ),
+		);
 		foreach ( $menus as $menu ) {
 			$choices[ $menu->term_id ] = wp_html_excerpt( $menu->name, 40, '&hellip;' );
 		}
@@ -666,9 +681,7 @@
 					'priority' => 10 + $i,
 				) ) );
 			}
-
-			// Note: other controls inside of this section get added dynamically in JS via the MenuSection.ready() function.
-		}
+		}// End foreach().
 
 		// Add the add-new-menu section and controls.
 		$this->manager->add_section( new WP_Customize_New_Menu_Section( $this->manager, 'add_menu', array(
@@ -729,7 +742,9 @@
 	public function available_item_types() {
 		$item_types = array();
 
-		$post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
+		$post_types = get_post_types( array(
+			'show_in_nav_menus' => true,
+		), 'objects' );
 		if ( $post_types ) {
 			foreach ( $post_types as $slug => $post_type ) {
 				$item_types[] = array(
@@ -741,7 +756,9 @@
 			}
 		}
 
-		$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'objects' );
+		$taxonomies = get_taxonomies( array(
+			'show_in_nav_menus' => true,
+		), 'objects' );
 		if ( $taxonomies ) {
 			foreach ( $taxonomies as $slug => $taxonomy ) {
 				if ( 'post_format' === $taxonomy && ! current_theme_supports( 'post-formats' ) ) {
Index: src/wp-includes/class-wp-customize-panel.php
===================================================================
--- src/wp-includes/class-wp-customize-panel.php	(revision 40901)
+++ src/wp-includes/class-wp-customize-panel.php	(working copy)
@@ -335,7 +335,7 @@
 		<script type="text/html" id="tmpl-customize-panel-<?php echo esc_attr( $this->type ); ?>">
 			<?php $this->render_template(); ?>
 		</script>
-        <?php
+		<?php
 	}
 
 	/**
Index: src/wp-includes/class-wp-customize-setting.php
===================================================================
--- src/wp-includes/class-wp-customize-setting.php	(revision 40901)
+++ src/wp-includes/class-wp-customize-setting.php	(working copy)
@@ -191,8 +191,8 @@
 		$this->id_data['base'] = array_shift( $this->id_data['keys'] );
 
 		// Rebuild the ID.
-		$this->id = $this->id_data[ 'base' ];
-		if ( ! empty( $this->id_data[ 'keys' ] ) ) {
+		$this->id = $this->id_data['base'];
+		if ( ! empty( $this->id_data['keys'] ) ) {
 			$this->id .= '[' . implode( '][', $this->id_data['keys'] ) . ']';
 		}
 
@@ -413,7 +413,7 @@
 				 * @param WP_Customize_Setting $this WP_Customize_Setting instance.
 				 */
 				do_action( "customize_preview_{$this->type}", $this );
-		}
+		}// End switch().
 
 		$this->is_previewed = true;
 
@@ -778,7 +778,7 @@
 			}
 		} else {
 			$value = $this->get_root_value( $this->default );
-		}
+		}// End if().
 		return $value;
 	}
 
@@ -803,8 +803,9 @@
 		 */
 		$value = apply_filters( "customize_sanitize_js_{$this->id}", $this->value(), $this );
 
-		if ( is_string( $value ) )
-			return html_entity_decode( $value, ENT_QUOTES, 'UTF-8');
+		if ( is_string( $value ) ) {
+			return html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );
+		}
 
 		return $value;
 	}
@@ -833,11 +834,13 @@
 	 * @return bool False if theme doesn't support the setting or user can't change setting, otherwise true.
 	 */
 	final public function check_capabilities() {
-		if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) )
+		if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
 			return false;
+		}
 
-		if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) )
+		if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
 			return false;
+		}
 
 		return true;
 	}
@@ -853,21 +856,25 @@
 	 * @return array|void Keys are 'root', 'node', and 'key'.
 	 */
 	final protected function multidimensional( &$root, $keys, $create = false ) {
-		if ( $create && empty( $root ) )
+		if ( $create && empty( $root ) ) {
 			$root = array();
+		}
 
-		if ( ! isset( $root ) || empty( $keys ) )
+		if ( ! isset( $root ) || empty( $keys ) ) {
 			return;
+		}
 
 		$last = array_pop( $keys );
 		$node = &$root;
 
 		foreach ( $keys as $key ) {
-			if ( $create && ! isset( $node[ $key ] ) )
+			if ( $create && ! isset( $node[ $key ] ) ) {
 				$node[ $key ] = array();
+			}
 
-			if ( ! is_array( $node ) || ! isset( $node[ $key ] ) )
+			if ( ! is_array( $node ) || ! isset( $node[ $key ] ) ) {
 				return;
+			}
 
 			$node = &$node[ $key ];
 		}
@@ -882,8 +889,9 @@
 			}
 		}
 
-		if ( ! isset( $node[ $last ] ) )
+		if ( ! isset( $node[ $last ] ) ) {
 			return;
+		}
 
 		return array(
 			'root' => &$root,
@@ -903,15 +911,17 @@
 	 * @return mixed
 	 */
 	final protected function multidimensional_replace( $root, $keys, $value ) {
-		if ( ! isset( $value ) )
+		if ( ! isset( $value ) ) {
 			return $root;
-		elseif ( empty( $keys ) ) // If there are no keys, we're replacing the root.
+		} elseif ( empty( $keys ) ) { // If there are no keys, we're replacing the root.
 			return $value;
+		}
 
 		$result = $this->multidimensional( $root, $keys, true );
 
-		if ( isset( $result ) )
+		if ( isset( $result ) ) {
 			$result['node'][ $result['key'] ] = $value;
+		}
 
 		return $root;
 	}
@@ -927,8 +937,9 @@
 	 * @return mixed The requested value or the default value.
 	 */
 	final protected function multidimensional_get( $root, $keys, $default = null ) {
-		if ( empty( $keys ) ) // If there are no keys, test the root.
+		if ( empty( $keys ) ) { // If there are no keys, test the root.
 			return isset( $root ) ? $root : $default;
+		}
 
 		$result = $this->multidimensional( $root, $keys );
 		return isset( $result ) ? $result['node'][ $result['key'] ] : $default;
Index: src/wp-includes/class-wp-customize-widgets.php
===================================================================
--- src/wp-includes/class-wp-customize-widgets.php	(revision 40901)
+++ src/wp-includes/class-wp-customize-widgets.php	(working copy)
@@ -35,9 +35,19 @@
 	 * @var array
 	 */
 	protected $core_widget_id_bases = array(
-		'archives', 'calendar', 'categories', 'links', 'meta',
-		'nav_menu', 'pages', 'recent-comments', 'recent-posts',
-		'rss', 'search', 'tag_cloud', 'text',
+		'archives',
+	'calendar',
+	'categories',
+	'links',
+	'meta',
+		'nav_menu',
+	'pages',
+	'recent-comments',
+	'recent-posts',
+		'rss',
+	'search',
+	'tag_cloud',
+	'text',
 	);
 
 	/**
@@ -382,7 +392,9 @@
 		add_filter( 'sidebars_widgets', array( $this, 'preview_sidebars_widgets' ), 1 );
 
 		$sidebars_widgets = array_merge(
-			array( 'wp_inactive_widgets' => array() ),
+			array(
+				'wp_inactive_widgets' => array(),
+			),
 			array_fill_keys( array_keys( $wp_registered_sidebars ), array() ),
 			wp_get_sidebars_widgets()
 		);
@@ -481,19 +493,19 @@
 
 					$this->manager->add_control( $control );
 				}
-			}
+			}// End if().
 
 			// Add a control for each active widget (located in a sidebar).
 			foreach ( $sidebar_widget_ids as $i => $widget_id ) {
 
 				// Skip widgets that may have gone away due to a plugin being deactivated.
-				if ( ! $is_active_sidebar || ! isset( $wp_registered_widgets[$widget_id] ) ) {
+				if ( ! $is_active_sidebar || ! isset( $wp_registered_widgets[ $widget_id ] ) ) {
 					continue;
 				}
 
-				$registered_widget = $wp_registered_widgets[$widget_id];
+				$registered_widget = $wp_registered_widgets[ $widget_id ];
 				$setting_id        = $this->get_setting_id( $widget_id );
-				$id_base           = $wp_registered_widget_controls[$widget_id]['id_base'];
+				$id_base           = $wp_registered_widget_controls[ $widget_id ]['id_base'];
 
 				$control = new WP_Widget_Form_Customize_Control( $this->manager, $setting_id, array(
 					'label'          => $registered_widget['name'],
@@ -502,13 +514,13 @@
 					'widget_id'      => $widget_id,
 					'widget_id_base' => $id_base,
 					'priority'       => $i,
-					'width'          => $wp_registered_widget_controls[$widget_id]['width'],
-					'height'         => $wp_registered_widget_controls[$widget_id]['height'],
+					'width'          => $wp_registered_widget_controls[ $widget_id ]['width'],
+					'height'         => $wp_registered_widget_controls[ $widget_id ]['height'],
 					'is_wide'        => $this->is_wide_widget( $widget_id ),
 				) );
 				$this->manager->add_control( $control );
 			}
-		}
+		}// End foreach().
 
 		if ( ! $this->manager->doing_ajax( 'customize_save' ) ) {
 			foreach ( $new_setting_ids as $new_setting_id ) {
@@ -574,7 +586,7 @@
 		global $wp_registered_widget_controls;
 
 		$parsed_widget_id = $this->parse_widget_id( $widget_id );
-		$width            = $wp_registered_widget_controls[$widget_id]['width'];
+		$width            = $wp_registered_widget_controls[ $widget_id ]['width'];
 		$is_core          = in_array( $parsed_widget_id['id_base'], $this->core_widget_id_bases );
 		$is_wide          = ( $width > 250 && ! $is_core );
 
@@ -832,7 +844,7 @@
 				<p class="screen-reader-text" id="widgets-search-desc"><?php _e( 'The search results will be updated as you type.' ); ?></p>
 			</div>
 			<div id="available-widgets-list">
-			<?php foreach ( $this->get_available_widgets() as $available_widget ): ?>
+			<?php foreach ( $this->get_available_widgets() as $available_widget ) : ?>
 				<div id="widget-tpl-<?php echo esc_attr( $available_widget['id'] ) ?>" data-widget-id="<?php echo esc_attr( $available_widget['id'] ) ?>" class="widget-tpl <?php echo esc_attr( $available_widget['id'] ) ?>" tabindex="0">
 					<?php echo $available_widget['control_tpl']; ?>
 				</div>
@@ -973,9 +985,9 @@
 			);
 
 			$is_disabled     = false;
-			$is_multi_widget = ( isset( $wp_registered_widget_controls[$widget['id']]['id_base'] ) && isset( $widget['params'][0]['number'] ) );
+			$is_multi_widget = ( isset( $wp_registered_widget_controls[ $widget['id'] ]['id_base'] ) && isset( $widget['params'][0]['number'] ) );
 			if ( $is_multi_widget ) {
-				$id_base            = $wp_registered_widget_controls[$widget['id']]['id_base'];
+				$id_base            = $wp_registered_widget_controls[ $widget['id'] ]['id_base'];
 				$args['_temp_id']   = "$id_base-__i__";
 				$args['_multi_num'] = next_widget_id_number( $id_base );
 				$args['_add']       = 'multi';
@@ -988,7 +1000,10 @@
 				$id_base = $widget['id'];
 			}
 
-			$list_widget_controls_args = wp_list_widget_controls_dynamic_sidebar( array( 0 => $args, 1 => $widget['params'][0] ) );
+			$list_widget_controls_args = wp_list_widget_controls_dynamic_sidebar( array(
+				0 => $args,
+				1 => $widget['params'][0],
+			) );
 			$control_tpl = $this->get_widget_control( $list_widget_controls_args );
 
 			// The properties here are mapped to the Backbone Widget model.
@@ -1000,13 +1015,13 @@
 				'is_disabled'  => $is_disabled,
 				'id_base'      => $id_base,
 				'transport'    => $this->is_widget_selective_refreshable( $id_base ) ? 'postMessage' : 'refresh',
-				'width'        => $wp_registered_widget_controls[$widget['id']]['width'],
-				'height'       => $wp_registered_widget_controls[$widget['id']]['height'],
+				'width'        => $wp_registered_widget_controls[ $widget['id'] ]['width'],
+				'height'       => $wp_registered_widget_controls[ $widget['id'] ]['height'],
 				'is_wide'      => $this->is_wide_widget( $widget['id'] ),
 			) );
 
 			$available_widgets[] = $available_widget;
-		}
+		}// End foreach().
 
 		return $available_widgets;
 	}
@@ -1160,7 +1175,7 @@
 	 *
 	 * @since 3.9.0
 	 * @access public
-     *
+	 *
 	 * @global array $wp_registered_sidebars
 	 * @global array $wp_registered_widgets
 	 */
@@ -1321,8 +1336,7 @@
 
 		if ( empty( $value['is_widget_customizer_js_value'] )
 			|| empty( $value['instance_hash_key'] )
-			|| empty( $value['encoded_serialized_instance'] ) )
-		{
+			|| empty( $value['encoded_serialized_instance'] ) ) {
 			return;
 		}
 
@@ -1442,13 +1456,13 @@
 
 			if ( ! is_null( $parsed_id['number'] ) ) {
 				$value = array();
-				$value[$parsed_id['number']] = $instance;
+				$value[ $parsed_id['number'] ] = $instance;
 				$key = 'widget-' . $parsed_id['id_base'];
-				$_REQUEST[$key] = $_POST[$key] = wp_slash( $value );
+				$_REQUEST[ $key ] = $_POST[ $key ] = wp_slash( $value );
 				$added_input_vars[] = $key;
 			} else {
 				foreach ( $instance as $key => $value ) {
-					$_REQUEST[$key] = $_POST[$key] = wp_slash( $value );
+					$_REQUEST[ $key ] = $_POST[ $key ] = wp_slash( $value );
 					$added_input_vars[] = $key;
 				}
 			}
@@ -1674,7 +1688,7 @@
 		);
 		if ( isset( $this->context_sidebar_instance_number ) ) {
 			$context['sidebar_instance_number'] = $this->context_sidebar_instance_number;
-		} else if ( isset( $sidebar_args['id'] ) && isset( $this->sidebar_instance_count[ $sidebar_args['id'] ] ) ) {
+		} elseif ( isset( $sidebar_args['id'] ) && isset( $this->sidebar_instance_count[ $sidebar_args['id'] ] ) ) {
 			$context['sidebar_instance_number'] = $this->sidebar_instance_count[ $sidebar_args['id'] ];
 		}
 
Index: src/wp-includes/class-wp-dependency.php
===================================================================
--- src/wp-includes/class-wp-dependency.php	(revision 40901)
+++ src/wp-includes/class-wp-dependency.php	(working copy)
@@ -80,8 +80,9 @@
 	 */
 	public function __construct() {
 		@list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args();
-		if ( ! is_array($this->deps) )
+		if ( ! is_array( $this->deps ) ) {
 			$this->deps = array();
+		}
 	}
 
 	/**
@@ -95,9 +96,10 @@
 	 * @return bool False if not scalar, true otherwise.
 	 */
 	public function add_data( $name, $data ) {
-		if ( !is_scalar($name) )
+		if ( ! is_scalar( $name ) ) {
 			return false;
-		$this->extra[$name] = $data;
+		}
+		$this->extra[ $name ] = $data;
 		return true;
 	}
 
Index: src/wp-includes/class-wp-editor.php
===================================================================
--- src/wp-includes/class-wp-editor.php	(revision 40901)
+++ src/wp-includes/class-wp-editor.php	(working copy)
@@ -95,7 +95,7 @@
 			'dfw'                 => false,
 			'_content_editor_dfw' => false,
 			'tinymce'             => true,
-			'quicktags'           => true
+			'quicktags'           => true,
 		) );
 
 		self::$this_tinymce = ( $set['tinymce'] && user_can_richedit() );
@@ -109,31 +109,36 @@
 
 		self::$this_quicktags = (bool) $set['quicktags'];
 
-		if ( self::$this_tinymce )
+		if ( self::$this_tinymce ) {
 			self::$has_tinymce = true;
+		}
 
-		if ( self::$this_quicktags )
+		if ( self::$this_quicktags ) {
 			self::$has_quicktags = true;
+		}
 
 		if ( $set['dfw'] ) {
 			self::$old_dfw_compat = true;
 		}
 
-		if ( empty( $set['editor_height'] ) )
+		if ( empty( $set['editor_height'] ) ) {
 			return $set;
+		}
 
 		if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) {
 			// A cookie (set when a user resizes the editor) overrides the height.
 			$cookie = (int) get_user_setting( 'ed_size' );
 
-			if ( $cookie )
+			if ( $cookie ) {
 				$set['editor_height'] = $cookie;
+			}
 		}
 
-		if ( $set['editor_height'] < 50 )
+		if ( $set['editor_height'] < 50 ) {
 			$set['editor_height'] = 50;
-		elseif ( $set['editor_height'] > 5000 )
+		} elseif ( $set['editor_height'] > 5000 ) {
 			$set['editor_height'] = 5000;
+		}
 
 		return $set;
 	}
@@ -179,7 +184,7 @@
 				}
 
 				$buttons .= '<button type="button" id="' . $editor_id_attr . '-tmce" class="wp-switch-editor switch-tmce"' .
-					' data-wp-editor-id="' . $editor_id_attr . '">' . __('Visual') . "</button>\n";
+					' data-wp-editor-id="' . $editor_id_attr . '">' . __( 'Visual' ) . "</button>\n";
 				$buttons .= '<button type="button" id="' . $editor_id_attr . '-html" class="wp-switch-editor switch-html"' .
 					' data-wp-editor-id="' . $editor_id_attr . '">' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . "</button>\n";
 			} else {
@@ -211,8 +216,9 @@
 			if ( $set['media_buttons'] ) {
 				self::$has_medialib = true;
 
-				if ( ! function_exists( 'media_buttons' ) )
+				if ( ! function_exists( 'media_buttons' ) ) {
 					include( ABSPATH . 'wp-admin/includes/media.php' );
+				}
 
 				echo '<div id="wp-' . $editor_id_attr . '-media-buttons" class="wp-media-buttons">';
 
@@ -253,7 +259,7 @@
 		$the_editor = apply_filters( 'the_editor', '<div id="wp-' . $editor_id_attr . '-editor-container" class="wp-editor-container">' .
 			$quicktags_toolbar .
 			'<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . esc_attr( $set['textarea_name'] ) . '" ' .
-			'id="' . $editor_id_attr . '">%s</textarea></div>' );
+		'id="' . $editor_id_attr . '">%s</textarea></div>' );
 
 		// Prepare the content for the Visual or Text editor, only when TinyMCE is used (back-compat).
 		if ( self::$this_tinymce ) {
@@ -304,10 +310,10 @@
 	 * @param string $editor_id
 	 * @param array  $set
 	 */
-	public static function editor_settings($editor_id, $set) {
+	public static function editor_settings( $editor_id, $set ) {
 		global $tinymce_version;
 
-		if ( empty(self::$first_init) ) {
+		if ( empty( self::$first_init ) ) {
 			if ( is_admin() ) {
 				add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
 				add_action( 'admin_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );
@@ -321,14 +327,16 @@
 
 			$qtInit = array(
 				'id' => $editor_id,
-				'buttons' => ''
+				'buttons' => '',
 			);
 
-			if ( is_array($set['quicktags']) )
-				$qtInit = array_merge($qtInit, $set['quicktags']);
+			if ( is_array( $set['quicktags'] ) ) {
+				$qtInit = array_merge( $qtInit, $set['quicktags'] );
+			}
 
-			if ( empty($qtInit['buttons']) )
+			if ( empty( $qtInit['buttons'] ) ) {
 				$qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
+			}
 
 			if ( $set['_content_editor_dfw'] ) {
 				$qtInit['buttons'] .= ',dfw';
@@ -344,9 +352,9 @@
 			 */
 			$qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id );
 
-			self::$qt_settings[$editor_id] = $qtInit;
+			self::$qt_settings[ $editor_id ] = $qtInit;
 
-			self::$qt_buttons = array_merge( self::$qt_buttons, explode(',', $qtInit['buttons']) );
+			self::$qt_buttons = array_merge( self::$qt_buttons, explode( ',', $qtInit['buttons'] ) );
 		}
 
 		if ( self::$this_tinymce ) {
@@ -428,7 +436,7 @@
 					if ( ( $key = array_search( 'spellchecker', $plugins ) ) !== false ) {
 						// Remove 'spellchecker' from the internal plugins if added with 'tiny_mce_plugins' filter to prevent errors.
 						// It can be added with 'mce_external_plugins'.
-						unset( $plugins[$key] );
+						unset( $plugins[ $key ] );
 					}
 
 					if ( ! empty( $mce_external_plugins ) ) {
@@ -477,14 +485,17 @@
 								$path = str_replace( content_url(), '', $plugurl );
 								$path = WP_CONTENT_DIR . $path . '/langs/';
 
-								if ( function_exists('realpath') )
-									$path = trailingslashit( realpath($path) );
+								if ( function_exists( 'realpath' ) ) {
+									$path = trailingslashit( realpath( $path ) );
+								}
 
-								if ( @is_file( $path . $mce_locale . '.js' ) )
+								if ( @is_file( $path . $mce_locale . '.js' ) ) {
 									$strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n";
+								}
 
-								if ( @is_file( $path . $mce_locale . '_dlg.js' ) )
+								if ( @is_file( $path . $mce_locale . '_dlg.js' ) ) {
 									$strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n";
+								}
 
 								if ( 'en' != $mce_locale && empty( $strings ) ) {
 									if ( @is_file( $path . 'en.js' ) ) {
@@ -498,15 +509,16 @@
 									}
 								}
 
-								if ( ! empty( $strings ) )
+								if ( ! empty( $strings ) ) {
 									$ext_plugins .= "\n" . $strings . "\n";
+								}
 							}
 
 							$ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n";
 							$ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n";
-						}
-					}
-				}
+						}// End foreach().
+					}// End if().
+				}// End if().
 
 				self::$plugins = $plugins;
 				self::$ext_plugins = $ext_plugins;
@@ -553,7 +565,7 @@
 				}
 
 				self::$first_init = $settings;
-			}
+			}// End if().
 
 			if ( $set['teeny'] ) {
 
@@ -565,7 +577,7 @@
 				 * @param array  $buttons   An array of teenyMCE buttons.
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
 				 */
-				$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 );
+				$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 );
 				$mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
 			} else {
 				$mce_buttons = array( 'formatselect', 'bold', 'italic', 'bullist', 'numlist', 'blockquote', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker' );
@@ -625,7 +637,7 @@
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
 				 */
 				$mce_buttons_4 = apply_filters( 'mce_buttons_4', array(), $editor_id );
-			}
+			}// End if().
 
 			$body_class = $editor_id;
 
@@ -634,10 +646,10 @@
 
 				if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
 					$post_format = get_post_format( $post );
-					if ( $post_format && ! is_wp_error( $post_format ) )
+					if ( $post_format && ! is_wp_error( $post_format ) ) {
 						$body_class .= ' post-format-' . sanitize_html_class( $post_format );
-					else
-						$body_class .= ' post-format-standard';
+					} else { $body_class .= ' post-format-standard';
+					}
 				}
 
 				$page_template = get_page_template_slug( $post );
@@ -655,7 +667,7 @@
 				unset( $set['tinymce']['body_class'] );
 			}
 
-			$mceInit = array (
+			$mceInit = array(
 				'selector' => "#$editor_id",
 				'wpautop' => (bool) $set['wpautop'],
 				'indent' => ! $set['wpautop'],
@@ -664,14 +676,15 @@
 				'toolbar3' => implode( ',', $mce_buttons_3 ),
 				'toolbar4' => implode( ',', $mce_buttons_4 ),
 				'tabfocus_elements' => $set['tabfocus_elements'],
-				'body_class' => $body_class
+				'body_class' => $body_class,
 			);
 
 			// Merge with the first part of the init array
 			$mceInit = array_merge( self::$first_init, $mceInit );
 
-			if ( is_array( $set['tinymce'] ) )
+			if ( is_array( $set['tinymce'] ) ) {
 				$mceInit = array_merge( $mceInit, $set['tinymce'] );
+			}
 
 			/*
 			 * For people who really REALLY know what they're doing with TinyMCE
@@ -710,8 +723,8 @@
 				$mceInit['toolbar4'] = '';
 			}
 
-			self::$mce_settings[$editor_id] = $mceInit;
-		} // end if self::$this_tinymce
+			self::$mce_settings[ $editor_id ] = $mceInit;
+		} // End if().
 	}
 
 	/**
@@ -833,7 +846,7 @@
 			'colorpicker',
 			'hr',
 			'lists',
-	//		'media',
+			//		'media',
 			'paste',
 			'tabfocus',
 			'textcolor',
@@ -844,9 +857,9 @@
 			'wpemoji',
 			'wpgallery',
 			'wplink',
-	//		'wpdialogs',
+			//		'wpdialogs',
 			'wptextpattern',
-	//		'wpview',
+			//		'wpview',
 		) );
 
 		$settings = self::_parse_init( $settings );
@@ -920,7 +933,7 @@
 
 		foreach ( self::get_translation() as $name => $value ) {
 			if ( is_array( $value ) ) {
-				$shortcut_labels[$name] = $value[1];
+				$shortcut_labels[ $name ] = $value[1];
 			}
 		}
 
@@ -1036,7 +1049,7 @@
 			'Square' => _x( 'Square', 'list style' ),
 			'Default' => _x( 'Default', 'list style' ),
 			'Circle' => _x( 'Circle', 'list style' ),
-			'Disc' => _x('Disc', 'list style' ),
+			'Disc' => _x( 'Disc', 'list style' ),
 			'Lower Greek' => _x( 'Lower Greek', 'list style' ),
 			'Lower Alpha' => _x( 'Lower Alpha', 'list style' ),
 			'Upper Alpha' => _x( 'Upper Alpha', 'list style' ),
@@ -1133,7 +1146,7 @@
 			'Prev' => _x( 'Prev', 'find/replace' ),
 			'Whole words' => _x( 'Whole words', 'find/replace' ),
 			'Find and replace' => __( 'Find and replace' ),
-			'Replace with' => _x('Replace with', 'find/replace' ),
+			'Replace with' => _x( 'Replace with', 'find/replace' ),
 			'Find' => _x( 'Find', 'find/replace' ),
 			'Replace all' => _x( 'Replace all', 'find/replace' ),
 			'Match case' => __( 'Match case' ),
@@ -1266,7 +1279,7 @@
 			'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.' =>
 				__( '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.' ),
 			);
-		}
+		}// End if().
 
 		/*
 		Imagetools plugin (not included):
@@ -1311,7 +1324,7 @@
 
 		foreach ( $mce_translation as $name => $value ) {
 			if ( is_array( $value ) ) {
-				$mce_translation[$name] = $value[0];
+				$mce_translation[ $name ] = $value[0];
 			}
 		}
 
@@ -1328,12 +1341,12 @@
 		foreach ( $mce_translation as $key => $value ) {
 			// Remove strings that are not translated.
 			if ( $key === $value ) {
-				unset( $mce_translation[$key] );
+				unset( $mce_translation[ $key ] );
 				continue;
 			}
 
 			if ( false !== strpos( $value, '&' ) ) {
-				$mce_translation[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );
+				$mce_translation[ $key ] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );
 			}
 		}
 
@@ -1379,8 +1392,8 @@
 		$version = 'ver=' . $tinymce_version;
 		$baseurl = self::get_baseurl();
 
-		$compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
-			&& false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
+		$compressed = $compress_scripts && $concatenate_scripts && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] )
+			&& false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' );
 
 		// Load tinymce.js when running from /src, else load wp-tinymce.js.gz (production) or tinymce.min.js (SCRIPT_DEBUG)
 		$mce_suffix = false !== strpos( get_bloginfo( 'version' ), '-src' ) ? '' : '.min';
@@ -1429,7 +1442,7 @@
 		$ref = array(
 			'plugins' => implode( ',', self::$plugins ),
 			'theme' => 'modern',
-			'language' => self::$mce_locale
+			'language' => self::$mce_locale,
 		);
 
 		$suffix = SCRIPT_DEBUG ? '' : '.min';
@@ -1488,11 +1501,13 @@
 		<script type="text/javascript">
 		<?php
 
-		if ( self::$ext_plugins )
+		if ( self::$ext_plugins ) {
 			echo self::$ext_plugins . "\n";
+		}
 
-		if ( ! is_admin() )
+		if ( ! is_admin() ) {
 			echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";';
+		}
 
 		?>
 
@@ -1579,8 +1594,9 @@
 
 		$args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1;
 
-		if ( isset( $args['s'] ) )
+		if ( isset( $args['s'] ) ) {
 			$query['s'] = $args['s'];
+		}
 
 		$query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
 
@@ -1601,16 +1617,17 @@
 		$get_posts = new WP_Query;
 		$posts = $get_posts->query( $query );
 		// Check if any posts were found.
-		if ( ! $get_posts->post_count )
+		if ( ! $get_posts->post_count ) {
 			return false;
+		}
 
 		// Build results.
 		$results = array();
 		foreach ( $posts as $post ) {
-			if ( 'post' == $post->post_type )
+			if ( 'post' == $post->post_type ) {
 				$info = mysql2date( __( 'Y/m/d' ), $post->post_date );
-			else
-				$info = $pts[ $post->post_type ]->labels->singular_name;
+			} else { $info = $pts[ $post->post_type ]->labels->singular_name;
+			}
 
 			$results[] = array(
 				'ID' => $post->ID,
@@ -1708,8 +1725,8 @@
 					<div class="river-waiting">
 						<span class="spinner"></span>
 					</div>
- 				</div>
- 			</div>
+				 </div>
+			 </div>
 		</div>
 		<div class="submitbox">
 			<div id="wp-link-cancel">
Index: src/wp-includes/class-wp-embed.php
===================================================================
--- src/wp-includes/class-wp-embed.php	(revision 40901)
+++ src/wp-includes/class-wp-embed.php	(working copy)
@@ -80,8 +80,9 @@
 	public function maybe_run_ajax_cache() {
 		$post = get_post();
 
-		if ( ! $post || empty( $_GET['message'] ) )
+		if ( ! $post || empty( $_GET['message'] ) ) {
 			return;
+		}
 
 ?>
 <script type="text/javascript">
@@ -105,7 +106,7 @@
 	 * @param int $priority Optional. Used to specify the order in which the registered handlers will be tested (default: 10). Lower numbers correspond with earlier testing, and handlers with the same priority are tested in the order in which they were added to the action.
 	 */
 	public function register_handler( $id, $regex, $callback, $priority = 10 ) {
-		$this->handlers[$priority][$id] = array(
+		$this->handlers[ $priority ][ $id ] = array(
 			'regex'    => $regex,
 			'callback' => $callback,
 		);
@@ -168,7 +169,7 @@
 		foreach ( $this->handlers as $priority => $handlers ) {
 			foreach ( $handlers as $id => $handler ) {
 				if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {
-					if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) )
+					if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) ) {
 						/**
 						 * Filters the returned embed handler.
 						 *
@@ -181,13 +182,15 @@
 						 * @param array  $attr   An array of shortcode attributes.
 						 */
 						return apply_filters( 'embed_handler_html', $return, $url, $attr );
+					}
 				}
 			}
 		}
 
 		$post_ID = ( ! empty( $post->ID ) ) ? $post->ID : null;
-		if ( ! empty( $this->post_ID ) ) // Potentially set by WP_Embed::cache_oembed()
+		if ( ! empty( $this->post_ID ) ) { // Potentially set by WP_Embed::cache_oembed()
 			$post_ID = $this->post_ID;
+		}
 
 		// Unknown URL format. Let oEmbed have a go.
 		if ( $post_ID ) {
@@ -220,8 +223,9 @@
 
 			if ( $this->usecache || $cached_recently ) {
 				// Failures are cached. Serve one if we're using the cache.
-				if ( '{{unknown}}' === $cache )
+				if ( '{{unknown}}' === $cache ) {
 					return $this->maybe_make_link( $url );
+				}
 
 				if ( ! empty( $cache ) ) {
 					/**
@@ -268,7 +272,7 @@
 				/** This filter is documented in wp-includes/class-wp-embed.php */
 				return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID );
 			}
-		}
+		}// End if().
 
 		// Still unknown
 		return $this->maybe_make_link( $url );
@@ -281,12 +285,14 @@
 	 */
 	public function delete_oembed_caches( $post_ID ) {
 		$post_metas = get_post_custom_keys( $post_ID );
-		if ( empty($post_metas) )
+		if ( empty( $post_metas ) ) {
 			return;
+		}
 
 		foreach ( $post_metas as $post_meta_key ) {
-			if ( '_oembed_' == substr( $post_meta_key, 0, 8 ) )
+			if ( '_oembed_' == substr( $post_meta_key, 0, 8 ) ) {
 				delete_post_meta( $post_ID, $post_meta_key );
+			}
 		}
 	}
 
@@ -298,7 +304,9 @@
 	public function cache_oembed( $post_ID ) {
 		$post = get_post( $post_ID );
 
-		$post_types = get_post_types( array( 'show_ui' => true ) );
+		$post_types = get_post_types( array(
+			'show_ui' => true,
+		) );
 		/**
 		 * Filters the array of post types to cache oEmbed results for.
 		 *
@@ -306,7 +314,7 @@
 		 *
 		 * @param array $post_types Array of post types to cache oEmbed results for. Defaults to post types with `show_ui` set to true.
 		 */
-		if ( empty( $post->ID ) || ! in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', $post_types ) ) ){
+		if ( empty( $post->ID ) || ! in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', $post_types ) ) ) {
 			return;
 		}
 
@@ -332,7 +340,9 @@
 	 */
 	public function autoembed( $content ) {
 		// Replace line breaks from all HTML elements with placeholders.
-		$content = wp_replace_in_html_tags( $content, array( "\n" => '<!-- wp-line-break -->' ) );
+		$content = wp_replace_in_html_tags( $content, array(
+			"\n" => '<!-- wp-line-break -->',
+		) );
 
 		if ( preg_match( '#(^|\s|>)https?://#i', $content ) ) {
 			// Find URLs on their own line.
@@ -371,7 +381,7 @@
 			return false;
 		}
 
-		$output = ( $this->linkifunknown ) ? '<a href="' . esc_url($url) . '">' . esc_html($url) . '</a>' : $url;
+		$output = ( $this->linkifunknown ) ? '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>' : $url;
 
 		/**
 		 * Filters the returned, maybe-linked embed URL.
Index: src/wp-includes/class-wp-error.php
===================================================================
--- src/wp-includes/class-wp-error.php	(revision 40901)
+++ src/wp-includes/class-wp-error.php	(working copy)
@@ -53,13 +53,15 @@
 	 * @param mixed $data Optional. Error data.
 	 */
 	public function __construct( $code = '', $message = '', $data = '' ) {
-		if ( empty($code) )
+		if ( empty( $code ) ) {
 			return;
+		}
 
-		$this->errors[$code][] = $message;
+		$this->errors[ $code ][] = $message;
 
-		if ( ! empty($data) )
-			$this->error_data[$code] = $data;
+		if ( ! empty( $data ) ) {
+			$this->error_data[ $code ] = $data;
+		}
 	}
 
 	/**
@@ -71,10 +73,11 @@
 	 * @return array List of error codes, if available.
 	 */
 	public function get_error_codes() {
-		if ( empty($this->errors) )
+		if ( empty( $this->errors ) ) {
 			return array();
+		}
 
-		return array_keys($this->errors);
+		return array_keys( $this->errors );
 	}
 
 	/**
@@ -88,8 +91,9 @@
 	public function get_error_code() {
 		$codes = $this->get_error_codes();
 
-		if ( empty($codes) )
+		if ( empty( $codes ) ) {
 			return '';
+		}
 
 		return $codes[0];
 	}
@@ -102,20 +106,21 @@
 	 * @param string|int $code Optional. Retrieve messages matching code, if exists.
 	 * @return array Error strings on success, or empty array on failure (if using code parameter).
 	 */
-	public function get_error_messages($code = '') {
+	public function get_error_messages( $code = '' ) {
 		// Return all messages if no code specified.
-		if ( empty($code) ) {
+		if ( empty( $code ) ) {
 			$all_messages = array();
-			foreach ( (array) $this->errors as $code => $messages )
-				$all_messages = array_merge($all_messages, $messages);
+			foreach ( (array) $this->errors as $code => $messages ) {
+				$all_messages = array_merge( $all_messages, $messages );
+			}
 
 			return $all_messages;
 		}
 
-		if ( isset($this->errors[$code]) )
-			return $this->errors[$code];
-		else
-			return array();
+		if ( isset( $this->errors[ $code ] ) ) {
+			return $this->errors[ $code ];
+		} else { return array();
+		}
 	}
 
 	/**
@@ -129,12 +134,14 @@
 	 * @param string|int $code Optional. Error code to retrieve message.
 	 * @return string
 	 */
-	public function get_error_message($code = '') {
-		if ( empty($code) )
+	public function get_error_message( $code = '' ) {
+		if ( empty( $code ) ) {
 			$code = $this->get_error_code();
-		$messages = $this->get_error_messages($code);
-		if ( empty($messages) )
+		}
+		$messages = $this->get_error_messages( $code );
+		if ( empty( $messages ) ) {
 			return '';
+		}
 		return $messages[0];
 	}
 
@@ -146,12 +153,14 @@
 	 * @param string|int $code Optional. Error code.
 	 * @return mixed Error data, if it exists.
 	 */
-	public function get_error_data($code = '') {
-		if ( empty($code) )
+	public function get_error_data( $code = '' ) {
+		if ( empty( $code ) ) {
 			$code = $this->get_error_code();
+		}
 
-		if ( isset($this->error_data[$code]) )
-			return $this->error_data[$code];
+		if ( isset( $this->error_data[ $code ] ) ) {
+			return $this->error_data[ $code ];
+		}
 	}
 
 	/**
@@ -164,10 +173,11 @@
 	 * @param string $message Error message.
 	 * @param mixed $data Optional. Error data.
 	 */
-	public function add($code, $message, $data = '') {
-		$this->errors[$code][] = $message;
-		if ( ! empty($data) )
-			$this->error_data[$code] = $data;
+	public function add( $code, $message, $data = '' ) {
+		$this->errors[ $code ][] = $message;
+		if ( ! empty( $data ) ) {
+			$this->error_data[ $code ] = $data;
+		}
 	}
 
 	/**
@@ -180,11 +190,12 @@
 	 * @param mixed $data Error data.
 	 * @param string|int $code Error code.
 	 */
-	public function add_data($data, $code = '') {
-		if ( empty($code) )
+	public function add_data( $data, $code = '' ) {
+		if ( empty( $code ) ) {
 			$code = $this->get_error_code();
+		}
 
-		$this->error_data[$code] = $data;
+		$this->error_data[ $code ] = $data;
 	}
 
 	/**
Index: src/wp-includes/class-wp-feed-cache-transient.php
===================================================================
--- src/wp-includes/class-wp-feed-cache-transient.php	(revision 40901)
+++ src/wp-includes/class-wp-feed-cache-transient.php	(working copy)
@@ -54,7 +54,7 @@
 	 * @param string $filename  Unique identifier for cache object.
 	 * @param string $extension 'spi' or 'spc'.
 	 */
-	public function __construct($location, $filename, $extension) {
+	public function __construct( $location, $filename, $extension ) {
 		$this->name = 'feed_' . $filename;
 		$this->mod_name = 'feed_mod_' . $filename;
 
@@ -67,7 +67,7 @@
 		 * @param int    $lifetime Cache duration in seconds. Default is 43200 seconds (12 hours).
 		 * @param string $filename Unique identifier for the cache object.
 		 */
-		$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename);
+		$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename );
 	}
 
 	/**
@@ -79,13 +79,13 @@
 	 * @param SimplePie $data Data to save.
 	 * @return true Always true.
 	 */
-	public function save($data) {
+	public function save( $data ) {
 		if ( $data instanceof SimplePie ) {
 			$data = $data->data;
 		}
 
-		set_transient($this->name, $data, $this->lifetime);
-		set_transient($this->mod_name, time(), $this->lifetime);
+		set_transient( $this->name, $data, $this->lifetime );
+		set_transient( $this->mod_name, time(), $this->lifetime );
 		return true;
 	}
 
@@ -98,7 +98,7 @@
 	 * @return mixed Transient value.
 	 */
 	public function load() {
-		return get_transient($this->name);
+		return get_transient( $this->name );
 	}
 
 	/**
@@ -110,7 +110,7 @@
 	 * @return mixed Transient value.
 	 */
 	public function mtime() {
-		return get_transient($this->mod_name);
+		return get_transient( $this->mod_name );
 	}
 
 	/**
@@ -122,7 +122,7 @@
 	 * @return bool False if value was not set and true if value was set.
 	 */
 	public function touch() {
-		return set_transient($this->mod_name, time(), $this->lifetime);
+		return set_transient( $this->mod_name, time(), $this->lifetime );
 	}
 
 	/**
@@ -134,8 +134,8 @@
 	 * @return true Always true.
 	 */
 	public function unlink() {
-		delete_transient($this->name);
-		delete_transient($this->mod_name);
+		delete_transient( $this->name );
+		delete_transient( $this->mod_name );
 		return true;
 	}
 }
Index: src/wp-includes/class-wp-feed-cache.php
===================================================================
--- src/wp-includes/class-wp-feed-cache.php	(revision 40901)
+++ src/wp-includes/class-wp-feed-cache.php	(working copy)
@@ -27,7 +27,7 @@
 	 * @param string $extension 'spi' or 'spc'.
 	 * @return WP_Feed_Cache_Transient Feed cache handler object that uses transients.
 	 */
-	public function create($location, $filename, $extension) {
-		return new WP_Feed_Cache_Transient($location, $filename, $extension);
+	public function create( $location, $filename, $extension ) {
+		return new WP_Feed_Cache_Transient( $location, $filename, $extension );
 	}
 }
Index: src/wp-includes/class-wp-hook.php
===================================================================
--- src/wp-includes/class-wp-hook.php	(revision 40901)
+++ src/wp-includes/class-wp-hook.php	(working copy)
@@ -82,7 +82,7 @@
 
 		$this->callbacks[ $priority ][ $idx ] = array(
 			'function' => $function_to_add,
-			'accepted_args' => $accepted_args
+			'accepted_args' => $accepted_args,
 		);
 
 		// if we're adding a new priority to the list, put them back in sorted order
@@ -160,7 +160,7 @@
 					next( $iteration );
 				}
 			}
-		}
+		}// End foreach().
 		unset( $iteration );
 	}
 
@@ -254,7 +254,7 @@
 
 		if ( false === $priority ) {
 			$this->callbacks = array();
-		} else if ( isset( $this->callbacks[ $priority ] ) ) {
+		} elseif ( isset( $this->callbacks[ $priority ] ) ) {
 			unset( $this->callbacks[ $priority ] );
 		}
 
@@ -287,8 +287,8 @@
 			$this->current_priority[ $nesting_level ] = $priority = current( $this->iterations[ $nesting_level ] );
 
 			foreach ( $this->callbacks[ $priority ] as $the_ ) {
-				if( ! $this->doing_action ) {
-					$args[ 0 ] = $value;
+				if ( ! $this->doing_action ) {
+					$args[0] = $value;
 				}
 
 				// Avoid the array_slice if possible.
@@ -297,7 +297,7 @@
 				} elseif ( $the_['accepted_args'] >= $num_args ) {
 					$value = call_user_func_array( $the_['function'], $args );
 				} else {
-					$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
+					$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
 				}
 			}
 		} while ( false !== next( $this->iterations[ $nesting_level ] ) );
Index: src/wp-includes/class-wp-http-cookie.php
===================================================================
--- src/wp-includes/class-wp-http-cookie.php	(revision 40901)
+++ src/wp-includes/class-wp-http-cookie.php	(working copy)
@@ -83,13 +83,16 @@
 	 *                                    and $port values.
 	 */
 	public function __construct( $data, $requested_url = '' ) {
-		if ( $requested_url )
+		if ( $requested_url ) {
 			$arrURL = @parse_url( $requested_url );
-		if ( isset( $arrURL['host'] ) )
+		}
+		if ( isset( $arrURL['host'] ) ) {
 			$this->domain = $arrURL['host'];
+		}
 		$this->path = isset( $arrURL['path'] ) ? $arrURL['path'] : '/';
-		if (  '/' != substr( $this->path, -1 ) )
+		if ( '/' != substr( $this->path, -1 ) ) {
 			$this->path = dirname( $this->path ) . '/';
+		}
 
 		if ( is_string( $data ) ) {
 			// Assume it's a header string direct from a previous request.
@@ -106,33 +109,37 @@
 
 			// Set everything else as a property.
 			foreach ( $pairs as $pair ) {
-				$pair = rtrim($pair);
+				$pair = rtrim( $pair );
 
 				// Handle the cookie ending in ; which results in a empty final pair.
-				if ( empty($pair) )
+				if ( empty( $pair ) ) {
 					continue;
+				}
 
 				list( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' );
 				$key = strtolower( trim( $key ) );
-				if ( 'expires' == $key )
+				if ( 'expires' == $key ) {
 					$val = strtotime( $val );
+				}
 				$this->$key = $val;
 			}
 		} else {
-			if ( !isset( $data['name'] ) )
+			if ( ! isset( $data['name'] ) ) {
 				return;
+			}
 
 			// Set properties based directly on parameters.
 			foreach ( array( 'name', 'value', 'path', 'domain', 'port' ) as $field ) {
-				if ( isset( $data[ $field ] ) )
+				if ( isset( $data[ $field ] ) ) {
 					$this->$field = $data[ $field ];
+				}
 			}
 
-			if ( isset( $data['expires'] ) )
+			if ( isset( $data['expires'] ) ) {
 				$this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] );
-			else
-				$this->expires = null;
-		}
+			} else { $this->expires = null;
+			}
+		}// End if().
 	}
 
 	/**
@@ -147,12 +154,14 @@
 	 * @return bool true if allowed, false otherwise.
 	 */
 	public function test( $url ) {
-		if ( is_null( $this->name ) )
+		if ( is_null( $this->name ) ) {
 			return false;
+		}
 
 		// Expires - if expired then nothing else matters.
-		if ( isset( $this->expires ) && time() > $this->expires )
+		if ( isset( $this->expires ) && time() > $this->expires ) {
 			return false;
+		}
 
 		// Get details on the URL we're thinking about sending to.
 		$url = parse_url( $url );
@@ -163,21 +172,25 @@
 		$path   = isset( $this->path )   ? $this->path   : '/';
 		$port   = isset( $this->port )   ? $this->port   : null;
 		$domain = isset( $this->domain ) ? strtolower( $this->domain ) : strtolower( $url['host'] );
-		if ( false === stripos( $domain, '.' ) )
+		if ( false === stripos( $domain, '.' ) ) {
 			$domain .= '.local';
+		}
 
 		// Host - very basic check that the request URL ends with the domain restriction (minus leading dot).
 		$domain = substr( $domain, 0, 1 ) == '.' ? substr( $domain, 1 ) : $domain;
-		if ( substr( $url['host'], -strlen( $domain ) ) != $domain )
+		if ( substr( $url['host'], -strlen( $domain ) ) != $domain ) {
 			return false;
+		}
 
 		// Port - supports "port-lists" in the format: "80,8000,8080".
-		if ( !empty( $port ) && !in_array( $url['port'], explode( ',', $port) ) )
+		if ( ! empty( $port ) && ! in_array( $url['port'], explode( ',', $port ) ) ) {
 			return false;
+		}
 
 		// Path - request path must start with path restriction.
-		if ( substr( $url['path'], 0, strlen( $path ) ) != $path )
+		if ( substr( $url['path'], 0, strlen( $path ) ) != $path ) {
 			return false;
+		}
 
 		return true;
 	}
@@ -191,8 +204,9 @@
 	 * @return string Header encoded cookie name and value.
 	 */
 	public function getHeaderValue() {
-		if ( ! isset( $this->name ) || ! isset( $this->value ) )
+		if ( ! isset( $this->name ) || ! isset( $this->value ) ) {
 			return '';
+		}
 
 		/**
 		 * Filters the header-encoded cookie value.
Index: src/wp-includes/class-wp-http-curl.php
===================================================================
--- src/wp-includes/class-wp-http-curl.php	(revision 40901)
+++ src/wp-includes/class-wp-http-curl.php	(working copy)
@@ -73,12 +73,16 @@
 	 * @param string|array $args Optional. Override the defaults.
 	 * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
 	 */
-	public function request($url, $args = array()) {
+	public function request( $url, $args = array() ) {
 		$defaults = array(
-			'method' => 'GET', 'timeout' => 5,
-			'redirection' => 5, 'httpversion' => '1.0',
+			'method' => 'GET',
+		'timeout' => 5,
+			'redirection' => 5,
+		'httpversion' => '1.0',
 			'blocking' => true,
-			'headers' => array(), 'body' => null, 'cookies' => array()
+			'headers' => array(),
+		'body' => null,
+		'cookies' => array(),
 		);
 
 		$r = wp_parse_args( $args, $defaults );
@@ -111,8 +115,8 @@
 			}
 		}
 
-		$is_local = isset($r['local']) && $r['local'];
-		$ssl_verify = isset($r['sslverify']) && $r['sslverify'];
+		$is_local = isset( $r['local'] ) && $r['local'];
+		$ssl_verify = isset( $r['sslverify'] ) && $r['sslverify'];
 		if ( $is_local ) {
 			/** This filter is documented in wp-includes/class-wp-http-streams.php */
 			$ssl_verify = apply_filters( 'https_local_ssl_verify', $ssl_verify );
@@ -129,7 +133,7 @@
 		curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
 		curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
 
-		curl_setopt( $handle, CURLOPT_URL, $url);
+		curl_setopt( $handle, CURLOPT_URL, $url );
 		curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
 		curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, ( $ssl_verify === true ) ? 2 : false );
 		curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify );
@@ -145,8 +149,9 @@
 		 * a bug #17490 with redirected POST requests, so handle redirections outside Curl.
 		 */
 		curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, false );
-		if ( defined( 'CURLOPT_PROTOCOLS' ) ) // PHP 5.2.10 / cURL 7.19.4
+		if ( defined( 'CURLOPT_PROTOCOLS' ) ) { // PHP 5.2.10 / cURL 7.19.4
 			curl_setopt( $handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );
+		}
 
 		switch ( $r['method'] ) {
 			case 'HEAD':
@@ -162,8 +167,9 @@
 				break;
 			default:
 				curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, $r['method'] );
-				if ( ! is_null( $r['body'] ) )
+				if ( ! is_null( $r['body'] ) ) {
 					curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
+				}
 				break;
 		}
 
@@ -174,24 +180,25 @@
 
 		curl_setopt( $handle, CURLOPT_HEADER, false );
 
-		if ( isset( $r['limit_response_size'] ) )
+		if ( isset( $r['limit_response_size'] ) ) {
 			$this->max_body_length = intval( $r['limit_response_size'] );
-		else
-			$this->max_body_length = false;
+		} else { $this->max_body_length = false;
+		}
 
 		// If streaming to a file open a file handle, and setup our curl streaming handler.
 		if ( $r['stream'] ) {
-			if ( ! WP_DEBUG )
+			if ( ! WP_DEBUG ) {
 				$this->stream_handle = @fopen( $r['filename'], 'w+' );
-			else
-				$this->stream_handle = fopen( $r['filename'], 'w+' );
-			if ( ! $this->stream_handle )
+			} else { $this->stream_handle = fopen( $r['filename'], 'w+' );
+			}
+			if ( ! $this->stream_handle ) {
 				return new WP_Error( 'http_request_failed', sprintf( __( 'Could not open handle for fopen() to %s' ), $r['filename'] ) );
+			}
 		} else {
 			$this->stream_handle = false;
 		}
 
-		if ( !empty( $r['headers'] ) ) {
+		if ( ! empty( $r['headers'] ) ) {
 			// cURL expects full header strings in each element.
 			$headers = array();
 			foreach ( $r['headers'] as $name => $value ) {
@@ -200,10 +207,10 @@
 			curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers );
 		}
 
-		if ( $r['httpversion'] == '1.0' )
+		if ( $r['httpversion'] == '1.0' ) {
 			curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );
-		else
-			curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
+		} else { curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
+		}
 
 		/**
 		 * Fires before the cURL request is executed.
@@ -233,7 +240,15 @@
 			}
 
 			curl_close( $handle );
-			return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );
+			return array(
+				'headers' => array(),
+				'body' => '',
+				'response' => array(
+					'code' => false,
+					'message' => false,
+				),
+				'cookies' => array(),
+			);
 		}
 
 		curl_exec( $handle );
@@ -274,23 +289,26 @@
 
 		curl_close( $handle );
 
-		if ( $r['stream'] )
+		if ( $r['stream'] ) {
 			fclose( $this->stream_handle );
+		}
 
 		$response = array(
 			'headers' => $theHeaders['headers'],
 			'body' => null,
 			'response' => $theHeaders['response'],
 			'cookies' => $theHeaders['cookies'],
-			'filename' => $r['filename']
+			'filename' => $r['filename'],
 		);
 
 		// Handle redirects.
-		if ( false !== ( $redirect_response = WP_HTTP::handle_redirects( $url, $r, $response ) ) )
+		if ( false !== ( $redirect_response = WP_HTTP::handle_redirects( $url, $r, $response ) ) ) {
 			return $redirect_response;
+		}
 
-		if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($theHeaders['headers']) )
+		if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode( $theHeaders['headers'] ) ) {
 			$theBody = WP_Http_Encoding::decompress( $theBody );
+		}
 
 		$response['body'] = $theBody;
 
@@ -360,16 +378,18 @@
 	 * @return bool False means this class can not be used, true means it can.
 	 */
 	public static function test( $args = array() ) {
-		if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) )
+		if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) ) {
 			return false;
+		}
 
 		$is_ssl = isset( $args['ssl'] ) && $args['ssl'];
 
 		if ( $is_ssl ) {
 			$curl_version = curl_version();
 			// Check whether this cURL version support SSL requests.
-			if ( ! (CURL_VERSION_SSL & $curl_version['features']) )
+			if ( ! (CURL_VERSION_SSL & $curl_version['features']) ) {
 				return false;
+			}
 		}
 
 		/**
Index: src/wp-includes/class-wp-http-encoding.php
===================================================================
--- src/wp-includes/class-wp-http-encoding.php	(revision 40901)
+++ src/wp-includes/class-wp-http-encoding.php	(working copy)
@@ -52,23 +52,28 @@
 	 */
 	public static function decompress( $compressed, $length = null ) {
 
-		if ( empty($compressed) )
+		if ( empty( $compressed ) ) {
 			return $compressed;
+		}
 
-		if ( false !== ( $decompressed = @gzinflate( $compressed ) ) )
+		if ( false !== ( $decompressed = @gzinflate( $compressed ) ) ) {
 			return $decompressed;
+		}
 
-		if ( false !== ( $decompressed = self::compatible_gzinflate( $compressed ) ) )
+		if ( false !== ( $decompressed = self::compatible_gzinflate( $compressed ) ) ) {
 			return $decompressed;
+		}
 
-		if ( false !== ( $decompressed = @gzuncompress( $compressed ) ) )
+		if ( false !== ( $decompressed = @gzuncompress( $compressed ) ) ) {
 			return $decompressed;
+		}
 
-		if ( function_exists('gzdecode') ) {
+		if ( function_exists( 'gzdecode' ) ) {
 			$decompressed = @gzdecode( $compressed );
 
-			if ( false !== $decompressed )
+			if ( false !== $decompressed ) {
 				return $decompressed;
+			}
 		}
 
 		return $compressed;
@@ -96,33 +101,38 @@
 	 * @param string $gzData String to decompress.
 	 * @return string|bool False on failure.
 	 */
-	public static function compatible_gzinflate($gzData) {
+	public static function compatible_gzinflate( $gzData ) {
 
 		// Compressed data might contain a full header, if so strip it for gzinflate().
-		if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) {
+		if ( substr( $gzData, 0, 3 ) == "\x1f\x8b\x08" ) {
 			$i = 10;
-			$flg = ord( substr($gzData, 3, 1) );
+			$flg = ord( substr( $gzData, 3, 1 ) );
 			if ( $flg > 0 ) {
 				if ( $flg & 4 ) {
-					list($xlen) = unpack('v', substr($gzData, $i, 2) );
+					list($xlen) = unpack( 'v', substr( $gzData, $i, 2 ) );
 					$i = $i + 2 + $xlen;
 				}
-				if ( $flg & 8 )
-					$i = strpos($gzData, "\0", $i) + 1;
-				if ( $flg & 16 )
-					$i = strpos($gzData, "\0", $i) + 1;
-				if ( $flg & 2 )
+				if ( $flg & 8 ) {
+					$i = strpos( $gzData, "\0", $i ) + 1;
+				}
+				if ( $flg & 16 ) {
+					$i = strpos( $gzData, "\0", $i ) + 1;
+				}
+				if ( $flg & 2 ) {
 					$i = $i + 2;
+				}
 			}
-			$decompressed = @gzinflate( substr($gzData, $i, -8) );
-			if ( false !== $decompressed )
+			$decompressed = @gzinflate( substr( $gzData, $i, -8 ) );
+			if ( false !== $decompressed ) {
 				return $decompressed;
+			}
 		}
 
 		// Compressed data from java.util.zip.Deflater amongst others.
-		$decompressed = @gzinflate( substr($gzData, 2) );
-		if ( false !== $decompressed )
+		$decompressed = @gzinflate( substr( $gzData, 2 ) );
+		if ( false !== $decompressed ) {
 			return $decompressed;
+		}
 
 		return false;
 	}
@@ -142,22 +152,26 @@
 		$type = array();
 		$compression_enabled = self::is_available();
 
-		if ( ! $args['decompress'] ) // Decompression specifically disabled.
+		if ( ! $args['decompress'] ) { // Decompression specifically disabled.
 			$compression_enabled = false;
-		elseif ( $args['stream'] ) // Disable when streaming to file.
+		} elseif ( $args['stream'] ) { // Disable when streaming to file.
 			$compression_enabled = false;
-		elseif ( isset( $args['limit_response_size'] ) ) // If only partial content is being requested, we won't be able to decompress it.
+		} elseif ( isset( $args['limit_response_size'] ) ) { // If only partial content is being requested, we won't be able to decompress it.
 			$compression_enabled = false;
+		}
 
 		if ( $compression_enabled ) {
-			if ( function_exists( 'gzinflate' ) )
+			if ( function_exists( 'gzinflate' ) ) {
 				$type[] = 'deflate;q=1.0';
+			}
 
-			if ( function_exists( 'gzuncompress' ) )
+			if ( function_exists( 'gzuncompress' ) ) {
 				$type[] = 'compress;q=0.5';
+			}
 
-			if ( function_exists( 'gzdecode' ) )
+			if ( function_exists( 'gzdecode' ) ) {
 				$type[] = 'gzip;q=0.5';
+			}
 		}
 
 		/**
@@ -172,7 +186,7 @@
 		 */
 		$type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args );
 
-		return implode(', ', $type);
+		return implode( ', ', $type );
 	}
 
 	/**
@@ -198,12 +212,13 @@
 	 * @param array|string $headers All of the available headers.
 	 * @return bool
 	 */
-	public static function should_decode($headers) {
+	public static function should_decode( $headers ) {
 		if ( is_array( $headers ) ) {
-			if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) )
+			if ( array_key_exists( 'content-encoding', $headers ) && ! empty( $headers['content-encoding'] ) ) {
 				return true;
+			}
 		} elseif ( is_string( $headers ) ) {
-			return ( stripos($headers, 'content-encoding:') !== false );
+			return ( stripos( $headers, 'content-encoding:' ) !== false );
 		}
 
 		return false;
@@ -223,6 +238,6 @@
 	 * @return bool
 	 */
 	public static function is_available() {
-		return ( function_exists('gzuncompress') || function_exists('gzdeflate') || function_exists('gzinflate') );
+		return ( function_exists( 'gzuncompress' ) || function_exists( 'gzdeflate' ) || function_exists( 'gzinflate' ) );
 	}
 }
Index: src/wp-includes/class-wp-http-ixr-client.php
===================================================================
--- src/wp-includes/class-wp-http-ixr-client.php	(revision 40901)
+++ src/wp-includes/class-wp-http-ixr-client.php	(working copy)
@@ -19,14 +19,14 @@
 	 * @param int|bool $port
 	 * @param int $timeout
 	 */
-	public function __construct($server, $path = false, $port = false, $timeout = 15) {
+	public function __construct( $server, $path = false, $port = false, $timeout = 15 ) {
 		if ( ! $path ) {
 			// Assume we have been given a URL instead
-			$bits = parse_url($server);
+			$bits = parse_url( $server );
 			$this->scheme = $bits['scheme'];
 			$this->server = $bits['host'];
-			$this->port = isset($bits['port']) ? $bits['port'] : $port;
-			$this->path = !empty($bits['path']) ? $bits['path'] : '/';
+			$this->port = isset( $bits['port'] ) ? $bits['port'] : $port;
+			$this->path = ! empty( $bits['path'] ) ? $bits['path'] : '/';
 
 			// Make absolutely sure we have a path
 			if ( ! $this->path ) {
@@ -51,21 +51,23 @@
 	 */
 	public function query() {
 		$args = func_get_args();
-		$method = array_shift($args);
-		$request = new IXR_Request($method, $args);
+		$method = array_shift( $args );
+		$request = new IXR_Request( $method, $args );
 		$xml = $request->getXml();
 
 		$port = $this->port ? ":$this->port" : '';
 		$url = $this->scheme . '://' . $this->server . $port . $this->path;
 		$args = array(
-			'headers'    => array('Content-Type' => 'text/xml'),
+			'headers'    => array(
+				'Content-Type' => 'text/xml',
+			),
 			'user-agent' => $this->useragent,
 			'body'       => $xml,
 		);
 
 		// Merge Custom headers ala #8145
 		foreach ( $this->headers as $header => $value ) {
-			$args['headers'][$header] = $value;
+			$args['headers'][ $header ] = $value;
 		}
 
 		/**
@@ -83,20 +85,20 @@
 
 		// Now send the request
 		if ( $this->debug ) {
-			echo '<pre class="ixr_request">' . htmlspecialchars($xml) . "\n</pre>\n\n";
+			echo '<pre class="ixr_request">' . htmlspecialchars( $xml ) . "\n</pre>\n\n";
 		}
 
-		$response = wp_remote_post($url, $args);
+		$response = wp_remote_post( $url, $args );
 
-		if ( is_wp_error($response) ) {
+		if ( is_wp_error( $response ) ) {
 			$errno    = $response->get_error_code();
 			$errorstr = $response->get_error_message();
-			$this->error = new IXR_Error(-32300, "transport error: $errno $errorstr");
+			$this->error = new IXR_Error( -32300, "transport error: $errno $errorstr" );
 			return false;
 		}
 
 		if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
-			$this->error = new IXR_Error(-32301, 'transport error - HTTP status code was not 200 (' . wp_remote_retrieve_response_code( $response ) . ')');
+			$this->error = new IXR_Error( -32301, 'transport error - HTTP status code was not 200 (' . wp_remote_retrieve_response_code( $response ) . ')' );
 			return false;
 		}
 
@@ -108,13 +110,13 @@
 		$this->message = new IXR_Message( wp_remote_retrieve_body( $response ) );
 		if ( ! $this->message->parse() ) {
 			// XML error
-			$this->error = new IXR_Error(-32700, 'parse error. not well formed');
+			$this->error = new IXR_Error( -32700, 'parse error. not well formed' );
 			return false;
 		}
 
 		// Is the message a fault?
 		if ( $this->message->messageType == 'fault' ) {
-			$this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);
+			$this->error = new IXR_Error( $this->message->faultCode, $this->message->faultString );
 			return false;
 		}
 
Index: src/wp-includes/class-wp-http-proxy.php
===================================================================
--- src/wp-includes/class-wp-http-proxy.php	(revision 40901)
+++ src/wp-includes/class-wp-http-proxy.php	(working copy)
@@ -52,7 +52,7 @@
 	 * @return bool
 	 */
 	public function is_enabled() {
-		return defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT');
+		return defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' );
 	}
 
 	/**
@@ -66,7 +66,7 @@
 	 * @return bool
 	 */
 	public function use_authentication() {
-		return defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD');
+		return defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' );
 	}
 
 	/**
@@ -77,8 +77,9 @@
 	 * @return string
 	 */
 	public function host() {
-		if ( defined('WP_PROXY_HOST') )
+		if ( defined( 'WP_PROXY_HOST' ) ) {
 			return WP_PROXY_HOST;
+		}
 
 		return '';
 	}
@@ -91,8 +92,9 @@
 	 * @return string
 	 */
 	public function port() {
-		if ( defined('WP_PROXY_PORT') )
+		if ( defined( 'WP_PROXY_PORT' ) ) {
 			return WP_PROXY_PORT;
+		}
 
 		return '';
 	}
@@ -105,8 +107,9 @@
 	 * @return string
 	 */
 	public function username() {
-		if ( defined('WP_PROXY_USERNAME') )
+		if ( defined( 'WP_PROXY_USERNAME' ) ) {
 			return WP_PROXY_USERNAME;
+		}
 
 		return '';
 	}
@@ -119,8 +122,9 @@
 	 * @return string
 	 */
 	public function password() {
-		if ( defined('WP_PROXY_PASSWORD') )
+		if ( defined( 'WP_PROXY_PASSWORD' ) ) {
 			return WP_PROXY_PASSWORD;
+		}
 
 		return '';
 	}
@@ -167,13 +171,14 @@
 		 * parse_url() only handles http, https type URLs, and will emit E_WARNING on failure.
 		 * This will be displayed on sites, which is not reasonable.
 		 */
-		$check = @parse_url($uri);
+		$check = @parse_url( $uri );
 
 		// Malformed URL, can not process, but this could mean ssl, so let through anyway.
-		if ( $check === false )
+		if ( $check === false ) {
 			return true;
+		}
 
-		$home = parse_url( get_option('siteurl') );
+		$home = parse_url( get_option( 'siteurl' ) );
 
 		/**
 		 * Filters whether to preempt sending the request through the proxy server.
@@ -189,31 +194,35 @@
 		 * @param array  $home     Associative array result of parsing the site URL.
 		 */
 		$result = apply_filters( 'pre_http_send_through_proxy', null, $uri, $check, $home );
-		if ( ! is_null( $result ) )
+		if ( ! is_null( $result ) ) {
 			return $result;
+		}
 
-		if ( 'localhost' == $check['host'] || ( isset( $home['host'] ) && $home['host'] == $check['host'] ) )
+		if ( 'localhost' == $check['host'] || ( isset( $home['host'] ) && $home['host'] == $check['host'] ) ) {
 			return false;
+		}
 
-		if ( !defined('WP_PROXY_BYPASS_HOSTS') )
+		if ( ! defined( 'WP_PROXY_BYPASS_HOSTS' ) ) {
 			return true;
+		}
 
 		static $bypass_hosts = null;
 		static $wildcard_regex = array();
 		if ( null === $bypass_hosts ) {
-			$bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS);
+			$bypass_hosts = preg_split( '|,\s*|', WP_PROXY_BYPASS_HOSTS );
 
-			if ( false !== strpos(WP_PROXY_BYPASS_HOSTS, '*') ) {
+			if ( false !== strpos( WP_PROXY_BYPASS_HOSTS, '*' ) ) {
 				$wildcard_regex = array();
-				foreach ( $bypass_hosts as $host )
+				foreach ( $bypass_hosts as $host ) {
 					$wildcard_regex[] = str_replace( '\*', '.+', preg_quote( $host, '/' ) );
-				$wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
+				}
+				$wildcard_regex = '/^(' . implode( '|', $wildcard_regex ) . ')$/i';
 			}
 		}
 
-		if ( !empty($wildcard_regex) )
-			return !preg_match($wildcard_regex, $check['host']);
-		else
-			return !in_array( $check['host'], $bypass_hosts );
+		if ( ! empty( $wildcard_regex ) ) {
+			return ! preg_match( $wildcard_regex, $check['host'] );
+		} else { return ! in_array( $check['host'], $bypass_hosts );
+		}
 	}
 }
Index: src/wp-includes/class-wp-http-streams.php
===================================================================
--- src/wp-includes/class-wp-http-streams.php	(revision 40901)
+++ src/wp-includes/class-wp-http-streams.php	(working copy)
@@ -27,12 +27,16 @@
 	 * @param string|array $args Optional. Override the defaults.
 	 * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
 	 */
-	public function request($url, $args = array()) {
+	public function request( $url, $args = array() ) {
 		$defaults = array(
-			'method' => 'GET', 'timeout' => 5,
-			'redirection' => 5, 'httpversion' => '1.0',
+			'method' => 'GET',
+		'timeout' => 5,
+			'redirection' => 5,
+		'httpversion' => '1.0',
 			'blocking' => true,
-			'headers' => array(), 'body' => null, 'cookies' => array()
+			'headers' => array(),
+		'body' => null,
+		'cookies' => array(),
 		);
 
 		$r = wp_parse_args( $args, $defaults );
@@ -48,7 +52,7 @@
 		// Construct Cookie: header if any cookies are set.
 		WP_Http::buildCookieHeader( $r );
 
-		$arrURL = parse_url($url);
+		$arrURL = parse_url( $url );
 
 		$connect_host = $arrURL['host'];
 
@@ -68,10 +72,10 @@
 		}
 
 		if ( isset( $r['headers']['Host'] ) || isset( $r['headers']['host'] ) ) {
-			if ( isset( $r['headers']['Host'] ) )
+			if ( isset( $r['headers']['Host'] ) ) {
 				$arrURL['host'] = $r['headers']['Host'];
-			else
-				$arrURL['host'] = $r['headers']['host'];
+			} else { $arrURL['host'] = $r['headers']['host'];
+			}
 			unset( $r['headers']['Host'], $r['headers']['host'] );
 		}
 
@@ -80,8 +84,9 @@
 		 * to ::1, which fails when the server is not set up for it. For compatibility, always
 		 * connect to the IPv4 address.
 		 */
-		if ( 'localhost' == strtolower( $connect_host ) )
+		if ( 'localhost' == strtolower( $connect_host ) ) {
 			$connect_host = '127.0.0.1';
+		}
 
 		$connect_host = $secure_transport ? 'ssl://' . $connect_host : 'tcp://' . $connect_host;
 
@@ -117,7 +122,7 @@
 				'SNI_enabled' => true,
 				'cafile' => $r['sslcertificates'],
 				'allow_self_signed' => ! $ssl_verify,
-			)
+			),
 		) );
 
 		$timeout = (int) floor( $r['timeout'] );
@@ -130,52 +135,55 @@
 		// Store error string.
 		$connection_error_str = null;
 
-		if ( !WP_DEBUG ) {
+		if ( ! WP_DEBUG ) {
 			// In the event that the SSL connection fails, silence the many PHP Warnings.
-			if ( $secure_transport )
-				$error_reporting = error_reporting(0);
+			if ( $secure_transport ) {
+				$error_reporting = error_reporting( 0 );
+			}
 
-			if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
+			if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
 				$handle = @stream_socket_client( 'tcp://' . $proxy->host() . ':' . $proxy->port(), $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );
-			else
-				$handle = @stream_socket_client( $connect_host . ':' . $arrURL['port'], $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );
+			} else { $handle = @stream_socket_client( $connect_host . ':' . $arrURL['port'], $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );
+			}
 
-			if ( $secure_transport )
+			if ( $secure_transport ) {
 				error_reporting( $error_reporting );
-
+			}
 		} else {
-			if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
+			if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
 				$handle = stream_socket_client( 'tcp://' . $proxy->host() . ':' . $proxy->port(), $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );
-			else
-				$handle = stream_socket_client( $connect_host . ':' . $arrURL['port'], $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );
+			} else { $handle = stream_socket_client( $connect_host . ':' . $arrURL['port'], $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );
+			}
 		}
 
 		if ( false === $handle ) {
 			// SSL connection failed due to expired/invalid cert, or, OpenSSL configuration is broken.
-			if ( $secure_transport && 0 === $connection_error && '' === $connection_error_str )
+			if ( $secure_transport && 0 === $connection_error && '' === $connection_error_str ) {
 				return new WP_Error( 'http_request_failed', __( 'The SSL certificate for the host could not be verified.' ) );
+			}
 
-			return new WP_Error('http_request_failed', $connection_error . ': ' . $connection_error_str );
+			return new WP_Error( 'http_request_failed', $connection_error . ': ' . $connection_error_str );
 		}
 
 		// Verify that the SSL certificate is valid for this request.
 		if ( $secure_transport && $ssl_verify && ! $proxy->is_enabled() ) {
-			if ( ! self::verify_ssl_certificate( $handle, $arrURL['host'] ) )
+			if ( ! self::verify_ssl_certificate( $handle, $arrURL['host'] ) ) {
 				return new WP_Error( 'http_request_failed', __( 'The SSL certificate for the host could not be verified.' ) );
+			}
 		}
 
 		stream_set_timeout( $handle, $timeout, $utimeout );
 
-		if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) //Some proxies require full URL in this field.
+		if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { //Some proxies require full URL in this field.
 			$requestPath = $url;
-		else
-			$requestPath = $arrURL['path'] . ( isset($arrURL['query']) ? '?' . $arrURL['query'] : '' );
+		} else { $requestPath = $arrURL['path'] . ( isset( $arrURL['query'] ) ? '?' . $arrURL['query'] : '' );
+		}
 
-		$strHeaders = strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
+		$strHeaders = strtoupper( $r['method'] ) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
 
 		$include_port_in_host_header = (
 			( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) ||
-			( 'http'  == $arrURL['scheme'] && 80  != $arrURL['port'] ) ||
+			( 'http' == $arrURL['scheme'] && 80 != $arrURL['port'] ) ||
 			( 'https' == $arrURL['scheme'] && 443 != $arrURL['port'] )
 		);
 
@@ -185,50 +193,64 @@
 			$strHeaders .= 'Host: ' . $arrURL['host'] . "\r\n";
 		}
 
-		if ( isset($r['user-agent']) )
+		if ( isset( $r['user-agent'] ) ) {
 			$strHeaders .= 'User-agent: ' . $r['user-agent'] . "\r\n";
+		}
 
-		if ( is_array($r['headers']) ) {
-			foreach ( (array) $r['headers'] as $header => $headerValue )
+		if ( is_array( $r['headers'] ) ) {
+			foreach ( (array) $r['headers'] as $header => $headerValue ) {
 				$strHeaders .= $header . ': ' . $headerValue . "\r\n";
+			}
 		} else {
 			$strHeaders .= $r['headers'];
 		}
 
-		if ( $proxy->use_authentication() )
+		if ( $proxy->use_authentication() ) {
 			$strHeaders .= $proxy->authentication_header() . "\r\n";
+		}
 
 		$strHeaders .= "\r\n";
 
-		if ( ! is_null($r['body']) )
+		if ( ! is_null( $r['body'] ) ) {
 			$strHeaders .= $r['body'];
+		}
 
-		fwrite($handle, $strHeaders);
+		fwrite( $handle, $strHeaders );
 
 		if ( ! $r['blocking'] ) {
 			stream_set_blocking( $handle, 0 );
 			fclose( $handle );
-			return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );
+			return array(
+				'headers' => array(),
+				'body' => '',
+				'response' => array(
+					'code' => false,
+					'message' => false,
+				),
+				'cookies' => array(),
+			);
 		}
 
 		$strResponse = '';
 		$bodyStarted = false;
 		$keep_reading = true;
 		$block_size = 4096;
-		if ( isset( $r['limit_response_size'] ) )
+		if ( isset( $r['limit_response_size'] ) ) {
 			$block_size = min( $block_size, $r['limit_response_size'] );
+		}
 
 		// If streaming to a file setup the file handle.
 		if ( $r['stream'] ) {
-			if ( ! WP_DEBUG )
+			if ( ! WP_DEBUG ) {
 				$stream_handle = @fopen( $r['filename'], 'w+' );
-			else
-				$stream_handle = fopen( $r['filename'], 'w+' );
-			if ( ! $stream_handle )
+			} else { $stream_handle = fopen( $r['filename'], 'w+' );
+			}
+			if ( ! $stream_handle ) {
 				return new WP_Error( 'http_request_failed', sprintf( __( 'Could not open handle for fopen() to %s' ), $r['filename'] ) );
+			}
 
 			$bytes_written = 0;
-			while ( ! feof($handle) && $keep_reading ) {
+			while ( ! feof( $handle ) && $keep_reading ) {
 				$block = fread( $handle, $block_size );
 				if ( ! $bodyStarted ) {
 					$strResponse .= $block;
@@ -258,7 +280,7 @@
 
 				$bytes_written += $bytes_written_to_file;
 
-				$keep_reading = !isset( $r['limit_response_size'] ) || $bytes_written < $r['limit_response_size'];
+				$keep_reading = ! isset( $r['limit_response_size'] ) || $bytes_written < $r['limit_response_size'];
 			}
 
 			fclose( $stream_handle );
@@ -272,13 +294,13 @@
 					$header_length = strpos( $strResponse, "\r\n\r\n" ) + 4;
 					$bodyStarted = true;
 				}
-				$keep_reading = ( ! $bodyStarted || !isset( $r['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $r['limit_response_size'] ) );
+				$keep_reading = ( ! $bodyStarted || ! isset( $r['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $r['limit_response_size'] ) );
 			}
 
 			$process = WP_Http::processResponse( $strResponse );
 			unset( $strResponse );
 
-		}
+		}// End if().
 
 		fclose( $handle );
 
@@ -290,22 +312,26 @@
 			'body' => null,
 			'response' => $arrHeaders['response'],
 			'cookies' => $arrHeaders['cookies'],
-			'filename' => $r['filename']
+			'filename' => $r['filename'],
 		);
 
 		// Handle redirects.
-		if ( false !== ( $redirect_response = WP_Http::handle_redirects( $url, $r, $response ) ) )
+		if ( false !== ( $redirect_response = WP_Http::handle_redirects( $url, $r, $response ) ) ) {
 			return $redirect_response;
+		}
 
 		// If the body was chunk encoded, then decode it.
-		if ( ! empty( $process['body'] ) && isset( $arrHeaders['headers']['transfer-encoding'] ) && 'chunked' == $arrHeaders['headers']['transfer-encoding'] )
-			$process['body'] = WP_Http::chunkTransferDecode($process['body']);
+		if ( ! empty( $process['body'] ) && isset( $arrHeaders['headers']['transfer-encoding'] ) && 'chunked' == $arrHeaders['headers']['transfer-encoding'] ) {
+			$process['body'] = WP_Http::chunkTransferDecode( $process['body'] );
+		}
 
-		if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($arrHeaders['headers']) )
+		if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode( $arrHeaders['headers'] ) ) {
 			$process['body'] = WP_Http_Encoding::decompress( $process['body'] );
+		}
 
-		if ( isset( $r['limit_response_size'] ) && strlen( $process['body'] ) > $r['limit_response_size'] )
+		if ( isset( $r['limit_response_size'] ) && strlen( $process['body'] ) > $r['limit_response_size'] ) {
 			$process['body'] = substr( $process['body'], 0, $r['limit_response_size'] );
+		}
 
 		$response['body'] = $process['body'];
 
@@ -332,12 +358,14 @@
 	public static function verify_ssl_certificate( $stream, $host ) {
 		$context_options = stream_context_get_options( $stream );
 
-		if ( empty( $context_options['ssl']['peer_certificate'] ) )
+		if ( empty( $context_options['ssl']['peer_certificate'] ) ) {
 			return false;
+		}
 
 		$cert = openssl_x509_parse( $context_options['ssl']['peer_certificate'] );
-		if ( ! $cert )
+		if ( ! $cert ) {
 			return false;
+		}
 
 		/*
 		 * If the request is being made to an IP address, we'll validate against IP fields
@@ -350,25 +378,29 @@
 			$match_against = preg_split( '/,\s*/', $cert['extensions']['subjectAltName'] );
 			foreach ( $match_against as $match ) {
 				list( $match_type, $match_host ) = explode( ':', $match );
-				if ( $host_type == strtolower( trim( $match_type ) ) ) // IP: or DNS:
+				if ( $host_type == strtolower( trim( $match_type ) ) ) { // IP: or DNS:
 					$certificate_hostnames[] = strtolower( trim( $match_host ) );
+				}
 			}
-		} elseif ( !empty( $cert['subject']['CN'] ) ) {
+		} elseif ( ! empty( $cert['subject']['CN'] ) ) {
 			// Only use the CN when the certificate includes no subjectAltName extension.
 			$certificate_hostnames[] = strtolower( $cert['subject']['CN'] );
 		}
 
 		// Exact hostname/IP matches.
-		if ( in_array( strtolower( $host ), $certificate_hostnames ) )
+		if ( in_array( strtolower( $host ), $certificate_hostnames ) ) {
 			return true;
+		}
 
 		// IP's can't be wildcards, Stop processing.
-		if ( 'ip' == $host_type )
+		if ( 'ip' == $host_type ) {
 			return false;
+		}
 
 		// Test to see if the domain is at least 2 deep for wildcard support.
-		if ( substr_count( $host, '.' ) < 2 )
+		if ( substr_count( $host, '.' ) < 2 ) {
 			return false;
+		}
 
 		// Wildcard subdomains certs (*.example.com) are valid for a.example.com but not a.b.example.com.
 		$wildcard_host = preg_replace( '/^[^.]+\./', '*.', $host );
@@ -388,16 +420,19 @@
 	 * @return bool False means this class can not be used, true means it can.
 	 */
 	public static function test( $args = array() ) {
-		if ( ! function_exists( 'stream_socket_client' ) )
+		if ( ! function_exists( 'stream_socket_client' ) ) {
 			return false;
+		}
 
 		$is_ssl = isset( $args['ssl'] ) && $args['ssl'];
 
 		if ( $is_ssl ) {
-			if ( ! extension_loaded( 'openssl' ) )
+			if ( ! extension_loaded( 'openssl' ) ) {
 				return false;
-			if ( ! function_exists( 'openssl_x509_parse' ) )
+			}
+			if ( ! function_exists( 'openssl_x509_parse' ) ) {
 				return false;
+			}
 		}
 
 		/**
Index: src/wp-includes/class-wp-image-editor-gd.php
===================================================================
--- src/wp-includes/class-wp-image-editor-gd.php	(revision 40901)
+++ src/wp-includes/class-wp-image-editor-gd.php	(working copy)
@@ -42,13 +42,14 @@
 	 * @return bool
 	 */
 	public static function test( $args = array() ) {
-		if ( ! extension_loaded('gd') || ! function_exists('gd_info') )
+		if ( ! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) ) {
 			return false;
+		}
 
 		// On some setups GD library does not provide imagerotate() - Ticket #11536
 		if ( isset( $args['methods'] ) &&
 			 in_array( 'rotate', $args['methods'] ) &&
-			 ! function_exists('imagerotate') ){
+			 ! function_exists( 'imagerotate' ) ) {
 
 				return false;
 		}
@@ -69,7 +70,7 @@
 	 */
 	public static function supports_mime_type( $mime_type ) {
 		$image_types = imagetypes();
-		switch( $mime_type ) {
+		switch ( $mime_type ) {
 			case 'image/jpeg':
 				return ($image_types & IMG_JPG) != 0;
 			case 'image/png':
@@ -90,23 +91,27 @@
 	 * @return bool|WP_Error True if loaded successfully; WP_Error on failure.
 	 */
 	public function load() {
-		if ( $this->image )
+		if ( $this->image ) {
 			return true;
+		}
 
-		if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) )
-			return new WP_Error( 'error_loading_image', __('File doesn&#8217;t exist?'), $this->file );
+		if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) ) {
+			return new WP_Error( 'error_loading_image', __( 'File doesn&#8217;t exist?' ), $this->file );
+		}
 
 		// Set artificially high because GD uses uncompressed images in memory.
 		wp_raise_memory_limit( 'image' );
 
 		$this->image = @imagecreatefromstring( file_get_contents( $this->file ) );
 
-		if ( ! is_resource( $this->image ) )
-			return new WP_Error( 'invalid_image', __('File is not an image.'), $this->file );
+		if ( ! is_resource( $this->image ) ) {
+			return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file );
+		}
 
 		$size = @getimagesize( $this->file );
-		if ( ! $size )
-			return new WP_Error( 'invalid_image', __('Could not read image size.'), $this->file );
+		if ( ! $size ) {
+			return new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file );
+		}
 
 		if ( function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {
 			imagealphablending( $this->image, false );
@@ -130,11 +135,13 @@
 	 * @return true
 	 */
 	protected function update_size( $width = false, $height = false ) {
-		if ( ! $width )
+		if ( ! $width ) {
 			$width = imagesx( $this->image );
+		}
 
-		if ( ! $height )
+		if ( ! $height ) {
 			$height = imagesy( $this->image );
+		}
 
 		return parent::update_size( $width, $height );
 	}
@@ -156,8 +163,9 @@
 	 * @return true|WP_Error
 	 */
 	public function resize( $max_w, $max_h, $crop = false ) {
-		if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) )
+		if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) {
 			return true;
+		}
 
 		$resized = $this->_resize( $max_w, $max_h, $crop );
 
@@ -166,10 +174,11 @@
 			$this->image = $resized;
 			return true;
 
-		} elseif ( is_wp_error( $resized ) )
+		} elseif ( is_wp_error( $resized ) ) {
 			return $resized;
+		}
 
-		return new WP_Error( 'image_resize_error', __('Image resize failed.'), $this->file );
+		return new WP_Error( 'image_resize_error', __( 'Image resize failed.' ), $this->file );
 	}
 
 	/**
@@ -182,7 +191,7 @@
 	protected function _resize( $max_w, $max_h, $crop = false ) {
 		$dims = image_resize_dimensions( $this->size['width'], $this->size['height'], $max_w, $max_h, $crop );
 		if ( ! $dims ) {
-			return new WP_Error( 'error_getting_dimensions', __('Could not calculate resized image dimensions'), $this->file );
+			return new WP_Error( 'error_getting_dimensions', __( 'Could not calculate resized image dimensions' ), $this->file );
 		}
 		list( $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ) = $dims;
 
@@ -194,7 +203,7 @@
 			return $resized;
 		}
 
-		return new WP_Error( 'image_resize_error', __('Image resize failed.'), $this->file );
+		return new WP_Error( 'image_resize_error', __( 'Image resize failed.' ), $this->file );
 	}
 
 	/**
@@ -250,7 +259,7 @@
 
 				if ( ! is_wp_error( $resized ) && $resized ) {
 					unset( $resized['path'] );
-					$metadata[$size] = $resized;
+					$metadata[ $size ] = $resized;
 				}
 			}
 
@@ -278,10 +287,12 @@
 	public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
 		// If destination width/height isn't specified, use same as
 		// width/height from source.
-		if ( ! $dst_w )
+		if ( ! $dst_w ) {
 			$dst_w = $src_w;
-		if ( ! $dst_h )
+		}
+		if ( ! $dst_h ) {
 			$dst_h = $src_h;
+		}
 
 		$dst = wp_imagecreatetruecolor( $dst_w, $dst_h );
 
@@ -290,8 +301,9 @@
 			$src_h -= $src_y;
 		}
 
-		if ( function_exists( 'imageantialias' ) )
+		if ( function_exists( 'imageantialias' ) ) {
 			imageantialias( $dst, true );
+		}
 
 		imagecopyresampled( $dst, $this->image, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
 
@@ -302,7 +314,7 @@
 			return true;
 		}
 
-		return new WP_Error( 'image_crop_error', __('Image crop failed.'), $this->file );
+		return new WP_Error( 'image_crop_error', __( 'Image crop failed.' ), $this->file );
 	}
 
 	/**
@@ -316,7 +328,7 @@
 	 * @return true|WP_Error
 	 */
 	public function rotate( $angle ) {
-		if ( function_exists('imagerotate') ) {
+		if ( function_exists( 'imagerotate' ) ) {
 			$transparency = imagecolorallocatealpha( $this->image, 255, 255, 255, 127 );
 			$rotated = imagerotate( $this->image, $angle, $transparency );
 
@@ -329,7 +341,7 @@
 				return true;
 			}
 		}
-		return new WP_Error( 'image_rotate_error', __('Image rotate failed.'), $this->file );
+		return new WP_Error( 'image_rotate_error', __( 'Image rotate failed.' ), $this->file );
 	}
 
 	/**
@@ -359,7 +371,7 @@
 				return true;
 			}
 		}
-		return new WP_Error( 'image_flip_error', __('Image flip failed.'), $this->file );
+		return new WP_Error( 'image_flip_error', __( 'Image flip failed.' ), $this->file );
 	}
 
 	/**
@@ -392,27 +404,29 @@
 	protected function _save( $image, $filename = null, $mime_type = null ) {
 		list( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type );
 
-		if ( ! $filename )
+		if ( ! $filename ) {
 			$filename = $this->generate_filename( null, null, $extension );
+		}
 
 		if ( 'image/gif' == $mime_type ) {
-			if ( ! $this->make_image( $filename, 'imagegif', array( $image, $filename ) ) )
-				return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
-		}
-		elseif ( 'image/png' == $mime_type ) {
+			if ( ! $this->make_image( $filename, 'imagegif', array( $image, $filename ) ) ) {
+				return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );
+			}
+		} elseif ( 'image/png' == $mime_type ) {
 			// convert from full colors to index colors, like original PNG.
-			if ( function_exists('imageistruecolor') && ! imageistruecolor( $image ) )
+			if ( function_exists( 'imageistruecolor' ) && ! imageistruecolor( $image ) ) {
 				imagetruecolortopalette( $image, false, imagecolorstotal( $image ) );
+			}
 
-			if ( ! $this->make_image( $filename, 'imagepng', array( $image, $filename ) ) )
-				return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
-		}
-		elseif ( 'image/jpeg' == $mime_type ) {
-			if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->get_quality() ) ) )
-				return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
-		}
-		else {
-			return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
+			if ( ! $this->make_image( $filename, 'imagepng', array( $image, $filename ) ) ) {
+				return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );
+			}
+		} elseif ( 'image/jpeg' == $mime_type ) {
+			if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->get_quality() ) ) ) {
+				return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );
+			}
+		} else {
+			return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );
 		}
 
 		// Set correct file permissions
@@ -473,8 +487,9 @@
 	 * @return bool
 	 */
 	protected function make_image( $filename, $function, $arguments ) {
-		if ( wp_is_stream( $filename ) )
+		if ( wp_is_stream( $filename ) ) {
 			$arguments[1] = null;
+		}
 
 		return parent::make_image( $filename, $function, $arguments );
 	}
Index: src/wp-includes/class-wp-image-editor-imagick.php
===================================================================
--- src/wp-includes/class-wp-image-editor-imagick.php	(revision 40901)
+++ src/wp-includes/class-wp-image-editor-imagick.php	(working copy)
@@ -48,11 +48,13 @@
 	public static function test( $args = array() ) {
 
 		// First, test Imagick's extension and classes.
-		if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick', false ) || ! class_exists( 'ImagickPixel', false ) )
+		if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick', false ) || ! class_exists( 'ImagickPixel', false ) ) {
 			return false;
+		}
 
-		if ( version_compare( phpversion( 'imagick' ), '2.2.0', '<' ) )
+		if ( version_compare( phpversion( 'imagick' ), '2.2.0', '<' ) ) {
 			return false;
+		}
 
 		$required_methods = array(
 			'clear',
@@ -77,8 +79,9 @@
 		);
 
 		// Now, test for deep requirements within Imagick.
-		if ( ! defined( 'imagick::COMPRESSION_JPEG' ) )
+		if ( ! defined( 'imagick::COMPRESSION_JPEG' ) ) {
 			return false;
+		}
 
 		$class_methods = array_map( 'strtolower', get_class_methods( 'Imagick' ) );
 		if ( array_diff( $required_methods, $class_methods ) ) {
@@ -107,18 +110,19 @@
 	public static function supports_mime_type( $mime_type ) {
 		$imagick_extension = strtoupper( self::get_extension( $mime_type ) );
 
-		if ( ! $imagick_extension )
+		if ( ! $imagick_extension ) {
 			return false;
+		}
 
 		// setIteratorIndex is optional unless mime is an animated format.
 		// Here, we just say no if you are missing it and aren't loading a jpeg.
-		if ( ! method_exists( 'Imagick', 'setIteratorIndex' ) && $mime_type != 'image/jpeg' )
+		if ( ! method_exists( 'Imagick', 'setIteratorIndex' ) && $mime_type != 'image/jpeg' ) {
 				return false;
+		}
 
 		try {
 			return ( (bool) @Imagick::queryFormats( $imagick_extension ) );
-		}
-		catch ( Exception $e ) {
+		} catch ( Exception $e ) {
 			return false;
 		}
 	}
@@ -132,11 +136,13 @@
 	 * @return true|WP_Error True if loaded; WP_Error on failure.
 	 */
 	public function load() {
-		if ( $this->image instanceof Imagick )
+		if ( $this->image instanceof Imagick ) {
 			return true;
+		}
 
-		if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) )
-			return new WP_Error( 'error_loading_image', __('File doesn&#8217;t exist?'), $this->file );
+		if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) ) {
+			return new WP_Error( 'error_loading_image', __( 'File doesn&#8217;t exist?' ), $this->file );
+		}
 
 		/*
 		 * Even though Imagick uses less PHP memory than GD, set higher limit
@@ -157,16 +163,17 @@
 			// only applies correctly before the image is read.
 			$this->image->readImage( $filename );
 
-			if ( ! $this->image->valid() )
-				return new WP_Error( 'invalid_image', __('File is not an image.'), $this->file);
+			if ( ! $this->image->valid() ) {
+				return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file );
+			}
 
 			// Select the first frame to handle animated images properly
-			if ( is_callable( array( $this->image, 'setIteratorIndex' ) ) )
-				$this->image->setIteratorIndex(0);
+			if ( is_callable( array( $this->image, 'setIteratorIndex' ) ) ) {
+				$this->image->setIteratorIndex( 0 );
+			}
 
 			$this->mime_type = $this->get_mime_type( $this->image->getImageFormat() );
-		}
-		catch ( Exception $e ) {
+		} catch ( Exception $e ) {
 			return new WP_Error( 'invalid_image', $e->getMessage(), $this->file );
 		}
 
@@ -199,12 +206,10 @@
 			if ( 'image/jpeg' == $this->mime_type ) {
 				$this->image->setImageCompressionQuality( $quality );
 				$this->image->setImageCompression( imagick::COMPRESSION_JPEG );
-			}
-			else {
+			} else {
 				$this->image->setImageCompressionQuality( $quality );
 			}
-		}
-		catch ( Exception $e ) {
+		} catch ( Exception $e ) {
 			return new WP_Error( 'image_quality_error', $e->getMessage() );
 		}
 
@@ -224,20 +229,21 @@
 	 */
 	protected function update_size( $width = null, $height = null ) {
 		$size = null;
-		if ( !$width || !$height ) {
+		if ( ! $width || ! $height ) {
 			try {
 				$size = $this->image->getImageGeometry();
-			}
-			catch ( Exception $e ) {
+			} catch ( Exception $e ) {
 				return new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file );
 			}
 		}
 
-		if ( ! $width )
+		if ( ! $width ) {
 			$width = $size['width'];
+		}
 
-		if ( ! $height )
+		if ( ! $height ) {
 			$height = $size['height'];
+		}
 
 		return parent::update_size( $width, $height );
 	}
@@ -258,12 +264,14 @@
 	 * @return bool|WP_Error
 	 */
 	public function resize( $max_w, $max_h, $crop = false ) {
-		if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) )
+		if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) {
 			return true;
+		}
 
 		$dims = image_resize_dimensions( $this->size['width'], $this->size['height'], $max_w, $max_h, $crop );
-		if ( ! $dims )
-			return new WP_Error( 'error_getting_dimensions', __('Could not calculate resized image dimensions') );
+		if ( ! $dims ) {
+			return new WP_Error( 'error_getting_dimensions', __( 'Could not calculate resized image dimensions' ) );
+		}
 		list( $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ) = $dims;
 
 		if ( $crop ) {
@@ -407,11 +415,9 @@
 			if ( is_callable( array( $this->image, 'setInterlaceScheme' ) ) && defined( 'Imagick::INTERLACE_NO' ) ) {
 				$this->image->setInterlaceScheme( Imagick::INTERLACE_NO );
 			}
-
-		}
-		catch ( Exception $e ) {
+		} catch ( Exception $e ) {
 			return new WP_Error( 'image_resize_error', $e->getMessage() );
-		}
+		}// End try().
 	}
 
 	/**
@@ -443,8 +449,9 @@
 		$orig_image = $this->image->getImage();
 
 		foreach ( $sizes as $size => $size_data ) {
-			if ( ! $this->image )
+			if ( ! $this->image ) {
 				$this->image = $orig_image->getImage();
+			}
 
 			if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) {
 				continue;
@@ -473,12 +480,12 @@
 
 				if ( ! is_wp_error( $resized ) && $resized ) {
 					unset( $resized['path'] );
-					$metadata[$size] = $resized;
+					$metadata[ $size ] = $resized;
 				}
 			}
 
 			$this->size = $orig_size;
-		}
+		}// End foreach().
 
 		$this->image = $orig_image;
 
@@ -508,15 +515,17 @@
 
 		try {
 			$this->image->cropImage( $src_w, $src_h, $src_x, $src_y );
-			$this->image->setImagePage( $src_w, $src_h, 0, 0);
+			$this->image->setImagePage( $src_w, $src_h, 0, 0 );
 
 			if ( $dst_w || $dst_h ) {
 				// If destination width/height isn't specified, use same as
 				// width/height from source.
-				if ( ! $dst_w )
+				if ( ! $dst_w ) {
 					$dst_w = $src_w;
-				if ( ! $dst_h )
+				}
+				if ( ! $dst_h ) {
 					$dst_h = $src_h;
+				}
 
 				$thumb_result = $this->thumbnail_image( $dst_w, $dst_h );
 				if ( is_wp_error( $thumb_result ) ) {
@@ -525,8 +534,7 @@
 
 				return $this->update_size();
 			}
-		}
-		catch ( Exception $e ) {
+		} catch ( Exception $e ) {
 			return new WP_Error( 'image_crop_error', $e->getMessage() );
 		}
 		return $this->update_size();
@@ -547,7 +555,7 @@
 		 * (GD rotates counter-clockwise)
 		 */
 		try {
-			$this->image->rotateImage( new ImagickPixel('none'), 360-$angle );
+			$this->image->rotateImage( new ImagickPixel( 'none' ), 360 -$angle );
 
 			// Normalise Exif orientation data so that display is consistent across devices.
 			if ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) {
@@ -556,12 +564,12 @@
 
 			// Since this changes the dimensions of the image, update the size.
 			$result = $this->update_size();
-			if ( is_wp_error( $result ) )
+			if ( is_wp_error( $result ) ) {
 				return $result;
+			}
 
 			$this->image->setImagePage( $this->size['width'], $this->size['height'], 0, 0 );
-		}
-		catch ( Exception $e ) {
+		} catch ( Exception $e ) {
 			return new WP_Error( 'image_rotate_error', $e->getMessage() );
 		}
 		return true;
@@ -579,13 +587,14 @@
 	 */
 	public function flip( $horz, $vert ) {
 		try {
-			if ( $horz )
+			if ( $horz ) {
 				$this->image->flipImage();
+			}
 
-			if ( $vert )
+			if ( $vert ) {
 				$this->image->flopImage();
-		}
-		catch ( Exception $e ) {
+			}
+		} catch ( Exception $e ) {
 			return new WP_Error( 'image_flip_error', $e->getMessage() );
 		}
 		return true;
@@ -610,8 +619,7 @@
 
 			try {
 				$this->image->setImageFormat( strtoupper( $this->get_extension( $this->mime_type ) ) );
-			}
-			catch ( Exception $e ) {
+			} catch ( Exception $e ) {
 				return new WP_Error( 'image_save_error', $e->getMessage(), $this->file );
 			}
 		}
@@ -629,8 +637,9 @@
 	protected function _save( $image, $filename = null, $mime_type = null ) {
 		list( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type );
 
-		if ( ! $filename )
+		if ( ! $filename ) {
 			$filename = $this->generate_filename( null, null, $extension );
+		}
 
 		try {
 			// Store initial Format
@@ -641,8 +650,7 @@
 
 			// Reset original Format
 			$this->image->setImageFormat( $orig_format );
-		}
-		catch ( Exception $e ) {
+		} catch ( Exception $e ) {
 			return new WP_Error( 'image_save_error', $e->getMessage(), $filename );
 		}
 
@@ -683,8 +691,7 @@
 
 			// Reset Image to original Format
 			$this->image->setImageFormat( $this->get_extension( $this->mime_type ) );
-		}
-		catch ( Exception $e ) {
+		} catch ( Exception $e ) {
 			return new WP_Error( 'image_stream_error', $e->getMessage() );
 		}
 
@@ -735,7 +742,6 @@
 					$this->image->removeImageProfile( $key );
 				}
 			}
-
 		} catch ( Exception $e ) {
 			return new WP_Error( 'image_strip_meta_error', $e->getMessage() );
 		}
@@ -760,8 +766,7 @@
 
 			// Only load the first page.
 			return $this->file . '[0]';
-		}
-		catch ( Exception $e ) {
+		} catch ( Exception $e ) {
 			return new WP_Error( 'pdf_setup_failed', $e->getMessage(), $this->file );
 		}
 	}
Index: src/wp-includes/class-wp-image-editor.php
===================================================================
--- src/wp-includes/class-wp-image-editor.php	(revision 40901)
+++ src/wp-includes/class-wp-image-editor.php	(working copy)
@@ -204,7 +204,7 @@
 	protected function update_size( $width = null, $height = null ) {
 		$this->size = array(
 			'width' => (int) $width,
-			'height' => (int) $height
+			'height' => (int) $height,
 		);
 		return true;
 	}
@@ -274,7 +274,7 @@
 			if ( $quality < 0 || $quality > 100 ) {
 				$quality = $this->default_quality;
 			}
-		}
+		}// End if().
 
 		// Allow 0, but squash to 1 due to identical images in GD, and for backward compatibility.
 		if ( 0 === $quality ) {
@@ -285,7 +285,7 @@
 			$this->quality = $quality;
 			return true;
 		} else {
-			return new WP_Error( 'invalid_image_quality', __('Attempted to set image quality outside of the range [1,100].') );
+			return new WP_Error( 'invalid_image_quality', __( 'Attempted to set image quality outside of the range [1,100].' ) );
 		}
 	}
 
@@ -315,8 +315,7 @@
 		if ( $filename ) {
 			$file_ext = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );
 			$file_mime = $this->get_mime_type( $file_ext );
-		}
-		else {
+		} else {
 			// If no file specified, grab editor's current extension and mime-type.
 			$file_ext = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) );
 			$file_mime = $this->mime_type;
@@ -368,8 +367,9 @@
 	 */
 	public function generate_filename( $suffix = null, $dest_path = null, $extension = null ) {
 		// $suffix will be appended to the destination filename, just before the extension
-		if ( ! $suffix )
+		if ( ! $suffix ) {
 			$suffix = $this->get_suffix();
+		}
 
 		$dir  = pathinfo( $this->file, PATHINFO_DIRNAME );
 		$ext  = pathinfo( $this->file, PATHINFO_EXTENSION );
@@ -377,8 +377,9 @@
 		$name = wp_basename( $this->file, ".$ext" );
 		$new_ext = strtolower( $extension ? $extension : $ext );
 
-		if ( ! is_null( $dest_path ) && $_dest_path = realpath( $dest_path ) )
+		if ( ! is_null( $dest_path ) && $_dest_path = realpath( $dest_path ) ) {
 			$dir = $_dest_path;
+		}
 
 		return trailingslashit( $dir ) . "{$name}-{$suffix}.{$new_ext}";
 	}
@@ -392,8 +393,9 @@
 	 * @return false|string suffix
 	 */
 	public function get_suffix() {
-		if ( ! $this->get_size() )
+		if ( ! $this->get_size() ) {
 			return false;
+		}
 
 		return "{$this->size['width']}x{$this->size['height']}";
 	}
@@ -424,8 +426,9 @@
 
 			$fp = fopen( $filename, 'w' );
 
-			if ( ! $fp )
+			if ( ! $fp ) {
 				return false;
+			}
 
 			fwrite( $fp, $contents );
 			fclose( $fp );
@@ -451,15 +454,16 @@
 	 * @return string|false
 	 */
 	protected static function get_mime_type( $extension = null ) {
-		if ( ! $extension )
+		if ( ! $extension ) {
 			return false;
+		}
 
 		$mime_types = wp_get_mime_types();
 		$extensions = array_keys( $mime_types );
 
 		foreach ( $extensions as $_extension ) {
 			if ( preg_match( "/{$extension}/i", $_extension ) ) {
-				return $mime_types[$_extension];
+				return $mime_types[ $_extension ];
 			}
 		}
 
@@ -481,8 +485,9 @@
 	protected static function get_extension( $mime_type = null ) {
 		$extensions = explode( '|', array_search( $mime_type, wp_get_mime_types() ) );
 
-		if ( empty( $extensions[0] ) )
+		if ( empty( $extensions[0] ) ) {
 			return false;
+		}
 
 		return $extensions[0];
 	}
Index: src/wp-includes/class-wp-list-util.php
===================================================================
--- src/wp-includes/class-wp-list-util.php	(revision 40901)
+++ src/wp-includes/class-wp-list-util.php	(working copy)
@@ -120,7 +120,7 @@
 				( 'OR' == $operator && $matched > 0 ) ||
 				( 'NOT' == $operator && 0 == $matched )
 			) {
-				$filtered[$key] = $obj;
+				$filtered[ $key ] = $obj;
 			}
 		}
 
@@ -204,7 +204,9 @@
 		}
 
 		if ( is_string( $orderby ) ) {
-			$orderby = array( $orderby => $order );
+			$orderby = array(
+				$orderby => $order,
+			);
 		}
 
 		foreach ( $orderby as $field => $direction ) {
Index: src/wp-includes/class-wp-locale.php
===================================================================
--- src/wp-includes/class-wp-locale.php	(revision 40901)
+++ src/wp-includes/class-wp-locale.php	(working copy)
@@ -128,13 +128,13 @@
 	 */
 	public function init() {
 		// The Weekdays
-		$this->weekday[0] = /* translators: weekday */ __('Sunday');
-		$this->weekday[1] = /* translators: weekday */ __('Monday');
-		$this->weekday[2] = /* translators: weekday */ __('Tuesday');
-		$this->weekday[3] = /* translators: weekday */ __('Wednesday');
-		$this->weekday[4] = /* translators: weekday */ __('Thursday');
-		$this->weekday[5] = /* translators: weekday */ __('Friday');
-		$this->weekday[6] = /* translators: weekday */ __('Saturday');
+		$this->weekday[0] = /* translators: weekday */ __( 'Sunday' );
+		$this->weekday[1] = /* translators: weekday */ __( 'Monday' );
+		$this->weekday[2] = /* translators: weekday */ __( 'Tuesday' );
+		$this->weekday[3] = /* translators: weekday */ __( 'Wednesday' );
+		$this->weekday[4] = /* translators: weekday */ __( 'Thursday' );
+		$this->weekday[5] = /* translators: weekday */ __( 'Friday' );
+		$this->weekday[6] = /* translators: weekday */ __( 'Saturday' );
 
 		// The first letter of each day.
 		$this->weekday_initial[ __( 'Sunday' ) ]    = /* translators: one-letter abbreviation of the weekday */ _x( 'S', 'Sunday initial' );
@@ -146,13 +146,13 @@
 		$this->weekday_initial[ __( 'Saturday' ) ]  = /* translators: one-letter abbreviation of the weekday */ _x( 'S', 'Saturday initial' );
 
 		// Abbreviations for each day.
-		$this->weekday_abbrev[__('Sunday')]    = /* translators: three-letter abbreviation of the weekday */ __('Sun');
-		$this->weekday_abbrev[__('Monday')]    = /* translators: three-letter abbreviation of the weekday */ __('Mon');
-		$this->weekday_abbrev[__('Tuesday')]   = /* translators: three-letter abbreviation of the weekday */ __('Tue');
-		$this->weekday_abbrev[__('Wednesday')] = /* translators: three-letter abbreviation of the weekday */ __('Wed');
-		$this->weekday_abbrev[__('Thursday')]  = /* translators: three-letter abbreviation of the weekday */ __('Thu');
-		$this->weekday_abbrev[__('Friday')]    = /* translators: three-letter abbreviation of the weekday */ __('Fri');
-		$this->weekday_abbrev[__('Saturday')]  = /* translators: three-letter abbreviation of the weekday */ __('Sat');
+		$this->weekday_abbrev[ __( 'Sunday' ) ]    = /* translators: three-letter abbreviation of the weekday */ __( 'Sun' );
+		$this->weekday_abbrev[ __( 'Monday' ) ]    = /* translators: three-letter abbreviation of the weekday */ __( 'Mon' );
+		$this->weekday_abbrev[ __( 'Tuesday' ) ]   = /* translators: three-letter abbreviation of the weekday */ __( 'Tue' );
+		$this->weekday_abbrev[ __( 'Wednesday' ) ] = /* translators: three-letter abbreviation of the weekday */ __( 'Wed' );
+		$this->weekday_abbrev[ __( 'Thursday' ) ]  = /* translators: three-letter abbreviation of the weekday */ __( 'Thu' );
+		$this->weekday_abbrev[ __( 'Friday' ) ]    = /* translators: three-letter abbreviation of the weekday */ __( 'Fri' );
+		$this->weekday_abbrev[ __( 'Saturday' ) ]  = /* translators: three-letter abbreviation of the weekday */ __( 'Sat' );
 
 		// The Months
 		$this->month['01'] = /* translators: month name */ __( 'January' );
@@ -197,10 +197,10 @@
 		$this->month_abbrev[ __( 'December' ) ]  = /* translators: three-letter abbreviation of the month */ _x( 'Dec', 'December abbreviation' );
 
 		// The Meridiems
-		$this->meridiem['am'] = __('am');
-		$this->meridiem['pm'] = __('pm');
-		$this->meridiem['AM'] = __('AM');
-		$this->meridiem['PM'] = __('PM');
+		$this->meridiem['am'] = __( 'am' );
+		$this->meridiem['pm'] = __( 'pm' );
+		$this->meridiem['AM'] = __( 'AM' );
+		$this->meridiem['PM'] = __( 'PM' );
 
 		// Numbers formatting
 		// See https://secure.php.net/number_format
@@ -224,11 +224,13 @@
 		$this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point;
 
 		// Set text direction.
-		if ( isset( $GLOBALS['text_direction'] ) )
+		if ( isset( $GLOBALS['text_direction'] ) ) {
 			$this->text_direction = $GLOBALS['text_direction'];
-		/* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */
-		elseif ( 'rtl' == _x( 'ltr', 'text direction' ) )
+		} // End if().
+
+		elseif ( 'rtl' == _x( 'ltr', 'text direction' ) ) {
 			$this->text_direction = 'rtl';
+		}
 
 		if ( 'rtl' === $this->text_direction && strpos( get_bloginfo( 'version' ), '-src' ) ) {
 			$this->text_direction = 'ltr';
@@ -260,8 +262,8 @@
 	 * @param int $weekday_number 0 for Sunday through 6 Saturday
 	 * @return string Full translated weekday
 	 */
-	public function get_weekday($weekday_number) {
-		return $this->weekday[$weekday_number];
+	public function get_weekday( $weekday_number ) {
+		return $this->weekday[ $weekday_number ];
 	}
 
 	/**
@@ -278,8 +280,8 @@
 	 * @param string $weekday_name
 	 * @return string
 	 */
-	public function get_weekday_initial($weekday_name) {
-		return $this->weekday_initial[$weekday_name];
+	public function get_weekday_initial( $weekday_name ) {
+		return $this->weekday_initial[ $weekday_name ];
 	}
 
 	/**
@@ -294,8 +296,8 @@
 	 * @param string $weekday_name Full translated weekday word
 	 * @return string Translated weekday abbreviation
 	 */
-	public function get_weekday_abbrev($weekday_name) {
-		return $this->weekday_abbrev[$weekday_name];
+	public function get_weekday_abbrev( $weekday_name ) {
+		return $this->weekday_abbrev[ $weekday_name ];
 	}
 
 	/**
@@ -315,8 +317,8 @@
 	 * @param string|int $month_number '01' through '12'
 	 * @return string Translated full month name
 	 */
-	public function get_month($month_number) {
-		return $this->month[zeroise($month_number, 2)];
+	public function get_month( $month_number ) {
+		return $this->month[ zeroise( $month_number, 2 ) ];
 	}
 
 	/**
@@ -331,8 +333,8 @@
 	 * @param string $month_name Translated month to get abbreviated version
 	 * @return string Translated abbreviated month
 	 */
-	public function get_month_abbrev($month_name) {
-		return $this->month_abbrev[$month_name];
+	public function get_month_abbrev( $month_name ) {
+		return $this->month_abbrev[ $month_name ];
 	}
 
 	/**
@@ -346,8 +348,8 @@
 	 * @param string $meridiem Either 'am', 'pm', 'AM', or 'PM'. Not translated version.
 	 * @return string Translated version
 	 */
-	public function get_meridiem($meridiem) {
-		return $this->meridiem[$meridiem];
+	public function get_meridiem( $meridiem ) {
+		return $this->meridiem[ $meridiem ];
 	}
 
 	/**
Index: src/wp-includes/class-wp-matchesmapregex.php
===================================================================
--- src/wp-includes/class-wp-matchesmapregex.php	(revision 40901)
+++ src/wp-includes/class-wp-matchesmapregex.php	(working copy)
@@ -49,7 +49,7 @@
 	 * @param string $subject subject if regex
 	 * @param array  $matches data to use in map
 	 */
-	public function __construct($subject, $matches) {
+	public function __construct( $subject, $matches ) {
 		$this->_subject = $subject;
 		$this->_matches = $matches;
 		$this->output = $this->_map();
@@ -67,8 +67,8 @@
 	 * @param array  $matches data used for substitution
 	 * @return string
 	 */
-	public static function apply($subject, $matches) {
-		$oSelf = new WP_MatchesMapRegex($subject, $matches);
+	public static function apply( $subject, $matches ) {
+		$oSelf = new WP_MatchesMapRegex( $subject, $matches );
 		return $oSelf->output;
 	}
 
@@ -79,8 +79,8 @@
 	 * @return string
 	 */
 	private function _map() {
-		$callback = array($this, 'callback');
-		return preg_replace_callback($this->_pattern, $callback, $this->_subject);
+		$callback = array( $this, 'callback' );
+		return preg_replace_callback( $this->_pattern, $callback, $this->_subject );
 	}
 
 	/**
@@ -90,8 +90,8 @@
 	 * @param  array $matches preg_replace regexp matches
 	 * @return string
 	 */
-	public function callback($matches) {
-		$index = intval(substr($matches[0], 9, -1));
-		return ( isset( $this->_matches[$index] ) ? urlencode($this->_matches[$index]) : '' );
+	public function callback( $matches ) {
+		$index = intval( substr( $matches[0], 9, -1 ) );
+		return ( isset( $this->_matches[ $index ] ) ? urlencode( $this->_matches[ $index ] ) : '' );
 	}
 }
Index: src/wp-includes/class-wp-meta-query.php
===================================================================
--- src/wp-includes/class-wp-meta-query.php	(revision 40901)
+++ src/wp-includes/class-wp-meta-query.php	(working copy)
@@ -137,8 +137,9 @@
 	 * }
 	 */
 	public function __construct( $meta_query = false ) {
-		if ( !$meta_query )
+		if ( ! $meta_query ) {
 			return;
+		}
 
 		if ( isset( $meta_query['relation'] ) && strtoupper( $meta_query['relation'] ) == 'OR' ) {
 			$this->relation = 'OR';
@@ -174,7 +175,7 @@
 			} elseif ( ! is_array( $query ) ) {
 				continue;
 
-			// First-order clause.
+				// First-order clause.
 			} elseif ( $this->is_first_order_clause( $query ) ) {
 				if ( isset( $query['value'] ) && array() === $query['value'] ) {
 					unset( $query['value'] );
@@ -182,7 +183,7 @@
 
 				$clean_queries[ $key ] = $query;
 
-			// Otherwise, it's a nested query, so we recurse.
+				// Otherwise, it's a nested query, so we recurse.
 			} else {
 				$cleaned_query = $this->sanitize_query( $query );
 
@@ -201,15 +202,15 @@
 			$clean_queries['relation'] = 'OR';
 			$this->has_or_relation = true;
 
-		/*
-		 * If there is only a single clause, call the relation 'OR'.
-		 * This value will not actually be used to join clauses, but it
-		 * simplifies the logic around combining key-only queries.
-		 */
+			/*
+			* If there is only a single clause, call the relation 'OR'.
+			* This value will not actually be used to join clauses, but it
+			* simplifies the logic around combining key-only queries.
+			*/
 		} elseif ( 1 === count( $clean_queries ) ) {
 			$clean_queries['relation'] = 'OR';
 
-		// Default to AND.
+			// Default to AND.
 		} else {
 			$clean_queries['relation'] = 'AND';
 		}
@@ -291,16 +292,19 @@
 	 * @return string MySQL type.
 	 */
 	public function get_cast_for_type( $type = '' ) {
-		if ( empty( $type ) )
+		if ( empty( $type ) ) {
 			return 'CHAR';
+		}
 
 		$meta_type = strtoupper( $type );
 
-		if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) )
+		if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) ) {
 			return 'CHAR';
+		}
 
-		if ( 'NUMERIC' == $meta_type )
+		if ( 'NUMERIC' == $meta_type ) {
 			$meta_type = 'SIGNED';
+		}
 
 		return $meta_type;
 	}
@@ -423,7 +427,7 @@
 
 		$indent = '';
 		for ( $i = 0; $i < $depth; $i++ ) {
-			$indent .= "  ";
+			$indent .= '  ';
 		}
 
 		foreach ( $query as $key => &$clause ) {
@@ -445,7 +449,7 @@
 					}
 
 					$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );
-				// This is a subquery, so we recurse.
+					// This is a subquery, so we recurse.
 				} else {
 					$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );
 
@@ -512,12 +516,23 @@
 		}
 
 		if ( ! in_array( $clause['compare'], array(
-			'=', '!=', '>', '>=', '<', '<=',
-			'LIKE', 'NOT LIKE',
-			'IN', 'NOT IN',
-			'BETWEEN', 'NOT BETWEEN',
-			'EXISTS', 'NOT EXISTS',
-			'REGEXP', 'NOT REGEXP', 'RLIKE'
+			'=',
+			'!=',
+			'>',
+			'>=',
+			'<',
+			'<=',
+			'LIKE',
+			'NOT LIKE',
+			'IN',
+			'NOT IN',
+			'BETWEEN',
+			'NOT BETWEEN',
+			'EXISTS',
+			'NOT EXISTS',
+			'REGEXP',
+			'NOT REGEXP',
+			'RLIKE',
 		) ) ) {
 			$clause['compare'] = '=';
 		}
@@ -539,7 +554,7 @@
 				$join .= $i ? " AS $alias" : '';
 				$join .= $wpdb->prepare( " ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key'] );
 
-			// All other JOIN clauses.
+				// All other JOIN clauses.
 			} else {
 				$join .= " INNER JOIN $this->meta_table";
 				$join .= $i ? " AS $alias" : '';
@@ -640,7 +655,7 @@
 					$sql_chunks['where'][] = "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$where}";
 				}
 			}
-		}
+		}// End if().
 
 		/*
 		 * Multiple WHERE clauses (for meta_key and meta_value) should
@@ -709,7 +724,7 @@
 			if ( 'OR' === $parent_query['relation'] ) {
 				$compatible_compares = array( '=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=' );
 
-			// Clauses joined by AND with "negative" operators share a join only if they also share a key.
+				// Clauses joined by AND with "negative" operators share a join only if they also share a key.
 			} elseif ( isset( $sibling['key'] ) && isset( $clause['key'] ) && $sibling['key'] === $clause['key'] ) {
 				$compatible_compares = array( '!=', 'NOT IN', 'NOT LIKE' );
 			}
@@ -732,7 +747,7 @@
 		 * @param array       $parent_query Parent of $clause.
 		 * @param object      $this         WP_Meta_Query object.
 		 */
-		return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this ) ;
+		return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this );
 	}
 
 	/**
Index: src/wp-includes/class-wp-network-query.php
===================================================================
--- src/wp-includes/class-wp-network-query.php	(revision 40901)
+++ src/wp-includes/class-wp-network-query.php	(working copy)
@@ -99,25 +99,25 @@
 	 *
 	 *     @type array        $network__in          Array of network IDs to include. Default empty.
 	 *     @type array        $network__not_in      Array of network IDs to exclude. Default empty.
- 	 *     @type bool         $count                Whether to return a network count (true) or array of network objects.
- 	 *                                              Default false.
- 	 *     @type string       $fields               Network fields to return. Accepts 'ids' (returns an array of network IDs)
- 	 *                                              or empty (returns an array of complete network objects). Default empty.
- 	 *     @type int          $number               Maximum number of networks to retrieve. Default empty (no limit).
- 	 *     @type int          $offset               Number of networks to offset the query. Used to build LIMIT clause.
- 	 *                                              Default 0.
- 	 *     @type bool         $no_found_rows        Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true.
- 	 *     @type string|array $orderby              Network status or array of statuses. Accepts 'id', 'domain', 'path',
- 	 *                                              'domain_length', 'path_length' and 'network__in'. Also accepts false,
- 	 *                                              an empty array, or 'none' to disable `ORDER BY` clause. Default 'id'.
- 	 *     @type string       $order                How to order retrieved networks. Accepts 'ASC', 'DESC'. Default 'ASC'.
- 	 *     @type string       $domain               Limit results to those affiliated with a given domain. Default empty.
- 	 *     @type array        $domain__in           Array of domains to include affiliated networks for. Default empty.
- 	 *     @type array        $domain__not_in       Array of domains to exclude affiliated networks for. Default empty.
- 	 *     @type string       $path                 Limit results to those affiliated with a given path. Default empty.
- 	 *     @type array        $path__in             Array of paths to include affiliated networks for. Default empty.
- 	 *     @type array        $path__not_in         Array of paths to exclude affiliated networks for. Default empty.
- 	 *     @type string       $search               Search term(s) to retrieve matching networks for. Default empty.
+	  *     @type bool         $count                Whether to return a network count (true) or array of network objects.
+	  *                                              Default false.
+	  *     @type string       $fields               Network fields to return. Accepts 'ids' (returns an array of network IDs)
+	  *                                              or empty (returns an array of complete network objects). Default empty.
+	  *     @type int          $number               Maximum number of networks to retrieve. Default empty (no limit).
+	  *     @type int          $offset               Number of networks to offset the query. Used to build LIMIT clause.
+	  *                                              Default 0.
+	  *     @type bool         $no_found_rows        Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true.
+	  *     @type string|array $orderby              Network status or array of statuses. Accepts 'id', 'domain', 'path',
+	  *                                              'domain_length', 'path_length' and 'network__in'. Also accepts false,
+	  *                                              an empty array, or 'none' to disable `ORDER BY` clause. Default 'id'.
+	  *     @type string       $order                How to order retrieved networks. Accepts 'ASC', 'DESC'. Default 'ASC'.
+	  *     @type string       $domain               Limit results to those affiliated with a given domain. Default empty.
+	  *     @type array        $domain__in           Array of domains to include affiliated networks for. Default empty.
+	  *     @type array        $domain__not_in       Array of domains to exclude affiliated networks for. Default empty.
+	  *     @type string       $path                 Limit results to those affiliated with a given path. Default empty.
+	  *     @type array        $path__in             Array of paths to include affiliated networks for. Default empty.
+	  *     @type array        $path__not_in         Array of paths to exclude affiliated networks for. Default empty.
+	  *     @type string       $search               Search term(s) to retrieve matching networks for. Default empty.
 	 *     @type bool         $update_network_cache Whether to prime the cache for found networks. Default true.
 	 * }
 	 */
@@ -327,7 +327,7 @@
 			$orderby = implode( ', ', $orderby_array );
 		} else {
 			$orderby = "$wpdb->site.id $order";
-		}
+		}// End if().
 
 		$number = absint( $this->query_vars['number'] );
 		$offset = absint( $this->query_vars['offset'] );
Index: src/wp-includes/class-wp-network.php
===================================================================
--- src/wp-includes/class-wp-network.php	(revision 40901)
+++ src/wp-includes/class-wp-network.php	(working copy)
@@ -133,7 +133,7 @@
 	 * @param WP_Network|object $network A network object.
 	 */
 	public function __construct( $network ) {
-		foreach( get_object_vars( $network ) as $key => $value ) {
+		foreach ( get_object_vars( $network ) as $key => $value ) {
 			$this->$key = $value;
 		}
 
@@ -298,7 +298,7 @@
 					'count'        => true,
 					'path__not_in' => '/',
 				) );
-				wp_cache_add( 'networks_have_paths', $using_paths, 'site-options'  );
+				wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' );
 			}
 		}
 
Index: src/wp-includes/class-wp-oembed-controller.php
===================================================================
--- src/wp-includes/class-wp-oembed-controller.php	(revision 40901)
+++ src/wp-includes/class-wp-oembed-controller.php	(working copy)
@@ -122,7 +122,9 @@
 		$data = get_oembed_response_data( $post_id, $request['maxwidth'] );
 
 		if ( ! $data ) {
-			return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) );
+			return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array(
+				'status' => 404,
+			) );
 		}
 
 		return $data;
@@ -138,7 +140,9 @@
 	 */
 	public function get_proxy_item_permissions_check() {
 		if ( ! current_user_can( 'edit_posts' ) ) {
-			return new WP_Error( 'rest_forbidden', __( 'Sorry, you are not allowed to make proxied oEmbed requests.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_forbidden', __( 'Sorry, you are not allowed to make proxied oEmbed requests.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 		return true;
 	}
@@ -171,7 +175,9 @@
 		$data = _wp_oembed_get_object()->get_data( $url, $args );
 
 		if ( false === $data ) {
-			return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) );
+			return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array(
+				'status' => 404,
+			) );
 		}
 
 		/**
Index: src/wp-includes/class-wp-post.php
===================================================================
--- src/wp-includes/class-wp-post.php	(revision 40901)
+++ src/wp-includes/class-wp-post.php	(working copy)
@@ -220,8 +220,9 @@
 		if ( ! $_post ) {
 			$_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post_id ) );
 
-			if ( ! $_post )
+			if ( ! $_post ) {
 				return false;
+			}
 
 			$_post = sanitize_post( $_post, 'raw' );
 			wp_cache_add( $_post->ID, $_post, 'posts' );
@@ -238,8 +239,9 @@
 	 * @param WP_Post|object $post Post object.
 	 */
 	public function __construct( $post ) {
-		foreach ( get_object_vars( $post ) as $key => $value )
+		foreach ( get_object_vars( $post ) as $key => $value ) {
 			$this->$key = $value;
+		}
 	}
 
 	/**
@@ -249,17 +251,21 @@
 	 * @return bool
 	 */
 	public function __isset( $key ) {
-		if ( 'ancestors' == $key )
+		if ( 'ancestors' == $key ) {
 			return true;
+		}
 
-		if ( 'page_template' == $key )
+		if ( 'page_template' == $key ) {
 			return true;
+		}
 
-		if ( 'post_category' == $key )
-		   return true;
+		if ( 'post_category' == $key ) {
+			return true;
+		}
 
-		if ( 'tags_input' == $key )
-		   return true;
+		if ( 'tags_input' == $key ) {
+			return true;
+		}
 
 		return metadata_exists( 'post', $this->ID, $key );
 	}
@@ -276,33 +282,38 @@
 		}
 
 		if ( 'post_category' == $key ) {
-			if ( is_object_in_taxonomy( $this->post_type, 'category' ) )
+			if ( is_object_in_taxonomy( $this->post_type, 'category' ) ) {
 				$terms = get_the_terms( $this, 'category' );
+			}
 
-			if ( empty( $terms ) )
+			if ( empty( $terms ) ) {
 				return array();
+			}
 
 			return wp_list_pluck( $terms, 'term_id' );
 		}
 
 		if ( 'tags_input' == $key ) {
-			if ( is_object_in_taxonomy( $this->post_type, 'post_tag' ) )
+			if ( is_object_in_taxonomy( $this->post_type, 'post_tag' ) ) {
 				$terms = get_the_terms( $this, 'post_tag' );
+			}
 
-			if ( empty( $terms ) )
+			if ( empty( $terms ) ) {
 				return array();
+			}
 
 			return wp_list_pluck( $terms, 'name' );
 		}
 
 		// Rest of the values need filtering.
-		if ( 'ancestors' == $key )
+		if ( 'ancestors' == $key ) {
 			$value = get_post_ancestors( $this );
-		else
-			$value = get_post_meta( $this->ID, $key, true );
+		} else { $value = get_post_meta( $this->ID, $key, true );
+		}
 
-		if ( $this->filter )
+		if ( $this->filter ) {
 			$value = sanitize_post_field( $key, $value, $this->ID, $this->filter );
+		}
 
 		return $value;
 	}
@@ -314,11 +325,13 @@
 	 * @return self|array|bool|object|WP_Post
 	 */
 	public function filter( $filter ) {
-		if ( $this->filter == $filter )
+		if ( $this->filter == $filter ) {
 			return $this;
+		}
 
-		if ( $filter == 'raw' )
+		if ( $filter == 'raw' ) {
 			return self::get_instance( $this->ID );
+		}
 
 		return sanitize_post( $this, $filter );
 	}
@@ -332,8 +345,9 @@
 		$post = get_object_vars( $this );
 
 		foreach ( array( 'ancestors', 'page_template', 'post_category', 'tags_input' ) as $key ) {
-			if ( $this->__isset( $key ) )
+			if ( $this->__isset( $key ) ) {
 				$post[ $key ] = $this->__get( $key );
+			}
 		}
 
 		return $post;
Index: src/wp-includes/class-wp-query.php
===================================================================
--- src/wp-includes/class-wp-query.php	(revision 40901)
+++ src/wp-includes/class-wp-query.php	(working copy)
@@ -472,7 +472,7 @@
 	 * @access public
 	 * @var bool
 	 */
-	 public $thumbnails_cached = false;
+	public $thumbnails_cached = false;
 
 	/**
 	 * Cached list of search stopwords.
@@ -530,11 +530,11 @@
 	 * @access public
 	 */
 	public function init() {
-		unset($this->posts);
-		unset($this->query);
+		unset( $this->posts );
+		unset( $this->query );
 		$this->query_vars = array();
-		unset($this->queried_object);
-		unset($this->queried_object_id);
+		unset( $this->queried_object );
+		unset( $this->queried_object_id );
 		$this->post_count = 0;
 		$this->current_post = -1;
 		$this->in_the_loop = false;
@@ -571,59 +571,75 @@
 	 * @param array $array Defined query variables.
 	 * @return array Complete query variables with undefined ones filled in empty.
 	 */
-	public function fill_query_vars($array) {
+	public function fill_query_vars( $array ) {
 		$keys = array(
-			'error'
-			, 'm'
-			, 'p'
-			, 'post_parent'
-			, 'subpost'
-			, 'subpost_id'
-			, 'attachment'
-			, 'attachment_id'
-			, 'name'
-			, 'static'
-			, 'pagename'
-			, 'page_id'
-			, 'second'
-			, 'minute'
-			, 'hour'
-			, 'day'
-			, 'monthnum'
-			, 'year'
-			, 'w'
-			, 'category_name'
-			, 'tag'
-			, 'cat'
-			, 'tag_id'
-			, 'author'
-			, 'author_name'
-			, 'feed'
-			, 'tb'
-			, 'paged'
-			, 'meta_key'
-			, 'meta_value'
-			, 'preview'
-			, 's'
-			, 'sentence'
-			, 'title'
-			, 'fields'
-			, 'menu_order'
-			, 'embed'
+			'error',
+		'm',
+		'p',
+		'post_parent',
+		'subpost',
+		'subpost_id',
+		'attachment',
+		'attachment_id',
+		'name',
+		'static',
+		'pagename',
+		'page_id',
+		'second',
+		'minute',
+		'hour',
+		'day',
+		'monthnum',
+		'year',
+		'w',
+		'category_name',
+		'tag',
+		'cat',
+		'tag_id',
+		'author',
+		'author_name',
+		'feed',
+		'tb',
+		'paged',
+		'meta_key',
+		'meta_value',
+		'preview',
+		's',
+		'sentence',
+		'title',
+		'fields',
+		'menu_order',
+		'embed',
 		);
 
 		foreach ( $keys as $key ) {
-			if ( !isset($array[$key]) )
-				$array[$key] = '';
+			if ( ! isset( $array[ $key ] ) ) {
+				$array[ $key ] = '';
+			}
 		}
 
-		$array_keys = array( 'category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in', 'post_name__in',
-			'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'post_parent__in', 'post_parent__not_in',
-			'author__in', 'author__not_in' );
+		$array_keys = array(
+		'category__in',
+		'category__not_in',
+		'category__and',
+		'post__in',
+		'post__not_in',
+		'post_name__in',
+			'tag__in',
+		'tag__not_in',
+		'tag__and',
+		'tag_slug__in',
+		'tag_slug__and',
+		'post_parent__in',
+		'post_parent__not_in',
+			'author__in',
+		'author__not_in',
+		);
 
 		foreach ( $array_keys as $key ) {
-			if ( !isset($array[$key]) )
-				$array[$key] = array();
+			if ( ! isset( $array[ $key ] ) ) {
+				$array[ $key ] = array();
+			}
 		}
 		return $array;
 	}
@@ -750,7 +766,7 @@
 	 *     @type int          $year                    The four-digit year. Default empty. Accepts any four-digit year.
 	 * }
 	 */
-	public function parse_query( $query =  '' ) {
+	public function parse_query( $query = '' ) {
 		if ( ! empty( $query ) ) {
 			$this->init();
 			$this->query = $this->query_vars = wp_parse_args( $query );
@@ -758,12 +774,13 @@
 			$this->query = $this->query_vars;
 		}
 
-		$this->query_vars = $this->fill_query_vars($this->query_vars);
+		$this->query_vars = $this->fill_query_vars( $this->query_vars );
 		$qv = &$this->query_vars;
 		$this->query_vars_changed = true;
 
-		if ( ! empty($qv['robots']) )
+		if ( ! empty( $qv['robots'] ) ) {
 			$this->is_robots = true;
+		}
 
 		if ( ! is_scalar( $qv['p'] ) || $qv['p'] < 0 ) {
 			$qv['p'] = 0;
@@ -772,22 +789,26 @@
 			$qv['p'] = intval( $qv['p'] );
 		}
 
-		$qv['page_id'] =  absint($qv['page_id']);
-		$qv['year'] = absint($qv['year']);
-		$qv['monthnum'] = absint($qv['monthnum']);
-		$qv['day'] = absint($qv['day']);
-		$qv['w'] = absint($qv['w']);
+		$qv['page_id'] = absint( $qv['page_id'] );
+		$qv['year'] = absint( $qv['year'] );
+		$qv['monthnum'] = absint( $qv['monthnum'] );
+		$qv['day'] = absint( $qv['day'] );
+		$qv['w'] = absint( $qv['w'] );
 		$qv['m'] = is_scalar( $qv['m'] ) ? preg_replace( '|[^0-9]|', '', $qv['m'] ) : '';
-		$qv['paged'] = absint($qv['paged']);
+		$qv['paged'] = absint( $qv['paged'] );
 		$qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers
 		$qv['author'] = preg_replace( '|[^0-9,-]|', '', $qv['author'] ); // comma separated list of positive or negative integers
 		$qv['pagename'] = trim( $qv['pagename'] );
 		$qv['name'] = trim( $qv['name'] );
 		$qv['title'] = trim( $qv['title'] );
-		if ( '' !== $qv['hour'] ) $qv['hour'] = absint($qv['hour']);
-		if ( '' !== $qv['minute'] ) $qv['minute'] = absint($qv['minute']);
-		if ( '' !== $qv['second'] ) $qv['second'] = absint($qv['second']);
-		if ( '' !== $qv['menu_order'] ) $qv['menu_order'] = absint($qv['menu_order']);
+		if ( '' !== $qv['hour'] ) { $qv['hour'] = absint( $qv['hour'] );
+		}
+		if ( '' !== $qv['minute'] ) { $qv['minute'] = absint( $qv['minute'] );
+		}
+		if ( '' !== $qv['second'] ) { $qv['second'] = absint( $qv['second'] );
+		}
+		if ( '' !== $qv['menu_order'] ) { $qv['menu_order'] = absint( $qv['menu_order'] );
+		}
 
 		// Fairly insane upper bound for search string lengths.
 		if ( ! is_scalar( $qv['s'] ) || ( ! empty( $qv['s'] ) && strlen( $qv['s'] ) > 1600 ) ) {
@@ -795,14 +816,16 @@
 		}
 
 		// Compat. Map subpost to attachment.
-		if ( '' != $qv['subpost'] )
+		if ( '' != $qv['subpost'] ) {
 			$qv['attachment'] = $qv['subpost'];
-		if ( '' != $qv['subpost_id'] )
+		}
+		if ( '' != $qv['subpost_id'] ) {
 			$qv['attachment_id'] = $qv['subpost_id'];
+		}
 
-		$qv['attachment_id'] = absint($qv['attachment_id']);
+		$qv['attachment_id'] = absint( $qv['attachment_id'] );
 
-		if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) {
+		if ( ('' != $qv['attachment']) || ! empty( $qv['attachment_id'] ) ) {
 			$this->is_single = true;
 			$this->is_attachment = true;
 		} elseif ( '' != $qv['name'] ) {
@@ -813,7 +836,7 @@
 			// If year, month, day, hour, minute, and second are set, a single
 			// post is being queried.
 			$this->is_single = true;
-		} elseif ( '' != $qv['static'] || '' != $qv['pagename'] || !empty($qv['page_id']) ) {
+		} elseif ( '' != $qv['static'] || '' != $qv['pagename'] || ! empty( $qv['page_id'] ) ) {
 			$this->is_page = true;
 			$this->is_single = false;
 		} else {
@@ -870,7 +893,7 @@
 
 			if ( $qv['m'] ) {
 				$this->is_date = true;
-				if ( strlen($qv['m']) > 9 ) {
+				if ( strlen( $qv['m'] ) > 9 ) {
 					$this->is_time = true;
 				} elseif ( strlen( $qv['m'] ) > 7 ) {
 					$this->is_day = true;
@@ -908,75 +931,86 @@
 			}
 			unset( $tax_query );
 
-			if ( empty($qv['author']) || ($qv['author'] == '0') ) {
+			if ( empty( $qv['author'] ) || ($qv['author'] == '0') ) {
 				$this->is_author = false;
 			} else {
 				$this->is_author = true;
 			}
 
-			if ( '' != $qv['author_name'] )
+			if ( '' != $qv['author_name'] ) {
 				$this->is_author = true;
+			}
 
-			if ( !empty( $qv['post_type'] ) && ! is_array( $qv['post_type'] ) ) {
+			if ( ! empty( $qv['post_type'] ) && ! is_array( $qv['post_type'] ) ) {
 				$post_type_obj = get_post_type_object( $qv['post_type'] );
-				if ( ! empty( $post_type_obj->has_archive ) )
+				if ( ! empty( $post_type_obj->has_archive ) ) {
 					$this->is_post_type_archive = true;
+				}
 			}
 
-			if ( $this->is_post_type_archive || $this->is_date || $this->is_author || $this->is_category || $this->is_tag || $this->is_tax )
+			if ( $this->is_post_type_archive || $this->is_date || $this->is_author || $this->is_category || $this->is_tag || $this->is_tax ) {
 				$this->is_archive = true;
-		}
+			}
+		}// End if().
 
-		if ( '' != $qv['feed'] )
+		if ( '' != $qv['feed'] ) {
 			$this->is_feed = true;
+		}
 
 		if ( '' != $qv['embed'] ) {
 			$this->is_embed = true;
 		}
 
-		if ( '' != $qv['tb'] )
+		if ( '' != $qv['tb'] ) {
 			$this->is_trackback = true;
+		}
 
-		if ( '' != $qv['paged'] && ( intval($qv['paged']) > 1 ) )
+		if ( '' != $qv['paged'] && ( intval( $qv['paged'] ) > 1 ) ) {
 			$this->is_paged = true;
+		}
 
 		// if we're previewing inside the write screen
-		if ( '' != $qv['preview'] )
+		if ( '' != $qv['preview'] ) {
 			$this->is_preview = true;
+		}
 
-		if ( is_admin() )
+		if ( is_admin() ) {
 			$this->is_admin = true;
+		}
 
-		if ( false !== strpos($qv['feed'], 'comments-') ) {
-			$qv['feed'] = str_replace('comments-', '', $qv['feed']);
+		if ( false !== strpos( $qv['feed'], 'comments-' ) ) {
+			$qv['feed'] = str_replace( 'comments-', '', $qv['feed'] );
 			$qv['withcomments'] = 1;
 		}
 
 		$this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;
 
-		if ( $this->is_feed && ( !empty($qv['withcomments']) || ( empty($qv['withoutcomments']) && $this->is_singular ) ) )
+		if ( $this->is_feed && ( ! empty( $qv['withcomments'] ) || ( empty( $qv['withoutcomments'] ) && $this->is_singular ) ) ) {
 			$this->is_comment_feed = true;
+		}
 
-		if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots ) )
+		if ( ! ( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots ) ) {
 			$this->is_home = true;
+		}
 
 		// Correct is_* for page_on_front and page_for_posts
-		if ( $this->is_home && 'page' == get_option('show_on_front') && get_option('page_on_front') ) {
-			$_query = wp_parse_args($this->query);
+		if ( $this->is_home && 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) ) {
+			$_query = wp_parse_args( $this->query );
 			// pagename can be set and empty depending on matched rewrite rules. Ignore an empty pagename.
-			if ( isset($_query['pagename']) && '' == $_query['pagename'] )
-				unset($_query['pagename']);
+			if ( isset( $_query['pagename'] ) && '' == $_query['pagename'] ) {
+				unset( $_query['pagename'] );
+			}
 
 			unset( $_query['embed'] );
 
-			if ( empty($_query) || !array_diff( array_keys($_query), array('preview', 'page', 'paged', 'cpage') ) ) {
+			if ( empty( $_query ) || ! array_diff( array_keys( $_query ), array( 'preview', 'page', 'paged', 'cpage' ) ) ) {
 				$this->is_page = true;
 				$this->is_home = false;
-				$qv['page_id'] = get_option('page_on_front');
+				$qv['page_id'] = get_option( 'page_on_front' );
 				// Correct <!--nextpage--> for page_on_front
-				if ( !empty($qv['paged']) ) {
+				if ( ! empty( $qv['paged'] ) ) {
 					$qv['page'] = $qv['paged'];
-					unset($qv['paged']);
+					unset( $qv['paged'] );
 				}
 			}
 		}
@@ -985,7 +1019,7 @@
 			$this->queried_object = get_page_by_path( $qv['pagename'] );
 
 			if ( $this->queried_object && 'attachment' == $this->queried_object->post_type ) {
-				if ( preg_match( "/^[^%]*%(?:postname)%/", get_option( 'permalink_structure' ) ) ) {
+				if ( preg_match( '/^[^%]*%(?:postname)%/', get_option( 'permalink_structure' ) ) ) {
 					// See if we also have a post with the same slug
 					$post = get_page_by_path( $qv['pagename'], OBJECT, 'post' );
 					if ( $post ) {
@@ -1002,7 +1036,7 @@
 				unset( $this->queried_object );
 			}
 
-			if  ( 'page' == get_option('show_on_front') && isset($this->queried_object_id) && $this->queried_object_id == get_option('page_for_posts') ) {
+			if ( 'page' == get_option( 'show_on_front' ) && isset( $this->queried_object_id ) && $this->queried_object_id == get_option( 'page_for_posts' ) ) {
 				$this->is_page = false;
 				$this->is_home = true;
 				$this->is_posts_page = true;
@@ -1010,35 +1044,37 @@
 		}
 
 		if ( $qv['page_id'] ) {
-			if  ( 'page' == get_option('show_on_front') && $qv['page_id'] == get_option('page_for_posts') ) {
+			if ( 'page' == get_option( 'show_on_front' ) && $qv['page_id'] == get_option( 'page_for_posts' ) ) {
 				$this->is_page = false;
 				$this->is_home = true;
 				$this->is_posts_page = true;
 			}
 		}
 
-		if ( !empty($qv['post_type']) ) {
-			if ( is_array($qv['post_type']) )
-				$qv['post_type'] = array_map('sanitize_key', $qv['post_type']);
-			else
-				$qv['post_type'] = sanitize_key($qv['post_type']);
+		if ( ! empty( $qv['post_type'] ) ) {
+			if ( is_array( $qv['post_type'] ) ) {
+				$qv['post_type'] = array_map( 'sanitize_key', $qv['post_type'] );
+			} else { $qv['post_type'] = sanitize_key( $qv['post_type'] );
+			}
 		}
 
 		if ( ! empty( $qv['post_status'] ) ) {
-			if ( is_array( $qv['post_status'] ) )
-				$qv['post_status'] = array_map('sanitize_key', $qv['post_status']);
-			else
-				$qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']);
+			if ( is_array( $qv['post_status'] ) ) {
+				$qv['post_status'] = array_map( 'sanitize_key', $qv['post_status'] );
+			} else { $qv['post_status'] = preg_replace( '|[^a-z0-9_,-]|', '', $qv['post_status'] );
+			}
 		}
 
-		if ( $this->is_posts_page && ( ! isset($qv['withcomments']) || ! $qv['withcomments'] ) )
+		if ( $this->is_posts_page && ( ! isset( $qv['withcomments'] ) || ! $qv['withcomments'] ) ) {
 			$this->is_comment_feed = false;
+		}
 
 		$this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;
 		// Done correcting is_* for page_on_front and page_for_posts
 
-		if ( '404' == $qv['error'] )
+		if ( '404' == $qv['error'] ) {
 			$this->set_404();
+		}
 
 		$this->is_embed = $this->is_embed && ( $this->is_singular || $this->is_404 );
 
@@ -1072,7 +1108,7 @@
 			$tax_query = array();
 		}
 
-		if ( !empty($q['taxonomy']) && !empty($q['term']) ) {
+		if ( ! empty( $q['taxonomy'] ) && ! empty( $q['term'] ) ) {
 			$tax_query[] = array(
 				'taxonomy' => $q['taxonomy'],
 				'terms' => array( $q['term'] ),
@@ -1081,35 +1117,36 @@
 		}
 
 		foreach ( get_taxonomies( array() , 'objects' ) as $taxonomy => $t ) {
-			if ( 'post_tag' == $taxonomy )
+			if ( 'post_tag' == $taxonomy ) {
 				continue;	// Handled further down in the $q['tag'] block
+			}
 
-			if ( $t->query_var && !empty( $q[$t->query_var] ) ) {
+			if ( $t->query_var && ! empty( $q[ $t->query_var ] ) ) {
 				$tax_query_defaults = array(
 					'taxonomy' => $taxonomy,
 					'field' => 'slug',
 				);
 
- 				if ( isset( $t->rewrite['hierarchical'] ) && $t->rewrite['hierarchical'] ) {
-					$q[$t->query_var] = wp_basename( $q[$t->query_var] );
+				if ( isset( $t->rewrite['hierarchical'] ) && $t->rewrite['hierarchical'] ) {
+					$q[ $t->query_var ] = wp_basename( $q[ $t->query_var ] );
 				}
 
-				$term = $q[$t->query_var];
+				$term = $q[ $t->query_var ];
 
 				if ( is_array( $term ) ) {
 					$term = implode( ',', $term );
 				}
 
-				if ( strpos($term, '+') !== false ) {
+				if ( strpos( $term, '+' ) !== false ) {
 					$terms = preg_split( '/[+]+/', $term );
 					foreach ( $terms as $term ) {
 						$tax_query[] = array_merge( $tax_query_defaults, array(
-							'terms' => array( $term )
+							'terms' => array( $term ),
 						) );
 					}
 				} else {
 					$tax_query[] = array_merge( $tax_query_defaults, array(
-						'terms' => preg_split( '/[,]+/', $term )
+						'terms' => preg_split( '/[,]+/', $term ),
 					) );
 				}
 			}
@@ -1129,10 +1166,11 @@
 			$q['cat'] = implode( ',', $cat_array );
 
 			foreach ( $cat_array as $cat ) {
-				if ( $cat > 0 )
+				if ( $cat > 0 ) {
 					$cat_in[] = $cat;
-				elseif ( $cat < 0 )
+				} elseif ( $cat < 0 ) {
 					$cat_not_in[] = abs( $cat );
+				}
 			}
 
 			if ( ! empty( $cat_in ) ) {
@@ -1140,7 +1178,7 @@
 					'taxonomy' => 'category',
 					'terms' => $cat_in,
 					'field' => 'term_id',
-					'include_children' => true
+					'include_children' => true,
 				);
 			}
 
@@ -1150,7 +1188,7 @@
 					'terms' => $cat_not_in,
 					'field' => 'term_id',
 					'operator' => 'NOT IN',
-					'include_children' => true
+					'include_children' => true,
 				);
 			}
 			unset( $cat_array, $cat_in, $cat_not_in );
@@ -1158,8 +1196,9 @@
 
 		if ( ! empty( $q['category__and'] ) && 1 === count( (array) $q['category__and'] ) ) {
 			$q['category__and'] = (array) $q['category__and'];
-			if ( ! isset( $q['category__in'] ) )
+			if ( ! isset( $q['category__in'] ) ) {
 				$q['category__in'] = array();
+			}
 			$q['category__in'][] = absint( reset( $q['category__and'] ) );
 			unset( $q['category__and'] );
 		}
@@ -1170,28 +1209,28 @@
 				'taxonomy' => 'category',
 				'terms' => $q['category__in'],
 				'field' => 'term_id',
-				'include_children' => false
+				'include_children' => false,
 			);
 		}
 
-		if ( ! empty($q['category__not_in']) ) {
+		if ( ! empty( $q['category__not_in'] ) ) {
 			$q['category__not_in'] = array_map( 'absint', array_unique( (array) $q['category__not_in'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'category',
 				'terms' => $q['category__not_in'],
 				'operator' => 'NOT IN',
-				'include_children' => false
+				'include_children' => false,
 			);
 		}
 
-		if ( ! empty($q['category__and']) ) {
+		if ( ! empty( $q['category__and'] ) ) {
 			$q['category__and'] = array_map( 'absint', array_unique( (array) $q['category__and'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'category',
 				'terms' => $q['category__and'],
 				'field' => 'term_id',
 				'operator' => 'AND',
-				'include_children' => false
+				'include_children' => false,
 			);
 		}
 
@@ -1201,75 +1240,75 @@
 		}
 
 		// Tag stuff
-		if ( '' != $q['tag'] && !$this->is_singular && $this->query_vars_changed ) {
-			if ( strpos($q['tag'], ',') !== false ) {
-				$tags = preg_split('/[,\r\n\t ]+/', $q['tag']);
+		if ( '' != $q['tag'] && ! $this->is_singular && $this->query_vars_changed ) {
+			if ( strpos( $q['tag'], ',' ) !== false ) {
+				$tags = preg_split( '/[,\r\n\t ]+/', $q['tag'] );
 				foreach ( (array) $tags as $tag ) {
-					$tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
+					$tag = sanitize_term_field( 'slug', $tag, 0, 'post_tag', 'db' );
 					$q['tag_slug__in'][] = $tag;
 				}
-			} elseif ( preg_match('/[+\r\n\t ]+/', $q['tag'] ) || ! empty( $q['cat'] ) ) {
-				$tags = preg_split('/[+\r\n\t ]+/', $q['tag']);
+			} elseif ( preg_match( '/[+\r\n\t ]+/', $q['tag'] ) || ! empty( $q['cat'] ) ) {
+				$tags = preg_split( '/[+\r\n\t ]+/', $q['tag'] );
 				foreach ( (array) $tags as $tag ) {
-					$tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
+					$tag = sanitize_term_field( 'slug', $tag, 0, 'post_tag', 'db' );
 					$q['tag_slug__and'][] = $tag;
 				}
 			} else {
-				$q['tag'] = sanitize_term_field('slug', $q['tag'], 0, 'post_tag', 'db');
+				$q['tag'] = sanitize_term_field( 'slug', $q['tag'], 0, 'post_tag', 'db' );
 				$q['tag_slug__in'][] = $q['tag'];
 			}
 		}
 
-		if ( !empty($q['tag_id']) ) {
+		if ( ! empty( $q['tag_id'] ) ) {
 			$q['tag_id'] = absint( $q['tag_id'] );
 			$tax_query[] = array(
 				'taxonomy' => 'post_tag',
-				'terms' => $q['tag_id']
+				'terms' => $q['tag_id'],
 			);
 		}
 
-		if ( !empty($q['tag__in']) ) {
-			$q['tag__in'] = array_map('absint', array_unique( (array) $q['tag__in'] ) );
+		if ( ! empty( $q['tag__in'] ) ) {
+			$q['tag__in'] = array_map( 'absint', array_unique( (array) $q['tag__in'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'post_tag',
-				'terms' => $q['tag__in']
+				'terms' => $q['tag__in'],
 			);
 		}
 
-		if ( !empty($q['tag__not_in']) ) {
-			$q['tag__not_in'] = array_map('absint', array_unique( (array) $q['tag__not_in'] ) );
+		if ( ! empty( $q['tag__not_in'] ) ) {
+			$q['tag__not_in'] = array_map( 'absint', array_unique( (array) $q['tag__not_in'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'post_tag',
 				'terms' => $q['tag__not_in'],
-				'operator' => 'NOT IN'
+				'operator' => 'NOT IN',
 			);
 		}
 
-		if ( !empty($q['tag__and']) ) {
-			$q['tag__and'] = array_map('absint', array_unique( (array) $q['tag__and'] ) );
+		if ( ! empty( $q['tag__and'] ) ) {
+			$q['tag__and'] = array_map( 'absint', array_unique( (array) $q['tag__and'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'post_tag',
 				'terms' => $q['tag__and'],
-				'operator' => 'AND'
+				'operator' => 'AND',
 			);
 		}
 
-		if ( !empty($q['tag_slug__in']) ) {
-			$q['tag_slug__in'] = array_map('sanitize_title_for_query', array_unique( (array) $q['tag_slug__in'] ) );
+		if ( ! empty( $q['tag_slug__in'] ) ) {
+			$q['tag_slug__in'] = array_map( 'sanitize_title_for_query', array_unique( (array) $q['tag_slug__in'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'post_tag',
 				'terms' => $q['tag_slug__in'],
-				'field' => 'slug'
+				'field' => 'slug',
 			);
 		}
 
-		if ( !empty($q['tag_slug__and']) ) {
-			$q['tag_slug__and'] = array_map('sanitize_title_for_query', array_unique( (array) $q['tag_slug__and'] ) );
+		if ( ! empty( $q['tag_slug__and'] ) ) {
+			$q['tag_slug__and'] = array_map( 'sanitize_title_for_query', array_unique( (array) $q['tag_slug__and'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'post_tag',
 				'terms' => $q['tag_slug__and'],
 				'field' => 'slug',
-				'operator' => 'AND'
+				'operator' => 'AND',
 			);
 		}
 
@@ -1300,8 +1339,9 @@
 
 		// added slashes screw with quote grouping when done early, so done later
 		$q['s'] = stripslashes( $q['s'] );
-		if ( empty( $_GET['s'] ) && $this->is_main_query() )
+		if ( empty( $_GET['s'] ) && $this->is_main_query() ) {
 			$q['s'] = urldecode( $q['s'] );
+		}
 		// there are no line breaks in <input /> fields
 		$q['s'] = str_replace( array( "\r", "\n" ), '', $q['s'] );
 		$q['search_terms_count'] = 1;
@@ -1312,8 +1352,9 @@
 				$q['search_terms_count'] = count( $matches[0] );
 				$q['search_terms'] = $this->parse_search_terms( $matches[0] );
 				// if the search string has only short terms or stopwords, or is 10+ terms long, match it as sentence
-				if ( empty( $q['search_terms'] ) || count( $q['search_terms'] ) > 9 )
+				if ( empty( $q['search_terms'] ) || count( $q['search_terms'] ) > 9 ) {
 					$q['search_terms'] = array( $q['s'] );
+				}
 			} else {
 				$q['search_terms'] = array( $q['s'] );
 			}
@@ -1385,17 +1426,19 @@
 
 		foreach ( $terms as $term ) {
 			// keep before/after spaces when term is for exact match
-			if ( preg_match( '/^".+"$/', $term ) )
+			if ( preg_match( '/^".+"$/', $term ) ) {
 				$term = trim( $term, "\"'" );
-			else
-				$term = trim( $term, "\"' " );
+			} else { $term = trim( $term, "\"' " );
+			}
 
 			// Avoid single A-Z and single dashes.
-			if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z\-]$/i', $term ) ) )
+			if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z\-]$/i', $term ) ) ) {
 				continue;
+			}
 
-			if ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) )
+			if ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) ) {
 				continue;
+			}
 
 			$checked[] = $term;
 		}
@@ -1411,21 +1454,23 @@
 	 * @return array Stopwords.
 	 */
 	protected function get_search_stopwords() {
-		if ( isset( $this->stopwords ) )
+		if ( isset( $this->stopwords ) ) {
 			return $this->stopwords;
+		}
 
 		/* translators: This is a comma-separated list of very common words that should be excluded from a search,
 		 * like a, an, and the. These are usually called "stopwords". You should not simply translate these individual
 		 * words into your language. Instead, look for and provide commonly accepted stopwords in your language.
 		 */
 		$words = explode( ',', _x( 'about,an,are,as,at,be,by,com,for,from,how,in,is,it,of,on,or,that,the,this,to,was,what,when,where,who,will,with,www',
-			'Comma-separated list of search stopwords in your language' ) );
+		'Comma-separated list of search stopwords in your language' ) );
 
 		$stopwords = array();
 		foreach ( $words as $word ) {
 			$word = trim( $word, "\r\n\t " );
-			if ( $word )
+			if ( $word ) {
 				$stopwords[] = $word;
+			}
 		}
 
 		/**
@@ -1470,8 +1515,9 @@
 				// all words in title
 				$search_orderby .= 'WHEN ' . implode( ' AND ', $q['search_orderby_title'] ) . ' THEN 2 ';
 				// any word in title, not needed when $num_terms == 1
-				if ( $num_terms > 1 )
+				if ( $num_terms > 1 ) {
 					$search_orderby .= 'WHEN ' . implode( ' OR ', $q['search_orderby_title'] ) . ' THEN 3 ';
+				}
 			}
 
 			// Sentence match in 'post_content' and 'post_excerpt'.
@@ -1486,7 +1532,7 @@
 		} else {
 			// single word or sentence search
 			$search_orderby = reset( $q['search_orderby_title'] ) . ' DESC';
-		}
+		}// End if().
 
 		return $search_orderby;
 	}
@@ -1506,9 +1552,24 @@
 
 		// Used to filter values.
 		$allowed_keys = array(
-			'post_name', 'post_author', 'post_date', 'post_title', 'post_modified',
-			'post_parent', 'post_type', 'name', 'author', 'date', 'title', 'modified',
-			'parent', 'type', 'ID', 'menu_order', 'comment_count', 'rand',
+			'post_name',
+		'post_author',
+		'post_date',
+		'post_title',
+		'post_modified',
+			'post_parent',
+		'post_type',
+		'name',
+		'author',
+		'date',
+		'title',
+		'modified',
+			'parent',
+		'type',
+		'ID',
+		'menu_order',
+		'comment_count',
+		'rand',
 		);
 
 		$primary_meta_key = '';
@@ -1579,7 +1640,7 @@
 				}
 
 				break;
-		}
+		}// End switch().
 
 		return $orderby_clause;
 	}
@@ -1649,8 +1710,8 @@
 	 * @param string $query_var Query variable key.
 	 * @param mixed  $value     Query variable value.
 	 */
-	public function set($query_var, $value) {
-		$this->query_vars[$query_var] = $value;
+	public function set( $query_var, $value ) {
+		$this->query_vars[ $query_var ] = $value;
 	}
 
 	/**
@@ -1686,7 +1747,7 @@
 		$q = &$this->query_vars;
 
 		// Fill again in case pre_get_posts unset some vars.
-		$q = $this->fill_query_vars($q);
+		$q = $this->fill_query_vars( $q );
 
 		// Parse meta query
 		$this->meta_query = new WP_Meta_Query();
@@ -1698,7 +1759,7 @@
 			$this->query_vars_changed = true;
 			$this->query_vars_hash = $hash;
 		}
-		unset($hash);
+		unset( $hash );
 
 		// First let's clear some variables
 		$distinct = '';
@@ -1726,46 +1787,51 @@
 			}
 		}
 
-		if ( !isset( $q['ignore_sticky_posts'] ) )
+		if ( ! isset( $q['ignore_sticky_posts'] ) ) {
 			$q['ignore_sticky_posts'] = false;
+		}
 
-		if ( !isset($q['suppress_filters']) )
+		if ( ! isset( $q['suppress_filters'] ) ) {
 			$q['suppress_filters'] = false;
+		}
 
-		if ( !isset($q['cache_results']) ) {
-			if ( wp_using_ext_object_cache() )
+		if ( ! isset( $q['cache_results'] ) ) {
+			if ( wp_using_ext_object_cache() ) {
 				$q['cache_results'] = false;
-			else
-				$q['cache_results'] = true;
+			} else { $q['cache_results'] = true;
+			}
 		}
 
-		if ( !isset($q['update_post_term_cache']) )
+		if ( ! isset( $q['update_post_term_cache'] ) ) {
 			$q['update_post_term_cache'] = true;
+		}
 
 		if ( ! isset( $q['lazy_load_term_meta'] ) ) {
 			$q['lazy_load_term_meta'] = $q['update_post_term_cache'];
 		}
 
-		if ( !isset($q['update_post_meta_cache']) )
+		if ( ! isset( $q['update_post_meta_cache'] ) ) {
 			$q['update_post_meta_cache'] = true;
+		}
 
-		if ( !isset($q['post_type']) ) {
-			if ( $this->is_search )
+		if ( ! isset( $q['post_type'] ) ) {
+			if ( $this->is_search ) {
 				$q['post_type'] = 'any';
-			else
-				$q['post_type'] = '';
+			} else { $q['post_type'] = '';
+			}
 		}
 		$post_type = $q['post_type'];
 		if ( empty( $q['posts_per_page'] ) ) {
 			$q['posts_per_page'] = get_option( 'posts_per_page' );
 		}
-		if ( isset($q['showposts']) && $q['showposts'] ) {
+		if ( isset( $q['showposts'] ) && $q['showposts'] ) {
 			$q['showposts'] = (int) $q['showposts'];
 			$q['posts_per_page'] = $q['showposts'];
 		}
-		if ( (isset($q['posts_per_archive_page']) && $q['posts_per_archive_page'] != 0) && ($this->is_archive || $this->is_search) )
+		if ( (isset( $q['posts_per_archive_page'] ) && $q['posts_per_archive_page'] != 0) && ($this->is_archive || $this->is_search) ) {
 			$q['posts_per_page'] = $q['posts_per_archive_page'];
-		if ( !isset($q['nopaging']) ) {
+		}
+		if ( ! isset( $q['nopaging'] ) ) {
 			if ( $q['posts_per_page'] == -1 ) {
 				$q['nopaging'] = true;
 			} else {
@@ -1783,30 +1849,32 @@
 			$q['nopaging'] = false;
 		}
 		$q['posts_per_page'] = (int) $q['posts_per_page'];
-		if ( $q['posts_per_page'] < -1 )
-			$q['posts_per_page'] = abs($q['posts_per_page']);
-		elseif ( $q['posts_per_page'] == 0 )
+		if ( $q['posts_per_page'] < -1 ) {
+			$q['posts_per_page'] = abs( $q['posts_per_page'] );
+		} elseif ( $q['posts_per_page'] == 0 ) {
 			$q['posts_per_page'] = 1;
+		}
 
-		if ( !isset($q['comments_per_page']) || $q['comments_per_page'] == 0 )
-			$q['comments_per_page'] = get_option('comments_per_page');
+		if ( ! isset( $q['comments_per_page'] ) || $q['comments_per_page'] == 0 ) {
+			$q['comments_per_page'] = get_option( 'comments_per_page' );
+		}
 
-		if ( $this->is_home && (empty($this->query) || $q['preview'] == 'true') && ( 'page' == get_option('show_on_front') ) && get_option('page_on_front') ) {
+		if ( $this->is_home && (empty( $this->query ) || $q['preview'] == 'true') && ( 'page' == get_option( 'show_on_front' ) ) && get_option( 'page_on_front' ) ) {
 			$this->is_page = true;
 			$this->is_home = false;
-			$q['page_id'] = get_option('page_on_front');
+			$q['page_id'] = get_option( 'page_on_front' );
 		}
 
-		if ( isset($q['page']) ) {
-			$q['page'] = trim($q['page'], '/');
-			$q['page'] = absint($q['page']);
+		if ( isset( $q['page'] ) ) {
+			$q['page'] = trim( $q['page'], '/' );
+			$q['page'] = absint( $q['page'] );
 		}
 
 		// If true, forcibly turns off SQL_CALC_FOUND_ROWS even when limits are present.
-		if ( isset($q['no_found_rows']) )
+		if ( isset( $q['no_found_rows'] ) ) {
 			$q['no_found_rows'] = (bool) $q['no_found_rows'];
-		else
-			$q['no_found_rows'] = false;
+		} else { $q['no_found_rows'] = false;
+		}
 
 		switch ( $q['fields'] ) {
 			case 'ids':
@@ -1824,47 +1892,54 @@
 		}
 		// The "m" parameter is meant for months but accepts datetimes of varying specificity
 		if ( $q['m'] ) {
-			$where .= " AND YEAR({$wpdb->posts}.post_date)=" . substr($q['m'], 0, 4);
-			if ( strlen($q['m']) > 5 ) {
-				$where .= " AND MONTH({$wpdb->posts}.post_date)=" . substr($q['m'], 4, 2);
+			$where .= " AND YEAR({$wpdb->posts}.post_date)=" . substr( $q['m'], 0, 4 );
+			if ( strlen( $q['m'] ) > 5 ) {
+				$where .= " AND MONTH({$wpdb->posts}.post_date)=" . substr( $q['m'], 4, 2 );
 			}
-			if ( strlen($q['m']) > 7 ) {
-				$where .= " AND DAYOFMONTH({$wpdb->posts}.post_date)=" . substr($q['m'], 6, 2);
+			if ( strlen( $q['m'] ) > 7 ) {
+				$where .= " AND DAYOFMONTH({$wpdb->posts}.post_date)=" . substr( $q['m'], 6, 2 );
 			}
-			if ( strlen($q['m']) > 9 ) {
-				$where .= " AND HOUR({$wpdb->posts}.post_date)=" . substr($q['m'], 8, 2);
+			if ( strlen( $q['m'] ) > 9 ) {
+				$where .= " AND HOUR({$wpdb->posts}.post_date)=" . substr( $q['m'], 8, 2 );
 			}
-			if ( strlen($q['m']) > 11 ) {
-				$where .= " AND MINUTE({$wpdb->posts}.post_date)=" . substr($q['m'], 10, 2);
+			if ( strlen( $q['m'] ) > 11 ) {
+				$where .= " AND MINUTE({$wpdb->posts}.post_date)=" . substr( $q['m'], 10, 2 );
 			}
-			if ( strlen($q['m']) > 13 ) {
-				$where .= " AND SECOND({$wpdb->posts}.post_date)=" . substr($q['m'], 12, 2);
+			if ( strlen( $q['m'] ) > 13 ) {
+				$where .= " AND SECOND({$wpdb->posts}.post_date)=" . substr( $q['m'], 12, 2 );
 			}
 		}
 
 		// Handle the other individual date parameters
 		$date_parameters = array();
 
-		if ( '' !== $q['hour'] )
+		if ( '' !== $q['hour'] ) {
 			$date_parameters['hour'] = $q['hour'];
+		}
 
-		if ( '' !== $q['minute'] )
+		if ( '' !== $q['minute'] ) {
 			$date_parameters['minute'] = $q['minute'];
+		}
 
-		if ( '' !== $q['second'] )
+		if ( '' !== $q['second'] ) {
 			$date_parameters['second'] = $q['second'];
+		}
 
-		if ( $q['year'] )
+		if ( $q['year'] ) {
 			$date_parameters['year'] = $q['year'];
+		}
 
-		if ( $q['monthnum'] )
+		if ( $q['monthnum'] ) {
 			$date_parameters['monthnum'] = $q['monthnum'];
+		}
 
-		if ( $q['w'] )
+		if ( $q['w'] ) {
 			$date_parameters['week'] = $q['w'];
+		}
 
-		if ( $q['day'] )
+		if ( $q['day'] ) {
 			$date_parameters['day'] = $q['day'];
+		}
 
 		if ( $date_parameters ) {
 			$date_query = new WP_Date_Query( array( $date_parameters ) );
@@ -1878,13 +1953,13 @@
 			$where .= $this->date_query->get_sql();
 		}
 
-
 		// If we've got a post_type AND it's not "any" post_type.
-		if ( !empty($q['post_type']) && 'any' != $q['post_type'] ) {
-			foreach ( (array)$q['post_type'] as $_post_type ) {
-				$ptype_obj = get_post_type_object($_post_type);
-				if ( !$ptype_obj || !$ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]) )
+		if ( ! empty( $q['post_type'] ) && 'any' != $q['post_type'] ) {
+			foreach ( (array) $q['post_type'] as $_post_type ) {
+				$ptype_obj = get_post_type_object( $_post_type );
+				if ( ! $ptype_obj || ! $ptype_obj->query_var || empty( $q[ $ptype_obj->query_var ] ) ) {
 					continue;
+				}
 
 				if ( ! $ptype_obj->hierarchical ) {
 					// Non-hierarchical post types can directly use 'name'.
@@ -1897,8 +1972,8 @@
 
 				// Only one request for a slug is possible, this is why name & pagename are overwritten above.
 				break;
-			} //end foreach
-			unset($ptype_obj);
+			} // End foreach().
+			unset( $ptype_obj );
 		}
 
 		if ( '' !== $q['title'] ) {
@@ -1910,36 +1985,38 @@
 			$q['name'] = sanitize_title_for_query( $q['name'] );
 			$where .= " AND {$wpdb->posts}.post_name = '" . $q['name'] . "'";
 		} elseif ( '' != $q['pagename'] ) {
-			if ( isset($this->queried_object_id) ) {
+			if ( isset( $this->queried_object_id ) ) {
 				$reqpage = $this->queried_object_id;
 			} else {
 				if ( 'page' != $q['post_type'] ) {
-					foreach ( (array)$q['post_type'] as $_post_type ) {
-						$ptype_obj = get_post_type_object($_post_type);
-						if ( !$ptype_obj || !$ptype_obj->hierarchical )
+					foreach ( (array) $q['post_type'] as $_post_type ) {
+						$ptype_obj = get_post_type_object( $_post_type );
+						if ( ! $ptype_obj || ! $ptype_obj->hierarchical ) {
 							continue;
+						}
 
-						$reqpage = get_page_by_path($q['pagename'], OBJECT, $_post_type);
-						if ( $reqpage )
+						$reqpage = get_page_by_path( $q['pagename'], OBJECT, $_post_type );
+						if ( $reqpage ) {
 							break;
+						}
 					}
-					unset($ptype_obj);
+					unset( $ptype_obj );
 				} else {
-					$reqpage = get_page_by_path($q['pagename']);
+					$reqpage = get_page_by_path( $q['pagename'] );
 				}
-				if ( !empty($reqpage) )
+				if ( ! empty( $reqpage ) ) {
 					$reqpage = $reqpage->ID;
-				else
-					$reqpage = 0;
+				} else { $reqpage = 0;
+				}
 			}
 
-			$page_for_posts = get_option('page_for_posts');
-			if  ( ('page' != get_option('show_on_front') ) || empty($page_for_posts) || ( $reqpage != $page_for_posts ) ) {
+			$page_for_posts = get_option( 'page_for_posts' );
+			if ( ('page' != get_option( 'show_on_front' ) ) || empty( $page_for_posts ) || ( $reqpage != $page_for_posts ) ) {
 				$q['pagename'] = sanitize_title_for_query( wp_basename( $q['pagename'] ) );
 				$q['name'] = $q['pagename'];
 				$where .= " AND ({$wpdb->posts}.ID = '$reqpage')";
 				$reqpage_obj = get_post( $reqpage );
-				if ( is_object($reqpage_obj) && 'attachment' == $reqpage_obj->post_type ) {
+				if ( is_object( $reqpage_obj ) && 'attachment' == $reqpage_obj->post_type ) {
 					$this->is_attachment = true;
 					$post_type = $q['post_type'] = 'attachment';
 					$this->is_page = true;
@@ -1954,20 +2031,21 @@
 			$q['post_name__in'] = array_map( 'sanitize_title_for_query', $q['post_name__in'] );
 			$post_name__in = "'" . implode( "','", $q['post_name__in'] ) . "'";
 			$where .= " AND {$wpdb->posts}.post_name IN ($post_name__in)";
-		}
+		}// End if().
 
 		// If an attachment is requested by number, let it supersede any post number.
-		if ( $q['attachment_id'] )
-			$q['p'] = absint($q['attachment_id']);
+		if ( $q['attachment_id'] ) {
+			$q['p'] = absint( $q['attachment_id'] );
+		}
 
 		// If a post number is specified, load that post
 		if ( $q['p'] ) {
 			$where .= " AND {$wpdb->posts}.ID = " . $q['p'];
 		} elseif ( $q['post__in'] ) {
-			$post__in = implode(',', array_map( 'absint', $q['post__in'] ));
+			$post__in = implode( ',', array_map( 'absint', $q['post__in'] ) );
 			$where .= " AND {$wpdb->posts}.ID IN ($post__in)";
 		} elseif ( $q['post__not_in'] ) {
-			$post__not_in = implode(',',  array_map( 'absint', $q['post__not_in'] ));
+			$post__not_in = implode( ',',  array_map( 'absint', $q['post__not_in'] ) );
 			$where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)";
 		}
 
@@ -1982,7 +2060,7 @@
 		}
 
 		if ( $q['page_id'] ) {
-			if  ( ('page' != get_option('show_on_front') ) || ( $q['page_id'] != get_option('page_for_posts') ) ) {
+			if ( ('page' != get_option( 'show_on_front' ) ) || ( $q['page_id'] != get_option( 'page_for_posts' ) ) ) {
 				$q['p'] = $q['page_id'];
 				$where = " AND {$wpdb->posts}.ID = " . $q['page_id'];
 			}
@@ -2006,7 +2084,7 @@
 		}
 
 		// Taxonomies
-		if ( !$this->is_singular ) {
+		if ( ! $this->is_singular ) {
 			$this->parse_tax_query( $q );
 
 			$clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' );
@@ -2016,22 +2094,26 @@
 		}
 
 		if ( $this->is_tax ) {
-			if ( empty($post_type) ) {
+			if ( empty( $post_type ) ) {
 				// Do a fully inclusive search for currently registered post types of queried taxonomies
 				$post_type = array();
 				$taxonomies = array_keys( $this->tax_query->queried_terms );
-				foreach ( get_post_types( array( 'exclude_from_search' => false ) ) as $pt ) {
+				foreach ( get_post_types( array(
+					'exclude_from_search' => false,
+				) ) as $pt ) {
 					$object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies( $pt );
-					if ( array_intersect( $taxonomies, $object_taxonomies ) )
+					if ( array_intersect( $taxonomies, $object_taxonomies ) ) {
 						$post_type[] = $pt;
+					}
 				}
-				if ( ! $post_type )
+				if ( ! $post_type ) {
 					$post_type = 'any';
-				elseif ( count( $post_type ) == 1 )
+				} elseif ( count( $post_type ) == 1 ) {
 					$post_type = $post_type[0];
+				}
 
 				$post_status_join = true;
-			} elseif ( in_array('attachment', (array) $post_type) ) {
+			} elseif ( in_array( 'attachment', (array) $post_type ) ) {
 				$post_status_join = true;
 			}
 		}
@@ -2090,9 +2172,9 @@
 					unset( $the_tag );
 				}
 			}
-		}
+		}// End if().
 
-		if ( !empty( $this->tax_query->queries ) || !empty( $this->meta_query->queries ) ) {
+		if ( ! empty( $this->tax_query->queries ) || ! empty( $this->meta_query->queries ) ) {
 			$groupby = "{$wpdb->posts}.ID";
 		}
 
@@ -2103,7 +2185,7 @@
 			$authors = array_unique( array_map( 'intval', preg_split( '/[,\s]+/', $q['author'] ) ) );
 			foreach ( $authors as $author ) {
 				$key = $author > 0 ? 'author__in' : 'author__not_in';
-				$q[$key][] = abs( $author );
+				$q[ $key ][] = abs( $author );
 			}
 			$q['author'] = implode( ',', $authors );
 		}
@@ -2119,19 +2201,20 @@
 		// Author stuff for nice URLs
 
 		if ( '' != $q['author_name'] ) {
-			if ( strpos($q['author_name'], '/') !== false ) {
-				$q['author_name'] = explode('/', $q['author_name']);
-				if ( $q['author_name'][ count($q['author_name'])-1 ] ) {
-					$q['author_name'] = $q['author_name'][count($q['author_name'])-1]; // no trailing slash
+			if ( strpos( $q['author_name'], '/' ) !== false ) {
+				$q['author_name'] = explode( '/', $q['author_name'] );
+				if ( $q['author_name'][ count( $q['author_name'] ) -1 ] ) {
+					$q['author_name'] = $q['author_name'][ count( $q['author_name'] ) -1 ]; // no trailing slash
 				} else {
-					$q['author_name'] = $q['author_name'][count($q['author_name'])-2]; // there was a trailing slash
+					$q['author_name'] = $q['author_name'][ count( $q['author_name'] ) -2 ]; // there was a trailing slash
 				}
 			}
 			$q['author_name'] = sanitize_title_for_query( $q['author_name'] );
-			$q['author'] = get_user_by('slug', $q['author_name']);
-			if ( $q['author'] )
+			$q['author'] = get_user_by( 'slug', $q['author_name'] );
+			if ( $q['author'] ) {
 				$q['author'] = $q['author']->ID;
-			$whichauthor .= " AND ({$wpdb->posts}.post_author = " . absint($q['author']) . ')';
+			}
+			$whichauthor .= " AND ({$wpdb->posts}.post_author = " . absint( $q['author'] ) . ')';
 		}
 
 		// MIME-Type stuff for attachment browsing
@@ -2209,13 +2292,14 @@
 					$orderby .= " {$q['order']}";
 				}
 			}
-		}
+		}// End if().
 
 		// Order search results by relevance only when another "orderby" is not specified in the query.
 		if ( ! empty( $q['s'] ) ) {
 			$search_orderby = '';
-			if ( ! empty( $q['search_orderby_title'] ) && ( empty( $q['orderby'] ) && ! $this->is_feed ) || ( isset( $q['orderby'] ) && 'relevance' === $q['orderby'] ) )
+			if ( ! empty( $q['search_orderby_title'] ) && ( empty( $q['orderby'] ) && ! $this->is_feed ) || ( isset( $q['orderby'] ) && 'relevance' === $q['orderby'] ) ) {
 				$search_orderby = $this->parse_search_order( $q );
+			}
 
 			if ( ! $q['suppress_filters'] ) {
 				/**
@@ -2229,18 +2313,21 @@
 				$search_orderby = apply_filters( 'posts_search_orderby', $search_orderby, $this );
 			}
 
-			if ( $search_orderby )
+			if ( $search_orderby ) {
 				$orderby = $orderby ? $search_orderby . ', ' . $orderby : $search_orderby;
+			}
 		}
 
 		if ( is_array( $post_type ) && count( $post_type ) > 1 ) {
 			$post_type_cap = 'multiple_post_type';
 		} else {
-			if ( is_array( $post_type ) )
+			if ( is_array( $post_type ) ) {
 				$post_type = reset( $post_type );
+			}
 			$post_type_object = get_post_type_object( $post_type );
-			if ( empty( $post_type_object ) )
+			if ( empty( $post_type_object ) ) {
 				$post_type_cap = $post_type;
+			}
 		}
 
 		if ( isset( $q['post_password'] ) ) {
@@ -2256,31 +2343,33 @@
 			$where .= $wpdb->prepare( " AND {$wpdb->posts}.comment_status = %s ", $q['comment_status'] );
 		}
 
-		if ( ! empty( $q['ping_status'] ) )  {
+		if ( ! empty( $q['ping_status'] ) ) {
 			$where .= $wpdb->prepare( " AND {$wpdb->posts}.ping_status = %s ", $q['ping_status'] );
 		}
 
 		if ( 'any' == $post_type ) {
-			$in_search_post_types = get_post_types( array('exclude_from_search' => false) );
+			$in_search_post_types = get_post_types( array(
+				'exclude_from_search' => false,
+			) );
 			if ( empty( $in_search_post_types ) ) {
 				$where .= ' AND 1=0 ';
 			} else {
 				$where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')";
 			}
-		} elseif ( !empty( $post_type ) && is_array( $post_type ) ) {
-			$where .= " AND {$wpdb->posts}.post_type IN ('" . join("', '", esc_sql( $post_type ) ) . "')";
+		} elseif ( ! empty( $post_type ) && is_array( $post_type ) ) {
+			$where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", esc_sql( $post_type ) ) . "')";
 		} elseif ( ! empty( $post_type ) ) {
 			$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type );
-			$post_type_object = get_post_type_object ( $post_type );
+			$post_type_object = get_post_type_object( $post_type );
 		} elseif ( $this->is_attachment ) {
 			$where .= " AND {$wpdb->posts}.post_type = 'attachment'";
-			$post_type_object = get_post_type_object ( 'attachment' );
+			$post_type_object = get_post_type_object( 'attachment' );
 		} elseif ( $this->is_page ) {
 			$where .= " AND {$wpdb->posts}.post_type = 'page'";
-			$post_type_object = get_post_type_object ( 'page' );
+			$post_type_object = get_post_type_object( 'page' );
 		} else {
 			$where .= " AND {$wpdb->posts}.post_type = 'post'";
-			$post_type_object = get_post_type_object ( 'post' );
+			$post_type_object = get_post_type_object( 'post' );
 		}
 
 		$edit_cap = 'edit_post';
@@ -2300,13 +2389,16 @@
 		if ( ! empty( $q['post_status'] ) ) {
 			$statuswheres = array();
 			$q_status = $q['post_status'];
-			if ( ! is_array( $q_status ) )
-				$q_status = explode(',', $q_status);
+			if ( ! is_array( $q_status ) ) {
+				$q_status = explode( ',', $q_status );
+			}
 			$r_status = array();
 			$p_status = array();
 			$e_status = array();
 			if ( in_array( 'any', $q_status ) ) {
-				foreach ( get_post_stati( array( 'exclude_from_search' => true ) ) as $status ) {
+				foreach ( get_post_stati( array(
+					'exclude_from_search' => true,
+				) ) as $status ) {
 					if ( ! in_array( $status, $q_status ) ) {
 						$e_status[] = "{$wpdb->posts}.post_status <> '$status'";
 					}
@@ -2323,52 +2415,58 @@
 				}
 			}
 
-			if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) {
-				$r_status = array_merge($r_status, $p_status);
-				unset($p_status);
+			if ( empty( $q['perm'] ) || 'readable' != $q['perm'] ) {
+				$r_status = array_merge( $r_status, $p_status );
+				unset( $p_status );
 			}
 
-			if ( !empty($e_status) ) {
-				$statuswheres[] = "(" . join( ' AND ', $e_status ) . ")";
+			if ( ! empty( $e_status ) ) {
+				$statuswheres[] = '(' . join( ' AND ', $e_status ) . ')';
 			}
-			if ( !empty($r_status) ) {
-				if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can($edit_others_cap) ) {
-					$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . "AND (" . join( ' OR ', $r_status ) . "))";
+			if ( ! empty( $r_status ) ) {
+				if ( ! empty( $q['perm'] ) && 'editable' == $q['perm'] && ! current_user_can( $edit_others_cap ) ) {
+					$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . join( ' OR ', $r_status ) . '))';
 				} else {
-					$statuswheres[] = "(" . join( ' OR ', $r_status ) . ")";
+					$statuswheres[] = '(' . join( ' OR ', $r_status ) . ')';
 				}
 			}
-			if ( !empty($p_status) ) {
-				if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can($read_private_cap) ) {
-					$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . "AND (" . join( ' OR ', $p_status ) . "))";
+			if ( ! empty( $p_status ) ) {
+				if ( ! empty( $q['perm'] ) && 'readable' == $q['perm'] && ! current_user_can( $read_private_cap ) ) {
+					$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . join( ' OR ', $p_status ) . '))';
 				} else {
-					$statuswheres[] = "(" . join( ' OR ', $p_status ) . ")";
+					$statuswheres[] = '(' . join( ' OR ', $p_status ) . ')';
 				}
 			}
 			if ( $post_status_join ) {
 				$join .= " LEFT JOIN {$wpdb->posts} AS p2 ON ({$wpdb->posts}.post_parent = p2.ID) ";
 				foreach ( $statuswheres as $index => $statuswhere ) {
-					$statuswheres[$index] = "($statuswhere OR ({$wpdb->posts}.post_status = 'inherit' AND " . str_replace( $wpdb->posts, 'p2', $statuswhere ) . "))";
+					$statuswheres[ $index ] = "($statuswhere OR ({$wpdb->posts}.post_status = 'inherit' AND " . str_replace( $wpdb->posts, 'p2', $statuswhere ) . '))';
 				}
 			}
 			$where_status = implode( ' OR ', $statuswheres );
 			if ( ! empty( $where_status ) ) {
 				$where .= " AND ($where_status)";
 			}
-		} elseif ( !$this->is_singular ) {
+		} elseif ( ! $this->is_singular ) {
 			$where .= " AND ({$wpdb->posts}.post_status = 'publish'";
 
 			// Add public states.
-			$public_states = get_post_stati( array('public' => true) );
+			$public_states = get_post_stati( array(
+				'public' => true,
+			) );
 			foreach ( (array) $public_states as $state ) {
-				if ( 'publish' == $state ) // Publish is hard-coded above.
+				if ( 'publish' == $state ) { // Publish is hard-coded above.
 					continue;
+				}
 				$where .= " OR {$wpdb->posts}.post_status = '$state'";
 			}
 
 			if ( $this->is_admin ) {
 				// Add protected states that should show in the admin all list.
-				$admin_all_states = get_post_stati( array('protected' => true, 'show_in_admin_all_list' => true) );
+				$admin_all_states = get_post_stati( array(
+					'protected' => true,
+					'show_in_admin_all_list' => true,
+				) );
 				foreach ( (array) $admin_all_states as $state ) {
 					$where .= " OR {$wpdb->posts}.post_status = '$state'";
 				}
@@ -2376,20 +2474,22 @@
 
 			if ( is_user_logged_in() ) {
 				// Add private states that are limited to viewing by the author of a post or someone who has caps to read private states.
-				$private_states = get_post_stati( array('private' => true) );
+				$private_states = get_post_stati( array(
+					'private' => true,
+				) );
 				foreach ( (array) $private_states as $state ) {
 					$where .= current_user_can( $read_private_cap ) ? " OR {$wpdb->posts}.post_status = '$state'" : " OR {$wpdb->posts}.post_author = $user_id AND {$wpdb->posts}.post_status = '$state'";
 				}
 			}
 
 			$where .= ')';
-		}
+		}// End if().
 
 		/*
 		 * Apply filters on where and join prior to paging so that any
 		 * manipulations to them are reflected in the paging by day queries.
 		 */
-		if ( !$q['suppress_filters'] ) {
+		if ( ! $q['suppress_filters'] ) {
 			/**
 			 * Filters the WHERE clause of the query.
 			 *
@@ -2412,10 +2512,11 @@
 		}
 
 		// Paging
-		if ( empty($q['nopaging']) && !$this->is_singular ) {
-			$page = absint($q['paged']);
-			if ( !$page )
+		if ( empty( $q['nopaging'] ) && ! $this->is_singular ) {
+			$page = absint( $q['paged'] );
+			if ( ! $page ) {
 				$page = 1;
+			}
 
 			// If 'offset' is provided, it takes precedence over 'paged'.
 			if ( isset( $q['offset'] ) && is_numeric( $q['offset'] ) ) {
@@ -2439,7 +2540,7 @@
 				$cgroupby = '';
 			}
 
-			if ( !$q['suppress_filters'] ) {
+			if ( ! $q['suppress_filters'] ) {
 				/**
 				 * Filters the JOIN clause of the comments feed query before sending.
 				 *
@@ -2488,29 +2589,30 @@
 				 * @param string   $climits The JOIN clause of the query.
 				 * @param WP_Query &$this   The WP_Query instance (passed by reference).
 				 */
-				$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
-			}
+				$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option( 'posts_per_rss' ), &$this ) );
+			}// End if().
 			$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
 			$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
 
-			$comments = (array) $wpdb->get_results("SELECT $distinct {$wpdb->comments}.* FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits");
+			$comments = (array) $wpdb->get_results( "SELECT $distinct {$wpdb->comments}.* FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits" );
 			// Convert to WP_Comment
 			$this->comments = array_map( 'get_comment', $comments );
-			$this->comment_count = count($this->comments);
+			$this->comment_count = count( $this->comments );
 
 			$post_ids = array();
 
-			foreach ( $this->comments as $comment )
+			foreach ( $this->comments as $comment ) {
 				$post_ids[] = (int) $comment->comment_post_ID;
+			}
 
-			$post_ids = join(',', $post_ids);
+			$post_ids = join( ',', $post_ids );
 			$join = '';
 			if ( $post_ids ) {
 				$where = "AND {$wpdb->posts}.ID IN ($post_ids) ";
 			} else {
-				$where = "AND 0";
+				$where = 'AND 0';
 			}
-		}
+		}// End if().
 
 		$pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
 
@@ -2518,7 +2620,7 @@
 		 * Apply post-paging filters on where and join. Only plugins that
 		 * manipulate paging queries should use these hooks.
 		 */
-		if ( !$q['suppress_filters'] ) {
+		if ( ! $q['suppress_filters'] ) {
 			/**
 			 * Filters the WHERE clause of the query.
 			 *
@@ -2606,14 +2708,14 @@
 			 */
 			$clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
 
-			$where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
-			$groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
-			$join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
-			$orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
-			$distinct = isset( $clauses[ 'distinct' ] ) ? $clauses[ 'distinct' ] : '';
-			$fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
-			$limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
-		}
+			$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
+			$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
+			$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
+			$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
+			$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';
+			$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
+			$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
+		}// End if().
 
 		/**
 		 * Fires to announce the query's current selection parameters.
@@ -2630,7 +2732,7 @@
 		 * Filters again for the benefit of caching plugins.
 		 * Regular plugins should use the hooks above.
 		 */
-		if ( !$q['suppress_filters'] ) {
+		if ( ! $q['suppress_filters'] ) {
 			/**
 			 * Filters the WHERE clause of the query.
 			 *
@@ -2730,27 +2832,30 @@
 			 */
 			$clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
 
-			$where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
-			$groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
-			$join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
-			$orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
-			$distinct = isset( $clauses[ 'distinct' ] ) ? $clauses[ 'distinct' ] : '';
-			$fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
-			$limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
-		}
+			$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
+			$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
+			$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
+			$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
+			$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';
+			$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
+			$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
+		}// End if().
 
-		if ( ! empty($groupby) )
+		if ( ! empty( $groupby ) ) {
 			$groupby = 'GROUP BY ' . $groupby;
-		if ( !empty( $orderby ) )
+		}
+		if ( ! empty( $orderby ) ) {
 			$orderby = 'ORDER BY ' . $orderby;
+		}
 
 		$found_rows = '';
-		if ( !$q['no_found_rows'] && !empty($limits) )
+		if ( ! $q['no_found_rows'] && ! empty( $limits ) ) {
 			$found_rows = 'SQL_CALC_FOUND_ROWS';
+		}
 
 		$this->request = $old_request = "SELECT $found_rows $distinct $fields FROM {$wpdb->posts} $join WHERE 1=1 $where $groupby $orderby $limits";
 
-		if ( !$q['suppress_filters'] ) {
+		if ( ! $q['suppress_filters'] ) {
 			/**
 			 * Filters the completed SQL query before sending.
 			 *
@@ -2812,7 +2917,7 @@
 		}
 
 		if ( null === $this->posts ) {
-			$split_the_query = ( $old_request == $this->request && "{$wpdb->posts}.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 );
+			$split_the_query = ( $old_request == $this->request && "{$wpdb->posts}.*" == $fields && ! empty( $limits ) && $q['posts_per_page'] < 500 );
 
 			/**
 			 * Filters whether to split the query.
@@ -2856,7 +2961,7 @@
 				$this->posts = $wpdb->get_results( $this->request );
 				$this->set_found_posts( $q, $limits );
 			}
-		}
+		}// End if().
 
 		// Convert to WP_Post objects.
 		if ( $this->posts ) {
@@ -2875,7 +2980,7 @@
 			$this->posts = apply_filters_ref_array( 'posts_results', array( $this->posts, &$this ) );
 		}
 
-		if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
+		if ( ! empty( $this->posts ) && $this->is_comment_feed && $this->is_singular ) {
 			/** This filter is documented in wp-includes/query.php */
 			$cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) );
 
@@ -2891,44 +2996,46 @@
 			$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
 
 			/** This filter is documented in wp-includes/query.php */
-			$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
+			$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option( 'posts_per_rss' ), &$this ) );
 
 			$comments_request = "SELECT {$wpdb->comments}.* FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits";
-			$comments = $wpdb->get_results($comments_request);
+			$comments = $wpdb->get_results( $comments_request );
 			// Convert to WP_Comment
 			$this->comments = array_map( 'get_comment', $comments );
-			$this->comment_count = count($this->comments);
+			$this->comment_count = count( $this->comments );
 		}
 
 		// Check post status to determine if post should be displayed.
-		if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) {
-			$status = get_post_status($this->posts[0]);
+		if ( ! empty( $this->posts ) && ($this->is_single || $this->is_page) ) {
+			$status = get_post_status( $this->posts[0] );
 			if ( 'attachment' === $this->posts[0]->post_type && 0 === (int) $this->posts[0]->post_parent ) {
 				$this->is_page = false;
 				$this->is_single = true;
 				$this->is_attachment = true;
 			}
-			$post_status_obj = get_post_status_object($status);
+			$post_status_obj = get_post_status_object( $status );
 
 			// If the post_status was specifically requested, let it pass through.
-			if ( !$post_status_obj->public && ! in_array( $status, $q_status ) ) {
+			if ( ! $post_status_obj->public && ! in_array( $status, $q_status ) ) {
 
 				if ( ! is_user_logged_in() ) {
 					// User must be logged in to view unpublished posts.
 					$this->posts = array();
 				} else {
-					if  ( $post_status_obj->protected ) {
+					if ( $post_status_obj->protected ) {
 						// User must have edit permissions on the draft to preview.
-						if ( ! current_user_can($edit_cap, $this->posts[0]->ID) ) {
+						if ( ! current_user_can( $edit_cap, $this->posts[0]->ID ) ) {
 							$this->posts = array();
 						} else {
 							$this->is_preview = true;
-							if ( 'future' != $status )
-								$this->posts[0]->post_date = current_time('mysql');
+							if ( 'future' != $status ) {
+								$this->posts[0]->post_date = current_time( 'mysql' );
+							}
 						}
 					} elseif ( $post_status_obj->private ) {
-						if ( ! current_user_can($read_cap, $this->posts[0]->ID) )
+						if ( ! current_user_can( $read_cap, $this->posts[0]->ID ) ) {
 							$this->posts = array();
+						}
 					} else {
 						$this->posts = array();
 					}
@@ -2946,40 +3053,41 @@
 				 */
 				$this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) );
 			}
-		}
+		}// End if().
 
 		// Put sticky posts at the top of the posts array
-		$sticky_posts = get_option('sticky_posts');
-		if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['ignore_sticky_posts'] ) {
-			$num_posts = count($this->posts);
+		$sticky_posts = get_option( 'sticky_posts' );
+		if ( $this->is_home && $page <= 1 && is_array( $sticky_posts ) && ! empty( $sticky_posts ) && ! $q['ignore_sticky_posts'] ) {
+			$num_posts = count( $this->posts );
 			$sticky_offset = 0;
 			// Loop over posts and relocate stickies to the front.
 			for ( $i = 0; $i < $num_posts; $i++ ) {
-				if ( in_array($this->posts[$i]->ID, $sticky_posts) ) {
-					$sticky_post = $this->posts[$i];
+				if ( in_array( $this->posts[ $i ]->ID, $sticky_posts ) ) {
+					$sticky_post = $this->posts[ $i ];
 					// Remove sticky from current position
-					array_splice($this->posts, $i, 1);
+					array_splice( $this->posts, $i, 1 );
 					// Move to front, after other stickies
-					array_splice($this->posts, $sticky_offset, 0, array($sticky_post));
+					array_splice( $this->posts, $sticky_offset, 0, array( $sticky_post ) );
 					// Increment the sticky offset. The next sticky will be placed at this offset.
 					$sticky_offset++;
 					// Remove post from sticky posts array
-					$offset = array_search($sticky_post->ID, $sticky_posts);
-					unset( $sticky_posts[$offset] );
+					$offset = array_search( $sticky_post->ID, $sticky_posts );
+					unset( $sticky_posts[ $offset ] );
 				}
 			}
 
 			// If any posts have been excluded specifically, Ignore those that are sticky.
-			if ( !empty($sticky_posts) && !empty($q['post__not_in']) )
-				$sticky_posts = array_diff($sticky_posts, $q['post__not_in']);
+			if ( ! empty( $sticky_posts ) && ! empty( $q['post__not_in'] ) ) {
+				$sticky_posts = array_diff( $sticky_posts, $q['post__not_in'] );
+			}
 
 			// Fetch sticky posts that weren't in the query results
-			if ( !empty($sticky_posts) ) {
+			if ( ! empty( $sticky_posts ) ) {
 				$stickies = get_posts( array(
 					'post__in' => $sticky_posts,
 					'post_type' => $post_type,
 					'post_status' => 'publish',
-					'nopaging' => true
+					'nopaging' => true,
 				) );
 
 				foreach ( $stickies as $sticky_post ) {
@@ -2987,7 +3095,7 @@
 					$sticky_offset++;
 				}
 			}
-		}
+		}// End if().
 
 		// If comments have been fetched as part of the query, make sure comment meta lazy-loading is set up.
 		if ( ! empty( $this->comments ) ) {
@@ -3014,8 +3122,9 @@
 
 			$this->posts = array_map( 'get_post', $this->posts );
 
-			if ( $q['cache_results'] )
-				update_post_caches($this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache']);
+			if ( $q['cache_results'] ) {
+				update_post_caches( $this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache'] );
+			}
 
 			$this->post = reset( $this->posts );
 		} else {
@@ -3044,8 +3153,9 @@
 		global $wpdb;
 		// Bail if posts is an empty array. Continue if posts is an empty string,
 		// null, or false to accommodate caching plugins that fill posts later.
-		if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) )
+		if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) ) {
 			return;
+		}
 
 		if ( ! empty( $limits ) ) {
 			/**
@@ -3071,8 +3181,9 @@
 		 */
 		$this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
 
-		if ( ! empty( $limits ) )
+		if ( ! empty( $limits ) ) {
 			$this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );
+		}
 	}
 
 	/**
@@ -3087,7 +3198,7 @@
 
 		$this->current_post++;
 
-		$this->post = $this->posts[$this->current_post];
+		$this->post = $this->posts[ $this->current_post ];
 		return $this->post;
 	}
 
@@ -3106,7 +3217,7 @@
 		global $post;
 		$this->in_the_loop = true;
 
-		if ( $this->current_post == -1 ) // loop has just started
+		if ( $this->current_post == -1 ) { // loop has just started
 			/**
 			 * Fires once the loop is started.
 			 *
@@ -3115,6 +3226,7 @@
 			 * @param WP_Query &$this The WP_Query instance (passed by reference).
 			 */
 			do_action_ref_array( 'loop_start', array( &$this ) );
+		}
 
 		$post = $this->next_post();
 		$this->setup_postdata( $post );
@@ -3174,7 +3286,7 @@
 	public function next_comment() {
 		$this->current_comment++;
 
-		$this->comment = $this->comments[$this->current_comment];
+		$this->comment = $this->comments[ $this->current_comment ];
 		return $this->comment;
 	}
 
@@ -3261,8 +3373,9 @@
 	 * @return object
 	 */
 	public function get_queried_object() {
-		if ( isset($this->queried_object) )
+		if ( isset( $this->queried_object ) ) {
 			return $this->queried_object;
+		}
 
 		$this->queried_object = null;
 		$this->queried_object_id = null;
@@ -3297,29 +3410,31 @@
 				}
 			}
 
-			if ( ! empty( $term ) && ! is_wp_error( $term ) )  {
+			if ( ! empty( $term ) && ! is_wp_error( $term ) ) {
 				$this->queried_object = $term;
 				$this->queried_object_id = (int) $term->term_id;
 
-				if ( $this->is_category && 'category' === $this->queried_object->taxonomy )
+				if ( $this->is_category && 'category' === $this->queried_object->taxonomy ) {
 					_make_cat_compat( $this->queried_object );
+				}
 			}
 		} elseif ( $this->is_post_type_archive ) {
 			$post_type = $this->get( 'post_type' );
-			if ( is_array( $post_type ) )
+			if ( is_array( $post_type ) ) {
 				$post_type = reset( $post_type );
+			}
 			$this->queried_object = get_post_type_object( $post_type );
 		} elseif ( $this->is_posts_page ) {
-			$page_for_posts = get_option('page_for_posts');
+			$page_for_posts = get_option( 'page_for_posts' );
 			$this->queried_object = get_post( $page_for_posts );
 			$this->queried_object_id = (int) $this->queried_object->ID;
 		} elseif ( $this->is_singular && ! empty( $this->post ) ) {
 			$this->queried_object = $this->post;
 			$this->queried_object_id = (int) $this->post->ID;
 		} elseif ( $this->is_author ) {
-			$this->queried_object_id = (int) $this->get('author');
+			$this->queried_object_id = (int) $this->get( 'author' );
 			$this->queried_object = get_userdata( $this->queried_object_id );
-		}
+		}// End if().
 
 		return $this->queried_object;
 	}
@@ -3335,7 +3450,7 @@
 	public function get_queried_object_id() {
 		$this->get_queried_object();
 
-		if ( isset($this->queried_object_id) ) {
+		if ( isset( $this->queried_object_id ) ) {
 			return $this->queried_object_id;
 		}
 
@@ -3406,14 +3521,14 @@
 	}
 
 	/**
- 	 * Is the query for an existing archive page?
- 	 *
- 	 * Month, Year, Category, Author, Post Type archive...
-	 *
- 	 * @since 3.1.0
- 	 *
- 	 * @return bool
- 	 */
+	  * Is the query for an existing archive page?
+	  *
+	  * Month, Year, Category, Author, Post Type archive...
+	 *
+	  * @since 3.1.0
+	  *
+	  * @return bool
+	  */
 	public function is_archive() {
 		return (bool) $this->is_archive;
 	}
@@ -3427,12 +3542,14 @@
 	 * @return bool
 	 */
 	public function is_post_type_archive( $post_types = '' ) {
-		if ( empty( $post_types ) || ! $this->is_post_type_archive )
+		if ( empty( $post_types ) || ! $this->is_post_type_archive ) {
 			return (bool) $this->is_post_type_archive;
+		}
 
 		$post_type = $this->get( 'post_type' );
-		if ( is_array( $post_type ) )
+		if ( is_array( $post_type ) ) {
 			$post_type = reset( $post_type );
+		}
 		$post_type_object = get_post_type_object( $post_type );
 
 		return in_array( $post_type_object->name, (array) $post_types );
@@ -3481,22 +3598,25 @@
 	 * @return bool
 	 */
 	public function is_author( $author = '' ) {
-		if ( !$this->is_author )
+		if ( ! $this->is_author ) {
 			return false;
+		}
 
-		if ( empty($author) )
+		if ( empty( $author ) ) {
 			return true;
+		}
 
 		$author_obj = $this->get_queried_object();
 
 		$author = array_map( 'strval', (array) $author );
 
-		if ( in_array( (string) $author_obj->ID, $author ) )
+		if ( in_array( (string) $author_obj->ID, $author ) ) {
 			return true;
-		elseif ( in_array( $author_obj->nickname, $author ) )
+		} elseif ( in_array( $author_obj->nickname, $author ) ) {
 			return true;
-		elseif ( in_array( $author_obj->user_nicename, $author ) )
+		} elseif ( in_array( $author_obj->user_nicename, $author ) ) {
 			return true;
+		}
 
 		return false;
 	}
@@ -3513,22 +3633,25 @@
 	 * @return bool
 	 */
 	public function is_category( $category = '' ) {
-		if ( !$this->is_category )
+		if ( ! $this->is_category ) {
 			return false;
+		}
 
-		if ( empty($category) )
+		if ( empty( $category ) ) {
 			return true;
+		}
 
 		$cat_obj = $this->get_queried_object();
 
 		$category = array_map( 'strval', (array) $category );
 
-		if ( in_array( (string) $cat_obj->term_id, $category ) )
+		if ( in_array( (string) $cat_obj->term_id, $category ) ) {
 			return true;
-		elseif ( in_array( $cat_obj->name, $category ) )
+		} elseif ( in_array( $cat_obj->name, $category ) ) {
 			return true;
-		elseif ( in_array( $cat_obj->slug, $category ) )
+		} elseif ( in_array( $cat_obj->slug, $category ) ) {
 			return true;
+		}
 
 		return false;
 	}
@@ -3545,22 +3668,25 @@
 	 * @return bool
 	 */
 	public function is_tag( $tag = '' ) {
-		if ( ! $this->is_tag )
+		if ( ! $this->is_tag ) {
 			return false;
+		}
 
-		if ( empty( $tag ) )
+		if ( empty( $tag ) ) {
 			return true;
+		}
 
 		$tag_obj = $this->get_queried_object();
 
 		$tag = array_map( 'strval', (array) $tag );
 
-		if ( in_array( (string) $tag_obj->term_id, $tag ) )
+		if ( in_array( (string) $tag_obj->term_id, $tag ) ) {
 			return true;
-		elseif ( in_array( $tag_obj->name, $tag ) )
+		} elseif ( in_array( $tag_obj->name, $tag ) ) {
 			return true;
-		elseif ( in_array( $tag_obj->slug, $tag ) )
+		} elseif ( in_array( $tag_obj->slug, $tag ) ) {
 			return true;
+		}
 
 		return false;
 	}
@@ -3586,23 +3712,27 @@
 	public function is_tax( $taxonomy = '', $term = '' ) {
 		global $wp_taxonomies;
 
-		if ( !$this->is_tax )
+		if ( ! $this->is_tax ) {
 			return false;
+		}
 
-		if ( empty( $taxonomy ) )
+		if ( empty( $taxonomy ) ) {
 			return true;
+		}
 
 		$queried_object = $this->get_queried_object();
 		$tax_array = array_intersect( array_keys( $wp_taxonomies ), (array) $taxonomy );
 		$term_array = (array) $term;
 
 		// Check that the taxonomy matches.
-		if ( ! ( isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array ) ) )
+		if ( ! ( isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array ) ) ) {
 			return false;
+		}
 
 		// Only a Taxonomy provided.
-		if ( empty( $term ) )
+		if ( empty( $term ) ) {
 			return true;
+		}
 
 		return isset( $queried_object->term_id ) &&
 			count( array_intersect(
@@ -3656,11 +3786,13 @@
 	 * @return bool
 	 */
 	public function is_feed( $feeds = '' ) {
-		if ( empty( $feeds ) || ! $this->is_feed )
+		if ( empty( $feeds ) || ! $this->is_feed ) {
 			return (bool) $this->is_feed;
+		}
 		$qv = $this->get( 'feed' );
-		if ( 'feed' == $qv )
+		if ( 'feed' == $qv ) {
 			$qv = get_default_feed();
+		}
 		return in_array( $qv, (array) $feeds );
 	}
 
@@ -3693,12 +3825,12 @@
 	 */
 	public function is_front_page() {
 		// most likely case
-		if ( 'posts' == get_option( 'show_on_front') && $this->is_home() )
+		if ( 'posts' == get_option( 'show_on_front' ) && $this->is_home() ) {
 			return true;
-		elseif ( 'page' == get_option( 'show_on_front') && get_option( 'page_on_front' ) && $this->is_page( get_option( 'page_on_front' ) ) )
+		} elseif ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && $this->is_page( get_option( 'page_on_front' ) ) ) {
 			return true;
-		else
-			return false;
+		} else { return false;
+		}
 	}
 
 	/**
@@ -3747,11 +3879,13 @@
 	 * @return bool Whether the query is for an existing single page.
 	 */
 	public function is_page( $page = '' ) {
-		if ( !$this->is_page )
+		if ( ! $this->is_page ) {
 			return false;
+		}
 
-		if ( empty( $page ) )
+		if ( empty( $page ) ) {
 			return true;
+		}
 
 		$page_obj = $this->get_queried_object();
 
@@ -3840,11 +3974,13 @@
 	 * @return bool Whether the query is for an existing single post.
 	 */
 	public function is_single( $post = '' ) {
-		if ( !$this->is_single )
+		if ( ! $this->is_single ) {
 			return false;
+		}
 
-		if ( empty($post) )
+		if ( empty( $post ) ) {
 			return true;
+		}
 
 		$post_obj = $this->get_queried_object();
 
@@ -3887,8 +4023,9 @@
 	 * @return bool Whether the query is for an existing single post of any of the given post types.
 	 */
 	public function is_singular( $post_types = '' ) {
-		if ( empty( $post_types ) || !$this->is_singular )
+		if ( empty( $post_types ) || ! $this->is_singular ) {
 			return (bool) $this->is_singular;
+		}
 
 		$post_obj = $this->get_queried_object();
 
@@ -3996,15 +4133,16 @@
 
 		$id = (int) $post->ID;
 
-		$authordata = get_userdata($post->post_author);
+		$authordata = get_userdata( $post->post_author );
 
-		$currentday = mysql2date('d.m.y', $post->post_date, false);
-		$currentmonth = mysql2date('m', $post->post_date, false);
+		$currentday = mysql2date( 'd.m.y', $post->post_date, false );
+		$currentmonth = mysql2date( 'm', $post->post_date, false );
 		$numpages = 1;
 		$multipage = 0;
 		$page = $this->get( 'page' );
-		if ( ! $page )
+		if ( ! $page ) {
 			$page = 1;
+		}
 
 		/*
 		 * Force full post content when viewing the permalink for the $post,
@@ -4025,10 +4163,11 @@
 			$content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
 
 			// Ignore nextpage at the beginning of the content.
-			if ( 0 === strpos( $content, '<!--nextpage-->' ) )
+			if ( 0 === strpos( $content, '<!--nextpage-->' ) ) {
 				$content = substr( $content, 15 );
+			}
 
-			$pages = explode('<!--nextpage-->', $content);
+			$pages = explode( '<!--nextpage-->', $content );
 		} else {
 			$pages = array( $post->post_content );
 		}
@@ -4055,8 +4194,8 @@
 			}
 			$multipage = 1;
 		} else {
-	 		$multipage = 0;
-	 	}
+			 $multipage = 0;
+		}
 
 		/**
 		 * Fires once the post data has been setup.
Index: src/wp-includes/class-wp-rewrite.php
===================================================================
--- src/wp-includes/class-wp-rewrite.php	(revision 40901)
+++ src/wp-includes/class-wp-rewrite.php	(working copy)
@@ -312,7 +312,7 @@
 		'%post_id%',
 		'%author%',
 		'%pagename%',
-		'%search%'
+		'%search%',
 	);
 
 	/**
@@ -334,7 +334,7 @@
 		'([0-9]+)',
 		'([^/]+)',
 		'([^/]+?)',
-		'(.+)'
+		'(.+)',
 	);
 
 	/**
@@ -355,7 +355,7 @@
 		'p=',
 		'author_name=',
 		'pagename=',
-		's='
+		's=',
 	);
 
 	/**
@@ -377,7 +377,7 @@
 	 * @return bool True, if permalinks are enabled.
 	 */
 	public function using_permalinks() {
-		return ! empty($this->permalink_structure);
+		return ! empty( $this->permalink_structure );
 	}
 
 	/**
@@ -429,11 +429,11 @@
 	 * @param int $number Index number.
 	 * @return string
 	 */
-	public function preg_index($number) {
+	public function preg_index( $number ) {
 		$match_prefix = '$';
 		$match_suffix = '';
 
-		if ( ! empty($this->matches) ) {
+		if ( ! empty( $this->matches ) ) {
 			$match_prefix = '$' . $this->matches . '[';
 			$match_suffix = ']';
 		}
@@ -458,31 +458,32 @@
 		global $wpdb;
 
 		// Get pages in order of hierarchy, i.e. children after parents.
-		$pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'page' AND post_status != 'auto-draft'");
+		$pages = $wpdb->get_results( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'page' AND post_status != 'auto-draft'" );
 		$posts = get_page_hierarchy( $pages );
 
 		// If we have no pages get out quick.
-		if ( !$posts )
+		if ( ! $posts ) {
 			return array( array(), array() );
+		}
 
 		// Now reverse it, because we need parents after children for rewrite rules to work properly.
-		$posts = array_reverse($posts, true);
+		$posts = array_reverse( $posts, true );
 
 		$page_uris = array();
 		$page_attachment_uris = array();
 
 		foreach ( $posts as $id => $post ) {
 			// URL => page name
-			$uri = get_page_uri($id);
-			$attachments = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $id ));
-			if ( !empty($attachments) ) {
+			$uri = get_page_uri( $id );
+			$attachments = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $id ) );
+			if ( ! empty( $attachments ) ) {
 				foreach ( $attachments as $attachment ) {
-					$attach_uri = get_page_uri($attachment->ID);
-					$page_attachment_uris[$attach_uri] = $attachment->ID;
+					$attach_uri = get_page_uri( $attachment->ID );
+					$page_attachment_uris[ $attach_uri ] = $attachment->ID;
 				}
 			}
 
-			$page_uris[$uri] = $id;
+			$page_uris[ $uri ] = $id;
 		}
 
 		return array( $page_uris, $page_attachment_uris );
@@ -524,38 +525,40 @@
 	 * @return string|false False on no permalink structure. Date permalink structure.
 	 */
 	public function get_date_permastruct() {
-		if ( isset($this->date_structure) )
+		if ( isset( $this->date_structure ) ) {
 			return $this->date_structure;
+		}
 
-		if ( empty($this->permalink_structure) ) {
+		if ( empty( $this->permalink_structure ) ) {
 			$this->date_structure = '';
 			return false;
 		}
 
 		// The date permalink must have year, month, and day separated by slashes.
-		$endians = array('%year%/%monthnum%/%day%', '%day%/%monthnum%/%year%', '%monthnum%/%day%/%year%');
+		$endians = array( '%year%/%monthnum%/%day%', '%day%/%monthnum%/%year%', '%monthnum%/%day%/%year%' );
 
 		$this->date_structure = '';
 		$date_endian = '';
 
 		foreach ( $endians as $endian ) {
-			if ( false !== strpos($this->permalink_structure, $endian) ) {
-				$date_endian= $endian;
+			if ( false !== strpos( $this->permalink_structure, $endian ) ) {
+				$date_endian = $endian;
 				break;
 			}
 		}
 
-		if ( empty($date_endian) )
+		if ( empty( $date_endian ) ) {
 			$date_endian = '%year%/%monthnum%/%day%';
+		}
 
 		/*
 		 * Do not allow the date tags and %post_id% to overlap in the permalink
 		 * structure. If they do, move the date tags to $front/date/.
 		 */
 		$front = $this->front;
-		preg_match_all('/%.+?%/', $this->permalink_structure, $tokens);
+		preg_match_all( '/%.+?%/', $this->permalink_structure, $tokens );
 		$tok_index = 1;
-		foreach ( (array) $tokens[0] as $token) {
+		foreach ( (array) $tokens[0] as $token ) {
 			if ( '%post_id%' == $token && ($tok_index <= 3) ) {
 				$front = $front . 'date/';
 				break;
@@ -582,12 +585,13 @@
 	public function get_year_permastruct() {
 		$structure = $this->get_date_permastruct();
 
-		if ( empty($structure) )
+		if ( empty( $structure ) ) {
 			return false;
+		}
 
-		$structure = str_replace('%monthnum%', '', $structure);
-		$structure = str_replace('%day%', '', $structure);
-		$structure = preg_replace('#/+#', '/', $structure);
+		$structure = str_replace( '%monthnum%', '', $structure );
+		$structure = str_replace( '%day%', '', $structure );
+		$structure = preg_replace( '#/+#', '/', $structure );
 
 		return $structure;
 	}
@@ -606,11 +610,12 @@
 	public function get_month_permastruct() {
 		$structure = $this->get_date_permastruct();
 
-		if ( empty($structure) )
+		if ( empty( $structure ) ) {
 			return false;
+		}
 
-		$structure = str_replace('%day%', '', $structure);
-		$structure = preg_replace('#/+#', '/', $structure);
+		$structure = str_replace( '%day%', '', $structure );
+		$structure = preg_replace( '#/+#', '/', $structure );
 
 		return $structure;
 	}
@@ -643,7 +648,7 @@
 	 * @return string|false False on failure. Category permalink structure.
 	 */
 	public function get_category_permastruct() {
-		return $this->get_extra_permastruct('category');
+		return $this->get_extra_permastruct( 'category' );
 	}
 
 	/**
@@ -660,7 +665,7 @@
 	 * @return string|false False on failure. Tag permalink structure.
 	 */
 	public function get_tag_permastruct() {
-		return $this->get_extra_permastruct('post_tag');
+		return $this->get_extra_permastruct( 'post_tag' );
 	}
 
 	/**
@@ -672,12 +677,14 @@
 	 * @param string $name Permalink structure name.
 	 * @return string|false False if not found. Permalink structure string.
 	 */
-	public function get_extra_permastruct($name) {
-		if ( empty($this->permalink_structure) )
+	public function get_extra_permastruct( $name ) {
+		if ( empty( $this->permalink_structure ) ) {
 			return false;
+		}
 
-		if ( isset($this->extra_permastructs[$name]) )
-			return $this->extra_permastructs[$name]['struct'];
+		if ( isset( $this->extra_permastructs[ $name ] ) ) {
+			return $this->extra_permastructs[ $name ]['struct'];
+		}
 
 		return false;
 	}
@@ -695,10 +702,11 @@
 	 * @return string|false False if not found. Permalink structure string.
 	 */
 	public function get_author_permastruct() {
-		if ( isset($this->author_structure) )
+		if ( isset( $this->author_structure ) ) {
 			return $this->author_structure;
+		}
 
-		if ( empty($this->permalink_structure) ) {
+		if ( empty( $this->permalink_structure ) ) {
 			$this->author_structure = '';
 			return false;
 		}
@@ -721,10 +729,11 @@
 	 * @return string|false False if not found. Permalink structure string.
 	 */
 	public function get_search_permastruct() {
-		if ( isset($this->search_structure) )
+		if ( isset( $this->search_structure ) ) {
 			return $this->search_structure;
+		}
 
-		if ( empty($this->permalink_structure) ) {
+		if ( empty( $this->permalink_structure ) ) {
 			$this->search_structure = '';
 			return false;
 		}
@@ -747,10 +756,11 @@
 	 * @return string|false False if not found. Permalink structure string.
 	 */
 	public function get_page_permastruct() {
-		if ( isset($this->page_structure) )
+		if ( isset( $this->page_structure ) ) {
 			return $this->page_structure;
+		}
 
-		if (empty($this->permalink_structure)) {
+		if ( empty( $this->permalink_structure ) ) {
 			$this->page_structure = '';
 			return false;
 		}
@@ -773,10 +783,11 @@
 	 * @return string|false False if not found. Permalink structure string.
 	 */
 	public function get_feed_permastruct() {
-		if ( isset($this->feed_structure) )
+		if ( isset( $this->feed_structure ) ) {
 			return $this->feed_structure;
+		}
 
-		if ( empty($this->permalink_structure) ) {
+		if ( empty( $this->permalink_structure ) ) {
 			$this->feed_structure = '';
 			return false;
 		}
@@ -799,10 +810,11 @@
 	 * @return string|false False if not found. Permalink structure string.
 	 */
 	public function get_comment_feed_permastruct() {
-		if ( isset($this->comment_feed_structure) )
+		if ( isset( $this->comment_feed_structure ) ) {
 			return $this->comment_feed_structure;
+		}
 
-		if (empty($this->permalink_structure)) {
+		if ( empty( $this->permalink_structure ) ) {
 			$this->comment_feed_structure = '';
 			return false;
 		}
@@ -891,12 +903,13 @@
 	 *                                    Default true.
 	 * @return array Rewrite rule list.
 	 */
-	public function generate_rewrite_rules($permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true) {
+	public function generate_rewrite_rules( $permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true ) {
 		// Build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/?
 		$feedregex2 = '';
-		foreach ( (array) $this->feeds as $feed_name)
+		foreach ( (array) $this->feeds as $feed_name ) {
 			$feedregex2 .= $feed_name . '|';
-		$feedregex2 = '(' . trim($feedregex2, '|') . ')/?$';
+		}
+		$feedregex2 = '(' . trim( $feedregex2, '|' ) . ')/?$';
 
 		/*
 		 * $feedregex is identical but with /feed/ added on as well, so URLs like <permalink>/feed/atom
@@ -912,24 +925,24 @@
 
 		// Build up an array of endpoint regexes to append => queries to append.
 		if ( $endpoints ) {
-			$ep_query_append = array ();
-			foreach ( (array) $this->endpoints as $endpoint) {
+			$ep_query_append = array();
+			foreach ( (array) $this->endpoints as $endpoint ) {
 				// Match everything after the endpoint name, but allow for nothing to appear there.
 				$epmatch = $endpoint[1] . '(/(.*))?/?$';
 
 				// This will be appended on to the rest of the query for each dir.
 				$epquery = '&' . $endpoint[2] . '=';
-				$ep_query_append[$epmatch] = array ( $endpoint[0], $epquery );
+				$ep_query_append[ $epmatch ] = array( $endpoint[0], $epquery );
 			}
 		}
 
 		// Get everything up to the first rewrite tag.
-		$front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
+		$front = substr( $permalink_structure, 0, strpos( $permalink_structure, '%' ) );
 
 		// Build an array of the tags (note that said array ends up being in $tokens[0]).
-		preg_match_all('/%.+?%/', $permalink_structure, $tokens);
+		preg_match_all( '/%.+?%/', $permalink_structure, $tokens );
 
-		$num_tokens = count($tokens[0]);
+		$num_tokens = count( $tokens[0] );
 
 		$index = $this->index; //probably 'index.php'
 		$feedindex = $index;
@@ -942,51 +955,52 @@
 		 */
 		$queries = array();
 		for ( $i = 0; $i < $num_tokens; ++$i ) {
-			if ( 0 < $i )
-				$queries[$i] = $queries[$i - 1] . '&';
-			else
-				$queries[$i] = '';
+			if ( 0 < $i ) {
+				$queries[ $i ] = $queries[ $i - 1 ] . '&';
+			} else { $queries[ $i ] = '';
+			}
 
-			$query_token = str_replace($this->rewritecode, $this->queryreplace, $tokens[0][$i]) . $this->preg_index($i+1);
-			$queries[$i] .= $query_token;
+			$query_token = str_replace( $this->rewritecode, $this->queryreplace, $tokens[0][ $i ] ) . $this->preg_index( $i + 1 );
+			$queries[ $i ] .= $query_token;
 		}
 
 		// Get the structure, minus any cruft (stuff that isn't tags) at the front.
 		$structure = $permalink_structure;
-		if ( $front != '/' )
-			$structure = str_replace($front, '', $structure);
+		if ( $front != '/' ) {
+			$structure = str_replace( $front, '', $structure );
+		}
 
 		/*
 		 * Create a list of dirs to walk over, making rewrite rules for each level
 		 * so for example, a $structure of /%year%/%monthnum%/%postname% would create
 		 * rewrite rules for /%year%/, /%year%/%monthnum%/ and /%year%/%monthnum%/%postname%
 		 */
-		$structure = trim($structure, '/');
-		$dirs = $walk_dirs ? explode('/', $structure) : array( $structure );
-		$num_dirs = count($dirs);
+		$structure = trim( $structure, '/' );
+		$dirs = $walk_dirs ? explode( '/', $structure ) : array( $structure );
+		$num_dirs = count( $dirs );
 
 		// Strip slashes from the front of $front.
-		$front = preg_replace('|^/+|', '', $front);
+		$front = preg_replace( '|^/+|', '', $front );
 
 		// The main workhorse loop.
 		$post_rewrite = array();
 		$struct = $front;
 		for ( $j = 0; $j < $num_dirs; ++$j ) {
 			// Get the struct for this dir, and trim slashes off the front.
-			$struct .= $dirs[$j] . '/'; // Accumulate. see comment near explode('/', $structure) above.
-			$struct = ltrim($struct, '/');
+			$struct .= $dirs[ $j ] . '/'; // Accumulate. see comment near explode('/', $structure) above.
+			$struct = ltrim( $struct, '/' );
 
 			// Replace tags with regexes.
-			$match = str_replace($this->rewritecode, $this->rewritereplace, $struct);
+			$match = str_replace( $this->rewritecode, $this->rewritereplace, $struct );
 
 			// Make a list of tags, and store how many there are in $num_toks.
-			$num_toks = preg_match_all('/%.+?%/', $struct, $toks);
+			$num_toks = preg_match_all( '/%.+?%/', $struct, $toks );
 
 			// Get the 'tagname=$matches[i]'.
-			$query = ( ! empty( $num_toks ) && isset( $queries[$num_toks - 1] ) ) ? $queries[$num_toks - 1] : '';
+			$query = ( ! empty( $num_toks ) && isset( $queries[ $num_toks - 1 ] ) ) ? $queries[ $num_toks - 1 ] : '';
 
 			// Set up $ep_mask_specific which is used to match more specific URL types.
-			switch ( $dirs[$j] ) {
+			switch ( $dirs[ $j ] ) {
 				case '%year%':
 					$ep_mask_specific = EP_YEAR;
 					break;
@@ -1002,25 +1016,25 @@
 
 			// Create query for /page/xx.
 			$pagematch = $match . $pageregex;
-			$pagequery = $index . '?' . $query . '&paged=' . $this->preg_index($num_toks + 1);
+			$pagequery = $index . '?' . $query . '&paged=' . $this->preg_index( $num_toks + 1 );
 
 			// Create query for /comment-page-xx.
 			$commentmatch = $match . $commentregex;
-			$commentquery = $index . '?' . $query . '&cpage=' . $this->preg_index($num_toks + 1);
+			$commentquery = $index . '?' . $query . '&cpage=' . $this->preg_index( $num_toks + 1 );
 
-			if ( get_option('page_on_front') ) {
+			if ( get_option( 'page_on_front' ) ) {
 				// Create query for Root /comment-page-xx.
 				$rootcommentmatch = $match . $commentregex;
-				$rootcommentquery = $index . '?' . $query . '&page_id=' . get_option('page_on_front') . '&cpage=' . $this->preg_index($num_toks + 1);
+				$rootcommentquery = $index . '?' . $query . '&page_id=' . get_option( 'page_on_front' ) . '&cpage=' . $this->preg_index( $num_toks + 1 );
 			}
 
 			// Create query for /feed/(feed|atom|rss|rss2|rdf).
 			$feedmatch = $match . $feedregex;
-			$feedquery = $feedindex . '?' . $query . '&feed=' . $this->preg_index($num_toks + 1);
+			$feedquery = $feedindex . '?' . $query . '&feed=' . $this->preg_index( $num_toks + 1 );
 
 			// Create query for /(feed|atom|rss|rss2|rdf) (see comment near creation of $feedregex).
 			$feedmatch2 = $match . $feedregex2;
-			$feedquery2 = $feedindex . '?' . $query . '&feed=' . $this->preg_index($num_toks + 1);
+			$feedquery2 = $feedindex . '?' . $query . '&feed=' . $this->preg_index( $num_toks + 1 );
 
 			// Create query and regex for embeds.
 			$embedmatch = $match . $embedregex;
@@ -1037,27 +1051,38 @@
 
 			// ...adding on /feed/ regexes => queries
 			if ( $feed ) {
-				$rewrite = array( $feedmatch => $feedquery, $feedmatch2 => $feedquery2, $embedmatch => $embedquery );
+				$rewrite = array(
+					$feedmatch => $feedquery,
+					$feedmatch2 => $feedquery2,
+					$embedmatch => $embedquery,
+				);
 			}
 
 			//...and /page/xx ones
 			if ( $paged ) {
-				$rewrite = array_merge( $rewrite, array( $pagematch => $pagequery ) );
+				$rewrite = array_merge( $rewrite, array(
+					$pagematch => $pagequery,
+				) );
 			}
 
 			// Only on pages with comments add ../comment-page-xx/.
 			if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask ) {
-				$rewrite = array_merge($rewrite, array($commentmatch => $commentquery));
-			} elseif ( EP_ROOT & $ep_mask && get_option('page_on_front') ) {
-				$rewrite = array_merge($rewrite, array($rootcommentmatch => $rootcommentquery));
+				$rewrite = array_merge( $rewrite, array(
+					$commentmatch => $commentquery,
+				) );
+			} elseif ( EP_ROOT & $ep_mask && get_option( 'page_on_front' ) ) {
+				$rewrite = array_merge( $rewrite, array(
+					$rootcommentmatch => $rootcommentquery,
+				) );
 			}
 
 			// Do endpoints.
 			if ( $endpoints ) {
-				foreach ( (array) $ep_query_append as $regex => $ep) {
+				foreach ( (array) $ep_query_append as $regex => $ep ) {
 					// Add the endpoints on if the mask fits.
-					if ( $ep[0] & $ep_mask || $ep[0] & $ep_mask_specific )
-						$rewrite[$match . $regex] = $index . '?' . $query . $ep[1] . $this->preg_index($num_toks + 2);
+					if ( $ep[0] & $ep_mask || $ep[0] & $ep_mask_specific ) {
+						$rewrite[ $match . $regex ] = $index . '?' . $query . $ep[1] . $this->preg_index( $num_toks + 2 );
+					}
 				}
 			}
 
@@ -1072,20 +1097,23 @@
 				 * 2) post ID, 3) page name, 4) timestamp (year, month, day, hour, second and
 				 * minute all present). Set these flags now as we need them for the endpoints.
 				 */
-				if ( strpos($struct, '%postname%') !== false
-						|| strpos($struct, '%post_id%') !== false
-						|| strpos($struct, '%pagename%') !== false
-						|| (strpos($struct, '%year%') !== false && strpos($struct, '%monthnum%') !== false && strpos($struct, '%day%') !== false && strpos($struct, '%hour%') !== false && strpos($struct, '%minute%') !== false && strpos($struct, '%second%') !== false)
+				if ( strpos( $struct, '%postname%' ) !== false
+						|| strpos( $struct, '%post_id%' ) !== false
+						|| strpos( $struct, '%pagename%' ) !== false
+						|| (strpos( $struct, '%year%' ) !== false && strpos( $struct, '%monthnum%' ) !== false && strpos( $struct, '%day%' ) !== false && strpos( $struct, '%hour%' ) !== false && strpos( $struct, '%minute%' ) !== false && strpos( $struct, '%second%' ) !== false)
 						) {
 					$post = true;
-					if ( strpos($struct, '%pagename%') !== false )
+					if ( strpos( $struct, '%pagename%' ) !== false ) {
 						$page = true;
+					}
 				}
 
 				if ( ! $post ) {
 					// For custom post types, we need to add on endpoints as well.
-					foreach ( get_post_types( array('_builtin' => false ) ) as $ptype ) {
-						if ( strpos($struct, "%$ptype%") !== false ) {
+					foreach ( get_post_types( array(
+						'_builtin' => false,
+					) ) as $ptype ) {
+						if ( strpos( $struct, "%$ptype%" ) !== false ) {
 							$post = true;
 
 							// This is for page style attachment URLs.
@@ -1106,10 +1134,10 @@
 					$embedquery = $embedindex . '?' . $query . '&embed=true';
 
 					// Trim slashes from the end of the regex for this dir.
-					$match = rtrim($match, '/');
+					$match = rtrim( $match, '/' );
 
 					// Get rid of brackets.
-					$submatchbase = str_replace( array('(', ')'), '', $match);
+					$submatchbase = str_replace( array( '(', ')' ), '', $match );
 
 					// Add a rule for at attachments, which take the form of <permalink>/some-text.
 					$sub1 = $submatchbase . '/([^/]+)/';
@@ -1151,18 +1179,18 @@
 					$sub2embed = $sub2 . $embedregex;
 
 					// Create queries for these extra tag-ons we've just dealt with.
-					$subquery = $index . '?attachment=' . $this->preg_index(1);
+					$subquery = $index . '?attachment=' . $this->preg_index( 1 );
 					$subtbquery = $subquery . '&tb=1';
-					$subfeedquery = $subquery . '&feed=' . $this->preg_index(2);
-					$subcommentquery = $subquery . '&cpage=' . $this->preg_index(2);
+					$subfeedquery = $subquery . '&feed=' . $this->preg_index( 2 );
+					$subcommentquery = $subquery . '&cpage=' . $this->preg_index( 2 );
 					$subembedquery = $subquery . '&embed=true';
 
 					// Do endpoints for attachments.
-					if ( !empty($endpoints) ) {
+					if ( ! empty( $endpoints ) ) {
 						foreach ( (array) $ep_query_append as $regex => $ep ) {
 							if ( $ep[0] & EP_ATTACHMENT ) {
-								$rewrite[$sub1 . $regex] = $subquery . $ep[1] . $this->preg_index(3);
-								$rewrite[$sub2 . $regex] = $subquery . $ep[1] . $this->preg_index(3);
+								$rewrite[ $sub1 . $regex ] = $subquery . $ep[1] . $this->preg_index( 3 );
+								$rewrite[ $sub2 . $regex ] = $subquery . $ep[1] . $this->preg_index( 3 );
 							}
 						}
 					}
@@ -1181,29 +1209,35 @@
 					 * When cast to int, returned 0.
 					 */
 					$match = $match . '(?:/([0-9]+))?/?$';
-					$query = $index . '?' . $query . '&page=' . $this->preg_index($num_toks + 1);
+					$query = $index . '?' . $query . '&page=' . $this->preg_index( $num_toks + 1 );
 
-				// Not matching a permalink so this is a lot simpler.
+					// Not matching a permalink so this is a lot simpler.
 				} else {
 					// Close the match and finalise the query.
 					$match .= '?$';
 					$query = $index . '?' . $query;
-				}
+				}// End if().
 
 				/*
 				 * Create the final array for this dir by joining the $rewrite array (which currently
 				 * only contains rules/queries for trackback, pages etc) to the main regex/query for
 				 * this dir
 				 */
-				$rewrite = array_merge($rewrite, array($match => $query));
+				$rewrite = array_merge( $rewrite, array(
+					$match => $query,
+				) );
 
 				// If we're matching a permalink, add those extras (attachments etc) on.
 				if ( $post ) {
 					// Add trackback.
-					$rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite);
+					$rewrite = array_merge( array(
+						$trackbackmatch => $trackbackquery,
+					), $rewrite );
 
 					// Add embed.
-					$rewrite = array_merge( array( $embedmatch => $embedquery ), $rewrite );
+					$rewrite = array_merge( array(
+						$embedmatch => $embedquery,
+					), $rewrite );
 
 					// Add regexes/queries for attachments, attachment trackbacks and so on.
 					if ( ! $page ) {
@@ -1214,16 +1248,23 @@
 							$sub1feed    => $subfeedquery,
 							$sub1feed2   => $subfeedquery,
 							$sub1comment => $subcommentquery,
-							$sub1embed   => $subembedquery
+							$sub1embed   => $subembedquery,
 						) );
 					}
 
-					$rewrite = array_merge( array( $sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery, $sub2comment => $subcommentquery, $sub2embed => $subembedquery ), $rewrite );
+					$rewrite = array_merge( array(
+						$sub2 => $subquery,
+						$sub2tb => $subtbquery,
+						$sub2feed => $subfeedquery,
+						$sub2feed2 => $subfeedquery,
+						$sub2comment => $subcommentquery,
+						$sub2embed => $subembedquery,
+					), $rewrite );
 				}
-			}
+			}// End if().
 			// Add the rules for this dir to the accumulating $post_rewrite.
-			$post_rewrite = array_merge($rewrite, $post_rewrite);
-		}
+			$post_rewrite = array_merge( $rewrite, $post_rewrite );
+		}// End for().
 
 		// The finished rules. phew!
 		return $post_rewrite;
@@ -1245,8 +1286,8 @@
 	 * @param bool   $walk_dirs           Optional, default is false. Whether to create list of directories to walk over.
 	 * @return array
 	 */
-	public function generate_rewrite_rule($permalink_structure, $walk_dirs = false) {
-		return $this->generate_rewrite_rules($permalink_structure, EP_NONE, false, false, false, $walk_dirs);
+	public function generate_rewrite_rule( $permalink_structure, $walk_dirs = false ) {
+		return $this->generate_rewrite_rules( $permalink_structure, EP_NONE, false, false, false, $walk_dirs );
 	}
 
 	/**
@@ -1270,8 +1311,9 @@
 	public function rewrite_rules() {
 		$rewrite = array();
 
-		if ( empty($this->permalink_structure) )
+		if ( empty( $this->permalink_structure ) ) {
 			return $rewrite;
+		}
 
 		// robots.txt -only if installed at the root
 		$home_path = parse_url( home_url() );
@@ -1306,7 +1348,7 @@
 		$post_rewrite = apply_filters( 'post_rewrite_rules', $post_rewrite );
 
 		// Date rewrite rules.
-		$date_rewrite = $this->generate_rewrite_rules($this->get_date_permastruct(), EP_DATE);
+		$date_rewrite = $this->generate_rewrite_rules( $this->get_date_permastruct(), EP_DATE );
 
 		/**
 		 * Filters rewrite rules used for date archives.
@@ -1320,7 +1362,7 @@
 		$date_rewrite = apply_filters( 'date_rewrite_rules', $date_rewrite );
 
 		// Root-level rewrite rules.
-		$root_rewrite = $this->generate_rewrite_rules($this->root . '/', EP_ROOT);
+		$root_rewrite = $this->generate_rewrite_rules( $this->root . '/', EP_ROOT );
 
 		/**
 		 * Filters rewrite rules used for root-level archives.
@@ -1335,7 +1377,7 @@
 		$root_rewrite = apply_filters( 'root_rewrite_rules', $root_rewrite );
 
 		// Comments rewrite rules.
-		$comments_rewrite = $this->generate_rewrite_rules($this->root . $this->comments_base, EP_COMMENTS, false, true, true, false);
+		$comments_rewrite = $this->generate_rewrite_rules( $this->root . $this->comments_base, EP_COMMENTS, false, true, true, false );
 
 		/**
 		 * Filters rewrite rules used for comment feed archives.
@@ -1350,7 +1392,7 @@
 
 		// Search rewrite rules.
 		$search_structure = $this->get_search_permastruct();
-		$search_rewrite = $this->generate_rewrite_rules($search_structure, EP_SEARCH);
+		$search_rewrite = $this->generate_rewrite_rules( $search_structure, EP_SEARCH );
 
 		/**
 		 * Filters rewrite rules used for search archives.
@@ -1365,7 +1407,7 @@
 		$search_rewrite = apply_filters( 'search_rewrite_rules', $search_rewrite );
 
 		// Author rewrite rules.
-		$author_rewrite = $this->generate_rewrite_rules($this->get_author_permastruct(), EP_AUTHORS);
+		$author_rewrite = $this->generate_rewrite_rules( $this->get_author_permastruct(), EP_AUTHORS );
 
 		/**
 		 * Filters rewrite rules used for author archives.
@@ -1394,10 +1436,10 @@
 		// Extra permastructs.
 		foreach ( $this->extra_permastructs as $permastructname => $struct ) {
 			if ( is_array( $struct ) ) {
-				if ( count( $struct ) == 2 )
+				if ( count( $struct ) == 2 ) {
 					$rules = $this->generate_rewrite_rules( $struct[0], $struct[1] );
-				else
-					$rules = $this->generate_rewrite_rules( $struct['struct'], $struct['ep_mask'], $struct['paged'], $struct['feed'], $struct['forcomments'], $struct['walk_dirs'], $struct['endpoints'] );
+				} else { $rules = $this->generate_rewrite_rules( $struct['struct'], $struct['ep_mask'], $struct['paged'], $struct['feed'], $struct['forcomments'], $struct['walk_dirs'], $struct['endpoints'] );
+				}
 			} else {
 				$rules = $this->generate_rewrite_rules( $struct );
 			}
@@ -1427,14 +1469,14 @@
 				$rules = apply_filters( 'tag_rewrite_rules', $rules );
 			}
 
-			$this->extra_rules_top = array_merge($this->extra_rules_top, $rules);
-		}
+			$this->extra_rules_top = array_merge( $this->extra_rules_top, $rules );
+		}// End foreach().
 
 		// Put them together.
-		if ( $this->use_verbose_page_rules )
-			$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules);
-		else
-			$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
+		if ( $this->use_verbose_page_rules ) {
+			$this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules );
+		} else { $this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules );
+		}
 
 		/**
 		 * Fires after the rewrite rules are generated.
@@ -1471,15 +1513,15 @@
 	 * @return array Rewrite rules.
 	 */
 	public function wp_rewrite_rules() {
-		$this->rules = get_option('rewrite_rules');
-		if ( empty($this->rules) ) {
+		$this->rules = get_option( 'rewrite_rules' );
+		if ( empty( $this->rules ) ) {
 			$this->matches = 'matches';
 			$this->rewrite_rules();
 			if ( ! did_action( 'wp_loaded' ) ) {
 				add_action( 'wp_loaded', array( $this, 'flush_rules' ) );
 				return $this->rules;
 			}
-			update_option('rewrite_rules', $this->rules);
+			update_option( 'rewrite_rules', $this->rules );
 		}
 
 		return $this->rules;
@@ -1500,18 +1542,20 @@
 	 * @return string
 	 */
 	public function mod_rewrite_rules() {
-		if ( ! $this->using_permalinks() )
+		if ( ! $this->using_permalinks() ) {
 			return '';
+		}
 
 		$site_root = parse_url( site_url() );
-		if ( isset( $site_root['path'] ) )
-			$site_root = trailingslashit($site_root['path']);
+		if ( isset( $site_root['path'] ) ) {
+			$site_root = trailingslashit( $site_root['path'] );
+		}
 
-		$home_root = parse_url(home_url());
-		if ( isset( $home_root['path'] ) )
-			$home_root = trailingslashit($home_root['path']);
-		else
-			$home_root = '/';
+		$home_root = parse_url( home_url() );
+		if ( isset( $home_root['path'] ) ) {
+			$home_root = trailingslashit( $home_root['path'] );
+		} else { $home_root = '/';
+		}
 
 		$rules = "<IfModule mod_rewrite.c>\n";
 		$rules .= "RewriteEngine On\n";
@@ -1521,9 +1565,9 @@
 		$rules .= "RewriteRule ^index\.php$ - [L]\n";
 
 		// Add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all).
-		foreach ( (array) $this->non_wp_rules as $match => $query) {
+		foreach ( (array) $this->non_wp_rules as $match => $query ) {
 			// Apache 1.3 does not support the reluctant (non-greedy) modifier.
-			$match = str_replace('.+?', '.+', $match);
+			$match = str_replace( '.+?', '.+', $match );
 
 			$rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n";
 		}
@@ -1531,19 +1575,19 @@
 		if ( $this->use_verbose_rules ) {
 			$this->matches = '';
 			$rewrite = $this->rewrite_rules();
-			$num_rules = count($rewrite);
+			$num_rules = count( $rewrite );
 			$rules .= "RewriteCond %{REQUEST_FILENAME} -f [OR]\n" .
 				"RewriteCond %{REQUEST_FILENAME} -d\n" .
 				"RewriteRule ^.*$ - [S=$num_rules]\n";
 
-			foreach ( (array) $rewrite as $match => $query) {
+			foreach ( (array) $rewrite as $match => $query ) {
 				// Apache 1.3 does not support the reluctant (non-greedy) modifier.
-				$match = str_replace('.+?', '.+', $match);
+				$match = str_replace( '.+?', '.+', $match );
 
-				if ( strpos($query, $this->index) !== false )
+				if ( strpos( $query, $this->index ) !== false ) {
 					$rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n";
-				else
-					$rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n";
+				} else { $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n";
+				}
 			}
 		} else {
 			$rules .= "RewriteCond %{REQUEST_FILENAME} !-f\n" .
@@ -1587,8 +1631,9 @@
 	 * @return string IIS7 URL rewrite rule sets.
 	 */
 	public function iis7_url_rewrite_rules( $add_parent_tags = false ) {
-		if ( ! $this->using_permalinks() )
+		if ( ! $this->using_permalinks() ) {
 			return '';
+		}
 		$rules = '';
 		if ( $add_parent_tags ) {
 			$rules .= '<configuration>
@@ -1748,10 +1793,12 @@
 	 */
 	public function add_permastruct( $name, $struct, $args = array() ) {
 		// Back-compat for the old parameters: $with_front and $ep_mask.
-		if ( ! is_array( $args ) )
+		if ( ! is_array( $args ) ) {
 			$args = array( 'with_front' => $args );
-		if ( func_num_args() == 4 )
+		}
+		if ( func_num_args() == 4 ) {
 			$args['ep_mask'] = func_get_arg( 3 );
+		}
 
 		$defaults = array(
 			'with_front' => true,
@@ -1765,10 +1812,10 @@
 		$args = array_intersect_key( $args, $defaults );
 		$args = wp_parse_args( $args, $defaults );
 
-		if ( $args['with_front'] )
+		if ( $args['with_front'] ) {
 			$struct = $this->front . $struct;
-		else
-			$struct = $this->root . $struct;
+		} else { $struct = $this->root . $struct;
+		}
 		$args['struct'] = $struct;
 
 		$this->extra_permastructs[ $name ] = $args;
@@ -1829,10 +1876,12 @@
 		if ( ! $hard || ! apply_filters( 'flush_rewrite_rules_hard', true ) ) {
 			return;
 		}
-		if ( function_exists( 'save_mod_rewrite_rules' ) )
+		if ( function_exists( 'save_mod_rewrite_rules' ) ) {
 			save_mod_rewrite_rules();
-		if ( function_exists( 'iis7_save_url_rewrite_rules' ) )
+		}
+		if ( function_exists( 'iis7_save_url_rewrite_rules' ) ) {
 			iis7_save_url_rewrite_rules();
+		}
 	}
 
 	/**
@@ -1847,26 +1896,27 @@
 	 */
 	public function init() {
 		$this->extra_rules = $this->non_wp_rules = $this->endpoints = array();
-		$this->permalink_structure = get_option('permalink_structure');
-		$this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%'));
+		$this->permalink_structure = get_option( 'permalink_structure' );
+		$this->front = substr( $this->permalink_structure, 0, strpos( $this->permalink_structure, '%' ) );
 		$this->root = '';
 
-		if ( $this->using_index_permalinks() )
+		if ( $this->using_index_permalinks() ) {
 			$this->root = $this->index . '/';
+		}
 
-		unset($this->author_structure);
-		unset($this->date_structure);
-		unset($this->page_structure);
-		unset($this->search_structure);
-		unset($this->feed_structure);
-		unset($this->comment_feed_structure);
-		$this->use_trailing_slashes = ( '/' == substr($this->permalink_structure, -1, 1) );
+		unset( $this->author_structure );
+		unset( $this->date_structure );
+		unset( $this->page_structure );
+		unset( $this->search_structure );
+		unset( $this->feed_structure );
+		unset( $this->comment_feed_structure );
+		$this->use_trailing_slashes = ( '/' == substr( $this->permalink_structure, -1, 1 ) );
 
 		// Enable generic rules for pages if permalink structure doesn't begin with a wildcard.
-		if ( preg_match("/^[^%]*%(?:postname|category|tag|author)%/", $this->permalink_structure) )
+		if ( preg_match( '/^[^%]*%(?:postname|category|tag|author)%/', $this->permalink_structure ) ) {
 			 $this->use_verbose_page_rules = true;
-		else
-			$this->use_verbose_page_rules = false;
+		} else { $this->use_verbose_page_rules = false;
+		}
 	}
 
 	/**
@@ -1884,10 +1934,10 @@
 	 *
 	 * @param string $permalink_structure Permalink structure.
 	 */
-	public function set_permalink_structure($permalink_structure) {
+	public function set_permalink_structure( $permalink_structure ) {
 		if ( $permalink_structure != $this->permalink_structure ) {
 			$old_permalink_structure = $this->permalink_structure;
-			update_option('permalink_structure', $permalink_structure);
+			update_option( 'permalink_structure', $permalink_structure );
 
 			$this->init();
 
@@ -1915,9 +1965,9 @@
 	 *
 	 * @param string $category_base Category permalink structure base.
 	 */
-	public function set_category_base($category_base) {
-		if ( $category_base != get_option('category_base') ) {
-			update_option('category_base', $category_base);
+	public function set_category_base( $category_base ) {
+		if ( $category_base != get_option( 'category_base' ) ) {
+			update_option( 'category_base', $category_base );
 			$this->init();
 		}
 	}
@@ -1935,7 +1985,7 @@
 	 * @param string $tag_base Tag permalink structure base.
 	 */
 	public function set_tag_base( $tag_base ) {
-		if ( $tag_base != get_option( 'tag_base') ) {
+		if ( $tag_base != get_option( 'tag_base' ) ) {
 			update_option( 'tag_base', $tag_base );
 			$this->init();
 		}
Index: src/wp-includes/class-wp-role.php
===================================================================
--- src/wp-includes/class-wp-role.php	(revision 40901)
+++ src/wp-includes/class-wp-role.php	(working copy)
@@ -58,7 +58,7 @@
 	 * @param bool $grant Whether role has capability privilege.
 	 */
 	public function add_cap( $cap, $grant = true ) {
-		$this->capabilities[$cap] = $grant;
+		$this->capabilities[ $cap ] = $grant;
 		wp_roles()->add_cap( $this->name, $cap, $grant );
 	}
 
@@ -76,7 +76,7 @@
 	 * @param string $cap Capability name.
 	 */
 	public function remove_cap( $cap ) {
-		unset( $this->capabilities[$cap] );
+		unset( $this->capabilities[ $cap ] );
 		wp_roles()->remove_cap( $this->name, $cap );
 	}
 
@@ -106,10 +106,10 @@
 		 */
 		$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );
 
-		if ( !empty( $capabilities[$cap] ) )
-			return $capabilities[$cap];
-		else
-			return false;
+		if ( ! empty( $capabilities[ $cap ] ) ) {
+			return $capabilities[ $cap ];
+		} else { return false;
+		}
 	}
 
 }
Index: src/wp-includes/class-wp-roles.php
===================================================================
--- src/wp-includes/class-wp-roles.php	(revision 40901)
+++ src/wp-includes/class-wp-roles.php	(working copy)
@@ -118,14 +118,15 @@
 			$this->roles = get_option( $this->role_key );
 		}
 
-		if ( empty( $this->roles ) )
+		if ( empty( $this->roles ) ) {
 			return;
+		}
 
 		$this->role_objects = array();
-		$this->role_names =  array();
+		$this->role_names = array();
 		foreach ( array_keys( $this->roles ) as $role ) {
-			$this->role_objects[$role] = new WP_Role( $role, $this->roles[$role]['capabilities'] );
-			$this->role_names[$role] = $this->roles[$role]['name'];
+			$this->role_objects[ $role ] = new WP_Role( $role, $this->roles[ $role ]['capabilities'] );
+			$this->role_names[ $role ] = $this->roles[ $role ]['name'];
 		}
 
 		/**
@@ -174,15 +175,16 @@
 			return;
 		}
 
-		$this->roles[$role] = array(
+		$this->roles[ $role ] = array(
 			'name' => $display_name,
-			'capabilities' => $capabilities
+			'capabilities' => $capabilities,
 			);
-		if ( $this->use_db )
+		if ( $this->use_db ) {
 			update_option( $this->role_key, $this->roles );
-		$this->role_objects[$role] = new WP_Role( $role, $capabilities );
-		$this->role_names[$role] = $display_name;
-		return $this->role_objects[$role];
+		}
+		$this->role_objects[ $role ] = new WP_Role( $role, $capabilities );
+		$this->role_names[ $role ] = $display_name;
+		return $this->role_objects[ $role ];
 	}
 
 	/**
@@ -194,18 +196,21 @@
 	 * @param string $role Role name.
 	 */
 	public function remove_role( $role ) {
-		if ( ! isset( $this->role_objects[$role] ) )
+		if ( ! isset( $this->role_objects[ $role ] ) ) {
 			return;
+		}
 
-		unset( $this->role_objects[$role] );
-		unset( $this->role_names[$role] );
-		unset( $this->roles[$role] );
+		unset( $this->role_objects[ $role ] );
+		unset( $this->role_names[ $role ] );
+		unset( $this->roles[ $role ] );
 
-		if ( $this->use_db )
+		if ( $this->use_db ) {
 			update_option( $this->role_key, $this->roles );
+		}
 
-		if ( get_option( 'default_role' ) == $role )
+		if ( get_option( 'default_role' ) == $role ) {
 			update_option( 'default_role', 'subscriber' );
+		}
 	}
 
 	/**
@@ -219,12 +224,14 @@
 	 * @param bool $grant Optional, default is true. Whether role is capable of performing capability.
 	 */
 	public function add_cap( $role, $cap, $grant = true ) {
-		if ( ! isset( $this->roles[$role] ) )
+		if ( ! isset( $this->roles[ $role ] ) ) {
 			return;
+		}
 
-		$this->roles[$role]['capabilities'][$cap] = $grant;
-		if ( $this->use_db )
+		$this->roles[ $role ]['capabilities'][ $cap ] = $grant;
+		if ( $this->use_db ) {
 			update_option( $this->role_key, $this->roles );
+		}
 	}
 
 	/**
@@ -237,12 +244,14 @@
 	 * @param string $cap Capability name.
 	 */
 	public function remove_cap( $role, $cap ) {
-		if ( ! isset( $this->roles[$role] ) )
+		if ( ! isset( $this->roles[ $role ] ) ) {
 			return;
+		}
 
-		unset( $this->roles[$role]['capabilities'][$cap] );
-		if ( $this->use_db )
+		unset( $this->roles[ $role ]['capabilities'][ $cap ] );
+		if ( $this->use_db ) {
 			update_option( $this->role_key, $this->roles );
+		}
 	}
 
 	/**
@@ -255,10 +264,10 @@
 	 * @return WP_Role|null WP_Role object if found, null if the role does not exist.
 	 */
 	public function get_role( $role ) {
-		if ( isset( $this->role_objects[$role] ) )
-			return $this->role_objects[$role];
-		else
-			return null;
+		if ( isset( $this->role_objects[ $role ] ) ) {
+			return $this->role_objects[ $role ];
+		} else { return null;
+		}
 	}
 
 	/**
@@ -283,6 +292,6 @@
 	 * @return bool
 	 */
 	public function is_role( $role ) {
-		return isset( $this->role_names[$role] );
+		return isset( $this->role_names[ $role ] );
 	}
 }
Index: src/wp-includes/class-wp-session-tokens.php
===================================================================
--- src/wp-includes/class-wp-session-tokens.php	(revision 40901)
+++ src/wp-includes/class-wp-session-tokens.php	(working copy)
@@ -140,7 +140,7 @@
 		$session['expiration'] = $expiration;
 
 		// IP address.
-		if ( !empty( $_SERVER['REMOTE_ADDR'] ) ) {
+		if ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {
 			$session['ip'] = $_SERVER['REMOTE_ADDR'];
 		}
 
Index: src/wp-includes/class-wp-simplepie-file.php
===================================================================
--- src/wp-includes/class-wp-simplepie-file.php	(revision 40901)
+++ src/wp-includes/class-wp-simplepie-file.php	(working copy)
@@ -33,7 +33,7 @@
 	 * @param boolean      $force_fsockopen Optional. Whether to force opening internet or unix domain socket
 	 *                                      connection or not. Default false.
 	 */
-	public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) {
+	public function __construct( $url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false ) {
 		$this->url = $url;
 		$this->timeout = $timeout;
 		$this->redirects = $redirects;
@@ -42,21 +42,23 @@
 
 		$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE;
 
-		if ( preg_match('/^http(s)?:\/\//i', $url) ) {
+		if ( preg_match( '/^http(s)?:\/\//i', $url ) ) {
 			$args = array(
 				'timeout' => $this->timeout,
 				'redirection' => $this->redirects,
 			);
 
-			if ( !empty($this->headers) )
+			if ( ! empty( $this->headers ) ) {
 				$args['headers'] = $this->headers;
+			}
 
-			if ( SIMPLEPIE_USERAGENT != $this->useragent ) //Use default WP user agent unless custom has been specified
+			if ( SIMPLEPIE_USERAGENT != $this->useragent ) { //Use default WP user agent unless custom has been specified
 				$args['user-agent'] = $this->useragent;
+			}
 
-			$res = wp_safe_remote_request($url, $args);
+			$res = wp_safe_remote_request( $url, $args );
 
-			if ( is_wp_error($res) ) {
+			if ( is_wp_error( $res ) ) {
 				$this->error = 'WP HTTP Error: ' . $res->get_error_message();
 				$this->success = false;
 			} else {
Index: src/wp-includes/class-wp-simplepie-sanitize-kses.php
===================================================================
--- src/wp-includes/class-wp-simplepie-sanitize-kses.php	(revision 40901)
+++ src/wp-includes/class-wp-simplepie-sanitize-kses.php	(working copy)
@@ -36,10 +36,9 @@
 	public function sanitize( $data, $type, $base = '' ) {
 		$data = trim( $data );
 		if ( $type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML ) {
-			if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data)) {
+			if ( preg_match( '/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data ) ) {
 				$type |= SIMPLEPIE_CONSTRUCT_HTML;
-			}
-			else {
+			} else {
 				$type |= SIMPLEPIE_CONSTRUCT_TEXT;
 			}
 		}
Index: src/wp-includes/class-wp-site-query.php
===================================================================
--- src/wp-includes/class-wp-site-query.php	(revision 40901)
+++ src/wp-includes/class-wp-site-query.php	(working copy)
@@ -374,7 +374,7 @@
 			$orderby = implode( ', ', $orderby_array );
 		} else {
 			$orderby = "blog_id $order";
-		}
+		}// End if().
 
 		$number = absint( $this->query_vars['number'] );
 		$offset = absint( $this->query_vars['offset'] );
@@ -401,12 +401,12 @@
 
 		// Parse site IDs for an IN clause.
 		if ( ! empty( $this->query_vars['site__in'] ) ) {
-			$this->sql_clauses['where']['site__in'] = "blog_id IN ( " . implode( ',', wp_parse_id_list( $this->query_vars['site__in'] ) ) . ' )';
+			$this->sql_clauses['where']['site__in'] = 'blog_id IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['site__in'] ) ) . ' )';
 		}
 
 		// Parse site IDs for a NOT IN clause.
 		if ( ! empty( $this->query_vars['site__not_in'] ) ) {
-			$this->sql_clauses['where']['site__not_in'] = "blog_id NOT IN ( " . implode( ',', wp_parse_id_list( $this->query_vars['site__not_in'] ) ) . ' )';
+			$this->sql_clauses['where']['site__not_in'] = 'blog_id NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['site__not_in'] ) ) . ' )';
 		}
 
 		$network_id = absint( $this->query_vars['network_id'] );
@@ -455,32 +455,32 @@
 
 		if ( is_numeric( $this->query_vars['archived'] ) ) {
 			$archived = absint( $this->query_vars['archived'] );
-			$this->sql_clauses['where']['archived'] = $wpdb->prepare( "archived = %d ", $archived );
+			$this->sql_clauses['where']['archived'] = $wpdb->prepare( 'archived = %d ', $archived );
 		}
 
 		if ( is_numeric( $this->query_vars['mature'] ) ) {
 			$mature = absint( $this->query_vars['mature'] );
-			$this->sql_clauses['where']['mature'] = $wpdb->prepare( "mature = %d ", $mature );
+			$this->sql_clauses['where']['mature'] = $wpdb->prepare( 'mature = %d ', $mature );
 		}
 
 		if ( is_numeric( $this->query_vars['spam'] ) ) {
 			$spam = absint( $this->query_vars['spam'] );
-			$this->sql_clauses['where']['spam'] = $wpdb->prepare( "spam = %d ", $spam );
+			$this->sql_clauses['where']['spam'] = $wpdb->prepare( 'spam = %d ', $spam );
 		}
 
 		if ( is_numeric( $this->query_vars['deleted'] ) ) {
 			$deleted = absint( $this->query_vars['deleted'] );
-			$this->sql_clauses['where']['deleted'] = $wpdb->prepare( "deleted = %d ", $deleted );
+			$this->sql_clauses['where']['deleted'] = $wpdb->prepare( 'deleted = %d ', $deleted );
 		}
 
 		if ( is_numeric( $this->query_vars['public'] ) ) {
 			$public = absint( $this->query_vars['public'] );
-			$this->sql_clauses['where']['public'] = $wpdb->prepare( "public = %d ", $public );
+			$this->sql_clauses['where']['public'] = $wpdb->prepare( 'public = %d ', $public );
 		}
 
 		if ( is_numeric( $this->query_vars['lang_id'] ) ) {
 			$lang_id = absint( $this->query_vars['lang_id'] );
-			$this->sql_clauses['where']['lang_id'] = $wpdb->prepare( "lang_id = %d ", $lang_id );
+			$this->sql_clauses['where']['lang_id'] = $wpdb->prepare( 'lang_id = %d ', $lang_id );
 		}
 
 		// Parse site language IDs for an IN clause.
Index: src/wp-includes/class-wp-site.php
===================================================================
--- src/wp-includes/class-wp-site.php	(revision 40901)
+++ src/wp-includes/class-wp-site.php	(working copy)
@@ -201,7 +201,7 @@
 	 * @param WP_Site|object $site A site object.
 	 */
 	public function __construct( $site ) {
-		foreach( get_object_vars( $site ) as $key => $value ) {
+		foreach ( get_object_vars( $site ) as $key => $value ) {
 			$this->$key = $value;
 		}
 	}
Index: src/wp-includes/class-wp-tax-query.php
===================================================================
--- src/wp-includes/class-wp-tax-query.php	(revision 40901)
+++ src/wp-includes/class-wp-tax-query.php	(working copy)
@@ -50,7 +50,10 @@
 	 * @access private
 	 * @var string
 	 */
-	private static $no_results = array( 'join' => array( '' ), 'where' => array( '0 = 1' ) );
+	private static $no_results = array(
+		'join' => array( '' ),
+		'where' => array( '0 = 1' ),
+	);
 
 	/**
 	 * A flat list of table aliases used in the JOIN clauses.
@@ -155,7 +158,7 @@
 			if ( 'relation' === $key ) {
 				$cleaned_query['relation'] = $this->sanitize_relation( $query );
 
-			// First-order clause.
+				// First-order clause.
 			} elseif ( self::is_first_order_clause( $query ) ) {
 
 				$cleaned_clause = array_merge( $defaults, $query );
@@ -184,8 +187,6 @@
 						$this->queried_terms[ $taxonomy ]['field'] = $cleaned_clause['field'];
 					}
 				}
-
-			// Otherwise, it's a nested query, so we recurse.
 			} elseif ( is_array( $query ) ) {
 				$cleaned_subquery = $this->sanitize_query( $query );
 
@@ -197,8 +198,8 @@
 
 					$cleaned_query[] = $cleaned_subquery;
 				}
-			}
-		}
+			}// End if().
+		}// End foreach().
 
 		return $cleaned_query;
 	}
@@ -328,7 +329,7 @@
 
 		$indent = '';
 		for ( $i = 0; $i < $depth; $i++ ) {
-			$indent .= "  ";
+			$indent .= '  ';
 		}
 
 		foreach ( $query as $key => &$clause ) {
@@ -350,7 +351,7 @@
 					}
 
 					$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );
-				// This is a subquery, so we recurse.
+					// This is a subquery, so we recurse.
 				} else {
 					$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );
 
@@ -445,7 +446,6 @@
 				$join .= " ON ($this->primary_table.$this->primary_id_column = $alias.object_id)";
 			}
 
-
 			$where = "$alias.term_taxonomy_id $operator ($terms)";
 
 		} elseif ( 'NOT IN' == $operator ) {
@@ -490,7 +490,7 @@
 				AND $wpdb->term_relationships.object_id = $this->primary_table.$this->primary_id_column
 			)", $clause['taxonomy'] );
 
-		}
+		}// End if().
 
 		$sql['join'][]  = $join;
 		$sql['where'][] = $where;
@@ -578,8 +578,9 @@
 		if ( is_taxonomy_hierarchical( $query['taxonomy'] ) && $query['include_children'] ) {
 			$this->transform_query( $query, 'term_id' );
 
-			if ( is_wp_error( $query ) )
+			if ( is_wp_error( $query ) ) {
 				return;
+			}
 
 			$children = array();
 			foreach ( $query['terms'] as $term ) {
@@ -606,11 +607,13 @@
 	public function transform_query( &$query, $resulting_field ) {
 		global $wpdb;
 
-		if ( empty( $query['terms'] ) )
+		if ( empty( $query['terms'] ) ) {
 			return;
+		}
 
-		if ( $query['field'] == $resulting_field )
+		if ( $query['field'] == $resulting_field ) {
 			return;
+		}
 
 		$resulting_field = sanitize_key( $resulting_field );
 
@@ -631,7 +634,7 @@
 					$term = "'" . esc_sql( $clean_term ) . "'";
 				}
 
-				$terms = implode( ",", $query['terms'] );
+				$terms = implode( ',', $query['terms'] );
 
 				$terms = $wpdb->get_col( "
 					SELECT $wpdb->term_taxonomy.$resulting_field
@@ -657,7 +660,7 @@
 					WHERE taxonomy = '{$query['taxonomy']}'
 					AND term_id IN ($terms)
 				" );
-		}
+		}// End switch().
 
 		if ( 'AND' == $query['operator'] && count( $terms ) < count( $query['terms'] ) ) {
 			$query = new WP_Error( 'inexistent_terms', __( 'Inexistent terms.' ) );
Index: src/wp-includes/class-wp-term-query.php
===================================================================
--- src/wp-includes/class-wp-term-query.php	(revision 40901)
+++ src/wp-includes/class-wp-term-query.php	(working copy)
@@ -432,7 +432,7 @@
 					(array) get_terms( $taxonomies[0], array(
 						'child_of' => intval( $extrunk ),
 						'fields' => 'ids',
-						'hide_empty' => 0
+						'hide_empty' => 0,
 					) )
 				);
 			}
@@ -505,16 +505,16 @@
 				$tt_ids = implode( ',', array_map( 'intval', $args['term_taxonomy_id'] ) );
 				$this->sql_clauses['where']['term_taxonomy_id'] = "tt.term_taxonomy_id IN ({$tt_ids})";
 			} else {
-				$this->sql_clauses['where']['term_taxonomy_id'] = $wpdb->prepare( "tt.term_taxonomy_id = %d", $args['term_taxonomy_id'] );
+				$this->sql_clauses['where']['term_taxonomy_id'] = $wpdb->prepare( 'tt.term_taxonomy_id = %d', $args['term_taxonomy_id'] );
 			}
 		}
 
 		if ( ! empty( $args['name__like'] ) ) {
-			$this->sql_clauses['where']['name__like'] = $wpdb->prepare( "t.name LIKE %s", '%' . $wpdb->esc_like( $args['name__like'] ) . '%' );
+			$this->sql_clauses['where']['name__like'] = $wpdb->prepare( 't.name LIKE %s', '%' . $wpdb->esc_like( $args['name__like'] ) . '%' );
 		}
 
 		if ( ! empty( $args['description__like'] ) ) {
-			$this->sql_clauses['where']['description__like'] = $wpdb->prepare( "tt.description LIKE %s", '%' . $wpdb->esc_like( $args['description__like'] ) . '%' );
+			$this->sql_clauses['where']['description__like'] = $wpdb->prepare( 'tt.description LIKE %s', '%' . $wpdb->esc_like( $args['description__like'] ) . '%' );
 		}
 
 		if ( ! empty( $args['object_ids'] ) ) {
@@ -544,7 +544,7 @@
 		if ( 'count' == $args['fields'] ) {
 			$hierarchical = false;
 		}
-		if ( $args['hide_empty'] && !$hierarchical ) {
+		if ( $args['hide_empty'] && ! $hierarchical ) {
 			$this->sql_clauses['where']['count'] = 'tt.count > 0';
 		}
 
@@ -562,7 +562,6 @@
 			$limits = '';
 		}
 
-
 		if ( ! empty( $args['search'] ) ) {
 			$this->sql_clauses['where']['search'] = $this->get_search_sql( $args['search'] );
 		}
@@ -579,7 +578,7 @@
 		if ( ! empty( $meta_clauses ) ) {
 			$join .= $mq_sql['join'];
 			$this->sql_clauses['where']['meta_query'] = preg_replace( '/^\s*AND\s*/', '', $mq_sql['where'] );
-			$distinct .= "DISTINCT";
+			$distinct .= 'DISTINCT';
 
 		}
 
@@ -653,13 +652,13 @@
 		 */
 		$clauses = apply_filters( 'terms_clauses', compact( 'fields', 'join', 'where', 'distinct', 'orderby', 'order', 'limits' ), $taxonomies, $args );
 
-		$fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
-		$join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
-		$where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
-		$distinct = isset( $clauses[ 'distinct' ] ) ? $clauses[ 'distinct' ] : '';
-		$orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
-		$order = isset( $clauses[ 'order' ] ) ? $clauses[ 'order' ] : '';
-		$limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
+		$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
+		$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
+		$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
+		$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';
+		$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
+		$order = isset( $clauses['order'] ) ? $clauses['order'] : '';
+		$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
 
 		if ( $where ) {
 			$where = "WHERE $where";
@@ -909,7 +908,7 @@
 			return $orderby;
 		}
 
-		switch( $orderby_raw ) {
+		switch ( $orderby_raw ) {
 			case $primary_meta_key:
 			case 'meta_value':
 				if ( ! empty( $primary_meta_query['type'] ) ) {
Index: src/wp-includes/class-wp-term.php
===================================================================
--- src/wp-includes/class-wp-term.php	(revision 40901)
+++ src/wp-includes/class-wp-term.php	(working copy)
@@ -148,12 +148,10 @@
 						break;
 					}
 				}
-
-			// If only one match was found, it's the one we want.
 			} elseif ( 1 === count( $terms ) ) {
 				$_term = reset( $terms );
 
-			// Otherwise, the term must be shared between taxonomies.
+				// Otherwise, the term must be shared between taxonomies.
 			} else {
 				// If the term is shared only with invalid taxonomies, return the one valid term.
 				foreach ( $terms as $t ) {
@@ -185,7 +183,7 @@
 			if ( 1 === count( $terms ) ) {
 				wp_cache_add( $term_id, $_term, 'terms' );
 			}
-		}
+		}// End if().
 
 		$term_obj = new WP_Term( $_term );
 		$term_obj->filter( $term_obj->filter );
Index: src/wp-includes/class-wp-text-diff-renderer-inline.php
===================================================================
--- src/wp-includes/class-wp-text-diff-renderer-inline.php	(revision 40901)
+++ src/wp-includes/class-wp-text-diff-renderer-inline.php	(working copy)
@@ -23,8 +23,8 @@
 	 * @param string $newlineEscape
 	 * @return string
 	 */
-	public function _splitOnWords($string, $newlineEscape = "\n") {
-		$string = str_replace("\0", '', $string);
+	public function _splitOnWords( $string, $newlineEscape = "\n" ) {
+		$string = str_replace( "\0", '', $string );
 		$words  = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
 		$words  = str_replace( "\n", $newlineEscape, $words );
 		return $words;
Index: src/wp-includes/class-wp-text-diff-renderer-table.php
===================================================================
--- src/wp-includes/class-wp-text-diff-renderer-table.php	(revision 40901)
+++ src/wp-includes/class-wp-text-diff-renderer-table.php	(working copy)
@@ -71,8 +71,9 @@
 	 */
 	public function __construct( $params = array() ) {
 		parent::__construct( $params );
-		if ( isset( $params[ 'show_split_view' ] ) )
-			$this->_show_split_view = $params[ 'show_split_view' ];
+		if ( isset( $params['show_split_view'] ) ) {
+			$this->_show_split_view = $params['show_split_view'];
+		}
 	}
 
 	/**
@@ -91,7 +92,7 @@
 	 * @param array $lines
 	 * @param string $prefix
 	 */
-	public function _lines( $lines, $prefix=' ' ) {
+	public function _lines( $lines, $prefix = ' ' ) {
 	}
 
 	/**
@@ -144,7 +145,7 @@
 	 */
 	public function _added( $lines, $encode = true ) {
 		$r = '';
-		foreach ($lines as $line) {
+		foreach ( $lines as $line ) {
 			if ( $encode ) {
 				$processed_line = htmlspecialchars( $line );
 
@@ -159,7 +160,7 @@
 				 *
 				 * @param String $processed_line The processed diffed line.
 				 * @param String $line           The unprocessed diffed line.
-		 		 * @param string null            The line context. Values are 'added', 'deleted' or 'unchanged'.
+				  * @param string null            The line context. Values are 'added', 'deleted' or 'unchanged'.
 				 */
 				$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'added' );
 			}
@@ -183,7 +184,7 @@
 	 */
 	public function _deleted( $lines, $encode = true ) {
 		$r = '';
-		foreach ($lines as $line) {
+		foreach ( $lines as $line ) {
 			if ( $encode ) {
 				$processed_line = htmlspecialchars( $line );
 
@@ -195,7 +196,6 @@
 			} else {
 				$r .= '<tr>' . $this->deletedLine( $line ) . "</tr>\n";
 			}
-
 		}
 		return $r;
 	}
@@ -210,15 +210,15 @@
 	 */
 	public function _context( $lines, $encode = true ) {
 		$r = '';
-		foreach ($lines as $line) {
+		foreach ( $lines as $line ) {
 			if ( $encode ) {
 				$processed_line = htmlspecialchars( $line );
 
 				/** This filter is documented in wp-includes/wp-diff.php */
 				$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'unchanged' );
 			}
-			if (  $this->_show_split_view ) {
-				$r .= '<tr>' . $this->contextLine( $line ) . $this->emptyLine() . $this->contextLine( $line )  . "</tr>\n";
+			if ( $this->_show_split_view ) {
+				$r .= '<tr>' . $this->contextLine( $line ) . $this->emptyLine() . $this->contextLine( $line ) . "</tr>\n";
 			} else {
 				$r .= '<tr>' . $this->contextLine( $line ) . "</tr>\n";
 			}
@@ -257,58 +257,60 @@
 
 		// Compute word diffs for each matched pair using the inline diff
 		foreach ( $orig_matches as $o => $f ) {
-			if ( is_numeric($o) && is_numeric($f) ) {
-				$text_diff = new Text_Diff( 'auto', array( array($orig[$o]), array($final[$f]) ) );
+			if ( is_numeric( $o ) && is_numeric( $f ) ) {
+				$text_diff = new Text_Diff( 'auto', array( array( $orig[ $o ] ), array( $final[ $f ] ) ) );
 				$renderer = new $this->inline_diff_renderer;
 				$diff = $renderer->render( $text_diff );
 
 				// If they're too different, don't include any <ins> or <dels>
 				if ( preg_match_all( '!(<ins>.*?</ins>|<del>.*?</del>)!', $diff, $diff_matches ) ) {
 					// length of all text between <ins> or <del>
-					$stripped_matches = strlen(strip_tags( join(' ', $diff_matches[0]) ));
+					$stripped_matches = strlen( strip_tags( join( ' ', $diff_matches[0] ) ) );
 					// since we count lengith of text between <ins> or <del> (instead of picking just one),
 					//	we double the length of chars not in those tags.
-					$stripped_diff = strlen(strip_tags( $diff )) * 2 - $stripped_matches;
+					$stripped_diff = strlen( strip_tags( $diff ) ) * 2 - $stripped_matches;
 					$diff_ratio = $stripped_matches / $stripped_diff;
-					if ( $diff_ratio > $this->_diff_threshold )
+					if ( $diff_ratio > $this->_diff_threshold ) {
 						continue; // Too different. Don't save diffs.
+					}
 				}
 
 				// Un-inline the diffs by removing del or ins
-				$orig_diffs[$o]  = preg_replace( '|<ins>.*?</ins>|', '', $diff );
-				$final_diffs[$f] = preg_replace( '|<del>.*?</del>|', '', $diff );
+				$orig_diffs[ $o ]  = preg_replace( '|<ins>.*?</ins>|', '', $diff );
+				$final_diffs[ $f ] = preg_replace( '|<del>.*?</del>|', '', $diff );
 			}
 		}
 
-		foreach ( array_keys($orig_rows) as $row ) {
+		foreach ( array_keys( $orig_rows ) as $row ) {
 			// Both columns have blanks. Ignore them.
-			if ( $orig_rows[$row] < 0 && $final_rows[$row] < 0 )
+			if ( $orig_rows[ $row ] < 0 && $final_rows[ $row ] < 0 ) {
 				continue;
+			}
 
 			// If we have a word based diff, use it. Otherwise, use the normal line.
-			if ( isset( $orig_diffs[$orig_rows[$row]] ) )
-				$orig_line = $orig_diffs[$orig_rows[$row]];
-			elseif ( isset( $orig[$orig_rows[$row]] ) )
-				$orig_line = htmlspecialchars($orig[$orig_rows[$row]]);
-			else
-				$orig_line = '';
-
-			if ( isset( $final_diffs[$final_rows[$row]] ) )
-				$final_line = $final_diffs[$final_rows[$row]];
-			elseif ( isset( $final[$final_rows[$row]] ) )
-				$final_line = htmlspecialchars($final[$final_rows[$row]]);
-			else
-				$final_line = '';
-
-			if ( $orig_rows[$row] < 0 ) { // Orig is blank. This is really an added row.
-				$r .= $this->_added( array($final_line), false );
-			} elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row.
-				$r .= $this->_deleted( array($orig_line), false );
+			if ( isset( $orig_diffs[ $orig_rows[ $row ] ] ) ) {
+				$orig_line = $orig_diffs[ $orig_rows[ $row ] ];
+			} elseif ( isset( $orig[ $orig_rows[ $row ] ] ) ) {
+				$orig_line = htmlspecialchars( $orig[ $orig_rows[ $row ] ] );
+			} else { $orig_line = '';
+			}
+
+			if ( isset( $final_diffs[ $final_rows[ $row ] ] ) ) {
+				$final_line = $final_diffs[ $final_rows[ $row ] ];
+			} elseif ( isset( $final[ $final_rows[ $row ] ] ) ) {
+				$final_line = htmlspecialchars( $final[ $final_rows[ $row ] ] );
+			} else { $final_line = '';
+			}
+
+			if ( $orig_rows[ $row ] < 0 ) { // Orig is blank. This is really an added row.
+				$r .= $this->_added( array( $final_line ), false );
+			} elseif ( $final_rows[ $row ] < 0 ) { // Final is blank. This is really a deleted row.
+				$r .= $this->_deleted( array( $orig_line ), false );
 			} else { // A true changed row.
 				if ( $this->_show_split_view ) {
 					$r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->emptyLine() . $this->addedLine( $final_line ) . "</tr>\n";
 				} else {
-					$r .= '<tr>' . $this->deletedLine( $orig_line ) . "</tr><tr>" . $this->addedLine( $final_line ) . "</tr>\n";
+					$r .= '<tr>' . $this->deletedLine( $orig_line ) . '</tr><tr>' . $this->addedLine( $final_line ) . "</tr>\n";
 				}
 			}
 		}
@@ -334,80 +336,81 @@
 
 		// Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array.
 		$matches = array();
-		foreach ( array_keys($orig) as $o ) {
-			foreach ( array_keys($final) as $f ) {
-				$matches["$o,$f"] = $this->compute_string_distance( $orig[$o], $final[$f] );
+		foreach ( array_keys( $orig ) as $o ) {
+			foreach ( array_keys( $final ) as $f ) {
+				$matches[ "$o,$f" ] = $this->compute_string_distance( $orig[ $o ], $final[ $f ] );
 			}
 		}
-		asort($matches); // Order by string distance.
+		asort( $matches ); // Order by string distance.
 
 		$orig_matches  = array();
 		$final_matches = array();
 
 		foreach ( $matches as $keys => $difference ) {
-			list($o, $f) = explode(',', $keys);
+			list($o, $f) = explode( ',', $keys );
 			$o = (int) $o;
 			$f = (int) $f;
 
 			// Already have better matches for these guys
-			if ( isset($orig_matches[$o]) && isset($final_matches[$f]) )
+			if ( isset( $orig_matches[ $o ] ) && isset( $final_matches[ $f ] ) ) {
 				continue;
+			}
 
 			// First match for these guys. Must be best match
-			if ( !isset($orig_matches[$o]) && !isset($final_matches[$f]) ) {
-				$orig_matches[$o] = $f;
-				$final_matches[$f] = $o;
+			if ( ! isset( $orig_matches[ $o ] ) && ! isset( $final_matches[ $f ] ) ) {
+				$orig_matches[ $o ] = $f;
+				$final_matches[ $f ] = $o;
 				continue;
 			}
 
 			// Best match of this final is already taken?  Must mean this final is a new row.
-			if ( isset($orig_matches[$o]) )
-				$final_matches[$f] = 'x';
-
-			// Best match of this orig is already taken?  Must mean this orig is a deleted row.
-			elseif ( isset($final_matches[$f]) )
-				$orig_matches[$o] = 'x';
+			if ( isset( $orig_matches[ $o ] ) ) {
+				$final_matches[ $f ] = 'x';
+			} // End if().
+			elseif ( isset( $final_matches[ $f ] ) ) {
+				$orig_matches[ $o ] = 'x';
+			}
 		}
 
 		// We read the text in this order
-		ksort($orig_matches);
-		ksort($final_matches);
+		ksort( $orig_matches );
+		ksort( $final_matches );
 
 		// Stores rows and blanks for each column.
-		$orig_rows = $orig_rows_copy = array_keys($orig_matches);
-		$final_rows = array_keys($final_matches);
+		$orig_rows = $orig_rows_copy = array_keys( $orig_matches );
+		$final_rows = array_keys( $final_matches );
 
 		// Interleaves rows with blanks to keep matches aligned.
 		// We may end up with some extraneous blank rows, but we'll just ignore them later.
 		foreach ( $orig_rows_copy as $orig_row ) {
-			$final_pos = array_search($orig_matches[$orig_row], $final_rows, true);
-			$orig_pos = (int) array_search($orig_row, $orig_rows, true);
+			$final_pos = array_search( $orig_matches[ $orig_row ], $final_rows, true );
+			$orig_pos = (int) array_search( $orig_row, $orig_rows, true );
 
 			if ( false === $final_pos ) { // This orig is paired with a blank final.
 				array_splice( $final_rows, $orig_pos, 0, -1 );
 			} elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways. Pad final with blank rows.
 				$diff_pos = $final_pos - $orig_pos;
-				while ( $diff_pos < 0 )
-					array_splice( $final_rows, $orig_pos, 0, $diff_pos++ );
+				while ( $diff_pos < 0 ) {					array_splice( $final_rows, $orig_pos, 0, $diff_pos++ );
+				}
 			} elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways. Pad orig with blank rows.
 				$diff_pos = $orig_pos - $final_pos;
-				while ( $diff_pos < 0 )
-					array_splice( $orig_rows, $orig_pos, 0, $diff_pos++ );
+				while ( $diff_pos < 0 ) {					array_splice( $orig_rows, $orig_pos, 0, $diff_pos++ );
+				}
 			}
 		}
 
 		// Pad the ends with blank rows if the columns aren't the same length
-		$diff_count = count($orig_rows) - count($final_rows);
+		$diff_count = count( $orig_rows ) - count( $final_rows );
 		if ( $diff_count < 0 ) {
-			while ( $diff_count < 0 )
-				array_push($orig_rows, $diff_count++);
+			while ( $diff_count < 0 ) {				array_push( $orig_rows, $diff_count++ );
+			}
 		} elseif ( $diff_count > 0 ) {
 			$diff_count = -1 * $diff_count;
-			while ( $diff_count < 0 )
-				array_push($final_rows, $diff_count++);
+			while ( $diff_count < 0 ) {				array_push( $final_rows, $diff_count++ );
+			}
 		}
 
-		return array($orig_matches, $final_matches, $orig_rows, $final_rows);
+		return array( $orig_matches, $final_matches, $orig_rows, $final_rows );
 	}
 
 	/**
@@ -421,18 +424,19 @@
 	 */
 	public function compute_string_distance( $string1, $string2 ) {
 		// Vectors containing character frequency for all chars in each string
-		$chars1 = count_chars($string1);
-		$chars2 = count_chars($string2);
+		$chars1 = count_chars( $string1 );
+		$chars2 = count_chars( $string2 );
 
 		// L1-norm of difference vector.
-		$difference = array_sum( array_map( array($this, 'difference'), $chars1, $chars2 ) );
+		$difference = array_sum( array_map( array( $this, 'difference' ), $chars1, $chars2 ) );
 
 		// $string1 has zero length? Odd. Give huge penalty by not dividing.
-		if ( !$string1 )
+		if ( ! $string1 ) {
 			return $difference;
+		}
 
 		// Return distance per character (of string1).
-		return $difference / strlen($string1);
+		return $difference / strlen( $string1 );
 	}
 
 	/**
Index: src/wp-includes/class-wp-theme.php
===================================================================
--- src/wp-includes/class-wp-theme.php	(revision 40901)
+++ src/wp-includes/class-wp-theme.php	(working copy)
@@ -210,8 +210,9 @@
 			self::$persistently_cache = apply_filters( 'wp_cache_themes_persistently', false, 'WP_Theme' );
 			if ( self::$persistently_cache ) {
 				wp_cache_add_global_groups( 'themes' );
-				if ( is_int( self::$persistently_cache ) )
+				if ( is_int( self::$persistently_cache ) ) {
 					self::$cache_expiration = self::$persistently_cache;
+				}
 			} else {
 				wp_cache_add_non_persistent_groups( 'themes' );
 			}
@@ -233,39 +234,54 @@
 
 		if ( is_array( $cache ) ) {
 			foreach ( array( 'errors', 'headers', 'template' ) as $key ) {
-				if ( isset( $cache[ $key ] ) )
+				if ( isset( $cache[ $key ] ) ) {
 					$this->$key = $cache[ $key ];
+				}
 			}
-			if ( $this->errors )
+			if ( $this->errors ) {
 				return;
-			if ( isset( $cache['theme_root_template'] ) )
+			}
+			if ( isset( $cache['theme_root_template'] ) ) {
 				$theme_root_template = $cache['theme_root_template'];
+			}
 		} elseif ( ! file_exists( $this->theme_root . '/' . $theme_file ) ) {
 			$this->headers['Name'] = $this->stylesheet;
-			if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) )
+			if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) ) {
 				$this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), esc_html( $this->stylesheet ) ) );
-			else
-				$this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
+			} else { $this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
+			}
 			$this->template = $this->stylesheet;
-			$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
-			if ( ! file_exists( $this->theme_root ) ) // Don't cache this one.
+			$this->cache_add( 'theme', array(
+				'headers' => $this->headers,
+				'errors' => $this->errors,
+				'stylesheet' => $this->stylesheet,
+				'template' => $this->template,
+			) );
+			if ( ! file_exists( $this->theme_root ) ) { // Don't cache this one.
 				$this->errors->add( 'theme_root_missing', __( 'ERROR: The themes directory is either empty or doesn&#8217;t exist. Please check your installation.' ) );
+			}
 			return;
 		} elseif ( ! is_readable( $this->theme_root . '/' . $theme_file ) ) {
 			$this->headers['Name'] = $this->stylesheet;
 			$this->errors = new WP_Error( 'theme_stylesheet_not_readable', __( 'Stylesheet is not readable.' ) );
 			$this->template = $this->stylesheet;
-			$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
+			$this->cache_add( 'theme', array(
+				'headers' => $this->headers,
+				'errors' => $this->errors,
+				'stylesheet' => $this->stylesheet,
+				'template' => $this->template,
+			) );
 			return;
 		} else {
 			$this->headers = get_file_data( $this->theme_root . '/' . $theme_file, self::$file_headers, 'theme' );
 			// Default themes always trump their pretenders.
 			// Properly identify default themes that are inside a directory within wp-content/themes.
 			if ( $default_theme_slug = array_search( $this->headers['Name'], self::$default_themes ) ) {
-				if ( basename( $this->stylesheet ) != $default_theme_slug )
+				if ( basename( $this->stylesheet ) != $default_theme_slug ) {
 					$this->headers['Name'] .= '/' . $this->stylesheet;
+				}
 			}
-		}
+		}// End if().
 
 		// (If template is set from cache [and there are no errors], we know it's good.)
 		if ( ! $this->template && ! ( $this->template = $this->headers['Template'] ) ) {
@@ -279,7 +295,12 @@
 					'<code>style.css</code>'
 				);
 				$this->errors = new WP_Error( 'theme_no_index', $error_message );
-				$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
+				$this->cache_add( 'theme', array(
+					'headers' => $this->headers,
+					'errors' => $this->errors,
+					'stylesheet' => $this->stylesheet,
+					'template' => $this->template,
+				) );
 				return;
 			}
 		}
@@ -298,7 +319,12 @@
 			} else {
 				// Parent theme is missing.
 				$this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), esc_html( $this->template ) ) );
-				$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
+				$this->cache_add( 'theme', array(
+					'headers' => $this->headers,
+					'errors' => $this->errors,
+					'stylesheet' => $this->stylesheet,
+					'template' => $this->template,
+				) );
 				$this->parent = new WP_Theme( $this->template, $this->theme_root, $this );
 				return;
 			}
@@ -310,11 +336,21 @@
 			if ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {
 				$_child->parent = null;
 				$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $_child->template ) ) );
-				$_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) );
+				$_child->cache_add( 'theme', array(
+					'headers' => $_child->headers,
+					'errors' => $_child->errors,
+					'stylesheet' => $_child->stylesheet,
+					'template' => $_child->template,
+				) );
 				// The two themes actually reference each other with the Template header.
 				if ( $_child->stylesheet == $this->template ) {
 					$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $this->template ) ) );
-					$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
+					$this->cache_add( 'theme', array(
+						'headers' => $this->headers,
+						'errors' => $this->errors,
+						'stylesheet' => $this->stylesheet,
+						'template' => $this->template,
+					) );
 				}
 				return;
 			}
@@ -324,10 +360,16 @@
 
 		// We're good. If we didn't retrieve from cache, set it.
 		if ( ! is_array( $cache ) ) {
-			$cache = array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template );
+			$cache = array(
+				'headers' => $this->headers,
+				'errors' => $this->errors,
+				'stylesheet' => $this->stylesheet,
+				'template' => $this->template,
+			);
 			// If the parent theme is in another root, we'll want to cache this. Avoids an entire branch of filesystem calls above.
-			if ( isset( $theme_root_template ) )
+			if ( isset( $theme_root_template ) ) {
 				$cache['theme_root_template'] = $theme_root_template;
+			}
 			$this->cache_add( 'theme', $cache );
 		}
 	}
@@ -340,7 +382,7 @@
 	 * @return string Theme name, ready for display (translated)
 	 */
 	public function __toString() {
-		return (string) $this->display('Name');
+		return (string) $this->display( 'Name' );
 	}
 
 	/**
@@ -355,8 +397,20 @@
 	 */
 	public function __isset( $offset ) {
 		static $properties = array(
-			'name', 'title', 'version', 'parent_theme', 'template_dir', 'stylesheet_dir', 'template', 'stylesheet',
-			'screenshot', 'description', 'author', 'tags', 'theme_root', 'theme_root_uri',
+			'name',
+		'title',
+		'version',
+		'parent_theme',
+		'template_dir',
+		'stylesheet_dir',
+		'template',
+		'stylesheet',
+			'screenshot',
+		'description',
+		'author',
+		'tags',
+		'theme_root',
+		'theme_root_uri',
 		);
 
 		return in_array( $offset, $properties );
@@ -374,11 +428,11 @@
 		switch ( $offset ) {
 			case 'name' :
 			case 'title' :
-				return $this->get('Name');
+				return $this->get( 'Name' );
 			case 'version' :
-				return $this->get('Version');
+				return $this->get( 'Version' );
 			case 'parent_theme' :
-				return $this->parent() ? $this->parent()->get('Name') : '';
+				return $this->parent() ? $this->parent()->get( 'Name' ) : '';
 			case 'template_dir' :
 				return $this->get_template_directory();
 			case 'stylesheet_dir' :
@@ -391,9 +445,9 @@
 				return $this->get_screenshot( 'relative' );
 			// 'author' and 'description' did not previously return translated data.
 			case 'description' :
-				return $this->display('Description');
+				return $this->display( 'Description' );
 			case 'author' :
-				return $this->display('Author');
+				return $this->display( 'Author' );
 			case 'tags' :
 				return $this->get( 'Tags' );
 			case 'theme_root' :
@@ -437,9 +491,25 @@
 	 */
 	public function offsetExists( $offset ) {
 		static $keys = array(
-			'Name', 'Version', 'Status', 'Title', 'Author', 'Author Name', 'Author URI', 'Description',
-			'Template', 'Stylesheet', 'Template Files', 'Stylesheet Files', 'Template Dir', 'Stylesheet Dir',
-			'Screenshot', 'Tags', 'Theme Root', 'Theme Root URI', 'Parent Theme',
+			'Name',
+		'Version',
+		'Status',
+		'Title',
+		'Author',
+		'Author Name',
+		'Author URI',
+		'Description',
+			'Template',
+		'Stylesheet',
+		'Template Files',
+		'Stylesheet Files',
+		'Template Dir',
+		'Stylesheet Dir',
+			'Screenshot',
+		'Tags',
+		'Theme Root',
+		'Theme Root URI',
+		'Parent Theme',
 		);
 
 		return in_array( $offset, $keys );
@@ -468,15 +538,15 @@
 				 * See note above about using translated data. get() is not ideal.
 				 * It is only for backward compatibility. Use display().
 				 */
-				return $this->get('Name');
+				return $this->get( 'Name' );
 			case 'Author' :
-				return $this->display( 'Author');
+				return $this->display( 'Author' );
 			case 'Author Name' :
-				return $this->display( 'Author', false);
+				return $this->display( 'Author', false );
 			case 'Author URI' :
-				return $this->display('AuthorURI');
+				return $this->display( 'AuthorURI' );
 			case 'Description' :
-				return $this->display( 'Description');
+				return $this->display( 'Description' );
 			case 'Version' :
 			case 'Status' :
 				return $this->get( $offset );
@@ -495,16 +565,16 @@
 			case 'Screenshot' :
 				return $this->get_screenshot( 'relative' );
 			case 'Tags' :
-				return $this->get('Tags');
+				return $this->get( 'Tags' );
 			case 'Theme Root' :
 				return $this->get_theme_root();
 			case 'Theme Root URI' :
 				return $this->get_theme_root_uri();
 			case 'Parent Theme' :
-				return $this->parent() ? $this->parent()->get('Name') : '';
+				return $this->parent() ? $this->parent()->get( 'Name' ) : '';
 			default :
 				return null;
-		}
+		}// End switch().
 	}
 
 	/**
@@ -584,8 +654,9 @@
 	 * @access public
 	 */
 	public function cache_delete() {
-		foreach ( array( 'theme', 'screenshot', 'headers', 'post_templates' ) as $key )
+		foreach ( array( 'theme', 'screenshot', 'headers', 'post_templates' ) as $key ) {
 			wp_cache_delete( $key . '-' . $this->cache_hash, 'themes' );
+		}
 		$this->template = $this->textdomain_loaded = $this->theme_root_uri = $this->parent = $this->errors = $this->headers_sanitized = $this->name_translated = null;
 		$this->headers = array();
 		$this->__construct( $this->stylesheet, $this->theme_root );
@@ -609,22 +680,26 @@
 	 * @return string|false String on success, false on failure.
 	 */
 	public function get( $header ) {
-		if ( ! isset( $this->headers[ $header ] ) )
+		if ( ! isset( $this->headers[ $header ] ) ) {
 			return false;
+		}
 
 		if ( ! isset( $this->headers_sanitized ) ) {
 			$this->headers_sanitized = $this->cache_get( 'headers' );
-			if ( ! is_array( $this->headers_sanitized ) )
+			if ( ! is_array( $this->headers_sanitized ) ) {
 				$this->headers_sanitized = array();
+			}
 		}
 
-		if ( isset( $this->headers_sanitized[ $header ] ) )
+		if ( isset( $this->headers_sanitized[ $header ] ) ) {
 			return $this->headers_sanitized[ $header ];
+		}
 
 		// If themes are a persistent group, sanitize everything and cache it. One cache add is better than many cache sets.
 		if ( self::$persistently_cache ) {
-			foreach ( array_keys( $this->headers ) as $_header )
+			foreach ( array_keys( $this->headers ) as $_header ) {
 				$this->headers_sanitized[ $_header ] = $this->sanitize_header( $_header, $this->headers[ $_header ] );
+			}
 			$this->cache_add( 'headers', $this->headers_sanitized );
 		} else {
 			$this->headers_sanitized[ $header ] = $this->sanitize_header( $header, $this->headers[ $header ] );
@@ -650,14 +725,17 @@
 			return false;
 		}
 
-		if ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) )
+		if ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) ) {
 			$translate = false;
+		}
 
-		if ( $translate )
+		if ( $translate ) {
 			$value = $this->translate_header( $header, $value );
+		}
 
-		if ( $markup )
+		if ( $markup ) {
 			$value = $this->markup_header( $header, $value, $translate );
+		}
 
 		return $value;
 	}
@@ -685,8 +763,12 @@
 				// Fall through otherwise.
 			case 'Name' :
 				static $header_tags = array(
-					'abbr'    => array( 'title' => true ),
-					'acronym' => array( 'title' => true ),
+					'abbr'    => array(
+						'title' => true,
+					),
+					'acronym' => array(
+						'title' => true,
+					),
 					'code'    => true,
 					'em'      => true,
 					'strong'  => true,
@@ -697,9 +779,16 @@
 				// There shouldn't be anchor tags in Author, but some themes like to be challenging.
 			case 'Description' :
 				static $header_tags_with_a = array(
-					'a'       => array( 'href' => true, 'title' => true ),
-					'abbr'    => array( 'title' => true ),
-					'acronym' => array( 'title' => true ),
+					'a'       => array(
+						'href' => true,
+						'title' => true,
+					),
+					'abbr'    => array(
+						'title' => true,
+					),
+					'acronym' => array(
+						'title' => true,
+					),
 					'code'    => true,
 					'em'      => true,
 					'strong'  => true,
@@ -716,7 +805,7 @@
 			case 'Version' :
 				$value = strip_tags( $value );
 				break;
-		}
+		}// End switch().
 
 		return $value;
 	}
@@ -724,7 +813,7 @@
 	/**
 	 * Mark up a theme header.
 	 *
-     * @since 3.4.0
+	 * @since 3.4.0
 	 * @access private
 	 *
 	 * @staticvar string $comma
@@ -745,7 +834,7 @@
 				$value = wptexturize( $value );
 				break;
 			case 'Author' :
-				if ( $this->get('AuthorURI') ) {
+				if ( $this->get( 'AuthorURI' ) ) {
 					$value = sprintf( '<a href="%1$s">%2$s</a>', $this->display( 'AuthorURI', true, $translate ), $value );
 				} elseif ( ! $value ) {
 					$value = __( 'Anonymous' );
@@ -784,9 +873,10 @@
 		switch ( $header ) {
 			case 'Name' :
 				// Cached for sorting reasons.
-				if ( isset( $this->name_translated ) )
+				if ( isset( $this->name_translated ) ) {
 					return $this->name_translated;
-				$this->name_translated = translate( $value, $this->get('TextDomain' ) );
+				}
+				$this->name_translated = translate( $value, $this->get( 'TextDomain' ) );
 				return $this->name_translated;
 			case 'Tags' :
 				if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) ) {
@@ -797,14 +887,27 @@
 				if ( ! isset( $tags_list ) ) {
 					$tags_list = array(
 						// As of 4.6, deprecated tags which are only used to provide translation for older themes.
-						'black' => __( 'Black' ), 'blue' => __( 'Blue' ), 'brown'  => __( 'Brown' ),
-						'gray' => __( 'Gray' ), 'green'  => __( 'Green' ), 'orange' => __( 'Orange' ),
-						'pink' => __( 'Pink' ), 'purple' => __( 'Purple' ), 'red' => __( 'Red' ),
-						'silver' => __( 'Silver' ), 'tan' => __( 'Tan' ), 'white' => __( 'White' ),
-						'yellow' => __( 'Yellow' ), 'dark' => __( 'Dark' ), 'light' => __( 'Light' ),
-						'fixed-layout' => __( 'Fixed Layout' ), 'fluid-layout' => __( 'Fluid Layout' ),
-						'responsive-layout' => __( 'Responsive Layout' ), 'blavatar' => __( 'Blavatar' ),
-						'photoblogging' => __( 'Photoblogging' ), 'seasonal' => __( 'Seasonal' ),
+						'black' => __( 'Black' ),
+					'blue' => __( 'Blue' ),
+					'brown'  => __( 'Brown' ),
+						'gray' => __( 'Gray' ),
+					'green'  => __( 'Green' ),
+					'orange' => __( 'Orange' ),
+						'pink' => __( 'Pink' ),
+					'purple' => __( 'Purple' ),
+					'red' => __( 'Red' ),
+						'silver' => __( 'Silver' ),
+					'tan' => __( 'Tan' ),
+					'white' => __( 'White' ),
+						'yellow' => __( 'Yellow' ),
+					'dark' => __( 'Dark' ),
+					'light' => __( 'Light' ),
+						'fixed-layout' => __( 'Fixed Layout' ),
+					'fluid-layout' => __( 'Fluid Layout' ),
+						'responsive-layout' => __( 'Responsive Layout' ),
+					'blavatar' => __( 'Blavatar' ),
+						'photoblogging' => __( 'Photoblogging' ),
+					'seasonal' => __( 'Seasonal' ),
 					);
 
 					$feature_list = get_theme_feature_list( false ); // No API
@@ -824,8 +927,8 @@
 				return $value;
 
 			default :
-				$value = translate( $value, $this->get('TextDomain') );
-		}
+				$value = translate( $value, $this->get( 'TextDomain' ) );
+		}// End switch().
 		return $value;
 	}
 
@@ -871,8 +974,9 @@
 	 * @return string Absolute path of the stylesheet directory.
 	 */
 	public function get_stylesheet_directory() {
-		if ( $this->errors() && in_array( 'theme_root_missing', $this->errors()->get_error_codes() ) )
+		if ( $this->errors() && in_array( 'theme_root_missing', $this->errors()->get_error_codes() ) ) {
 			return '';
+		}
 
 		return $this->theme_root . '/' . $this->stylesheet;
 	}
@@ -889,10 +993,10 @@
 	 * @return string Absolute path of the template directory.
 	 */
 	public function get_template_directory() {
-		if ( $this->parent() )
+		if ( $this->parent() ) {
 			$theme_root = $this->parent()->theme_root;
-		else
-			$theme_root = $this->theme_root;
+		} else { $theme_root = $this->theme_root;
+		}
 
 		return $theme_root . '/' . $this->template;
 	}
@@ -924,10 +1028,10 @@
 	 * @return string URL to the template directory.
 	 */
 	public function get_template_directory_uri() {
-		if ( $this->parent() )
+		if ( $this->parent() ) {
 			$theme_root_uri = $this->parent()->get_theme_root_uri();
-		else
-			$theme_root_uri = $this->get_theme_root_uri();
+		} else { $theme_root_uri = $this->get_theme_root_uri();
+		}
 
 		return $theme_root_uri . '/' . str_replace( '%2F', '/', rawurlencode( $this->template ) );
 	}
@@ -959,8 +1063,9 @@
 	 * @return string Theme root URI.
 	 */
 	public function get_theme_root_uri() {
-		if ( ! isset( $this->theme_root_uri ) )
+		if ( ! isset( $this->theme_root_uri ) ) {
 			$this->theme_root_uri = get_theme_root_uri( $this->stylesheet, $this->theme_root );
+		}
 		return $this->theme_root_uri;
 	}
 
@@ -981,8 +1086,9 @@
 	public function get_screenshot( $uri = 'uri' ) {
 		$screenshot = $this->cache_get( 'screenshot' );
 		if ( $screenshot ) {
-			if ( 'relative' == $uri )
+			if ( 'relative' == $uri ) {
 				return $screenshot;
+			}
 			return $this->get_stylesheet_directory_uri() . '/' . $screenshot;
 		} elseif ( 0 === $screenshot ) {
 			return false;
@@ -991,8 +1097,9 @@
 		foreach ( array( 'png', 'gif', 'jpg', 'jpeg' ) as $ext ) {
 			if ( file_exists( $this->get_stylesheet_directory() . "/screenshot.$ext" ) ) {
 				$this->cache_add( 'screenshot', 'screenshot.' . $ext );
-				if ( 'relative' == $uri )
+				if ( 'relative' == $uri ) {
 					return 'screenshot.' . $ext;
+				}
 				return $this->get_stylesheet_directory_uri() . '/' . 'screenshot.' . $ext;
 			}
 		}
@@ -1016,8 +1123,9 @@
 	public function get_files( $type = null, $depth = 0, $search_parent = false ) {
 		$files = (array) self::scandir( $this->get_stylesheet_directory(), $type, $depth );
 
-		if ( $search_parent && $this->parent() )
+		if ( $search_parent && $this->parent() ) {
 			$files += (array) self::scandir( $this->get_template_directory(), $type, $depth );
+		}
 
 		return $files;
 	}
@@ -1140,8 +1248,9 @@
 	 *                     with `$relative_path`, with the values being absolute paths. False otherwise.
 	 */
 	private static function scandir( $path, $extensions = null, $depth = 0, $relative_path = '' ) {
-		if ( ! is_dir( $path ) )
+		if ( ! is_dir( $path ) ) {
 			return false;
+		}
 
 		if ( $extensions ) {
 			$extensions = (array) $extensions;
@@ -1149,8 +1258,9 @@
 		}
 
 		$relative_path = trailingslashit( $relative_path );
-		if ( '/' == $relative_path )
+		if ( '/' == $relative_path ) {
 			$relative_path = '';
+		}
 
 		$results = scandir( $path );
 		$files = array();
@@ -1158,7 +1268,7 @@
 		/**
 		 * Filters the array of excluded directories and files while scanning theme folder.
 		 *
- 		 * @since 4.7.4
+		  * @since 4.7.4
 		 *
 		 * @param array $exclusions Array of excluded directories and files.
 		 */
@@ -1169,8 +1279,9 @@
 				continue;
 			}
 			if ( is_dir( $path . '/' . $result ) ) {
-				if ( ! $depth )
+				if ( ! $depth ) {
 					continue;
+				}
 				$found = self::scandir( $path . '/' . $result, $extensions, $depth - 1 , $relative_path . $result );
 				$files = array_merge_recursive( $files, $found );
 			} elseif ( ! $extensions || preg_match( '~\.(' . $_extensions . ')$~', $result ) ) {
@@ -1194,10 +1305,11 @@
 	 * 	False if no textdomain was specified in the file headers, or if the domain could not be loaded.
 	 */
 	public function load_textdomain() {
-		if ( isset( $this->textdomain_loaded ) )
+		if ( isset( $this->textdomain_loaded ) ) {
 			return $this->textdomain_loaded;
+		}
 
-		$textdomain = $this->get('TextDomain');
+		$textdomain = $this->get( 'TextDomain' );
 		if ( ! $textdomain ) {
 			$this->textdomain_loaded = false;
 			return false;
@@ -1209,10 +1321,10 @@
 		}
 
 		$path = $this->get_stylesheet_directory();
-		if ( $domainpath = $this->get('DomainPath') )
+		if ( $domainpath = $this->get( 'DomainPath' ) ) {
 			$path .= $domainpath;
-		else
-			$path .= '/languages';
+		} else { $path .= '/languages';
+		}
 
 		$this->textdomain_loaded = load_theme_textdomain( $textdomain, $path );
 		return $this->textdomain_loaded;
@@ -1230,19 +1342,22 @@
 	 * @return bool Whether the theme is allowed for the network. Returns true in single-site.
 	 */
 	public function is_allowed( $check = 'both', $blog_id = null ) {
-		if ( ! is_multisite() )
+		if ( ! is_multisite() ) {
 			return true;
+		}
 
 		if ( 'both' == $check || 'network' == $check ) {
 			$allowed = self::get_allowed_on_network();
-			if ( ! empty( $allowed[ $this->get_stylesheet() ] ) )
+			if ( ! empty( $allowed[ $this->get_stylesheet() ] ) ) {
 				return true;
+			}
 		}
 
 		if ( 'both' == $check || 'site' == $check ) {
 			$allowed = self::get_allowed_on_site( $blog_id );
-			if ( ! empty( $allowed[ $this->get_stylesheet() ] ) )
+			if ( ! empty( $allowed[ $this->get_stylesheet() ] ) ) {
 				return true;
+			}
 		}
 
 		return false;
@@ -1340,8 +1455,9 @@
 	public static function get_allowed_on_site( $blog_id = null ) {
 		static $allowed_themes = array();
 
-		if ( ! $blog_id || ! is_multisite() )
+		if ( ! $blog_id || ! is_multisite() ) {
 			$blog_id = get_current_blog_id();
+		}
 
 		if ( isset( $allowed_themes[ $blog_id ] ) ) {
 			/**
@@ -1382,8 +1498,9 @@
 				$converted = array();
 				$themes = wp_get_themes();
 				foreach ( $themes as $stylesheet => $theme_data ) {
-					if ( isset( $allowed_themes[ $blog_id ][ $theme_data->get('Name') ] ) )
+					if ( isset( $allowed_themes[ $blog_id ][ $theme_data->get( 'Name' ) ] ) ) {
 						$converted[ $stylesheet ] = true;
+					}
 				}
 				$allowed_themes[ $blog_id ] = $converted;
 			}
Index: src/wp-includes/class-wp-user-meta-session-tokens.php
===================================================================
--- src/wp-includes/class-wp-user-meta-session-tokens.php	(revision 40901)
+++ src/wp-includes/class-wp-user-meta-session-tokens.php	(working copy)
@@ -41,7 +41,9 @@
 	 */
 	protected function prepare_session( $session ) {
 		if ( is_int( $session ) ) {
-			return array( 'expiration' => $session );
+			return array(
+				'expiration' => $session,
+			);
 		}
 
 		return $session;
@@ -113,7 +115,9 @@
 	 */
 	protected function destroy_other_sessions( $verifier ) {
 		$session = $this->get_session( $verifier );
-		$this->update_sessions( array( $verifier => $session ) );
+		$this->update_sessions( array(
+			$verifier => $session,
+		) );
 	}
 
 	/**
Index: src/wp-includes/class-wp-user-query.php
===================================================================
--- src/wp-includes/class-wp-user-query.php	(revision 40901)
+++ src/wp-includes/class-wp-user-query.php	(working copy)
@@ -120,7 +120,7 @@
 			'nicename__not_in' => array(),
 			'login' => '',
 			'login__in' => array(),
-			'login__not_in' => array()
+			'login__not_in' => array(),
 		);
 
 		return wp_parse_args( $args, $defaults );
@@ -238,7 +238,7 @@
 
 		// Ensure that query vars are filled after 'pre_get_users'.
 		$qv =& $this->query_vars;
-		$qv =  $this->fill_query_vars( $qv );
+		$qv = $this->fill_query_vars( $qv );
 
 		if ( is_array( $qv['fields'] ) ) {
 			$qv['fields'] = array_unique( $qv['fields'] );
@@ -255,11 +255,12 @@
 			$this->query_fields = "$wpdb->users.ID";
 		}
 
-		if ( isset( $qv['count_total'] ) && $qv['count_total'] )
+		if ( isset( $qv['count_total'] ) && $qv['count_total'] ) {
 			$this->query_fields = 'SQL_CALC_FOUND_ROWS ' . $this->query_fields;
+		}
 
 		$this->query_from = "FROM $wpdb->users";
-		$this->query_where = "WHERE 1=1";
+		$this->query_where = 'WHERE 1=1';
 
 		// Parse and sanitize 'include', for use by 'orderby' as well as 'include' below.
 		if ( ! empty( $qv['include'] ) ) {
@@ -275,7 +276,9 @@
 
 		if ( $qv['has_published_posts'] && $blog_id ) {
 			if ( true === $qv['has_published_posts'] ) {
-				$post_types = get_post_types( array( 'public' => true ) );
+				$post_types = get_post_types( array(
+					'public' => true,
+				) );
 			} else {
 				$post_types = (array) $qv['has_published_posts'];
 			}
@@ -285,11 +288,11 @@
 			}
 
 			$posts_table = $wpdb->get_blog_prefix( $blog_id ) . 'posts';
-			$this->query_where .= " AND $wpdb->users.ID IN ( SELECT DISTINCT $posts_table.post_author FROM $posts_table WHERE $posts_table.post_status = 'publish' AND $posts_table.post_type IN ( " . join( ", ", $post_types ) . " ) )";
+			$this->query_where .= " AND $wpdb->users.ID IN ( SELECT DISTINCT $posts_table.post_author FROM $posts_table WHERE $posts_table.post_status = 'publish' AND $posts_table.post_type IN ( " . join( ', ', $post_types ) . ' ) )';
 		}
 
 		// nicename
-		if ( '' !== $qv['nicename']) {
+		if ( '' !== $qv['nicename'] ) {
 			$this->query_where .= $wpdb->prepare( ' AND user_nicename = %s', $qv['nicename'] );
 		}
 
@@ -306,7 +309,7 @@
 		}
 
 		// login
-		if ( '' !== $qv['login']) {
+		if ( '' !== $qv['login'] ) {
 			$this->query_where .= $wpdb->prepare( ' AND user_login = %s', $qv['login'] );
 		}
 
@@ -371,7 +374,9 @@
 		if ( $blog_id && ( ! empty( $roles ) || ! empty( $role__in ) || ! empty( $role__not_in ) || is_multisite() ) ) {
 			$role_queries  = array();
 
-			$roles_clauses = array( 'relation' => 'AND' );
+			$roles_clauses = array(
+				'relation' => 'AND',
+			);
 			if ( ! empty( $roles ) ) {
 				foreach ( $roles as $role ) {
 					$roles_clauses[] = array(
@@ -384,7 +389,9 @@
 				$role_queries[] = $roles_clauses;
 			}
 
-			$role__in_clauses = array( 'relation' => 'OR' );
+			$role__in_clauses = array(
+				'relation' => 'OR',
+			);
 			if ( ! empty( $role__in ) ) {
 				foreach ( $role__in as $role ) {
 					$role__in_clauses[] = array(
@@ -397,7 +404,9 @@
 				$role_queries[] = $role__in_clauses;
 			}
 
-			$role__not_in_clauses = array( 'relation' => 'AND' );
+			$role__not_in_clauses = array(
+				'relation' => 'AND',
+			);
 			if ( ! empty( $role__not_in ) ) {
 				foreach ( $role__not_in as $role ) {
 					$role__not_in_clauses[] = array(
@@ -432,7 +441,7 @@
 			}
 
 			$this->meta_query->parse_query_vars( $this->meta_query->queries );
-		}
+		}// End if().
 
 		if ( ! empty( $this->meta_query->queries ) ) {
 			$clauses = $this->meta_query->get_sql( 'user', $wpdb->users, 'ID', $this );
@@ -450,7 +459,9 @@
 
 		if ( empty( $qv['orderby'] ) ) {
 			// Default order is by 'user_login'.
-			$ordersby = array( 'user_login' => $order );
+			$ordersby = array(
+				'user_login' => $order,
+			);
 		} elseif ( is_array( $qv['orderby'] ) ) {
 			$ordersby = $qv['orderby'];
 		} else {
@@ -497,42 +508,45 @@
 		// limit
 		if ( isset( $qv['number'] ) && $qv['number'] > 0 ) {
 			if ( $qv['offset'] ) {
-				$this->query_limit = $wpdb->prepare("LIMIT %d, %d", $qv['offset'], $qv['number']);
+				$this->query_limit = $wpdb->prepare( 'LIMIT %d, %d', $qv['offset'], $qv['number'] );
 			} else {
-				$this->query_limit = $wpdb->prepare( "LIMIT %d, %d", $qv['number'] * ( $qv['paged'] - 1 ), $qv['number'] );
+				$this->query_limit = $wpdb->prepare( 'LIMIT %d, %d', $qv['number'] * ( $qv['paged'] - 1 ), $qv['number'] );
 			}
 		}
 
 		$search = '';
-		if ( isset( $qv['search'] ) )
+		if ( isset( $qv['search'] ) ) {
 			$search = trim( $qv['search'] );
+		}
 
 		if ( $search ) {
-			$leading_wild = ( ltrim($search, '*') != $search );
-			$trailing_wild = ( rtrim($search, '*') != $search );
-			if ( $leading_wild && $trailing_wild )
+			$leading_wild = ( ltrim( $search, '*' ) != $search );
+			$trailing_wild = ( rtrim( $search, '*' ) != $search );
+			if ( $leading_wild && $trailing_wild ) {
 				$wild = 'both';
-			elseif ( $leading_wild )
+			} elseif ( $leading_wild ) {
 				$wild = 'leading';
-			elseif ( $trailing_wild )
+			} elseif ( $trailing_wild ) {
 				$wild = 'trailing';
-			else
-				$wild = false;
-			if ( $wild )
-				$search = trim($search, '*');
+			} else { $wild = false;
+			}
+			if ( $wild ) {
+				$search = trim( $search, '*' );
+			}
 
 			$search_columns = array();
-			if ( $qv['search_columns'] )
+			if ( $qv['search_columns'] ) {
 				$search_columns = array_intersect( $qv['search_columns'], array( 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename' ) );
+			}
 			if ( ! $search_columns ) {
-				if ( false !== strpos( $search, '@') )
-					$search_columns = array('user_email');
-				elseif ( is_numeric($search) )
-					$search_columns = array('user_login', 'ID');
-				elseif ( preg_match('|^https?://|', $search) && ! ( is_multisite() && wp_is_large_network( 'users' ) ) )
-					$search_columns = array('user_url');
-				else
-					$search_columns = array('user_login', 'user_url', 'user_email', 'user_nicename', 'display_name');
+				if ( false !== strpos( $search, '@' ) ) {
+					$search_columns = array( 'user_email' );
+				} elseif ( is_numeric( $search ) ) {
+					$search_columns = array( 'user_login', 'ID' );
+				} elseif ( preg_match( '|^https?://|', $search ) && ! ( is_multisite() && wp_is_large_network( 'users' ) ) ) {
+					$search_columns = array( 'user_url' );
+				} else { $search_columns = array( 'user_login', 'user_url', 'user_email', 'user_nicename', 'display_name' );
+				}
 			}
 
 			/**
@@ -550,7 +564,7 @@
 			$search_columns = apply_filters( 'user_search_columns', $search_columns, $search, $this );
 
 			$this->query_where .= $this->get_search_sql( $search, $search_columns, $wild );
-		}
+		}// End if().
 
 		if ( ! empty( $include ) ) {
 			// Sanitized earlier.
@@ -611,18 +625,21 @@
 		 *
 		 * @param string $sql The SELECT FOUND_ROWS() query for the current WP_User_Query.
 		 */
-		if ( isset( $qv['count_total'] ) && $qv['count_total'] )
+		if ( isset( $qv['count_total'] ) && $qv['count_total'] ) {
 			$this->total_users = (int) $wpdb->get_var( apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()' ) );
+		}
 
-		if ( !$this->results )
+		if ( ! $this->results ) {
 			return;
+		}
 
 		if ( 'all_with_meta' == $qv['fields'] ) {
 			cache_users( $this->results );
 
 			$r = array();
-			foreach ( $this->results as $userid )
+			foreach ( $this->results as $userid ) {
 				$r[ $userid ] = new WP_User( $userid, '', $qv['blog_id'] );
+			}
 
 			$this->results = $r;
 		} elseif ( 'all' == $qv['fields'] ) {
@@ -642,8 +659,9 @@
 	 * @return mixed
 	 */
 	public function get( $query_var ) {
-		if ( isset( $this->query_vars[$query_var] ) )
-			return $this->query_vars[$query_var];
+		if ( isset( $this->query_vars[ $query_var ] ) ) {
+			return $this->query_vars[ $query_var ];
+		}
 
 		return null;
 	}
@@ -658,7 +676,7 @@
 	 * @param mixed $value Query variable value.
 	 */
 	public function set( $query_var, $value ) {
-		$this->query_vars[$query_var] = $value;
+		$this->query_vars[ $query_var ] = $value;
 	}
 
 	/**
@@ -691,7 +709,7 @@
 			}
 		}
 
-		return ' AND (' . implode(' OR ', $searches) . ')';
+		return ' AND (' . implode( ' OR ', $searches ) . ')';
 	}
 
 	/**
@@ -772,8 +790,8 @@
 			$_orderby = "FIELD( user_login, '$login__in' )";
 		} elseif ( isset( $meta_query_clauses[ $orderby ] ) ) {
 			$meta_clause = $meta_query_clauses[ $orderby ];
-			$_orderby = sprintf( "CAST(%s.meta_value AS %s)", esc_sql( $meta_clause['alias'] ), esc_sql( $meta_clause['cast'] ) );
-		}
+			$_orderby = sprintf( 'CAST(%s.meta_value AS %s)', esc_sql( $meta_clause['alias'] ), esc_sql( $meta_clause['cast'] ) );
+		}// End if().
 
 		return $_orderby;
 	}
Index: src/wp-includes/class-wp-user.php
===================================================================
--- src/wp-includes/class-wp-user.php	(revision 40901)
+++ src/wp-includes/class-wp-user.php	(working copy)
@@ -197,17 +197,20 @@
 		if ( 'id' == $field ) {
 			// Make sure the value is numeric to avoid casting objects, for example,
 			// to int 1.
-			if ( ! is_numeric( $value ) )
+			if ( ! is_numeric( $value ) ) {
 				return false;
+			}
 			$value = intval( $value );
-			if ( $value < 1 )
+			if ( $value < 1 ) {
 				return false;
+			}
 		} else {
 			$value = trim( $value );
 		}
 
-		if ( !$value )
+		if ( ! $value ) {
 			return false;
+		}
 
 		switch ( $field ) {
 			case 'id':
@@ -215,16 +218,16 @@
 				$db_field = 'ID';
 				break;
 			case 'slug':
-				$user_id = wp_cache_get($value, 'userslugs');
+				$user_id = wp_cache_get( $value, 'userslugs' );
 				$db_field = 'user_nicename';
 				break;
 			case 'email':
-				$user_id = wp_cache_get($value, 'useremail');
+				$user_id = wp_cache_get( $value, 'useremail' );
 				$db_field = 'user_email';
 				break;
 			case 'login':
 				$value = sanitize_user( $value );
-				$user_id = wp_cache_get($value, 'userlogins');
+				$user_id = wp_cache_get( $value, 'userlogins' );
 				$db_field = 'user_login';
 				break;
 			default:
@@ -232,14 +235,16 @@
 		}
 
 		if ( false !== $user_id ) {
-			if ( $user = wp_cache_get( $user_id, 'users' ) )
+			if ( $user = wp_cache_get( $user_id, 'users' ) ) {
 				return $user;
+			}
 		}
 
-		if ( !$user = $wpdb->get_row( $wpdb->prepare(
+		if ( ! $user = $wpdb->get_row( $wpdb->prepare(
 			"SELECT * FROM $wpdb->users WHERE $db_field = %s", $value
-		) ) )
+		) ) ) {
 			return false;
+		}
 
 		update_user_caches( $user );
 
@@ -284,11 +289,13 @@
 			$key = 'ID';
 		}
 
-		if ( isset( $this->data->$key ) )
+		if ( isset( $this->data->$key ) ) {
 			return true;
+		}
 
-		if ( isset( self::$back_compat_keys[ $key ] ) )
+		if ( isset( self::$back_compat_keys[ $key ] ) ) {
 			$key = self::$back_compat_keys[ $key ];
+		}
 
 		return metadata_exists( 'user', $this->ID, $key );
 	}
@@ -317,8 +324,9 @@
 		if ( isset( $this->data->$key ) ) {
 			$value = $this->data->$key;
 		} else {
-			if ( isset( self::$back_compat_keys[ $key ] ) )
+			if ( isset( self::$back_compat_keys[ $key ] ) ) {
 				$key = self::$back_compat_keys[ $key ];
+			}
 			$value = get_user_meta( $this->ID, $key, true );
 		}
 
@@ -454,15 +462,16 @@
 	protected function _init_caps( $cap_key = '' ) {
 		global $wpdb;
 
-		if ( empty($cap_key) )
+		if ( empty( $cap_key ) ) {
 			$this->cap_key = $wpdb->get_blog_prefix() . 'capabilities';
-		else
-			$this->cap_key = $cap_key;
+		} else { $this->cap_key = $cap_key;
+		}
 
 		$this->caps = get_user_meta( $this->ID, $this->cap_key, true );
 
-		if ( ! is_array( $this->caps ) )
+		if ( ! is_array( $this->caps ) ) {
 			$this->caps = array();
+		}
 
 		$this->get_role_caps();
 	}
@@ -484,8 +493,9 @@
 		$wp_roles = wp_roles();
 
 		//Filter out caps that are not role names and assign to $this->roles
-		if ( is_array( $this->caps ) )
+		if ( is_array( $this->caps ) ) {
 			$this->roles = array_filter( array_keys( $this->caps ), array( $wp_roles, 'is_role' ) );
+		}
 
 		//Build $allcaps from role caps, overlay user's $caps
 		$this->allcaps = array();
@@ -513,7 +523,7 @@
 			return;
 		}
 
-		$this->caps[$role] = true;
+		$this->caps[ $role ] = true;
 		update_user_meta( $this->ID, $this->cap_key, $this->caps );
 		$this->get_role_caps();
 		$this->update_user_level_from_caps();
@@ -538,9 +548,10 @@
 	 * @param string $role Role name.
 	 */
 	public function remove_role( $role ) {
-		if ( !in_array($role, $this->roles) )
+		if ( ! in_array( $role, $this->roles ) ) {
 			return;
-		unset( $this->caps[$role] );
+		}
+		unset( $this->caps[ $role ] );
 		update_user_meta( $this->ID, $this->cap_key, $this->caps );
 		$this->get_role_caps();
 		$this->update_user_level_from_caps();
@@ -569,16 +580,20 @@
 	 * @param string $role Role name.
 	 */
 	public function set_role( $role ) {
-		if ( 1 == count( $this->roles ) && $role == current( $this->roles ) )
+		if ( 1 == count( $this->roles ) && $role == current( $this->roles ) ) {
 			return;
+		}
 
-		foreach ( (array) $this->roles as $oldrole )
-			unset( $this->caps[$oldrole] );
+		foreach ( (array) $this->roles as $oldrole ) {
+			unset( $this->caps[ $oldrole ] );
+		}
 
 		$old_roles = $this->roles;
-		if ( !empty( $role ) ) {
-			$this->caps[$role] = true;
-			$this->roles = array( $role => true );
+		if ( ! empty( $role ) ) {
+			$this->caps[ $role ] = true;
+			$this->roles = array(
+				$role => true,
+			);
 		} else {
 			$this->roles = false;
 		}
@@ -655,7 +670,7 @@
 	 * @param bool $grant Whether to grant capability to user.
 	 */
 	public function add_cap( $cap, $grant = true ) {
-		$this->caps[$cap] = $grant;
+		$this->caps[ $cap ] = $grant;
 		update_user_meta( $this->ID, $this->cap_key, $this->caps );
 		$this->get_role_caps();
 		$this->update_user_level_from_caps();
@@ -717,7 +732,7 @@
 	 */
 	public function has_cap( $cap ) {
 		if ( is_numeric( $cap ) ) {
-			_deprecated_argument( __FUNCTION__, '2.0.0', __('Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.') );
+			_deprecated_argument( __FUNCTION__, '2.0.0', __( 'Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.' ) );
 			$cap = $this->translate_level_to_cap( $cap );
 		}
 
@@ -727,8 +742,9 @@
 
 		// Multisite super admin has all caps by definition, Unless specifically denied.
 		if ( is_multisite() && is_super_admin( $this->ID ) ) {
-			if ( in_array('do_not_allow', $caps) )
+			if ( in_array( 'do_not_allow', $caps ) ) {
 				return false;
+			}
 			return true;
 		}
 
@@ -750,8 +766,9 @@
 
 		// Must have ALL requested caps.
 		foreach ( (array) $caps as $cap ) {
-			if ( empty( $capabilities[ $cap ] ) )
+			if ( empty( $capabilities[ $cap ] ) ) {
 				return false;
+			}
 		}
 
 		return true;
@@ -783,10 +800,10 @@
 	 */
 	public function for_blog( $blog_id = '' ) {
 		global $wpdb;
-		if ( ! empty( $blog_id ) )
+		if ( ! empty( $blog_id ) ) {
 			$cap_key = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities';
-		else
-			$cap_key = '';
+		} else { $cap_key = '';
+		}
 		$this->_init_caps( $cap_key );
 	}
 }
Index: src/wp-includes/class-wp-walker.php
===================================================================
--- src/wp-includes/class-wp-walker.php	(revision 40901)
+++ src/wp-includes/class-wp-walker.php	(working copy)
@@ -142,34 +142,34 @@
 			$args[0]['has_children'] = $this->has_children; // Back-compat.
 		}
 
-		$cb_args = array_merge( array(&$output, $element, $depth), $args);
-		call_user_func_array(array($this, 'start_el'), $cb_args);
+		$cb_args = array_merge( array( &$output, $element, $depth ), $args );
+		call_user_func_array( array( $this, 'start_el' ), $cb_args );
 
 		// descend only when the depth is right and there are childrens for this element
-		if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
+		if ( ($max_depth == 0 || $max_depth > $depth + 1 ) && isset( $children_elements[ $id ] ) ) {
 
-			foreach ( $children_elements[ $id ] as $child ){
+			foreach ( $children_elements[ $id ] as $child ) {
 
-				if ( !isset($newlevel) ) {
+				if ( ! isset( $newlevel ) ) {
 					$newlevel = true;
 					//start the child delimiter
-					$cb_args = array_merge( array(&$output, $depth), $args);
-					call_user_func_array(array($this, 'start_lvl'), $cb_args);
+					$cb_args = array_merge( array( &$output, $depth ), $args );
+					call_user_func_array( array( $this, 'start_lvl' ), $cb_args );
 				}
 				$this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
 			}
 			unset( $children_elements[ $id ] );
 		}
 
-		if ( isset($newlevel) && $newlevel ){
+		if ( isset( $newlevel ) && $newlevel ) {
 			//end the child delimiter
-			$cb_args = array_merge( array(&$output, $depth), $args);
-			call_user_func_array(array($this, 'end_lvl'), $cb_args);
+			$cb_args = array_merge( array( &$output, $depth ), $args );
+			call_user_func_array( array( $this, 'end_lvl' ), $cb_args );
 		}
 
 		//end this element
-		$cb_args = array_merge( array(&$output, $element, $depth), $args);
-		call_user_func_array(array($this, 'end_el'), $cb_args);
+		$cb_args = array_merge( array( &$output, $element, $depth ), $args );
+		call_user_func_array( array( $this, 'end_el' ), $cb_args );
 	}
 
 	/**
@@ -188,7 +188,7 @@
 	 * @return string The hierarchical item output.
 	 */
 	public function walk( $elements, $max_depth ) {
-		$args = array_slice(func_get_args(), 2);
+		$args = array_slice( func_get_args(), 2 );
 		$output = '';
 
 		//invalid parameter or nothing to walk
@@ -201,8 +201,9 @@
 		// flat display
 		if ( -1 == $max_depth ) {
 			$empty_array = array();
-			foreach ( $elements as $e )
+			foreach ( $elements as $e ) {
 				$this->display_element( $e, $empty_array, 1, 0, $args, $output );
+			}
 			return $output;
 		}
 
@@ -214,34 +215,35 @@
 		 */
 		$top_level_elements = array();
 		$children_elements  = array();
-		foreach ( $elements as $e) {
-			if ( empty( $e->$parent_field ) )
+		foreach ( $elements as $e ) {
+			if ( empty( $e->$parent_field ) ) {
 				$top_level_elements[] = $e;
-			else
-				$children_elements[ $e->$parent_field ][] = $e;
+			} else { $children_elements[ $e->$parent_field ][] = $e;
+			}
 		}
 
 		/*
 		 * When none of the elements is top level.
 		 * Assume the first one must be root of the sub elements.
 		 */
-		if ( empty($top_level_elements) ) {
+		if ( empty( $top_level_elements ) ) {
 
 			$first = array_slice( $elements, 0, 1 );
 			$root = $first[0];
 
 			$top_level_elements = array();
 			$children_elements  = array();
-			foreach ( $elements as $e) {
-				if ( $root->$parent_field == $e->$parent_field )
+			foreach ( $elements as $e ) {
+				if ( $root->$parent_field == $e->$parent_field ) {
 					$top_level_elements[] = $e;
-				else
-					$children_elements[ $e->$parent_field ][] = $e;
+				} else { $children_elements[ $e->$parent_field ][] = $e;
+				}
 			}
 		}
 
-		foreach ( $top_level_elements as $e )
+		foreach ( $top_level_elements as $e ) {
 			$this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
+		}
 
 		/*
 		 * If we are displaying all levels, and remaining children_elements is not empty,
@@ -249,25 +251,27 @@
 		 */
 		if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) {
 			$empty_array = array();
-			foreach ( $children_elements as $orphans )
-				foreach ( $orphans as $op )
+			foreach ( $children_elements as $orphans ) {
+				foreach ( $orphans as $op ) {
 					$this->display_element( $op, $empty_array, 1, 0, $args, $output );
-		 }
+				}
+			}
+		}
 
 		 return $output;
 	}
 
 	/**
- 	 * paged_walk() - produce a page of nested elements
- 	 *
- 	 * Given an array of hierarchical elements, the maximum depth, a specific page number,
- 	 * and number of elements per page, this function first determines all top level root elements
- 	 * belonging to that page, then lists them and all of their children in hierarchical order.
- 	 *
+	  * paged_walk() - produce a page of nested elements
+	  *
+	  * Given an array of hierarchical elements, the maximum depth, a specific page number,
+	  * and number of elements per page, this function first determines all top level root elements
+	  * belonging to that page, then lists them and all of their children in hierarchical order.
+	  *
 	 * $max_depth = 0 means display all levels.
 	 * $max_depth > 0 specifies the number of display levels.
 	 *
- 	 * @since 2.7.0
+	  * @since 2.7.0
 	 *
 	 * @param array $elements
 	 * @param int   $max_depth The maximum hierarchical depth.
@@ -286,26 +290,29 @@
 		$parent_field = $this->db_fields['parent'];
 
 		$count = -1;
-		if ( -1 == $max_depth )
+		if ( -1 == $max_depth ) {
 			$total_top = count( $elements );
-		if ( $page_num < 1 || $per_page < 0  ) {
+		}
+		if ( $page_num < 1 || $per_page < 0 ) {
 			// No paging
 			$paging = false;
 			$start = 0;
-			if ( -1 == $max_depth )
+			if ( -1 == $max_depth ) {
 				$end = $total_top;
+			}
 			$this->max_pages = 1;
 		} else {
 			$paging = true;
-			$start = ( (int)$page_num - 1 ) * (int)$per_page;
+			$start = ( (int) $page_num - 1 ) * (int) $per_page;
 			$end   = $start + $per_page;
-			if ( -1 == $max_depth )
-				$this->max_pages = ceil($total_top / $per_page);
+			if ( -1 == $max_depth ) {
+				$this->max_pages = ceil( $total_top / $per_page );
+			}
 		}
 
 		// flat display
 		if ( -1 == $max_depth ) {
-			if ( !empty($args[0]['reverse_top_level']) ) {
+			if ( ! empty( $args[0]['reverse_top_level'] ) ) {
 				$elements = array_reverse( $elements );
 				$oldstart = $start;
 				$start = $total_top - $end;
@@ -315,10 +322,12 @@
 			$empty_array = array();
 			foreach ( $elements as $e ) {
 				$count++;
-				if ( $count < $start )
+				if ( $count < $start ) {
 					continue;
-				if ( $count >= $end )
+				}
+				if ( $count >= $end ) {
 					break;
+				}
 				$this->display_element( $e, $empty_array, 1, 0, $args, $output );
 			}
 			return $output;
@@ -331,51 +340,57 @@
 		 */
 		$top_level_elements = array();
 		$children_elements  = array();
-		foreach ( $elements as $e) {
-			if ( 0 == $e->$parent_field )
+		foreach ( $elements as $e ) {
+			if ( 0 == $e->$parent_field ) {
 				$top_level_elements[] = $e;
-			else
-				$children_elements[ $e->$parent_field ][] = $e;
+			} else { $children_elements[ $e->$parent_field ][] = $e;
+			}
 		}
 
 		$total_top = count( $top_level_elements );
-		if ( $paging )
-			$this->max_pages = ceil($total_top / $per_page);
-		else
-			$end = $total_top;
+		if ( $paging ) {
+			$this->max_pages = ceil( $total_top / $per_page );
+		} else { $end = $total_top;
+		}
 
-		if ( !empty($args[0]['reverse_top_level']) ) {
+		if ( ! empty( $args[0]['reverse_top_level'] ) ) {
 			$top_level_elements = array_reverse( $top_level_elements );
 			$oldstart = $start;
 			$start = $total_top - $end;
 			$end = $total_top - $oldstart;
 		}
-		if ( !empty($args[0]['reverse_children']) ) {
-			foreach ( $children_elements as $parent => $children )
-				$children_elements[$parent] = array_reverse( $children );
+		if ( ! empty( $args[0]['reverse_children'] ) ) {
+			foreach ( $children_elements as $parent => $children ) {
+				$children_elements[ $parent ] = array_reverse( $children );
+			}
 		}
 
 		foreach ( $top_level_elements as $e ) {
 			$count++;
 
 			// For the last page, need to unset earlier children in order to keep track of orphans.
-			if ( $end >= $total_top && $count < $start )
+			if ( $end >= $total_top && $count < $start ) {
 					$this->unset_children( $e, $children_elements );
+			}
 
-			if ( $count < $start )
+			if ( $count < $start ) {
 				continue;
+			}
 
-			if ( $count >= $end )
+			if ( $count >= $end ) {
 				break;
+			}
 
 			$this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
 		}
 
 		if ( $end >= $total_top && count( $children_elements ) > 0 ) {
 			$empty_array = array();
-			foreach ( $children_elements as $orphans )
-				foreach ( $orphans as $op )
+			foreach ( $children_elements as $orphans ) {
+				foreach ( $orphans as $op ) {
 					$this->display_element( $op, $empty_array, 1, 0, $args, $output );
+				}
+			}
 		}
 
 		return $output;
@@ -390,13 +405,14 @@
 	 * @param array $elements Elements to list.
 	 * @return int Number of root elements.
 	 */
-	public function get_number_of_root_elements( $elements ){
+	public function get_number_of_root_elements( $elements ) {
 		$num = 0;
 		$parent_field = $this->db_fields['parent'];
 
-		foreach ( $elements as $e) {
-			if ( 0 == $e->$parent_field )
+		foreach ( $elements as $e ) {
+			if ( 0 == $e->$parent_field ) {
 				$num++;
+			}
 		}
 		return $num;
 	}
@@ -409,7 +425,7 @@
 	 * @param object $e
 	 * @param array $children_elements
 	 */
-	public function unset_children( $e, &$children_elements ){
+	public function unset_children( $e, &$children_elements ) {
 		if ( ! $e || ! $children_elements ) {
 			return;
 		}
@@ -417,9 +433,11 @@
 		$id_field = $this->db_fields['id'];
 		$id = $e->$id_field;
 
-		if ( !empty($children_elements[$id]) && is_array($children_elements[$id]) )
-			foreach ( (array) $children_elements[$id] as $child )
+		if ( ! empty( $children_elements[ $id ] ) && is_array( $children_elements[ $id ] ) ) {
+			foreach ( (array) $children_elements[ $id ] as $child ) {
 				$this->unset_children( $child, $children_elements );
+			}
+		}
 
 		unset( $children_elements[ $id ] );
 	}
Index: src/wp-includes/class-wp-widget-factory.php
===================================================================
--- src/wp-includes/class-wp-widget-factory.php	(revision 40901)
+++ src/wp-includes/class-wp-widget-factory.php	(working copy)
@@ -135,18 +135,18 @@
 	 */
 	public function _register_widgets() {
 		global $wp_registered_widgets;
-		$keys = array_keys($this->widgets);
-		$registered = array_keys($wp_registered_widgets);
-		$registered = array_map('_get_widget_id_base', $registered);
+		$keys = array_keys( $this->widgets );
+		$registered = array_keys( $wp_registered_widgets );
+		$registered = array_map( '_get_widget_id_base', $registered );
 
 		foreach ( $keys as $key ) {
 			// don't register new widget if old widget with the same id is already registered
-			if ( in_array($this->widgets[$key]->id_base, $registered, true) ) {
-				unset($this->widgets[$key]);
+			if ( in_array( $this->widgets[ $key ]->id_base, $registered, true ) ) {
+				unset( $this->widgets[ $key ] );
 				continue;
 			}
 
-			$this->widgets[$key]->_register();
+			$this->widgets[ $key ]->_register();
 		}
 	}
 }
Index: src/wp-includes/class-wp-widget.php
===================================================================
--- src/wp-includes/class-wp-widget.php	(revision 40901)
+++ src/wp-includes/class-wp-widget.php	(working copy)
@@ -120,7 +120,7 @@
 	 * @param array $instance The settings for the particular instance of the widget.
 	 */
 	public function widget( $args, $instance ) {
-		die('function WP_Widget::widget() must be over-ridden in a sub-class.');
+		die( 'function WP_Widget::widget() must be over-ridden in a sub-class.' );
 	}
 
 	/**
@@ -152,7 +152,7 @@
 	 * @return string Default return is 'noform'.
 	 */
 	public function form( $instance ) {
-		echo '<p class="no-options-widget">' . __('There are no options for this widget.') . '</p>';
+		echo '<p class="no-options-widget">' . __( 'There are no options for this widget.' ) . '</p>';
 		return 'noform';
 	}
 
@@ -173,11 +173,16 @@
 	 *                                information on accepted arguments. Default empty array.
 	 */
 	public function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) {
-		$this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : strtolower($id_base);
+		$this->id_base = empty( $id_base ) ? preg_replace( '/(wp_)?widget_/', '', strtolower( get_class( $this ) ) ) : strtolower( $id_base );
 		$this->name = $name;
 		$this->option_name = 'widget_' . $this->id_base;
-		$this->widget_options = wp_parse_args( $widget_options, array( 'classname' => $this->option_name, 'customize_selective_refresh' => false ) );
-		$this->control_options = wp_parse_args( $control_options, array( 'id_base' => $this->id_base ) );
+		$this->widget_options = wp_parse_args( $widget_options, array(
+			'classname' => $this->option_name,
+			'customize_selective_refresh' => false,
+		) );
+		$this->control_options = wp_parse_args( $control_options, array(
+			'id_base' => $this->id_base,
+		) );
 	}
 
 	/**
@@ -214,7 +219,7 @@
 	 * @param string $field_name Field name
 	 * @return string Name attribute for $field_name
 	 */
-	public function get_field_name($field_name) {
+	public function get_field_name( $field_name ) {
 		if ( false === $pos = strpos( $field_name, '[' ) ) {
 			return 'widget-' . $this->id_base . '[' . $this->number . '][' . $field_name . ']';
 		} else {
@@ -280,7 +285,7 @@
 	 * @param int $number The unique order number of this widget instance compared to other
 	 *                    instances of the same class.
 	 */
-	public function _set($number) {
+	public function _set( $number ) {
 		$this->number = $number;
 		$this->id = $this->id_base . '-' . $number;
 	}
@@ -294,7 +299,7 @@
 	 * @return callable Display callback.
 	 */
 	public function _get_display_callback() {
-		return array($this, 'display_callback');
+		return array( $this, 'display_callback' );
 	}
 
 	/**
@@ -306,7 +311,7 @@
 	 * @return callable Update callback.
 	 */
 	public function _get_update_callback() {
-		return array($this, 'update_callback');
+		return array( $this, 'update_callback' );
 	}
 
 	/**
@@ -318,7 +323,7 @@
 	 * @return callable Form callback.
 	 */
 	public function _get_form_callback() {
-		return array($this, 'form_callback');
+		return array( $this, 'form_callback' );
 	}
 
 	/**
@@ -360,10 +365,14 @@
 	 */
 	public function display_callback( $args, $widget_args = 1 ) {
 		if ( is_numeric( $widget_args ) ) {
-			$widget_args = array( 'number' => $widget_args );
+			$widget_args = array(
+				'number' => $widget_args,
+			);
 		}
 
-		$widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );
+		$widget_args = wp_parse_args( $widget_args, array(
+			'number' => -1,
+		) );
 		$this->_set( $widget_args['number'] );
 		$instances = $this->get_settings();
 
@@ -416,37 +425,41 @@
 		$all_instances = $this->get_settings();
 
 		// We need to update the data
-		if ( $this->updated )
+		if ( $this->updated ) {
 			return;
+		}
 
-		if ( isset($_POST['delete_widget']) && $_POST['delete_widget'] ) {
+		if ( isset( $_POST['delete_widget'] ) && $_POST['delete_widget'] ) {
 			// Delete the settings for this instance of the widget
-			if ( isset($_POST['the-widget-id']) )
+			if ( isset( $_POST['the-widget-id'] ) ) {
 				$del_id = $_POST['the-widget-id'];
-			else
-				return;
+			} else { return;
+			}
 
-			if ( isset($wp_registered_widgets[$del_id]['params'][0]['number']) ) {
-				$number = $wp_registered_widgets[$del_id]['params'][0]['number'];
+			if ( isset( $wp_registered_widgets[ $del_id ]['params'][0]['number'] ) ) {
+				$number = $wp_registered_widgets[ $del_id ]['params'][0]['number'];
 
-				if ( $this->id_base . '-' . $number == $del_id )
-					unset($all_instances[$number]);
+				if ( $this->id_base . '-' . $number == $del_id ) {
+					unset( $all_instances[ $number ] );
+				}
 			}
 		} else {
-			if ( isset($_POST['widget-' . $this->id_base]) && is_array($_POST['widget-' . $this->id_base]) ) {
-				$settings = $_POST['widget-' . $this->id_base];
-			} elseif ( isset($_POST['id_base']) && $_POST['id_base'] == $this->id_base ) {
+			if ( isset( $_POST[ 'widget-' . $this->id_base ] ) && is_array( $_POST[ 'widget-' . $this->id_base ] ) ) {
+				$settings = $_POST[ 'widget-' . $this->id_base ];
+			} elseif ( isset( $_POST['id_base'] ) && $_POST['id_base'] == $this->id_base ) {
 				$num = $_POST['multi_number'] ? (int) $_POST['multi_number'] : (int) $_POST['widget_number'];
-				$settings = array( $num => array() );
+				$settings = array(
+					$num => array(),
+				);
 			} else {
 				return;
 			}
 
 			foreach ( $settings as $number => $new_instance ) {
-				$new_instance = stripslashes_deep($new_instance);
-				$this->_set($number);
+				$new_instance = stripslashes_deep( $new_instance );
+				$this->_set( $number );
 
-				$old_instance = isset($all_instances[$number]) ? $all_instances[$number] : array();
+				$old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array();
 
 				$was_cache_addition_suspended = wp_suspend_cache_addition();
 				if ( $this->is_preview() && ! $was_cache_addition_suspended ) {
@@ -474,14 +487,14 @@
 				 */
 				$instance = apply_filters( 'widget_update_callback', $instance, $new_instance, $old_instance, $this );
 				if ( false !== $instance ) {
-					$all_instances[$number] = $instance;
+					$all_instances[ $number ] = $instance;
 				}
 
 				break; // run only once
-			}
-		}
+			}// End foreach().
+		}// End if().
 
-		$this->save_settings($all_instances);
+		$this->save_settings( $all_instances );
 		$this->updated = true;
 	}
 
@@ -500,18 +513,23 @@
 	 * @return string|null
 	 */
 	public function form_callback( $widget_args = 1 ) {
-		if ( is_numeric($widget_args) )
-			$widget_args = array( 'number' => $widget_args );
+		if ( is_numeric( $widget_args ) ) {
+			$widget_args = array(
+				'number' => $widget_args,
+			);
+		}
 
-		$widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );
+		$widget_args = wp_parse_args( $widget_args, array(
+			'number' => -1,
+		) );
 		$all_instances = $this->get_settings();
 
 		if ( -1 == $widget_args['number'] ) {
 			// We echo out a form where 'number' can be set later
-			$this->_set('__i__');
+			$this->_set( '__i__' );
 			$instance = array();
 		} else {
-			$this->_set($widget_args['number']);
+			$this->_set( $widget_args['number'] );
 			$instance = $all_instances[ $widget_args['number'] ];
 		}
 
@@ -529,7 +547,7 @@
 
 		$return = null;
 		if ( false !== $instance ) {
-			$return = $this->form($instance);
+			$return = $this->form( $instance );
 
 			/**
 			 * Fires at the end of the widget control form.
@@ -562,9 +580,15 @@
 	 *                        compared to other instances of the same class. Default -1.
 	 */
 	public function _register_one( $number = -1 ) {
-		wp_register_sidebar_widget(	$this->id, $this->name,	$this->_get_display_callback(), $this->widget_options, array( 'number' => $number ) );
-		_register_widget_update_callback( $this->id_base, $this->_get_update_callback(), $this->control_options, array( 'number' => -1 ) );
-		_register_widget_form_callback(	$this->id, $this->name,	$this->_get_form_callback(), $this->control_options, array( 'number' => $number ) );
+		wp_register_sidebar_widget(	$this->id, $this->name,	$this->_get_display_callback(), $this->widget_options, array(
+			'number' => $number,
+		) );
+		_register_widget_update_callback( $this->id_base, $this->_get_update_callback(), $this->control_options, array(
+			'number' => -1,
+		) );
+		_register_widget_form_callback(	$this->id, $this->name,	$this->_get_form_callback(), $this->control_options, array(
+			'number' => $number,
+		) );
 	}
 
 	/**
Index: src/wp-includes/class-wp-xmlrpc-server.php
===================================================================
--- src/wp-includes/class-wp-xmlrpc-server.php	(revision 40901)
+++ src/wp-includes/class-wp-xmlrpc-server.php	(working copy)
@@ -153,7 +153,7 @@
 			'pingback.extensions.getPingbacks' => 'this:pingback_extensions_getPingbacks',
 
 			'demo.sayHello' => 'this:sayHello',
-			'demo.addTwoNumbers' => 'this:addTwoNumbers'
+			'demo.addTwoNumbers' => 'this:addTwoNumbers',
 		);
 
 		$this->initialise_blog_option_info();
@@ -194,7 +194,7 @@
 	 * @access public
 	 */
 	public function serve_request() {
-		$this->IXR_Server($this->methods);
+		$this->IXR_Server( $this->methods );
 	}
 
 	/**
@@ -328,14 +328,16 @@
 	 *                     when array is passed.
 	 */
 	public function escape( &$data ) {
-		if ( ! is_array( $data ) )
+		if ( ! is_array( $data ) ) {
 			return wp_slash( $data );
+		}
 
 		foreach ( $data as &$v ) {
-			if ( is_array( $v ) )
+			if ( is_array( $v ) ) {
 				$this->escape( $v );
-			elseif ( ! is_object( $v ) )
+			} elseif ( ! is_object( $v ) ) {
 				$v = wp_slash( $v );
+			}
 		}
 	}
 
@@ -347,20 +349,21 @@
 	 * @param int $post_id Post ID.
 	 * @return array Custom fields, if exist.
 	 */
-	public function get_custom_fields($post_id) {
+	public function get_custom_fields( $post_id ) {
 		$post_id = (int) $post_id;
 
 		$custom_fields = array();
 
-		foreach ( (array) has_meta($post_id) as $meta ) {
+		foreach ( (array) has_meta( $post_id ) as $meta ) {
 			// Don't expose protected fields.
-			if ( ! current_user_can( 'edit_post_meta', $post_id , $meta['meta_key'] ) )
+			if ( ! current_user_can( 'edit_post_meta', $post_id , $meta['meta_key'] ) ) {
 				continue;
+			}
 
 			$custom_fields[] = array(
-				"id"    => $meta['meta_id'],
-				"key"   => $meta['meta_key'],
-				"value" => $meta['meta_value']
+				'id'    => $meta['meta_id'],
+				'key'   => $meta['meta_key'],
+				'value' => $meta['meta_value'],
 			);
 		}
 
@@ -375,11 +378,11 @@
 	 * @param int $post_id Post ID.
 	 * @param array $fields Custom fields.
 	 */
-	public function set_custom_fields($post_id, $fields) {
+	public function set_custom_fields( $post_id, $fields ) {
 		$post_id = (int) $post_id;
 
 		foreach ( (array) $fields as $meta ) {
-			if ( isset($meta['id']) ) {
+			if ( isset( $meta['id'] ) ) {
 				$meta['id'] = (int) $meta['id'];
 				$pmeta = get_metadata_by_mid( 'post', $meta['id'] );
 
@@ -387,13 +390,15 @@
 					continue;
 				}
 
-				if ( isset($meta['key']) ) {
+				if ( isset( $meta['key'] ) ) {
 					$meta['key'] = wp_unslash( $meta['key'] );
-					if ( $meta['key'] !== $pmeta->meta_key )
+					if ( $meta['key'] !== $pmeta->meta_key ) {
 						continue;
+					}
 					$meta['value'] = wp_unslash( $meta['value'] );
-					if ( current_user_can( 'edit_post_meta', $post_id, $meta['key'] ) )
+					if ( current_user_can( 'edit_post_meta', $post_id, $meta['key'] ) ) {
 						update_metadata_by_mid( 'post', $meta['id'], $meta['value'] );
+					}
 				} elseif ( current_user_can( 'delete_post_meta', $post_id, $pmeta->meta_key ) ) {
 					delete_metadata_by_mid( 'post', $meta['id'] );
 				}
@@ -416,150 +421,150 @@
 			'software_name'     => array(
 				'desc'          => __( 'Software Name' ),
 				'readonly'      => true,
-				'value'         => 'WordPress'
+				'value'         => 'WordPress',
 			),
 			'software_version'  => array(
 				'desc'          => __( 'Software Version' ),
 				'readonly'      => true,
-				'value'         => get_bloginfo( 'version' )
+				'value'         => get_bloginfo( 'version' ),
 			),
 			'blog_url'          => array(
 				'desc'          => __( 'WordPress Address (URL)' ),
 				'readonly'      => true,
-				'option'        => 'siteurl'
+				'option'        => 'siteurl',
 			),
 			'home_url'          => array(
 				'desc'          => __( 'Site Address (URL)' ),
 				'readonly'      => true,
-				'option'        => 'home'
+				'option'        => 'home',
 			),
 			'login_url'          => array(
 				'desc'          => __( 'Login Address (URL)' ),
 				'readonly'      => true,
-				'value'         => wp_login_url( )
+				'value'         => wp_login_url( ),
 			),
 			'admin_url'          => array(
 				'desc'          => __( 'The URL to the admin area' ),
 				'readonly'      => true,
-				'value'         => get_admin_url( )
+				'value'         => get_admin_url( ),
 			),
 			'image_default_link_type' => array(
 				'desc'          => __( 'Image default link type' ),
 				'readonly'      => true,
-				'option'        => 'image_default_link_type'
+				'option'        => 'image_default_link_type',
 			),
 			'image_default_size' => array(
 				'desc'          => __( 'Image default size' ),
 				'readonly'      => true,
-				'option'        => 'image_default_size'
+				'option'        => 'image_default_size',
 			),
 			'image_default_align' => array(
 				'desc'          => __( 'Image default align' ),
 				'readonly'      => true,
-				'option'        => 'image_default_align'
+				'option'        => 'image_default_align',
 			),
 			'template'          => array(
 				'desc'          => __( 'Template' ),
 				'readonly'      => true,
-				'option'        => 'template'
+				'option'        => 'template',
 			),
 			'stylesheet'        => array(
 				'desc'          => __( 'Stylesheet' ),
 				'readonly'      => true,
-				'option'        => 'stylesheet'
+				'option'        => 'stylesheet',
 			),
 			'post_thumbnail'    => array(
-				'desc'          => __('Post Thumbnail'),
+				'desc'          => __( 'Post Thumbnail' ),
 				'readonly'      => true,
-				'value'         => current_theme_supports( 'post-thumbnails' )
+				'value'         => current_theme_supports( 'post-thumbnails' ),
 			),
 
 			// Updatable options
 			'time_zone'         => array(
 				'desc'          => __( 'Time Zone' ),
 				'readonly'      => false,
-				'option'        => 'gmt_offset'
+				'option'        => 'gmt_offset',
 			),
 			'blog_title'        => array(
 				'desc'          => __( 'Site Title' ),
 				'readonly'      => false,
-				'option'        => 'blogname'
+				'option'        => 'blogname',
 			),
 			'blog_tagline'      => array(
 				'desc'          => __( 'Site Tagline' ),
 				'readonly'      => false,
-				'option'        => 'blogdescription'
+				'option'        => 'blogdescription',
 			),
 			'date_format'       => array(
 				'desc'          => __( 'Date Format' ),
 				'readonly'      => false,
-				'option'        => 'date_format'
+				'option'        => 'date_format',
 			),
 			'time_format'       => array(
 				'desc'          => __( 'Time Format' ),
 				'readonly'      => false,
-				'option'        => 'time_format'
+				'option'        => 'time_format',
 			),
 			'users_can_register' => array(
 				'desc'          => __( 'Allow new users to sign up' ),
 				'readonly'      => false,
-				'option'        => 'users_can_register'
+				'option'        => 'users_can_register',
 			),
 			'thumbnail_size_w'  => array(
 				'desc'          => __( 'Thumbnail Width' ),
 				'readonly'      => false,
-				'option'        => 'thumbnail_size_w'
+				'option'        => 'thumbnail_size_w',
 			),
 			'thumbnail_size_h'  => array(
 				'desc'          => __( 'Thumbnail Height' ),
 				'readonly'      => false,
-				'option'        => 'thumbnail_size_h'
+				'option'        => 'thumbnail_size_h',
 			),
 			'thumbnail_crop'    => array(
 				'desc'          => __( 'Crop thumbnail to exact dimensions' ),
 				'readonly'      => false,
-				'option'        => 'thumbnail_crop'
+				'option'        => 'thumbnail_crop',
 			),
 			'medium_size_w'     => array(
 				'desc'          => __( 'Medium size image width' ),
 				'readonly'      => false,
-				'option'        => 'medium_size_w'
+				'option'        => 'medium_size_w',
 			),
 			'medium_size_h'     => array(
 				'desc'          => __( 'Medium size image height' ),
 				'readonly'      => false,
-				'option'        => 'medium_size_h'
+				'option'        => 'medium_size_h',
 			),
 			'medium_large_size_w'   => array(
 				'desc'          => __( 'Medium-Large size image width' ),
 				'readonly'      => false,
-				'option'        => 'medium_large_size_w'
+				'option'        => 'medium_large_size_w',
 			),
 			'medium_large_size_h'   => array(
 				'desc'          => __( 'Medium-Large size image height' ),
 				'readonly'      => false,
-				'option'        => 'medium_large_size_h'
+				'option'        => 'medium_large_size_h',
 			),
 			'large_size_w'      => array(
 				'desc'          => __( 'Large size image width' ),
 				'readonly'      => false,
-				'option'        => 'large_size_w'
+				'option'        => 'large_size_w',
 			),
 			'large_size_h'      => array(
 				'desc'          => __( 'Large size image height' ),
 				'readonly'      => false,
-				'option'        => 'large_size_h'
+				'option'        => 'large_size_h',
 			),
 			'default_comment_status' => array(
 				'desc'          => __( 'Allow people to post comments on new articles' ),
 				'readonly'      => false,
-				'option'        => 'default_comment_status'
+				'option'        => 'default_comment_status',
 			),
 			'default_ping_status' => array(
 				'desc'          => __( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new articles' ),
 				'readonly'      => false,
-				'option'        => 'default_ping_status'
-			)
+				'option'        => 'default_ping_status',
+			),
 		);
 
 		/**
@@ -597,7 +602,7 @@
 		}
 
 		// If this isn't on WPMU then just use blogger_getUsersBlogs
-		if ( !is_multisite() ) {
+		if ( ! is_multisite() ) {
 			array_unshift( $args, 1 );
 			return $this->blogger_getUsersBlogs( $args );
 		}
@@ -607,8 +612,9 @@
 		$username = $args[0];
 		$password = $args[1];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/**
 		 * Fires after the XML-RPC user has been authenticated but before the rest of
@@ -633,8 +639,9 @@
 
 		foreach ( $blogs as $blog ) {
 			// Don't include blogs that aren't hosted at this site.
-			if ( $blog->site_id != get_current_network_id() )
+			if ( $blog->site_id != get_current_network_id() ) {
 				continue;
+			}
 
 			$blog_id = $blog->userblog_id;
 
@@ -696,17 +703,21 @@
 			'_builtin' => (bool) $taxonomy->_builtin,
 		);
 
-		if ( in_array( 'labels', $fields ) )
+		if ( in_array( 'labels', $fields ) ) {
 			$_taxonomy['labels'] = (array) $taxonomy->labels;
+		}
 
-		if ( in_array( 'cap', $fields ) )
+		if ( in_array( 'cap', $fields ) ) {
 			$_taxonomy['cap'] = (array) $taxonomy->cap;
+		}
 
-		if ( in_array( 'menu', $fields ) )
+		if ( in_array( 'menu', $fields ) ) {
 			$_taxonomy['show_in_menu'] = (bool) $_taxonomy->show_in_menu;
+		}
 
-		if ( in_array( 'object_type', $fields ) )
+		if ( in_array( 'object_type', $fields ) ) {
 			$_taxonomy['object_type'] = array_unique( (array) $taxonomy->object_type );
+		}
 
 		/**
 		 * Filters XML-RPC-prepared data for the given taxonomy.
@@ -730,8 +741,9 @@
 	 */
 	protected function _prepare_term( $term ) {
 		$_term = $term;
-		if ( ! is_array( $_term ) )
+		if ( ! is_array( $_term ) ) {
 			$_term = get_object_vars( $_term );
+		}
 
 		// For integers which may be larger than XML-RPC supports ensure we return strings.
 		$_term['term_id'] = strval( $_term['term_id'] );
@@ -795,7 +807,9 @@
 	 */
 	protected function _prepare_post( $post, $fields ) {
 		// Holds the data for this post. built up based on $fields.
-		$_post = array( 'post_id' => strval( $post['ID'] ) );
+		$_post = array(
+			'post_id' => strval( $post['ID'] ),
+		);
 
 		// Prepare common post fields.
 		$post_fields = array(
@@ -825,18 +839,20 @@
 		$post_fields['post_thumbnail'] = array();
 		$thumbnail_id = get_post_thumbnail_id( $post['ID'] );
 		if ( $thumbnail_id ) {
-			$thumbnail_size = current_theme_supports('post-thumbnail') ? 'post-thumbnail' : 'thumbnail';
+			$thumbnail_size = current_theme_supports( 'post-thumbnail' ) ? 'post-thumbnail' : 'thumbnail';
 			$post_fields['post_thumbnail'] = $this->_prepare_media_item( get_post( $thumbnail_id ), $thumbnail_size );
 		}
 
 		// Consider future posts as published.
-		if ( $post_fields['post_status'] === 'future' )
+		if ( $post_fields['post_status'] === 'future' ) {
 			$post_fields['post_status'] = 'publish';
+		}
 
 		// Fill in blank post format.
 		$post_fields['post_format'] = get_post_format( $post['ID'] );
-		if ( empty( $post_fields['post_format'] ) )
+		if ( empty( $post_fields['post_format'] ) ) {
 			$post_fields['post_format'] = 'standard';
+		}
 
 		// Merge requested $post_fields fields into $_post.
 		if ( in_array( 'post', $fields ) ) {
@@ -857,8 +873,9 @@
 			}
 		}
 
-		if ( in_array( 'custom_fields', $fields ) )
+		if ( in_array( 'custom_fields', $fields ) ) {
 			$_post['custom_fields'] = $this->get_custom_fields( $post['ID'] );
+		}
 
 		if ( in_array( 'enclosure', $fields ) ) {
 			$_post['enclosure'] = array();
@@ -921,8 +938,9 @@
 			$_post_type['show_in_menu'] = (bool) $post_type->show_in_menu;
 		}
 
-		if ( in_array( 'taxonomies', $fields ) )
+		if ( in_array( 'taxonomies', $fields ) ) {
 			$_post_type['taxonomies'] = get_object_taxonomies( $post_type->name, 'names' );
+		}
 
 		/**
 		 * Filters XML-RPC-prepared date for the given post type.
@@ -955,14 +973,14 @@
 			'caption'          => $media_item->post_excerpt,
 			'description'      => $media_item->post_content,
 			'metadata'         => wp_get_attachment_metadata( $media_item->ID ),
-			'type'             => $media_item->post_mime_type
+			'type'             => $media_item->post_mime_type,
 		);
 
 		$thumbnail_src = image_downsize( $media_item->ID, $thumbnail_size );
-		if ( $thumbnail_src )
+		if ( $thumbnail_src ) {
 			$_media_item['thumbnail'] = $thumbnail_src[0];
-		else
-			$_media_item['thumbnail'] = $_media_item['link'];
+		} else { $_media_item['thumbnail'] = $_media_item['link'];
+		}
 
 		/**
 		 * Filters XML-RPC-prepared data for the given media item.
@@ -990,7 +1008,7 @@
 		$link = get_permalink( $page->ID );
 
 		// Get info the page parent if there is one.
-		$parent_title = "";
+		$parent_title = '';
 		if ( ! empty( $page->post_parent ) ) {
 			$parent = get_post( $page->post_parent );
 			$parent_title = $parent->post_title;
@@ -1016,8 +1034,9 @@
 		$author = get_userdata( $page->post_author );
 
 		$page_template = get_page_template_slug( $page->ID );
-		if ( empty( $page_template ) )
+		if ( empty( $page_template ) ) {
 			$page_template = 'default';
+		}
 
 		$_page = array(
 			'dateCreated'            => $page_date,
@@ -1043,7 +1062,7 @@
 			'wp_author_display_name' => $author->display_name,
 			'date_created_gmt'       => $page_date_gmt,
 			'custom_fields'          => $this->get_custom_fields( $page->ID ),
-			'wp_page_template'       => $page_template
+			'wp_page_template'       => $page_template,
 		);
 
 		/**
@@ -1085,9 +1104,9 @@
 			'parent'           => $comment->comment_parent,
 			'status'           => $comment_status,
 			'content'          => $comment->comment_content,
-			'link'             => get_comment_link($comment),
+			'link'             => get_comment_link( $comment ),
 			'post_id'          => $comment->comment_post_ID,
-			'post_title'       => get_the_title($comment->comment_post_ID),
+			'post_title'       => get_the_title( $comment->comment_post_ID ),
 			'author'           => $comment->comment_author,
 			'author_url'       => $comment->comment_author_url,
 			'author_email'     => $comment->comment_author_email,
@@ -1203,8 +1222,9 @@
 	 * @return int|IXR_Error Post ID on success, IXR_Error instance otherwise.
 	 */
 	public function wp_newPost( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -1212,8 +1232,9 @@
 		$password       = $args[2];
 		$content_struct = $args[3];
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		// convert the date field back to IXR form
 		if ( isset( $content_struct['post_date'] ) && ! ( $content_struct['post_date'] instanceof IXR_Date ) ) {
@@ -1273,7 +1294,7 @@
 			if ( $update ) {
 				unstick_post( $post_data['ID'] );
 			}
-		} elseif ( isset( $post_data['sticky'] ) )  {
+		} elseif ( isset( $post_data['sticky'] ) ) {
 			if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) {
 				return new IXR_Error( 401, __( 'Sorry, you are not allowed to make posts sticky.' ) );
 			}
@@ -1327,21 +1348,26 @@
 		$post_data = wp_parse_args( array_intersect_key( $content_struct, $defaults ), $defaults );
 
 		$post_type = get_post_type_object( $post_data['post_type'] );
-		if ( ! $post_type )
+		if ( ! $post_type ) {
 			return new IXR_Error( 403, __( 'Invalid post type.' ) );
+		}
 
 		$update = ! empty( $post_data['ID'] );
 
 		if ( $update ) {
-			if ( ! get_post( $post_data['ID'] ) )
+			if ( ! get_post( $post_data['ID'] ) ) {
 				return new IXR_Error( 401, __( 'Invalid post ID.' ) );
-			if ( ! current_user_can( 'edit_post', $post_data['ID'] ) )
+			}
+			if ( ! current_user_can( 'edit_post', $post_data['ID'] ) ) {
 				return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
-			if ( $post_data['post_type'] != get_post_type( $post_data['ID'] ) )
+			}
+			if ( $post_data['post_type'] != get_post_type( $post_data['ID'] ) ) {
 				return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
+			}
 		} else {
-			if ( ! current_user_can( $post_type->cap->create_posts ) || ! current_user_can( $post_type->cap->edit_posts ) )
+			if ( ! current_user_can( $post_type->cap->create_posts ) || ! current_user_can( $post_type->cap->edit_posts ) ) {
 				return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );
+			}
 		}
 
 		switch ( $post_data['post_status'] ) {
@@ -1349,41 +1375,49 @@
 			case 'pending':
 				break;
 			case 'private':
-				if ( ! current_user_can( $post_type->cap->publish_posts ) )
+				if ( ! current_user_can( $post_type->cap->publish_posts ) ) {
 					return new IXR_Error( 401, __( 'Sorry, you are not allowed to create private posts in this post type.' ) );
+				}
 				break;
 			case 'publish':
 			case 'future':
-				if ( ! current_user_can( $post_type->cap->publish_posts ) )
+				if ( ! current_user_can( $post_type->cap->publish_posts ) ) {
 					return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type.' ) );
+				}
 				break;
 			default:
-				if ( ! get_post_status_object( $post_data['post_status'] ) )
+				if ( ! get_post_status_object( $post_data['post_status'] ) ) {
 					$post_data['post_status'] = 'draft';
+				}
 			break;
 		}
 
-		if ( ! empty( $post_data['post_password'] ) && ! current_user_can( $post_type->cap->publish_posts ) )
+		if ( ! empty( $post_data['post_password'] ) && ! current_user_can( $post_type->cap->publish_posts ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to create password protected posts in this post type.' ) );
+		}
 
 		$post_data['post_author'] = absint( $post_data['post_author'] );
 		if ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) {
-			if ( ! current_user_can( $post_type->cap->edit_others_posts ) )
+			if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) {
 				return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) );
+			}
 
 			$author = get_userdata( $post_data['post_author'] );
 
-			if ( ! $author )
+			if ( ! $author ) {
 				return new IXR_Error( 404, __( 'Invalid author ID.' ) );
+			}
 		} else {
 			$post_data['post_author'] = $user->ID;
 		}
 
-		if ( isset( $post_data['comment_status'] ) && $post_data['comment_status'] != 'open' && $post_data['comment_status'] != 'closed' )
+		if ( isset( $post_data['comment_status'] ) && $post_data['comment_status'] != 'open' && $post_data['comment_status'] != 'closed' ) {
 			unset( $post_data['comment_status'] );
+		}
 
-		if ( isset( $post_data['ping_status'] ) && $post_data['ping_status'] != 'open' && $post_data['ping_status'] != 'closed' )
+		if ( isset( $post_data['ping_status'] ) && $post_data['ping_status'] != 'open' && $post_data['ping_status'] != 'closed' ) {
 			unset( $post_data['ping_status'] );
+		}
 
 		// Do some timestamp voodoo.
 		if ( ! empty( $post_data['post_date_gmt'] ) ) {
@@ -1404,8 +1438,9 @@
 			$post_data['edit_date'] = true;
 		}
 
-		if ( ! isset( $post_data['ID'] ) )
+		if ( ! isset( $post_data['ID'] ) ) {
 			$post_data['ID'] = get_default_post_to_edit( $post_data['post_type'], true )->ID;
+		}
 		$post_ID = $post_data['ID'];
 
 		if ( $post_data['post_type'] == 'post' ) {
@@ -1417,16 +1452,18 @@
 
 		if ( isset( $post_data['post_thumbnail'] ) ) {
 			// empty value deletes, non-empty value adds/updates.
-			if ( ! $post_data['post_thumbnail'] )
+			if ( ! $post_data['post_thumbnail'] ) {
 				delete_post_thumbnail( $post_ID );
-			elseif ( ! get_post( absint( $post_data['post_thumbnail'] ) ) )
+			} elseif ( ! get_post( absint( $post_data['post_thumbnail'] ) ) ) {
 				return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
+			}
 			set_post_thumbnail( $post_ID, $post_data['post_thumbnail'] );
 			unset( $content_struct['post_thumbnail'] );
 		}
 
-		if ( isset( $post_data['custom_fields'] ) )
+		if ( isset( $post_data['custom_fields'] ) ) {
 			$this->set_custom_fields( $post_ID, $post_data['custom_fields'] );
+		}
 
 		if ( isset( $post_data['terms'] ) || isset( $post_data['terms_names'] ) ) {
 			$post_type_taxonomies = get_object_taxonomies( $post_data['post_type'], 'objects' );
@@ -1440,21 +1477,24 @@
 
 				// Validating term ids.
 				foreach ( $taxonomies as $taxonomy ) {
-					if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) )
+					if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) ) {
 						return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
+					}
 
-					if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
+					if ( ! current_user_can( $post_type_taxonomies[ $taxonomy ]->cap->assign_terms ) ) {
 						return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
+					}
 
-					$term_ids = $post_data['terms'][$taxonomy];
+					$term_ids = $post_data['terms'][ $taxonomy ];
 					$terms[ $taxonomy ] = array();
 					foreach ( $term_ids as $term_id ) {
 						$term = get_term_by( 'id', $term_id, $taxonomy );
 
-						if ( ! $term )
+						if ( ! $term ) {
 							return new IXR_Error( 403, __( 'Invalid term ID.' ) );
+						}
 
-						$terms[$taxonomy][] = (int) $term_id;
+						$terms[ $taxonomy ][] = (int) $term_id;
 					}
 				}
 			}
@@ -1464,11 +1504,13 @@
 				$taxonomies = array_keys( $post_data['terms_names'] );
 
 				foreach ( $taxonomies as $taxonomy ) {
-					if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) )
+					if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) ) {
 						return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
+					}
 
-					if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
+					if ( ! current_user_can( $post_type_taxonomies[ $taxonomy ]->cap->assign_terms ) ) {
 						return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
+					}
 
 					/*
 					 * For hierarchical taxonomies, we can't assign a term when multiple terms
@@ -1482,45 +1524,49 @@
 						$tax_term_names_count = array_count_values( $tax_term_names );
 
 						// Filter out non-ambiguous term names.
-						$ambiguous_tax_term_counts = array_filter( $tax_term_names_count, array( $this, '_is_greater_than_one') );
+						$ambiguous_tax_term_counts = array_filter( $tax_term_names_count, array( $this, '_is_greater_than_one' ) );
 
 						$ambiguous_terms = array_keys( $ambiguous_tax_term_counts );
 					}
 
-					$term_names = $post_data['terms_names'][$taxonomy];
+					$term_names = $post_data['terms_names'][ $taxonomy ];
 					foreach ( $term_names as $term_name ) {
-						if ( in_array( $term_name, $ambiguous_terms ) )
+						if ( in_array( $term_name, $ambiguous_terms ) ) {
 							return new IXR_Error( 401, __( 'Ambiguous term name used in a hierarchical taxonomy. Please use term ID instead.' ) );
+						}
 
 						$term = get_term_by( 'name', $term_name, $taxonomy );
 
 						if ( ! $term ) {
 							// Term doesn't exist, so check that the user is allowed to create new terms.
-							if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->edit_terms ) )
+							if ( ! current_user_can( $post_type_taxonomies[ $taxonomy ]->cap->edit_terms ) ) {
 								return new IXR_Error( 401, __( 'Sorry, you are not allowed to add a term to one of the given taxonomies.' ) );
+							}
 
 							// Create the new term.
 							$term_info = wp_insert_term( $term_name, $taxonomy );
-							if ( is_wp_error( $term_info ) )
+							if ( is_wp_error( $term_info ) ) {
 								return new IXR_Error( 500, $term_info->get_error_message() );
+							}
 
-							$terms[$taxonomy][] = (int) $term_info['term_id'];
+							$terms[ $taxonomy ][] = (int) $term_info['term_id'];
 						} else {
-							$terms[$taxonomy][] = (int) $term->term_id;
+							$terms[ $taxonomy ][] = (int) $term->term_id;
 						}
 					}
-				}
-			}
+				}// End foreach().
+			}// End if().
 
 			$post_data['tax_input'] = $terms;
 			unset( $post_data['terms'], $post_data['terms_names'] );
-		}
+		}// End if().
 
 		if ( isset( $post_data['post_format'] ) ) {
 			$format = set_post_format( $post_ID, $post_data['post_format'] );
 
-			if ( is_wp_error( $format ) )
+			if ( is_wp_error( $format ) ) {
 				return new IXR_Error( 500, $format->get_error_message() );
+			}
 
 			unset( $post_data['post_format'] );
 		}
@@ -1542,11 +1588,13 @@
 		$post_data = apply_filters( 'xmlrpc_wp_insert_post_data', $post_data, $content_struct );
 
 		$post_ID = $update ? wp_update_post( $post_data, true ) : wp_insert_post( $post_data, true );
-		if ( is_wp_error( $post_ID ) )
+		if ( is_wp_error( $post_ID ) ) {
 			return new IXR_Error( 500, $post_ID->get_error_message() );
+		}
 
-		if ( ! $post_ID )
+		if ( ! $post_ID ) {
 			return new IXR_Error( 401, __( 'Sorry, your entry could not be posted.' ) );
+		}
 
 		return strval( $post_ID );
 	}
@@ -1571,8 +1619,9 @@
 	 * @return true|IXR_Error True on success, IXR_Error on failure.
 	 */
 	public function wp_editPost( $args ) {
-		if ( ! $this->minimum_args( $args, 5 ) )
+		if ( ! $this->minimum_args( $args, 5 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -1581,16 +1630,18 @@
 		$post_id        = (int) $args[3];
 		$content_struct = $args[4];
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.editPost' );
 
 		$post = get_post( $post_id, ARRAY_A );
 
-		if ( empty( $post['ID'] ) )
+		if ( empty( $post['ID'] ) ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
 		if ( isset( $content_struct['if_not_modified_since'] ) ) {
 			// If the post has been modified since the date provided, return an error.
@@ -1606,17 +1657,18 @@
 		 * Ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct,
 		 * since _insert_post() will ignore the non-GMT date if the GMT date is set.
 		 */
-		if ( $post['post_date_gmt'] == '0000-00-00 00:00:00' || isset( $content_struct['post_date'] ) )
+		if ( $post['post_date_gmt'] == '0000-00-00 00:00:00' || isset( $content_struct['post_date'] ) ) {
 			unset( $post['post_date_gmt'] );
-		else
-			$post['post_date_gmt'] = $this->_convert_date( $post['post_date_gmt'] );
+		} else { $post['post_date_gmt'] = $this->_convert_date( $post['post_date_gmt'] );
+		}
 
 		$this->escape( $post );
 		$merged_content_struct = array_merge( $post, $content_struct );
 
 		$retval = $this->_insert_post( $user, $merged_content_struct );
-		if ( $retval instanceof IXR_Error )
+		if ( $retval instanceof IXR_Error ) {
 			return $retval;
+		}
 
 		return true;
 	}
@@ -1639,8 +1691,9 @@
 	 * @return true|IXR_Error True on success, IXR_Error instance on failure.
 	 */
 	public function wp_deletePost( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -1648,8 +1701,9 @@
 		$password   = $args[2];
 		$post_id    = (int) $args[3];
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.deletePost' );
@@ -1722,8 +1776,9 @@
 	 *  - 'enclosure'
 	 */
 	public function wp_getPost( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -1745,19 +1800,22 @@
 			$fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPost' );
 		}
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPost' );
 
 		$post = get_post( $post_id, ARRAY_A );
 
-		if ( empty( $post['ID'] ) )
+		if ( empty( $post['ID'] ) ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( ! current_user_can( 'edit_post', $post_id ) )
+		if ( ! current_user_can( 'edit_post', $post_id ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
+		}
 
 		return $this->_prepare_post( $post, $fields );
 	}
@@ -1785,8 +1843,9 @@
 	 * @return array|IXR_Error Array contains a collection of posts.
 	 */
 	public function wp_getPosts( $args ) {
-		if ( ! $this->minimum_args( $args, 3 ) )
+		if ( ! $this->minimum_args( $args, 3 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -1801,8 +1860,9 @@
 			$fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPosts' );
 		}
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPosts' );
@@ -1811,31 +1871,37 @@
 
 		if ( isset( $filter['post_type'] ) ) {
 			$post_type = get_post_type_object( $filter['post_type'] );
-			if ( ! ( (bool) $post_type ) )
+			if ( ! ( (bool) $post_type ) ) {
 				return new IXR_Error( 403, __( 'Invalid post type.' ) );
+			}
 		} else {
 			$post_type = get_post_type_object( 'post' );
 		}
 
-		if ( ! current_user_can( $post_type->cap->edit_posts ) )
+		if ( ! current_user_can( $post_type->cap->edit_posts ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
+		}
 
 		$query['post_type'] = $post_type->name;
 
-		if ( isset( $filter['post_status'] ) )
+		if ( isset( $filter['post_status'] ) ) {
 			$query['post_status'] = $filter['post_status'];
+		}
 
-		if ( isset( $filter['number'] ) )
+		if ( isset( $filter['number'] ) ) {
 			$query['numberposts'] = absint( $filter['number'] );
+		}
 
-		if ( isset( $filter['offset'] ) )
+		if ( isset( $filter['offset'] ) ) {
 			$query['offset'] = absint( $filter['offset'] );
+		}
 
 		if ( isset( $filter['orderby'] ) ) {
 			$query['orderby'] = $filter['orderby'];
 
-			if ( isset( $filter['order'] ) )
+			if ( isset( $filter['order'] ) ) {
 				$query['order'] = $filter['order'];
+			}
 		}
 
 		if ( isset( $filter['s'] ) ) {
@@ -1844,15 +1910,17 @@
 
 		$posts_list = wp_get_recent_posts( $query );
 
-		if ( ! $posts_list )
+		if ( ! $posts_list ) {
 			return array();
+		}
 
 		// Holds all the posts data.
 		$struct = array();
 
 		foreach ( $posts_list as $post ) {
-			if ( ! current_user_can( 'edit_post', $post['ID'] ) )
+			if ( ! current_user_can( 'edit_post', $post['ID'] ) ) {
 				continue;
+			}
 
 			$struct[] = $this->_prepare_post( $post, $fields );
 		}
@@ -1880,8 +1948,9 @@
 	 * @return int|IXR_Error The term ID on success, or an IXR_Error object on failure.
 	 */
 	public function wp_newTerm( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -1889,14 +1958,16 @@
 		$password       = $args[2];
 		$content_struct = $args[3];
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.newTerm' );
 
-		if ( ! taxonomy_exists( $content_struct['taxonomy'] ) )
+		if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) {
 			return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
+		}
 
 		$taxonomy = get_taxonomy( $content_struct['taxonomy'] );
 
@@ -1910,38 +1981,46 @@
 		$term_data = array();
 
 		$term_data['name'] = trim( $content_struct['name'] );
-		if ( empty( $term_data['name'] ) )
+		if ( empty( $term_data['name'] ) ) {
 			return new IXR_Error( 403, __( 'The term name cannot be empty.' ) );
+		}
 
 		if ( isset( $content_struct['parent'] ) ) {
-			if ( ! $taxonomy['hierarchical'] )
+			if ( ! $taxonomy['hierarchical'] ) {
 				return new IXR_Error( 403, __( 'This taxonomy is not hierarchical.' ) );
+			}
 
 			$parent_term_id = (int) $content_struct['parent'];
 			$parent_term = get_term( $parent_term_id , $taxonomy['name'] );
 
-			if ( is_wp_error( $parent_term ) )
+			if ( is_wp_error( $parent_term ) ) {
 				return new IXR_Error( 500, $parent_term->get_error_message() );
+			}
 
-			if ( ! $parent_term )
+			if ( ! $parent_term ) {
 				return new IXR_Error( 403, __( 'Parent term does not exist.' ) );
+			}
 
 			$term_data['parent'] = $content_struct['parent'];
 		}
 
-		if ( isset( $content_struct['description'] ) )
+		if ( isset( $content_struct['description'] ) ) {
 			$term_data['description'] = $content_struct['description'];
+		}
 
-		if ( isset( $content_struct['slug'] ) )
+		if ( isset( $content_struct['slug'] ) ) {
 			$term_data['slug'] = $content_struct['slug'];
+		}
 
 		$term = wp_insert_term( $term_data['name'] , $taxonomy['name'] , $term_data );
 
-		if ( is_wp_error( $term ) )
+		if ( is_wp_error( $term ) ) {
 			return new IXR_Error( 500, $term->get_error_message() );
+		}
 
-		if ( ! $term )
+		if ( ! $term ) {
 			return new IXR_Error( 500, __( 'Sorry, your term could not be created.' ) );
+		}
 
 		return strval( $term['term_id'] );
 	}
@@ -1967,8 +2046,9 @@
 	 * @return true|IXR_Error True on success, IXR_Error instance on failure.
 	 */
 	public function wp_editTerm( $args ) {
-		if ( ! $this->minimum_args( $args, 5 ) )
+		if ( ! $this->minimum_args( $args, 5 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -1977,14 +2057,16 @@
 		$term_id        = (int) $args[3];
 		$content_struct = $args[4];
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.editTerm' );
 
-		if ( ! taxonomy_exists( $content_struct['taxonomy'] ) )
+		if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) {
 			return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
+		}
 
 		$taxonomy = get_taxonomy( $content_struct['taxonomy'] );
 
@@ -1995,11 +2077,13 @@
 
 		$term = get_term( $term_id , $content_struct['taxonomy'] );
 
-		if ( is_wp_error( $term ) )
+		if ( is_wp_error( $term ) ) {
 			return new IXR_Error( 500, $term->get_error_message() );
+		}
 
-		if ( ! $term )
+		if ( ! $term ) {
 			return new IXR_Error( 404, __( 'Invalid term ID.' ) );
+		}
 
 		if ( ! current_user_can( 'edit_term', $term_id ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this term.' ) );
@@ -2008,39 +2092,47 @@
 		if ( isset( $content_struct['name'] ) ) {
 			$term_data['name'] = trim( $content_struct['name'] );
 
-			if ( empty( $term_data['name'] ) )
+			if ( empty( $term_data['name'] ) ) {
 				return new IXR_Error( 403, __( 'The term name cannot be empty.' ) );
+			}
 		}
 
 		if ( ! empty( $content_struct['parent'] ) ) {
-			if ( ! $taxonomy['hierarchical'] )
+			if ( ! $taxonomy['hierarchical'] ) {
 				return new IXR_Error( 403, __( "This taxonomy is not hierarchical so you can't set a parent." ) );
+			}
 
 			$parent_term_id = (int) $content_struct['parent'];
 			$parent_term = get_term( $parent_term_id , $taxonomy['name'] );
 
-			if ( is_wp_error( $parent_term ) )
+			if ( is_wp_error( $parent_term ) ) {
 				return new IXR_Error( 500, $parent_term->get_error_message() );
+			}
 
-			if ( ! $parent_term )
+			if ( ! $parent_term ) {
 				return new IXR_Error( 403, __( 'Parent term does not exist.' ) );
+			}
 
 			$term_data['parent'] = $content_struct['parent'];
 		}
 
-		if ( isset( $content_struct['description'] ) )
+		if ( isset( $content_struct['description'] ) ) {
 			$term_data['description'] = $content_struct['description'];
+		}
 
-		if ( isset( $content_struct['slug'] ) )
+		if ( isset( $content_struct['slug'] ) ) {
 			$term_data['slug'] = $content_struct['slug'];
+		}
 
 		$term = wp_update_term( $term_id , $taxonomy['name'] , $term_data );
 
-		if ( is_wp_error( $term ) )
+		if ( is_wp_error( $term ) ) {
 			return new IXR_Error( 500, $term->get_error_message() );
+		}
 
-		if ( ! $term )
+		if ( ! $term ) {
 			return new IXR_Error( 500, __( 'Sorry, editing the term failed.' ) );
+		}
 
 		return true;
 	}
@@ -2064,8 +2156,9 @@
 	 * @return bool|IXR_Error True on success, IXR_Error instance on failure.
 	 */
 	public function wp_deleteTerm( $args ) {
-		if ( ! $this->minimum_args( $args, 5 ) )
+		if ( ! $this->minimum_args( $args, 5 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -2074,23 +2167,27 @@
 		$taxonomy           = $args[3];
 		$term_id            = (int) $args[4];
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.deleteTerm' );
 
-		if ( ! taxonomy_exists( $taxonomy ) )
+		if ( ! taxonomy_exists( $taxonomy ) ) {
 			return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
+		}
 
 		$taxonomy = get_taxonomy( $taxonomy );
 		$term = get_term( $term_id, $taxonomy->name );
 
-		if ( is_wp_error( $term ) )
+		if ( is_wp_error( $term ) ) {
 			return new IXR_Error( 500, $term->get_error_message() );
+		}
 
-		if ( ! $term )
+		if ( ! $term ) {
 			return new IXR_Error( 404, __( 'Invalid term ID.' ) );
+		}
 
 		if ( ! current_user_can( 'delete_term', $term_id ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this term.' ) );
@@ -2098,11 +2195,13 @@
 
 		$result = wp_delete_term( $term_id, $taxonomy->name );
 
-		if ( is_wp_error( $result ) )
+		if ( is_wp_error( $result ) ) {
 			return new IXR_Error( 500, $term->get_error_message() );
+		}
 
-		if ( ! $result )
+		if ( ! $result ) {
 			return new IXR_Error( 500, __( 'Sorry, deleting the term failed.' ) );
+		}
 
 		return $result;
 	}
@@ -2135,8 +2234,9 @@
 	 *  - 'count'
 	 */
 	public function wp_getTerm( $args ) {
-		if ( ! $this->minimum_args( $args, 5 ) )
+		if ( ! $this->minimum_args( $args, 5 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -2145,24 +2245,28 @@
 		$taxonomy           = $args[3];
 		$term_id            = (int) $args[4];
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getTerm' );
 
-		if ( ! taxonomy_exists( $taxonomy ) )
+		if ( ! taxonomy_exists( $taxonomy ) ) {
 			return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
+		}
 
 		$taxonomy = get_taxonomy( $taxonomy );
 
 		$term = get_term( $term_id , $taxonomy->name, ARRAY_A );
 
-		if ( is_wp_error( $term ) )
+		if ( is_wp_error( $term ) ) {
 			return new IXR_Error( 500, $term->get_error_message() );
+		}
 
-		if ( ! $term )
+		if ( ! $term ) {
 			return new IXR_Error( 404, __( 'Invalid term ID.' ) );
+		}
 
 		if ( ! current_user_can( 'assign_term', $term_id ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign this term.' ) );
@@ -2194,8 +2298,9 @@
 	 * @return array|IXR_Error An associative array of terms data on success, IXR_Error instance otherwise.
 	 */
 	public function wp_getTerms( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -2204,47 +2309,55 @@
 		$taxonomy       = $args[3];
 		$filter         = isset( $args[4] ) ? $args[4] : array();
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getTerms' );
 
-		if ( ! taxonomy_exists( $taxonomy ) )
+		if ( ! taxonomy_exists( $taxonomy ) ) {
 			return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
+		}
 
 		$taxonomy = get_taxonomy( $taxonomy );
 
-		if ( ! current_user_can( $taxonomy->cap->assign_terms ) )
+		if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) );
+		}
 
 		$query = array();
 
-		if ( isset( $filter['number'] ) )
+		if ( isset( $filter['number'] ) ) {
 			$query['number'] = absint( $filter['number'] );
+		}
 
-		if ( isset( $filter['offset'] ) )
+		if ( isset( $filter['offset'] ) ) {
 			$query['offset'] = absint( $filter['offset'] );
+		}
 
 		if ( isset( $filter['orderby'] ) ) {
 			$query['orderby'] = $filter['orderby'];
 
-			if ( isset( $filter['order'] ) )
+			if ( isset( $filter['order'] ) ) {
 				$query['order'] = $filter['order'];
+			}
 		}
 
-		if ( isset( $filter['hide_empty'] ) )
+		if ( isset( $filter['hide_empty'] ) ) {
 			$query['hide_empty'] = $filter['hide_empty'];
-		else
-			$query['get'] = 'all';
+		} else { $query['get'] = 'all';
+		}
 
-		if ( isset( $filter['search'] ) )
+		if ( isset( $filter['search'] ) ) {
 			$query['search'] = $filter['search'];
+		}
 
 		$terms = get_terms( $taxonomy->name, $query );
 
-		if ( is_wp_error( $terms ) )
+		if ( is_wp_error( $terms ) ) {
 			return new IXR_Error( 500, $terms->get_error_message() );
+		}
 
 		$struct = array();
 
@@ -2276,8 +2389,9 @@
 	 * @return array|IXR_Error An array of taxonomy data on success, IXR_Error instance otherwise.
 	 */
 	public function wp_getTaxonomy( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -2299,19 +2413,22 @@
 			$fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'cap', 'object_type' ), 'wp.getTaxonomy' );
 		}
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getTaxonomy' );
 
-		if ( ! taxonomy_exists( $taxonomy ) )
+		if ( ! taxonomy_exists( $taxonomy ) ) {
 			return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
+		}
 
 		$taxonomy = get_taxonomy( $taxonomy );
 
-		if ( ! current_user_can( $taxonomy->cap->assign_terms ) )
+		if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) );
+		}
 
 		return $this->_prepare_taxonomy( $taxonomy, $fields );
 	}
@@ -2336,8 +2453,9 @@
 	 *                         by `$fields`, or an IXR_Error instance on failure.
 	 */
 	public function wp_getTaxonomies( $args ) {
-		if ( ! $this->minimum_args( $args, 3 ) )
+		if ( ! $this->minimum_args( $args, 3 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -2352,8 +2470,9 @@
 			$fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'cap', 'object_type' ), 'wp.getTaxonomies' );
 		}
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getTaxonomies' );
@@ -2365,8 +2484,9 @@
 
 		foreach ( $taxonomies as $taxonomy ) {
 			// capability check for post_types
-			if ( ! current_user_can( $taxonomy->cap->assign_terms ) )
+			if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) {
 				continue;
+			}
 
 			$struct[] = $this->_prepare_taxonomy( $taxonomy, $fields );
 		}
@@ -2411,8 +2531,9 @@
 	 *  - 'roles'
 	 */
 	public function wp_getUser( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -2434,19 +2555,22 @@
 			$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUser' );
 		}
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getUser' );
 
-		if ( ! current_user_can( 'edit_user', $user_id ) )
+		if ( ! current_user_can( 'edit_user', $user_id ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this user.' ) );
+		}
 
 		$user_data = get_userdata( $user_id );
 
-		if ( ! $user_data )
+		if ( ! $user_data ) {
 			return new IXR_Error( 404, __( 'Invalid user ID.' ) );
+		}
 
 		return $this->_prepare_user( $user_data, $fields );
 	}
@@ -2476,8 +2600,9 @@
 	 * @return array|IXR_Error users data
 	 */
 	public function wp_getUsers( $args ) {
-		if ( ! $this->minimum_args( $args, 3 ) )
+		if ( ! $this->minimum_args( $args, 3 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -2492,14 +2617,16 @@
 			$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUsers' );
 		}
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getUsers' );
 
-		if ( ! current_user_can( 'list_users' ) )
+		if ( ! current_user_can( 'list_users' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to list users.' ) );
+		}
 
 		$query = array( 'fields' => 'all_with_meta' );
 
@@ -2509,13 +2636,15 @@
 		if ( isset( $filter['orderby'] ) ) {
 			$query['orderby'] = $filter['orderby'];
 
-			if ( isset( $filter['order'] ) )
+			if ( isset( $filter['order'] ) ) {
 				$query['order'] = $filter['order'];
+			}
 		}
 
 		if ( isset( $filter['role'] ) ) {
-			if ( get_role( $filter['role'] ) === null )
+			if ( get_role( $filter['role'] ) === null ) {
 				return new IXR_Error( 403, __( 'Invalid role.' ) );
+			}
 
 			$query['role'] = $filter['role'];
 		}
@@ -2528,8 +2657,9 @@
 
 		$_users = array();
 		foreach ( $users as $user_data ) {
-			if ( current_user_can( 'edit_user', $user_data->ID ) )
+			if ( current_user_can( 'edit_user', $user_data->ID ) ) {
 				$_users[] = $this->_prepare_user( $user_data, $fields );
+			}
 		}
 		return $_users;
 	}
@@ -2550,8 +2680,9 @@
 	 * @return array|IXR_Error (@see wp_getUser)
 	 */
 	public function wp_getProfile( $args ) {
-		if ( ! $this->minimum_args( $args, 3 ) )
+		if ( ! $this->minimum_args( $args, 3 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -2565,14 +2696,16 @@
 			$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );
 		}
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getProfile' );
 
-		if ( ! current_user_can( 'edit_user', $user->ID ) )
+		if ( ! current_user_can( 'edit_user', $user->ID ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) );
+		}
 
 		$user_data = get_userdata( $user->ID );
 
@@ -2602,8 +2735,9 @@
 	 * @return true|IXR_Error True, on success.
 	 */
 	public function wp_editProfile( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -2611,48 +2745,59 @@
 		$password       = $args[2];
 		$content_struct = $args[3];
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.editProfile' );
 
-		if ( ! current_user_can( 'edit_user', $user->ID ) )
+		if ( ! current_user_can( 'edit_user', $user->ID ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) );
+		}
 
 		// holds data of the user
 		$user_data = array();
 		$user_data['ID'] = $user->ID;
 
 		// only set the user details if it was given
-		if ( isset( $content_struct['first_name'] ) )
+		if ( isset( $content_struct['first_name'] ) ) {
 			$user_data['first_name'] = $content_struct['first_name'];
+		}
 
-		if ( isset( $content_struct['last_name'] ) )
+		if ( isset( $content_struct['last_name'] ) ) {
 			$user_data['last_name'] = $content_struct['last_name'];
+		}
 
-		if ( isset( $content_struct['url'] ) )
+		if ( isset( $content_struct['url'] ) ) {
 			$user_data['user_url'] = $content_struct['url'];
+		}
 
-		if ( isset( $content_struct['display_name'] ) )
+		if ( isset( $content_struct['display_name'] ) ) {
 			$user_data['display_name'] = $content_struct['display_name'];
+		}
 
-		if ( isset( $content_struct['nickname'] ) )
+		if ( isset( $content_struct['nickname'] ) ) {
 			$user_data['nickname'] = $content_struct['nickname'];
+		}
 
-		if ( isset( $content_struct['nicename'] ) )
+		if ( isset( $content_struct['nicename'] ) ) {
 			$user_data['user_nicename'] = $content_struct['nicename'];
+		}
 
-		if ( isset( $content_struct['bio'] ) )
+		if ( isset( $content_struct['bio'] ) ) {
 			$user_data['description'] = $content_struct['bio'];
+		}
 
 		$result = wp_update_user( $user_data );
 
-		if ( is_wp_error( $result ) )
+		if ( is_wp_error( $result ) ) {
 			return new IXR_Error( 500, $result->get_error_message() );
+		}
 
-		if ( ! $result )
+		if ( ! $result ) {
 			return new IXR_Error( 500, __( 'Sorry, the user cannot be updated.' ) );
+		}
 
 		return true;
 	}
@@ -2679,16 +2824,18 @@
 		$username = $args[2];
 		$password = $args[3];
 
-		if ( !$user = $this->login($username, $password) ) {
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
 		}
 
-		$page = get_post($page_id);
-		if ( ! $page )
+		$page = get_post( $page_id );
+		if ( ! $page ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( !current_user_can( 'edit_page', $page_id ) )
+		if ( ! current_user_can( 'edit_page', $page_id ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPage' );
@@ -2696,8 +2843,7 @@
 		// If we found the page then format the data.
 		if ( $page->ID && ($page->post_type == 'page') ) {
 			return $this->_prepare_page( $page );
-		}
-		// If the page doesn't exist indicate that.
+		} // End if().
 		else {
 			return new IXR_Error( 404, __( 'Sorry, no such page.' ) );
 		}
@@ -2723,27 +2869,30 @@
 
 		$username  = $args[1];
 		$password  = $args[2];
-		$num_pages = isset($args[3]) ? (int) $args[3] : 10;
+		$num_pages = isset( $args[3] ) ? (int) $args[3] : 10;
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_pages' ) )
+		if ( ! current_user_can( 'edit_pages' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPages' );
 
-		$pages = get_posts( array('post_type' => 'page', 'post_status' => 'any', 'numberposts' => $num_pages) );
-		$num_pages = count($pages);
+		$pages = get_posts( array( 'post_type' => 'page', 'post_status' => 'any', 'numberposts' => $num_pages ) );
+		$num_pages = count( $pages );
 
 		// If we have pages, put together their info.
 		if ( $num_pages >= 1 ) {
 			$pages_struct = array();
 
-			foreach ($pages as $page) {
-				if ( current_user_can( 'edit_page', $page->ID ) )
+			foreach ( $pages as $page ) {
+				if ( current_user_can( 'edit_page', $page->ID ) ) {
 					$pages_struct[] = $this->_prepare_page( $page );
+				}
 			}
 
 			return $pages_struct;
@@ -2774,14 +2923,15 @@
 		$username = $this->escape( $args[1] );
 		$password = $this->escape( $args[2] );
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.newPage' );
 
 		// Mark this as content for a page.
-		$args[3]["post_type"] = 'page';
+		$args[3]['post_type'] = 'page';
 
 		// Let mw_newPost do all of the heavy lifting.
 		return $this->mw_newPost( $args );
@@ -2809,26 +2959,30 @@
 		$password = $args[2];
 		$page_id  = (int) $args[3];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.deletePage' );
 
 		// Get the current page based on the page_id and
 		// make sure it is a page and not a post.
-		$actual_page = get_post($page_id, ARRAY_A);
-		if ( !$actual_page || ($actual_page['post_type'] != 'page') )
+		$actual_page = get_post( $page_id, ARRAY_A );
+		if ( ! $actual_page || ($actual_page['post_type'] != 'page') ) {
 			return new IXR_Error( 404, __( 'Sorry, no such page.' ) );
+		}
 
 		// Make sure the user can delete pages.
-		if ( !current_user_can('delete_page', $page_id) )
+		if ( ! current_user_can( 'delete_page', $page_id ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this page.' ) );
+		}
 
 		// Attempt to delete the page.
-		$result = wp_delete_post($page_id);
-		if ( !$result )
+		$result = wp_delete_post( $page_id );
+		if ( ! $result ) {
 			return new IXR_Error( 500, __( 'Failed to delete the page.' ) );
+		}
 
 		/**
 		 * Fires after a page has been successfully deleted via XML-RPC.
@@ -2871,7 +3025,7 @@
 		$escaped_username = $this->escape( $username );
 		$escaped_password = $this->escape( $password );
 
-		if ( !$user = $this->login( $escaped_username, $escaped_password ) ) {
+		if ( ! $user = $this->login( $escaped_username, $escaped_password ) ) {
 			return $this->error;
 		}
 
@@ -2879,13 +3033,15 @@
 		do_action( 'xmlrpc_call', 'wp.editPage' );
 
 		// Get the page data and make sure it is a page.
-		$actual_page = get_post($page_id, ARRAY_A);
-		if ( !$actual_page || ($actual_page['post_type'] != 'page') )
+		$actual_page = get_post( $page_id, ARRAY_A );
+		if ( ! $actual_page || ($actual_page['post_type'] != 'page') ) {
 			return new IXR_Error( 404, __( 'Sorry, no such page.' ) );
+		}
 
 		// Make sure the user is allowed to edit pages.
-		if ( !current_user_can('edit_page', $page_id) )
+		if ( ! current_user_can( 'edit_page', $page_id ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) );
+		}
 
 		// Mark this as content for a page.
 		$content['post_type'] = 'page';
@@ -2896,7 +3052,7 @@
 			$username,
 			$password,
 			$content,
-			$publish
+			$publish,
 		);
 
 		// Let mw_editPost do all of the heavy lifting.
@@ -2927,11 +3083,13 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_pages' ) )
+		if ( ! current_user_can( 'edit_pages' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPageList' );
@@ -2950,14 +3108,14 @@
 		");
 
 		// The date needs to be formatted properly.
-		$num_pages = count($page_list);
+		$num_pages = count( $page_list );
 		for ( $i = 0; $i < $num_pages; $i++ ) {
-			$page_list[$i]->dateCreated = $this->_convert_date(  $page_list[$i]->post_date );
-			$page_list[$i]->date_created_gmt = $this->_convert_date_gmt( $page_list[$i]->post_date_gmt, $page_list[$i]->post_date );
+			$page_list[ $i ]->dateCreated = $this->_convert_date( $page_list[ $i ]->post_date );
+			$page_list[ $i ]->date_created_gmt = $this->_convert_date_gmt( $page_list[ $i ]->post_date_gmt, $page_list[ $i ]->post_date );
 
-			unset($page_list[$i]->post_date_gmt);
-			unset($page_list[$i]->post_date);
-			unset($page_list[$i]->post_status);
+			unset( $page_list[ $i ]->post_date_gmt );
+			unset( $page_list[ $i ]->post_date );
+			unset( $page_list[ $i ]->post_status );
 		}
 
 		return $page_list;
@@ -2983,21 +3141,23 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can('edit_posts') )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getAuthors' );
 
 		$authors = array();
-		foreach ( get_users( array( 'fields' => array('ID','user_login','display_name') ) ) as $user ) {
+		foreach ( get_users( array( 'fields' => array( 'ID', 'user_login', 'display_name' ) ) ) as $user ) {
 			$authors[] = array(
 				'user_id'       => $user->ID,
 				'user_login'    => $user->user_login,
-				'display_name'  => $user->display_name
+				'display_name'  => $user->display_name,
 			);
 		}
 
@@ -3024,11 +3184,13 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_posts' ) )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view tags.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getKeywords' );
@@ -3074,45 +3236,50 @@
 		$password = $args[2];
 		$category = $args[3];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.newCategory' );
 
 		// Make sure the user is allowed to add a category.
-		if ( !current_user_can('manage_categories') )
-			return new IXR_Error(401, __('Sorry, you are not allowed to add a category.'));
+		if ( ! current_user_can( 'manage_categories' ) ) {
+			return new IXR_Error( 401, __( 'Sorry, you are not allowed to add a category.' ) );
+		}
 
 		// If no slug was provided make it empty so that
 		// WordPress will generate one.
-		if ( empty($category['slug']) )
+		if ( empty( $category['slug'] ) ) {
 			$category['slug'] = '';
+		}
 
 		// If no parent_id was provided make it empty
 		// so that it will be a top level page (no parent).
-		if ( !isset($category['parent_id']) )
+		if ( ! isset( $category['parent_id'] ) ) {
 			$category['parent_id'] = '';
+		}
 
 		// If no description was provided make it empty.
-		if ( empty($category["description"]) )
-			$category["description"] = "";
+		if ( empty( $category['description'] ) ) {
+			$category['description'] = '';
+		}
 
 		$new_category = array(
 			'cat_name'				=> $category['name'],
 			'category_nicename'		=> $category['slug'],
 			'category_parent'		=> $category['parent_id'],
-			'category_description'	=> $category['description']
+			'category_description'	=> $category['description'],
 		);
 
-		$cat_id = wp_insert_category($new_category, true);
+		$cat_id = wp_insert_category( $new_category, true );
 		if ( is_wp_error( $cat_id ) ) {
-			if ( 'term_exists' == $cat_id->get_error_code() )
+			if ( 'term_exists' == $cat_id->get_error_code() ) {
 				return (int) $cat_id->get_error_data();
-			else
-				return new IXR_Error(500, __('Sorry, the new category failed.'));
+			} else { return new IXR_Error( 500, __( 'Sorry, the new category failed.' ) );
+			}
 		} elseif ( ! $cat_id ) {
-			return new IXR_Error(500, __('Sorry, the new category failed.'));
+			return new IXR_Error( 500, __( 'Sorry, the new category failed.' ) );
 		}
 
 		/**
@@ -3150,14 +3317,16 @@
 		$password    = $args[2];
 		$category_id = (int) $args[3];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.deleteCategory' );
 
-		if ( !current_user_can('manage_categories') )
+		if ( ! current_user_can( 'manage_categories' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete a category.' ) );
+		}
 
 		$status = wp_delete_term( $category_id, 'category' );
 
@@ -3200,21 +3369,23 @@
 		$category    = $args[3];
 		$max_results = (int) $args[4];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_posts' ) )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.suggestCategories' );
 
 		$category_suggestions = array();
-		$args = array('get' => 'all', 'number' => $max_results, 'name__like' => $category);
-		foreach ( (array) get_categories($args) as $cat ) {
+		$args = array( 'get' => 'all', 'number' => $max_results, 'name__like' => $category );
+		foreach ( (array) get_categories( $args ) as $cat ) {
 			$category_suggestions[] = array(
 				'category_id'	=> $cat->term_id,
-				'category_name'	=> $cat->name
+				'category_name'	=> $cat->name,
 			);
 		}
 
@@ -3236,8 +3407,8 @@
 	 * }
 	 * @return array|IXR_Error
 	 */
-	public function wp_getComment($args) {
-		$this->escape($args);
+	public function wp_getComment( $args ) {
+		$this->escape( $args );
 
 		$username	= $args[1];
 		$password	= $args[2];
@@ -3372,7 +3543,7 @@
 	 * @return bool|IXR_Error See wp_delete_comment().
 	 */
 	public function wp_deleteComment( $args ) {
-		$this->escape($args);
+		$this->escape( $args );
 
 		$username	= $args[1];
 		$password	= $args[2];
@@ -3386,7 +3557,7 @@
 			return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
 		}
 
-		if ( !current_user_can( 'edit_comment', $comment_ID ) ) {
+		if ( ! current_user_can( 'edit_comment', $comment_ID ) ) {
 			return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) );
 		}
 
@@ -3445,7 +3616,7 @@
 		$comment_ID	= (int) $args[3];
 		$content_struct = $args[4];
 
-		if ( !$user = $this->login( $username, $password ) ) {
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
 		}
 
@@ -3460,44 +3631,51 @@
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.editComment' );
 
-		if ( isset($content_struct['status']) ) {
+		if ( isset( $content_struct['status'] ) ) {
 			$statuses = get_comment_statuses();
-			$statuses = array_keys($statuses);
+			$statuses = array_keys( $statuses );
 
-			if ( ! in_array($content_struct['status'], $statuses) )
+			if ( ! in_array( $content_struct['status'], $statuses ) ) {
 				return new IXR_Error( 401, __( 'Invalid comment status.' ) );
+			}
 			$comment_approved = $content_struct['status'];
 		}
 
 		// Do some timestamp voodoo
-		if ( !empty( $content_struct['date_created_gmt'] ) ) {
+		if ( ! empty( $content_struct['date_created_gmt'] ) ) {
 			// We know this is supposed to be GMT, so we're going to slap that Z on there by force
 			$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
-			$comment_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
-			$comment_date_gmt = iso8601_to_datetime($dateCreated, 'GMT');
+			$comment_date = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) );
+			$comment_date_gmt = iso8601_to_datetime( $dateCreated, 'GMT' );
 		}
 
-		if ( isset($content_struct['content']) )
+		if ( isset( $content_struct['content'] ) ) {
 			$comment_content = $content_struct['content'];
+		}
 
-		if ( isset($content_struct['author']) )
+		if ( isset( $content_struct['author'] ) ) {
 			$comment_author = $content_struct['author'];
+		}
 
-		if ( isset($content_struct['author_url']) )
+		if ( isset( $content_struct['author_url'] ) ) {
 			$comment_author_url = $content_struct['author_url'];
+		}
 
-		if ( isset($content_struct['author_email']) )
+		if ( isset( $content_struct['author_email'] ) ) {
 			$comment_author_email = $content_struct['author_email'];
+		}
 
 		// We've got all the data -- post it:
-		$comment = compact('comment_ID', 'comment_content', 'comment_approved', 'comment_date', 'comment_date_gmt', 'comment_author', 'comment_author_email', 'comment_author_url');
+		$comment = compact( 'comment_ID', 'comment_content', 'comment_approved', 'comment_date', 'comment_date_gmt', 'comment_author', 'comment_author_email', 'comment_author_url' );
 
-		$result = wp_update_comment($comment);
-		if ( is_wp_error( $result ) )
-			return new IXR_Error(500, $result->get_error_message());
+		$result = wp_update_comment( $comment );
+		if ( is_wp_error( $result ) ) {
+			return new IXR_Error( 500, $result->get_error_message() );
+		}
 
-		if ( !$result )
-			return new IXR_Error(500, __('Sorry, the comment could not be edited.'));
+		if ( ! $result ) {
+			return new IXR_Error( 500, __( 'Sorry, the comment could not be edited.' ) );
+		}
 
 		/**
 		 * Fires after a comment has been successfully updated via XML-RPC.
@@ -3528,8 +3706,8 @@
 	 * }
 	 * @return int|IXR_Error See wp_new_comment().
 	 */
-	public function wp_newComment($args) {
-		$this->escape($args);
+	public function wp_newComment( $args ) {
+		$this->escape( $args );
 
 		$username       = $args[1];
 		$password       = $args[2];
@@ -3546,11 +3724,11 @@
 		 */
 		$allow_anon = apply_filters( 'xmlrpc_allow_anonymous_comments', false );
 
-		$user = $this->login($username, $password);
+		$user = $this->login( $username, $password );
 
-		if ( !$user ) {
+		if ( ! $user ) {
 			$logged_in = false;
-			if ( $allow_anon && get_option('comment_registration') ) {
+			if ( $allow_anon && get_option( 'comment_registration' ) ) {
 				return new IXR_Error( 403, __( 'You must be registered to comment.' ) );
 			} elseif ( ! $allow_anon ) {
 				return $this->error;
@@ -3559,10 +3737,10 @@
 			$logged_in = true;
 		}
 
-		if ( is_numeric($post) )
-			$post_id = absint($post);
-		else
-			$post_id = url_to_postid($post);
+		if ( is_numeric( $post ) ) {
+			$post_id = absint( $post );
+		} else { $post_id = url_to_postid( $post );
+		}
 
 		if ( ! $post_id ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
@@ -3596,28 +3774,32 @@
 			$comment['user_ID'] = $user->ID;
 		} else {
 			$comment['comment_author'] = '';
-			if ( isset($content_struct['author']) )
+			if ( isset( $content_struct['author'] ) ) {
 				$comment['comment_author'] = $content_struct['author'];
+			}
 
 			$comment['comment_author_email'] = '';
-			if ( isset($content_struct['author_email']) )
+			if ( isset( $content_struct['author_email'] ) ) {
 				$comment['comment_author_email'] = $content_struct['author_email'];
+			}
 
 			$comment['comment_author_url'] = '';
-			if ( isset($content_struct['author_url']) )
+			if ( isset( $content_struct['author_url'] ) ) {
 				$comment['comment_author_url'] = $content_struct['author_url'];
+			}
 
 			$comment['user_ID'] = 0;
 
-			if ( get_option('require_name_email') ) {
-				if ( 6 > strlen($comment['comment_author_email']) || '' == $comment['comment_author'] )
+			if ( get_option( 'require_name_email' ) ) {
+				if ( 6 > strlen( $comment['comment_author_email'] ) || '' == $comment['comment_author'] ) {
 					return new IXR_Error( 403, __( 'Comment author name and email are required.' ) );
-				elseif ( !is_email($comment['comment_author_email']) )
+				} elseif ( ! is_email( $comment['comment_author_email'] ) ) {
 					return new IXR_Error( 403, __( 'A valid email address is required.' ) );
+				}
 			}
 		}
 
-		$comment['comment_parent'] = isset($content_struct['comment_parent']) ? absint($content_struct['comment_parent']) : 0;
+		$comment['comment_parent'] = isset( $content_struct['comment_parent'] ) ? absint( $content_struct['comment_parent'] ) : 0;
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.newComment' );
@@ -3722,7 +3904,7 @@
 			'approved' => $count->approved,
 			'awaiting_moderation' => $count->moderated,
 			'spam' => $count->spam,
-			'total_comments' => $count->total_comments
+			'total_comments' => $count->total_comments,
 		);
 	}
 
@@ -3746,11 +3928,13 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_posts' ) )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPostStatusList' );
@@ -3778,11 +3962,13 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_pages' ) )
+		if ( ! current_user_can( 'edit_pages' ) ) {
 			return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPageStatusList' );
@@ -3810,11 +3996,13 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_pages' ) )
+		if ( ! current_user_can( 'edit_pages' ) ) {
 			return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
+		}
 
 		$templates = get_page_templates();
 		$templates['Default'] = 'default';
@@ -3844,14 +4032,16 @@
 		$password	= $args[2];
 		$options	= isset( $args[3] ) ? (array) $args[3] : array();
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		// If no specific options where asked for, return all of them
-		if ( count( $options ) == 0 )
-			$options = array_keys($this->blog_options);
+		if ( count( $options ) == 0 ) {
+			$options = array_keys( $this->blog_options );
+		}
 
-		return $this->_getOptions($options);
+		return $this->_getOptions( $options );
 	}
 
 	/**
@@ -3862,20 +4052,21 @@
 	 * @param array $options Options to retrieve.
 	 * @return array
 	 */
-	public function _getOptions($options) {
+	public function _getOptions( $options ) {
 		$data = array();
 		$can_manage = current_user_can( 'manage_options' );
 		foreach ( $options as $option ) {
 			if ( array_key_exists( $option, $this->blog_options ) ) {
-				$data[$option] = $this->blog_options[$option];
+				$data[ $option ] = $this->blog_options[ $option ];
 				//Is the value static or dynamic?
-				if ( isset( $data[$option]['option'] ) ) {
-					$data[$option]['value'] = get_option( $data[$option]['option'] );
-					unset($data[$option]['option']);
+				if ( isset( $data[ $option ]['option'] ) ) {
+					$data[ $option ]['value'] = get_option( $data[ $option ]['option'] );
+					unset( $data[ $option ]['option'] );
 				}
 
-				if ( ! $can_manage )
-					$data[$option]['readonly'] = true;
+				if ( ! $can_manage ) {
+					$data[ $option ]['readonly'] = true;
+				}
 			}
 		}
 
@@ -3904,26 +4095,30 @@
 		$password	= $args[2];
 		$options	= (array) $args[3];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'manage_options' ) )
+		if ( ! current_user_can( 'manage_options' ) ) {
 			return new IXR_Error( 403, __( 'Sorry, you are not allowed to update options.' ) );
+		}
 
 		$option_names = array();
 		foreach ( $options as $o_name => $o_value ) {
 			$option_names[] = $o_name;
-			if ( !array_key_exists( $o_name, $this->blog_options ) )
+			if ( ! array_key_exists( $o_name, $this->blog_options ) ) {
 				continue;
+			}
 
-			if ( $this->blog_options[$o_name]['readonly'] == true )
+			if ( $this->blog_options[ $o_name ]['readonly'] == true ) {
 				continue;
+			}
 
-			update_option( $this->blog_options[$o_name]['option'], wp_unslash( $o_value ) );
+			update_option( $this->blog_options[ $o_name ]['option'], wp_unslash( $o_value ) );
 		}
 
 		//Now return the updated values
-		return $this->_getOptions($option_names);
+		return $this->_getOptions( $option_names );
 	}
 
 	/**
@@ -3956,17 +4151,20 @@
 		$password		= $args[2];
 		$attachment_id	= (int) $args[3];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'upload_files' ) )
+		if ( ! current_user_can( 'upload_files' ) ) {
 			return new IXR_Error( 403, __( 'Sorry, you are not allowed to upload files.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getMediaItem' );
 
-		if ( ! $attachment = get_post($attachment_id) )
+		if ( ! $attachment = get_post( $attachment_id ) ) {
 			return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
+		}
 
 		return $this->_prepare_media_item( $attachment );
 	}
@@ -3997,33 +4195,36 @@
 	 * }
 	 * @return array|IXR_Error Contains a collection of media items. See wp_xmlrpc_server::wp_getMediaItem() for a description of each item contents
 	 */
-	public function wp_getMediaLibrary($args) {
-		$this->escape($args);
+	public function wp_getMediaLibrary( $args ) {
+		$this->escape( $args );
 
 		$username	= $args[1];
 		$password	= $args[2];
 		$struct		= isset( $args[3] ) ? $args[3] : array() ;
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'upload_files' ) )
+		if ( ! current_user_can( 'upload_files' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getMediaLibrary' );
 
-		$parent_id = ( isset($struct['parent_id']) ) ? absint($struct['parent_id']) : '' ;
-		$mime_type = ( isset($struct['mime_type']) ) ? $struct['mime_type'] : '' ;
-		$offset = ( isset($struct['offset']) ) ? absint($struct['offset']) : 0 ;
-		$number = ( isset($struct['number']) ) ? absint($struct['number']) : -1 ;
+		$parent_id = ( isset( $struct['parent_id'] ) ) ? absint( $struct['parent_id'] ) : '' ;
+		$mime_type = ( isset( $struct['mime_type'] ) ) ? $struct['mime_type'] : '' ;
+		$offset = ( isset( $struct['offset'] ) ) ? absint( $struct['offset'] ) : 0 ;
+		$number = ( isset( $struct['number'] ) ) ? absint( $struct['number'] ) : -1 ;
 
-		$attachments = get_posts( array('post_type' => 'attachment', 'post_parent' => $parent_id, 'offset' => $offset, 'numberposts' => $number, 'post_mime_type' => $mime_type ) );
+		$attachments = get_posts( array( 'post_type' => 'attachment', 'post_parent' => $parent_id, 'offset' => $offset, 'numberposts' => $number, 'post_mime_type' => $mime_type ) );
 
 		$attachments_struct = array();
 
-		foreach ($attachments as $attachment )
+		foreach ( $attachments as $attachment ) {
 			$attachments_struct[] = $this->_prepare_media_item( $attachment );
+		}
 
 		return $attachments_struct;
 	}
@@ -4048,11 +4249,13 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_posts' ) )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPostFormats' );
@@ -4105,8 +4308,9 @@
 	 *  - 'supports'
 	 */
 	public function wp_getPostType( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -4128,19 +4332,22 @@
 			$fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
 		}
 
-		if ( !$user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPostType' );
 
-		if ( ! post_type_exists( $post_type_name ) )
+		if ( ! post_type_exists( $post_type_name ) ) {
 			return new IXR_Error( 403, __( 'Invalid post type.' ) );
+		}
 
 		$post_type = get_post_type_object( $post_type_name );
 
-		if ( ! current_user_can( $post_type->cap->edit_posts ) )
+		if ( ! current_user_can( $post_type->cap->edit_posts ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
+		}
 
 		return $this->_prepare_post_type( $post_type, $fields );
 	}
@@ -4164,8 +4371,9 @@
 	 * @return array|IXR_Error
 	 */
 	public function wp_getPostTypes( $args ) {
-		if ( ! $this->minimum_args( $args, 3 ) )
+		if ( ! $this->minimum_args( $args, 3 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -4180,8 +4388,9 @@
 			$fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
 		}
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getPostTypes' );
@@ -4191,10 +4400,11 @@
 		$struct = array();
 
 		foreach ( $post_types as $post_type ) {
-			if ( ! current_user_can( $post_type->cap->edit_posts ) )
+			if ( ! current_user_can( $post_type->cap->edit_posts ) ) {
 				continue;
+			}
 
-			$struct[$post_type->name] = $this->_prepare_post_type( $post_type, $fields );
+			$struct[ $post_type->name ] = $this->_prepare_post_type( $post_type, $fields );
 		}
 
 		return $struct;
@@ -4223,8 +4433,9 @@
 	 * @return array|IXR_Error contains a collection of posts.
 	 */
 	public function wp_getRevisions( $args ) {
-		if ( ! $this->minimum_args( $args, 4 ) )
+		if ( ! $this->minimum_args( $args, 4 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -4246,36 +4457,43 @@
 			$fields = apply_filters( 'xmlrpc_default_revision_fields', array( 'post_date', 'post_date_gmt' ), 'wp.getRevisions' );
 		}
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.getRevisions' );
 
-		if ( ! $post = get_post( $post_id ) )
+		if ( ! $post = get_post( $post_id ) ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( ! current_user_can( 'edit_post', $post_id ) )
+		if ( ! current_user_can( 'edit_post', $post_id ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
+		}
 
 		// Check if revisions are enabled.
-		if ( ! wp_revisions_enabled( $post ) )
+		if ( ! wp_revisions_enabled( $post ) ) {
 			return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
+		}
 
 		$revisions = wp_get_post_revisions( $post_id );
 
-		if ( ! $revisions )
+		if ( ! $revisions ) {
 			return array();
+		}
 
 		$struct = array();
 
 		foreach ( $revisions as $revision ) {
-			if ( ! current_user_can( 'read_post', $revision->ID ) )
+			if ( ! current_user_can( 'read_post', $revision->ID ) ) {
 				continue;
+			}
 
 			// Skip autosaves
-			if ( wp_is_post_autosave( $revision ) )
+			if ( wp_is_post_autosave( $revision ) ) {
 				continue;
+			}
 
 			$struct[] = $this->_prepare_post( get_object_vars( $revision ), $fields );
 		}
@@ -4301,8 +4519,9 @@
 	 * @return bool|IXR_Error false if there was an error restoring, true if success.
 	 */
 	public function wp_restoreRevision( $args ) {
-		if ( ! $this->minimum_args( $args, 3 ) )
+		if ( ! $this->minimum_args( $args, 3 ) ) {
 			return $this->error;
+		}
 
 		$this->escape( $args );
 
@@ -4310,27 +4529,33 @@
 		$password    = $args[2];
 		$revision_id = (int) $args[3];
 
-		if ( ! $user = $this->login( $username, $password ) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'wp.restoreRevision' );
 
-		if ( ! $revision = wp_get_post_revision( $revision_id ) )
+		if ( ! $revision = wp_get_post_revision( $revision_id ) ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( wp_is_post_autosave( $revision ) )
+		if ( wp_is_post_autosave( $revision ) ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( ! $post = get_post( $revision->post_parent ) )
+		if ( ! $post = get_post( $revision->post_parent ) ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( ! current_user_can( 'edit_post', $revision->post_parent ) )
+		if ( ! current_user_can( 'edit_post', $revision->post_parent ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
+		}
 
 		// Check if revisions are disabled.
-		if ( ! wp_revisions_enabled( $post ) )
+		if ( ! wp_revisions_enabled( $post ) ) {
 			return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
+		}
 
 		$post = wp_restore_post_revision( $revision_id );
 
@@ -4357,37 +4582,38 @@
 	 * }
 	 * @return array|IXR_Error
 	 */
-	public function blogger_getUsersBlogs($args) {
+	public function blogger_getUsersBlogs( $args ) {
 		if ( ! $this->minimum_args( $args, 3 ) ) {
 			return $this->error;
 		}
 
 		if ( is_multisite() ) {
-			return $this->_multisite_getUsersBlogs($args);
+			return $this->_multisite_getUsersBlogs( $args );
 		}
 
-		$this->escape($args);
+		$this->escape( $args );
 
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'blogger.getUsersBlogs' );
 
-		$is_admin = current_user_can('manage_options');
+		$is_admin = current_user_can( 'manage_options' );
 
 		$struct = array(
 			'isAdmin'  => $is_admin,
-			'url'      => get_option('home') . '/',
+			'url'      => get_option( 'home' ) . '/',
 			'blogid'   => '1',
-			'blogName' => get_option('blogname'),
+			'blogName' => get_option( 'blogname' ),
 			'xmlrpc'   => site_url( 'xmlrpc.php', 'rpc' ),
 		);
 
-		return array($struct);
+		return array( $struct );
 	}
 
 	/**
@@ -4411,18 +4637,20 @@
 		$path = $current_blog->path . 'xmlrpc.php';
 
 		$rpc = new IXR_Client( set_url_scheme( "http://{$domain}{$path}" ) );
-		$rpc->query('wp.getUsersBlogs', $args[1], $args[2]);
+		$rpc->query( 'wp.getUsersBlogs', $args[1], $args[2] );
 		$blogs = $rpc->getResponse();
 
-		if ( isset($blogs['faultCode']) )
-			return new IXR_Error($blogs['faultCode'], $blogs['faultString']);
+		if ( isset( $blogs['faultCode'] ) ) {
+			return new IXR_Error( $blogs['faultCode'], $blogs['faultString'] );
+		}
 
 		if ( $_SERVER['HTTP_HOST'] == $domain && $_SERVER['REQUEST_URI'] == $path ) {
 			return $blogs;
 		} else {
 			foreach ( (array) $blogs as $blog ) {
-				if ( strpos($blog['url'], $_SERVER['HTTP_HOST']) )
-					return array($blog);
+				if ( strpos( $blog['url'], $_SERVER['HTTP_HOST'] ) ) {
+					return array( $blog );
+				}
 			}
 			return array();
 		}
@@ -4450,11 +4678,13 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_posts' ) )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to access user data on this site.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'blogger.getUserInfo' );
@@ -4464,7 +4694,7 @@
 			'userid'    => $user->ID,
 			'url'       => $user->user_url,
 			'lastname'  => $user->last_name,
-			'firstname' => $user->first_name
+			'firstname' => $user->first_name,
 		);
 
 		return $struct;
@@ -4492,30 +4722,33 @@
 		$username = $args[2];
 		$password = $args[3];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		$post_data = get_post($post_ID, ARRAY_A);
-		if ( ! $post_data )
+		$post_data = get_post( $post_ID, ARRAY_A );
+		if ( ! $post_data ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( !current_user_can( 'edit_post', $post_ID ) )
+		if ( ! current_user_can( 'edit_post', $post_ID ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'blogger.getPost' );
 
-		$categories = implode(',', wp_get_post_categories($post_ID));
+		$categories = implode( ',', wp_get_post_categories( $post_ID ) );
 
-		$content  = '<title>'.wp_unslash($post_data['post_title']).'</title>';
-		$content .= '<category>'.$categories.'</category>';
-		$content .= wp_unslash($post_data['post_content']);
+		$content  = '<title>' . wp_unslash( $post_data['post_title'] ) . '</title>';
+		$content .= '<category>' . $categories . '</category>';
+		$content .= wp_unslash( $post_data['post_content'] );
 
 		$struct = array(
 			'userid'    => $post_data['post_author'],
 			'dateCreated' => $this->_convert_date( $post_data['post_date'] ),
 			'content'     => $content,
-			'postid'  => (string) $post_data['ID']
+			'postid'  => (string) $post_data['ID'],
 		);
 
 		return $struct;
@@ -4539,43 +4772,46 @@
 	 */
 	public function blogger_getRecentPosts( $args ) {
 
-		$this->escape($args);
+		$this->escape( $args );
 
 		// $args[0] = appkey - ignored
 		$username = $args[2];
 		$password = $args[3];
-		if ( isset( $args[4] ) )
+		if ( isset( $args[4] ) ) {
 			$query = array( 'numberposts' => absint( $args[4] ) );
-		else
-			$query = array();
+		} else { $query = array();
+		}
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( ! current_user_can( 'edit_posts' ) )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'blogger.getRecentPosts' );
 
 		$posts_list = wp_get_recent_posts( $query );
 
-		if ( !$posts_list ) {
-			$this->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.'));
+		if ( ! $posts_list ) {
+			$this->error = new IXR_Error( 500, __( 'Either there are no posts, or something went wrong.' ) );
 			return $this->error;
 		}
 
 		$recent_posts = array();
-		foreach ($posts_list as $entry) {
-			if ( !current_user_can( 'edit_post', $entry['ID'] ) )
+		foreach ( $posts_list as $entry ) {
+			if ( ! current_user_can( 'edit_post', $entry['ID'] ) ) {
 				continue;
+			}
 
 			$post_date  = $this->_convert_date( $entry['post_date'] );
-			$categories = implode(',', wp_get_post_categories($entry['ID']));
+			$categories = implode( ',', wp_get_post_categories( $entry['ID'] ) );
 
-			$content  = '<title>'.wp_unslash($entry['post_title']).'</title>';
-			$content .= '<category>'.$categories.'</category>';
-			$content .= wp_unslash($entry['post_content']);
+			$content  = '<title>' . wp_unslash( $entry['post_title'] ) . '</title>';
+			$content .= '<category>' . $categories . '</category>';
+			$content .= wp_unslash( $entry['post_content'] );
 
 			$recent_posts[] = array(
 				'userid' => $entry['post_author'],
@@ -4597,8 +4833,8 @@
 	 * @param array $args Unused.
 	 * @return IXR_Error Error object.
 	 */
-	public function blogger_getTemplate($args) {
-		return new IXR_Error( 403, __('Sorry, that file cannot be edited.' ) );
+	public function blogger_getTemplate( $args ) {
+		return new IXR_Error( 403, __( 'Sorry, that file cannot be edited.' ) );
 	}
 
 	/**
@@ -4610,8 +4846,8 @@
 	 * @param array $args Unused.
 	 * @return IXR_Error Error object.
 	 */
-	public function blogger_setTemplate($args) {
-		return new IXR_Error( 403, __('Sorry, that file cannot be edited.' ) );
+	public function blogger_setTemplate( $args ) {
+		return new IXR_Error( 403, __( 'Sorry, that file cannot be edited.' ) );
 	}
 
 	/**
@@ -4639,35 +4875,39 @@
 		$content  = $args[4];
 		$publish  = $args[5];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'blogger.newPost' );
 
 		$cap = ($publish) ? 'publish_posts' : 'edit_posts';
-		if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) || !current_user_can($cap) )
-			return new IXR_Error(401, __('Sorry, you are not allowed to post on this site.'));
+		if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) || ! current_user_can( $cap ) ) {
+			return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );
+		}
 
 		$post_status = ($publish) ? 'publish' : 'draft';
 
 		$post_author = $user->ID;
 
-		$post_title = xmlrpc_getposttitle($content);
-		$post_category = xmlrpc_getpostcategory($content);
-		$post_content = xmlrpc_removepostdata($content);
+		$post_title = xmlrpc_getposttitle( $content );
+		$post_category = xmlrpc_getpostcategory( $content );
+		$post_content = xmlrpc_removepostdata( $content );
 
-		$post_date = current_time('mysql');
-		$post_date_gmt = current_time('mysql', 1);
+		$post_date = current_time( 'mysql' );
+		$post_date_gmt = current_time( 'mysql', 1 );
 
-		$post_data = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status');
+		$post_data = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status' );
 
-		$post_ID = wp_insert_post($post_data);
-		if ( is_wp_error( $post_ID ) )
-			return new IXR_Error(500, $post_ID->get_error_message());
+		$post_ID = wp_insert_post( $post_data );
+		if ( is_wp_error( $post_ID ) ) {
+			return new IXR_Error( 500, $post_ID->get_error_message() );
+		}
 
-		if ( !$post_ID )
-			return new IXR_Error(500, __('Sorry, your entry could not be posted.'));
+		if ( ! $post_ID ) {
+			return new IXR_Error( 500, __( 'Sorry, your entry could not be posted.' ) );
+		}
 
 		$this->attach_uploads( $post_ID, $post_content );
 
@@ -4703,7 +4943,7 @@
 	 */
 	public function blogger_editPost( $args ) {
 
-		$this->escape($args);
+		$this->escape( $args );
 
 		$post_ID  = (int) $args[1];
 		$username = $args[2];
@@ -4724,10 +4964,10 @@
 			return new IXR_Error( 404, __( 'Sorry, no such post.' ) );
 		}
 
-		$this->escape($actual_post);
+		$this->escape( $actual_post );
 
 		if ( ! current_user_can( 'edit_post', $post_ID ) ) {
-			return new IXR_Error(401, __('Sorry, you are not allowed to edit this post.'));
+			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
 		}
 		if ( 'publish' == $actual_post['post_status'] && ! current_user_can( 'publish_posts' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) );
@@ -4745,7 +4985,7 @@
 		$result = wp_update_post( $postdata );
 
 		if ( ! $result ) {
-			return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be edited.'));
+			return new IXR_Error( 500, __( 'For some strange yet very annoying reason, this post could not be edited.' ) );
 		}
 		$this->attach_uploads( $actual_post['ID'], $postdata['post_content'] );
 
@@ -4784,8 +5024,9 @@
 		$username = $args[2];
 		$password = $args[3];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'blogger.deletePost' );
@@ -4861,40 +5102,42 @@
 	 * }
 	 * @return int|IXR_Error
 	 */
-	public function mw_newPost($args) {
-		$this->escape($args);
+	public function mw_newPost( $args ) {
+		$this->escape( $args );
 
 		$username       = $args[1];
 		$password       = $args[2];
 		$content_struct = $args[3];
 		$publish        = isset( $args[4] ) ? $args[4] : 0;
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'metaWeblog.newPost' );
 
 		$page_template = '';
-		if ( !empty( $content_struct['post_type'] ) ) {
+		if ( ! empty( $content_struct['post_type'] ) ) {
 			if ( $content_struct['post_type'] == 'page' ) {
-				if ( $publish )
+				if ( $publish ) {
 					$cap  = 'publish_pages';
-				elseif ( isset( $content_struct['page_status'] ) && 'publish' == $content_struct['page_status'] )
+				} elseif ( isset( $content_struct['page_status'] ) && 'publish' == $content_struct['page_status'] ) {
 					$cap  = 'publish_pages';
-				else
-					$cap = 'edit_pages';
+				} else { $cap = 'edit_pages';
+				}
 				$error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );
 				$post_type = 'page';
-				if ( !empty( $content_struct['wp_page_template'] ) )
+				if ( ! empty( $content_struct['wp_page_template'] ) ) {
 					$page_template = $content_struct['wp_page_template'];
+				}
 			} elseif ( $content_struct['post_type'] == 'post' ) {
-				if ( $publish )
+				if ( $publish ) {
 					$cap  = 'publish_posts';
-				elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'] )
+				} elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'] ) {
 					$cap  = 'publish_posts';
-				else
-					$cap = 'edit_posts';
+				} else { $cap = 'edit_posts';
+				}
 				$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
 				$post_type = 'post';
 			} else {
@@ -4902,66 +5145,75 @@
 				return new IXR_Error( 401, __( 'Invalid post type.' ) );
 			}
 		} else {
-			if ( $publish )
+			if ( $publish ) {
 				$cap  = 'publish_posts';
-			elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'])
+			} elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'] ) {
 				$cap  = 'publish_posts';
-			else
-				$cap = 'edit_posts';
+			} else { $cap = 'edit_posts';
+			}
 			$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
 			$post_type = 'post';
-		}
+		}// End if().
 
-		if ( ! current_user_can( get_post_type_object( $post_type )->cap->create_posts ) )
+		if ( ! current_user_can( get_post_type_object( $post_type )->cap->create_posts ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts on this site.' ) );
-		if ( !current_user_can( $cap ) )
+		}
+		if ( ! current_user_can( $cap ) ) {
 			return new IXR_Error( 401, $error_message );
+		}
 
 		// Check for a valid post format if one was given
 		if ( isset( $content_struct['wp_post_format'] ) ) {
 			$content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] );
-			if ( !array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {
+			if ( ! array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {
 				return new IXR_Error( 404, __( 'Invalid post format.' ) );
 			}
 		}
 
 		// Let WordPress generate the post_name (slug) unless
 		// one has been provided.
-		$post_name = "";
-		if ( isset($content_struct['wp_slug']) )
+		$post_name = '';
+		if ( isset( $content_struct['wp_slug'] ) ) {
 			$post_name = $content_struct['wp_slug'];
+		}
 
 		// Only use a password if one was given.
-		if ( isset($content_struct['wp_password']) )
+		if ( isset( $content_struct['wp_password'] ) ) {
 			$post_password = $content_struct['wp_password'];
+		}
 
 		// Only set a post parent if one was provided.
-		if ( isset($content_struct['wp_page_parent_id']) )
+		if ( isset( $content_struct['wp_page_parent_id'] ) ) {
 			$post_parent = $content_struct['wp_page_parent_id'];
+		}
 
 		// Only set the menu_order if it was provided.
-		if ( isset($content_struct['wp_page_order']) )
+		if ( isset( $content_struct['wp_page_order'] ) ) {
 			$menu_order = $content_struct['wp_page_order'];
+		}
 
 		$post_author = $user->ID;
 
 		// If an author id was provided then use it instead.
 		if ( isset( $content_struct['wp_author_id'] ) && ( $user->ID != $content_struct['wp_author_id'] ) ) {
 			switch ( $post_type ) {
-				case "post":
-					if ( !current_user_can( 'edit_others_posts' ) )
+				case 'post':
+					if ( ! current_user_can( 'edit_others_posts' ) ) {
 						return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) );
+					}
 					break;
-				case "page":
-					if ( !current_user_can( 'edit_others_pages' ) )
+				case 'page':
+					if ( ! current_user_can( 'edit_others_pages' ) ) {
 						return new IXR_Error( 401, __( 'Sorry, you are not allowed to create pages as this user.' ) );
+					}
 					break;
 				default:
 					return new IXR_Error( 401, __( 'Invalid post type.' ) );
 			}
 			$author = get_userdata( $content_struct['wp_author_id'] );
-			if ( ! $author )
+			if ( ! $author ) {
 				return new IXR_Error( 404, __( 'Invalid author ID.' ) );
+			}
 			$post_author = $content_struct['wp_author_id'];
 		}
 
@@ -4970,13 +5222,13 @@
 
 		$post_status = $publish ? 'publish' : 'draft';
 
-		if ( isset( $content_struct["{$post_type}_status"] ) ) {
-			switch ( $content_struct["{$post_type}_status"] ) {
+		if ( isset( $content_struct[ "{$post_type}_status" ] ) ) {
+			switch ( $content_struct[ "{$post_type}_status" ] ) {
 				case 'draft':
 				case 'pending':
 				case 'private':
 				case 'publish':
-					$post_status = $content_struct["{$post_type}_status"];
+					$post_status = $content_struct[ "{$post_type}_status" ];
 					break;
 				default:
 					$post_status = $publish ? 'publish' : 'draft';
@@ -4984,13 +5236,13 @@
 			}
 		}
 
-		$post_excerpt = isset($content_struct['mt_excerpt']) ? $content_struct['mt_excerpt'] : null;
-		$post_more = isset($content_struct['mt_text_more']) ? $content_struct['mt_text_more'] : null;
+		$post_excerpt = isset( $content_struct['mt_excerpt'] ) ? $content_struct['mt_excerpt'] : null;
+		$post_more = isset( $content_struct['mt_text_more'] ) ? $content_struct['mt_text_more'] : null;
 
-		$tags_input = isset($content_struct['mt_keywords']) ? $content_struct['mt_keywords'] : null;
+		$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;
 
-		if ( isset($content_struct['mt_allow_comments']) ) {
-			if ( !is_numeric($content_struct['mt_allow_comments']) ) {
+		if ( isset( $content_struct['mt_allow_comments'] ) ) {
+			if ( ! is_numeric( $content_struct['mt_allow_comments'] ) ) {
 				switch ( $content_struct['mt_allow_comments'] ) {
 					case 'closed':
 						$comment_status = 'closed';
@@ -5020,8 +5272,8 @@
 			$comment_status = get_default_comment_status( $post_type );
 		}
 
-		if ( isset($content_struct['mt_allow_pings']) ) {
-			if ( !is_numeric($content_struct['mt_allow_pings']) ) {
+		if ( isset( $content_struct['mt_allow_pings'] ) ) {
+			if ( ! is_numeric( $content_struct['mt_allow_pings'] ) ) {
 				switch ( $content_struct['mt_allow_pings'] ) {
 					case 'closed':
 						$ping_status = 'closed';
@@ -5050,26 +5302,29 @@
 			$ping_status = get_default_comment_status( $post_type, 'pingback' );
 		}
 
-		if ( $post_more )
+		if ( $post_more ) {
 			$post_content = $post_content . '<!--more-->' . $post_more;
+		}
 
 		$to_ping = null;
 		if ( isset( $content_struct['mt_tb_ping_urls'] ) ) {
 			$to_ping = $content_struct['mt_tb_ping_urls'];
-			if ( is_array($to_ping) )
-				$to_ping = implode(' ', $to_ping);
+			if ( is_array( $to_ping ) ) {
+				$to_ping = implode( ' ', $to_ping );
+			}
 		}
 
 		// Do some timestamp voodoo
-		if ( !empty( $content_struct['date_created_gmt'] ) )
+		if ( ! empty( $content_struct['date_created_gmt'] ) ) {
 			// We know this is supposed to be GMT, so we're going to slap that Z on there by force
 			$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
-		elseif ( !empty( $content_struct['dateCreated']) )
+		} elseif ( ! empty( $content_struct['dateCreated'] ) ) {
 			$dateCreated = $content_struct['dateCreated']->getIso();
+		}
 
-		if ( !empty( $dateCreated ) ) {
-			$post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
-			$post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT');
+		if ( ! empty( $dateCreated ) ) {
+			$post_date = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) );
+			$post_date_gmt = iso8601_to_datetime( $dateCreated, 'GMT' );
 		} else {
 			$post_date = '';
 			$post_date_gmt = '';
@@ -5079,14 +5334,14 @@
 		if ( isset( $content_struct['categories'] ) ) {
 			$catnames = $content_struct['categories'];
 
-			if ( is_array($catnames) ) {
-				foreach ($catnames as $cat) {
-					$post_category[] = get_cat_ID($cat);
+			if ( is_array( $catnames ) ) {
+				foreach ( $catnames as $cat ) {
+					$post_category[] = get_cat_ID( $cat );
 				}
 			}
 		}
 
-		$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template');
+		$postdata = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template' );
 
 		$post_ID = $postdata['ID'] = get_default_post_to_edit( $post_type, true )->ID;
 
@@ -5100,33 +5355,38 @@
 			}
 		}
 
-		if ( isset($content_struct['custom_fields']) )
-			$this->set_custom_fields($post_ID, $content_struct['custom_fields']);
+		if ( isset( $content_struct['custom_fields'] ) ) {
+			$this->set_custom_fields( $post_ID, $content_struct['custom_fields'] );
+		}
 
-		if ( isset ( $content_struct['wp_post_thumbnail'] ) ) {
-			if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false )
+		if ( isset( $content_struct['wp_post_thumbnail'] ) ) {
+			if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) {
 				return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
+			}
 
 			unset( $content_struct['wp_post_thumbnail'] );
 		}
 
 		// Handle enclosures
-		$thisEnclosure = isset($content_struct['enclosure']) ? $content_struct['enclosure'] : null;
-		$this->add_enclosure_if_new($post_ID, $thisEnclosure);
+		$thisEnclosure = isset( $content_struct['enclosure'] ) ? $content_struct['enclosure'] : null;
+		$this->add_enclosure_if_new( $post_ID, $thisEnclosure );
 
 		$this->attach_uploads( $post_ID, $post_content );
 
 		// Handle post formats if assigned, value is validated earlier
 		// in this function
-		if ( isset( $content_struct['wp_post_format'] ) )
+		if ( isset( $content_struct['wp_post_format'] ) ) {
 			set_post_format( $post_ID, $content_struct['wp_post_format'] );
+		}
 
 		$post_ID = wp_insert_post( $postdata, true );
-		if ( is_wp_error( $post_ID ) )
-			return new IXR_Error(500, $post_ID->get_error_message());
+		if ( is_wp_error( $post_ID ) ) {
+			return new IXR_Error( 500, $post_ID->get_error_message() );
+		}
 
-		if ( !$post_ID )
-			return new IXR_Error(500, __('Sorry, your entry could not be posted.'));
+		if ( ! $post_ID ) {
+			return new IXR_Error( 500, __( 'Sorry, your entry could not be posted.' ) );
+		}
 
 		/**
 		 * Fires after a new post has been successfully created via the XML-RPC MovableType API.
@@ -5138,7 +5398,7 @@
 		 */
 		do_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args );
 
-		return strval($post_ID);
+		return strval( $post_ID );
 	}
 
 	/**
@@ -5162,8 +5422,9 @@
 					}
 				}
 			}
-			if ( ! $found )
+			if ( ! $found ) {
 				add_post_meta( $post_ID, 'enclosure', $encstring );
+			}
 		}
 	}
 
@@ -5184,8 +5445,9 @@
 		$attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" );
 		if ( is_array( $attachments ) ) {
 			foreach ( $attachments as $file ) {
-				if ( ! empty( $file->guid ) && strpos( $post_content, $file->guid ) !== false )
-					$wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) );
+				if ( ! empty( $file->guid ) && strpos( $post_content, $file->guid ) !== false ) {
+					$wpdb->update( $wpdb->posts, array( 'post_parent' => $post_ID ), array( 'ID' => $file->ID ) );
+				}
 			}
 		}
 	}
@@ -5215,8 +5477,9 @@
 		$content_struct = $args[3];
 		$publish        = isset( $args[4] ) ? $args[4] : 0;
 
-		if ( ! $user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'metaWeblog.editPost' );
@@ -5227,29 +5490,33 @@
 		 * If there is no post data for the give post id, stop now and return an error.
 		 * Otherwise a new post will be created (which was the old behavior).
 		 */
-		if ( ! $postdata || empty( $postdata[ 'ID' ] ) )
+		if ( ! $postdata || empty( $postdata['ID'] ) ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( ! current_user_can( 'edit_post', $post_ID ) )
+		if ( ! current_user_can( 'edit_post', $post_ID ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
+		}
 
 		// Use wp.editPost to edit post types other than post and page.
-		if ( ! in_array( $postdata[ 'post_type' ], array( 'post', 'page' ) ) )
+		if ( ! in_array( $postdata['post_type'], array( 'post', 'page' ) ) ) {
 			return new IXR_Error( 401, __( 'Invalid post type.' ) );
+		}
 
 		// Thwart attempt to change the post type.
-		if ( ! empty( $content_struct[ 'post_type' ] ) && ( $content_struct['post_type'] != $postdata[ 'post_type' ] ) )
+		if ( ! empty( $content_struct['post_type'] ) && ( $content_struct['post_type'] != $postdata['post_type'] ) ) {
 			return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
+		}
 
 		// Check for a valid post format if one was given
 		if ( isset( $content_struct['wp_post_format'] ) ) {
 			$content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] );
-			if ( !array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {
+			if ( ! array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {
 				return new IXR_Error( 404, __( 'Invalid post format.' ) );
 			}
 		}
 
-		$this->escape($postdata);
+		$this->escape( $postdata );
 
 		$ID = $postdata['ID'];
 		$post_content = $postdata['post_content'];
@@ -5262,24 +5529,29 @@
 
 		// Let WordPress manage slug if none was provided.
 		$post_name = $postdata['post_name'];
-		if ( isset($content_struct['wp_slug']) )
+		if ( isset( $content_struct['wp_slug'] ) ) {
 			$post_name = $content_struct['wp_slug'];
+		}
 
 		// Only use a password if one was given.
-		if ( isset($content_struct['wp_password']) )
+		if ( isset( $content_struct['wp_password'] ) ) {
 			$post_password = $content_struct['wp_password'];
+		}
 
 		// Only set a post parent if one was given.
-		if ( isset($content_struct['wp_page_parent_id']) )
+		if ( isset( $content_struct['wp_page_parent_id'] ) ) {
 			$post_parent = $content_struct['wp_page_parent_id'];
+		}
 
 		// Only set the menu_order if it was given.
-		if ( isset($content_struct['wp_page_order']) )
+		if ( isset( $content_struct['wp_page_order'] ) ) {
 			$menu_order = $content_struct['wp_page_order'];
+		}
 
 		$page_template = null;
-		if ( ! empty( $content_struct['wp_page_template'] ) && 'page' == $post_type )
+		if ( ! empty( $content_struct['wp_page_template'] ) && 'page' == $post_type ) {
 			$page_template = $content_struct['wp_page_template'];
+		}
 
 		$post_author = $postdata['post_author'];
 
@@ -5305,8 +5577,8 @@
 			}
 		}
 
-		if ( isset($content_struct['mt_allow_comments']) ) {
-			if ( !is_numeric($content_struct['mt_allow_comments']) ) {
+		if ( isset( $content_struct['mt_allow_comments'] ) ) {
+			if ( ! is_numeric( $content_struct['mt_allow_comments'] ) ) {
 				switch ( $content_struct['mt_allow_comments'] ) {
 					case 'closed':
 						$comment_status = 'closed';
@@ -5334,8 +5606,8 @@
 			}
 		}
 
-		if ( isset($content_struct['mt_allow_pings']) ) {
-			if ( !is_numeric($content_struct['mt_allow_pings']) ) {
+		if ( isset( $content_struct['mt_allow_pings'] ) ) {
+			if ( ! is_numeric( $content_struct['mt_allow_pings'] ) ) {
 				switch ( $content_struct['mt_allow_pings'] ) {
 					case 'closed':
 						$ping_status = 'closed';
@@ -5348,7 +5620,7 @@
 						break;
 				}
 			} else {
-				switch ( (int) $content_struct["mt_allow_pings"] ) {
+				switch ( (int) $content_struct['mt_allow_pings'] ) {
 					case 0:
 						$ping_status = 'closed';
 						break;
@@ -5362,35 +5634,38 @@
 			}
 		}
 
-		if ( isset( $content_struct['title'] ) )
-			$post_title =  $content_struct['title'];
+		if ( isset( $content_struct['title'] ) ) {
+			$post_title = $content_struct['title'];
+		}
 
-		if ( isset( $content_struct['description'] ) )
+		if ( isset( $content_struct['description'] ) ) {
 			$post_content = $content_struct['description'];
+		}
 
 		$post_category = array();
 		if ( isset( $content_struct['categories'] ) ) {
 			$catnames = $content_struct['categories'];
-			if ( is_array($catnames) ) {
-				foreach ($catnames as $cat) {
-					$post_category[] = get_cat_ID($cat);
+			if ( is_array( $catnames ) ) {
+				foreach ( $catnames as $cat ) {
+					$post_category[] = get_cat_ID( $cat );
 				}
 			}
 		}
 
-		if ( isset( $content_struct['mt_excerpt'] ) )
-			$post_excerpt =  $content_struct['mt_excerpt'];
+		if ( isset( $content_struct['mt_excerpt'] ) ) {
+			$post_excerpt = $content_struct['mt_excerpt'];
+		}
 
 		$post_more = isset( $content_struct['mt_text_more'] ) ? $content_struct['mt_text_more'] : null;
 
 		$post_status = $publish ? 'publish' : 'draft';
-		if ( isset( $content_struct["{$post_type}_status"] ) ) {
-			switch( $content_struct["{$post_type}_status"] ) {
+		if ( isset( $content_struct[ "{$post_type}_status" ] ) ) {
+			switch ( $content_struct[ "{$post_type}_status" ] ) {
 				case 'draft':
 				case 'pending':
 				case 'private':
 				case 'publish':
-					$post_status = $content_struct["{$post_type}_status"];
+					$post_status = $content_struct[ "{$post_type}_status" ];
 					break;
 				default:
 					$post_status = $publish ? 'publish' : 'draft';
@@ -5408,29 +5683,32 @@
 			}
 		}
 
-		if ( $post_more )
-			$post_content = $post_content . "<!--more-->" . $post_more;
+		if ( $post_more ) {
+			$post_content = $post_content . '<!--more-->' . $post_more;
+		}
 
 		$to_ping = null;
 		if ( isset( $content_struct['mt_tb_ping_urls'] ) ) {
 			$to_ping = $content_struct['mt_tb_ping_urls'];
-			if ( is_array($to_ping) )
-				$to_ping = implode(' ', $to_ping);
+			if ( is_array( $to_ping ) ) {
+				$to_ping = implode( ' ', $to_ping );
+			}
 		}
 
 		// Do some timestamp voodoo.
-		if ( !empty( $content_struct['date_created_gmt'] ) )
+		if ( ! empty( $content_struct['date_created_gmt'] ) ) {
 			// We know this is supposed to be GMT, so we're going to slap that Z on there by force.
 			$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
-		elseif ( !empty( $content_struct['dateCreated']) )
+		} elseif ( ! empty( $content_struct['dateCreated'] ) ) {
 			$dateCreated = $content_struct['dateCreated']->getIso();
+		}
 
 		// Default to not flagging the post date to be edited unless it's intentional.
 		$edit_date = false;
 
-		if ( !empty( $dateCreated ) ) {
-			$post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
-			$post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT');
+		if ( ! empty( $dateCreated ) ) {
+			$post_date = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) );
+			$post_date_gmt = iso8601_to_datetime( $dateCreated, 'GMT' );
 
 			// Flag the post date to be edited.
 			$edit_date = true;
@@ -5440,14 +5718,16 @@
 		}
 
 		// We've got all the data -- post it.
-		$newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'edit_date', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template');
+		$newpost = compact( 'ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'edit_date', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template' );
 
-		$result = wp_update_post($newpost, true);
-		if ( is_wp_error( $result ) )
-			return new IXR_Error(500, $result->get_error_message());
+		$result = wp_update_post( $newpost, true );
+		if ( is_wp_error( $result ) ) {
+			return new IXR_Error( 500, $result->get_error_message() );
+		}
 
-		if ( !$result )
-			return new IXR_Error(500, __('Sorry, your entry could not be edited.'));
+		if ( ! $result ) {
+			return new IXR_Error( 500, __( 'Sorry, your entry could not be edited.' ) );
+		}
 
 		// Only posts can be sticky
 		if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) {
@@ -5460,30 +5740,33 @@
 			}
 		}
 
-		if ( isset($content_struct['custom_fields']) )
-			$this->set_custom_fields($post_ID, $content_struct['custom_fields']);
+		if ( isset( $content_struct['custom_fields'] ) ) {
+			$this->set_custom_fields( $post_ID, $content_struct['custom_fields'] );
+		}
 
-		if ( isset ( $content_struct['wp_post_thumbnail'] ) ) {
+		if ( isset( $content_struct['wp_post_thumbnail'] ) ) {
 
 			// Empty value deletes, non-empty value adds/updates.
 			if ( empty( $content_struct['wp_post_thumbnail'] ) ) {
 				delete_post_thumbnail( $post_ID );
 			} else {
-				if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false )
+				if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) {
 					return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
+				}
 			}
 			unset( $content_struct['wp_post_thumbnail'] );
 		}
 
 		// Handle enclosures.
-		$thisEnclosure = isset($content_struct['enclosure']) ? $content_struct['enclosure'] : null;
-		$this->add_enclosure_if_new($post_ID, $thisEnclosure);
+		$thisEnclosure = isset( $content_struct['enclosure'] ) ? $content_struct['enclosure'] : null;
+		$this->add_enclosure_if_new( $post_ID, $thisEnclosure );
 
 		$this->attach_uploads( $ID, $post_content );
 
 		// Handle post formats if assigned, validation is handled earlier in this function.
-		if ( isset( $content_struct['wp_post_format'] ) )
+		if ( isset( $content_struct['wp_post_format'] ) ) {
 			set_post_format( $post_ID, $content_struct['wp_post_format'] );
+		}
 
 		/**
 		 * Fires after a post has been successfully updated via the XML-RPC MovableType API.
@@ -5520,70 +5803,78 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		$postdata = get_post($post_ID, ARRAY_A);
-		if ( ! $postdata )
+		$postdata = get_post( $post_ID, ARRAY_A );
+		if ( ! $postdata ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( !current_user_can( 'edit_post', $post_ID ) )
+		if ( ! current_user_can( 'edit_post', $post_ID ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'metaWeblog.getPost' );
 
-		if ($postdata['post_date'] != '') {
+		if ( $postdata['post_date'] != '' ) {
 			$post_date = $this->_convert_date( $postdata['post_date'] );
 			$post_date_gmt = $this->_convert_date_gmt( $postdata['post_date_gmt'],  $postdata['post_date'] );
 			$post_modified = $this->_convert_date( $postdata['post_modified'] );
 			$post_modified_gmt = $this->_convert_date_gmt( $postdata['post_modified_gmt'], $postdata['post_modified'] );
 
 			$categories = array();
-			$catids = wp_get_post_categories($post_ID);
-			foreach ($catids as $catid)
-				$categories[] = get_cat_name($catid);
+			$catids = wp_get_post_categories( $post_ID );
+			foreach ( $catids as $catid ) {
+				$categories[] = get_cat_name( $catid );
+			}
 
 			$tagnames = array();
 			$tags = wp_get_post_tags( $post_ID );
-			if ( !empty( $tags ) ) {
-				foreach ( $tags as $tag )
+			if ( ! empty( $tags ) ) {
+				foreach ( $tags as $tag ) {
 					$tagnames[] = $tag->name;
+				}
 				$tagnames = implode( ', ', $tagnames );
 			} else {
 				$tagnames = '';
 			}
 
-			$post = get_extended($postdata['post_content']);
-			$link = get_permalink($postdata['ID']);
+			$post = get_extended( $postdata['post_content'] );
+			$link = get_permalink( $postdata['ID'] );
 
 			// Get the author info.
-			$author = get_userdata($postdata['post_author']);
+			$author = get_userdata( $postdata['post_author'] );
 
 			$allow_comments = ('open' == $postdata['comment_status']) ? 1 : 0;
 			$allow_pings = ('open' == $postdata['ping_status']) ? 1 : 0;
 
 			// Consider future posts as published
-			if ( $postdata['post_status'] === 'future' )
+			if ( $postdata['post_status'] === 'future' ) {
 				$postdata['post_status'] = 'publish';
+			}
 
 			// Get post format
 			$post_format = get_post_format( $post_ID );
-			if ( empty( $post_format ) )
+			if ( empty( $post_format ) ) {
 				$post_format = 'standard';
+			}
 
 			$sticky = false;
-			if ( is_sticky( $post_ID ) )
+			if ( is_sticky( $post_ID ) ) {
 				$sticky = true;
+			}
 
 			$enclosure = array();
-			foreach ( (array) get_post_custom($post_ID) as $key => $val) {
-				if ($key == 'enclosure') {
+			foreach ( (array) get_post_custom( $post_ID ) as $key => $val ) {
+				if ( $key == 'enclosure' ) {
 					foreach ( (array) $val as $enc ) {
-						$encdata = explode("\n", $enc);
-						$enclosure['url'] = trim(htmlspecialchars($encdata[0]));
-						$enclosure['length'] = (int) trim($encdata[1]);
-						$enclosure['type'] = trim($encdata[2]);
+						$encdata = explode( "\n", $enc );
+						$enclosure['url'] = trim( htmlspecialchars( $encdata[0] ) );
+						$enclosure['length'] = (int) trim( $encdata[1] );
+						$enclosure['type'] = trim( $encdata[2] );
 						break 2;
 					}
 				}
@@ -5612,21 +5903,22 @@
 				'wp_author_display_name' => $author->display_name,
 				'date_created_gmt' => $post_date_gmt,
 				'post_status' => $postdata['post_status'],
-				'custom_fields' => $this->get_custom_fields($post_ID),
+				'custom_fields' => $this->get_custom_fields( $post_ID ),
 				'wp_post_format' => $post_format,
 				'sticky' => $sticky,
 				'date_modified' => $post_modified,
-				'date_modified_gmt' => $post_modified_gmt
+				'date_modified_gmt' => $post_modified_gmt,
 			);
 
-			if ( !empty($enclosure) ) $resp['enclosure'] = $enclosure;
+			if ( ! empty( $enclosure ) ) { $resp['enclosure'] = $enclosure;
+			}
 
 			$resp['wp_post_thumbnail'] = get_post_thumbnail_id( $postdata['ID'] );
 
 			return $resp;
 		} else {
-			return new IXR_Error(404, __('Sorry, no such post.'));
-		}
+			return new IXR_Error( 404, __( 'Sorry, no such post.' ) );
+		}// End if().
 	}
 
 	/**
@@ -5649,29 +5941,33 @@
 
 		$username = $args[1];
 		$password = $args[2];
-		if ( isset( $args[3] ) )
+		if ( isset( $args[3] ) ) {
 			$query = array( 'numberposts' => absint( $args[3] ) );
-		else
-			$query = array();
+		} else { $query = array();
+		}
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( ! current_user_can( 'edit_posts' ) )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'metaWeblog.getRecentPosts' );
 
 		$posts_list = wp_get_recent_posts( $query );
 
-		if ( !$posts_list )
+		if ( ! $posts_list ) {
 			return array();
+		}
 
 		$recent_posts = array();
-		foreach ($posts_list as $entry) {
-			if ( !current_user_can( 'edit_post', $entry['ID'] ) )
+		foreach ( $posts_list as $entry ) {
+			if ( ! current_user_can( 'edit_post', $entry['ID'] ) ) {
 				continue;
+			}
 
 			$post_date = $this->_convert_date( $entry['post_date'] );
 			$post_date_gmt = $this->_convert_date_gmt( $entry['post_date_gmt'], $entry['post_date'] );
@@ -5679,13 +5975,14 @@
 			$post_modified_gmt = $this->_convert_date_gmt( $entry['post_modified_gmt'], $entry['post_modified'] );
 
 			$categories = array();
-			$catids = wp_get_post_categories($entry['ID']);
-			foreach ( $catids as $catid )
-				$categories[] = get_cat_name($catid);
+			$catids = wp_get_post_categories( $entry['ID'] );
+			foreach ( $catids as $catid ) {
+				$categories[] = get_cat_name( $catid );
+			}
 
 			$tagnames = array();
 			$tags = wp_get_post_tags( $entry['ID'] );
-			if ( !empty( $tags ) ) {
+			if ( ! empty( $tags ) ) {
 				foreach ( $tags as $tag ) {
 					$tagnames[] = $tag->name;
 				}
@@ -5694,23 +5991,25 @@
 				$tagnames = '';
 			}
 
-			$post = get_extended($entry['post_content']);
-			$link = get_permalink($entry['ID']);
+			$post = get_extended( $entry['post_content'] );
+			$link = get_permalink( $entry['ID'] );
 
 			// Get the post author info.
-			$author = get_userdata($entry['post_author']);
+			$author = get_userdata( $entry['post_author'] );
 
 			$allow_comments = ('open' == $entry['comment_status']) ? 1 : 0;
 			$allow_pings = ('open' == $entry['ping_status']) ? 1 : 0;
 
 			// Consider future posts as published
-			if ( $entry['post_status'] === 'future' )
+			if ( $entry['post_status'] === 'future' ) {
 				$entry['post_status'] = 'publish';
+			}
 
 			// Get post format
 			$post_format = get_post_format( $entry['ID'] );
-			if ( empty( $post_format ) )
+			if ( empty( $post_format ) ) {
 				$post_format = 'standard';
+			}
 
 			$recent_posts[] = array(
 				'dateCreated' => $post_date,
@@ -5735,14 +6034,14 @@
 				'wp_author_display_name' => $author->display_name,
 				'date_created_gmt' => $post_date_gmt,
 				'post_status' => $entry['post_status'],
-				'custom_fields' => $this->get_custom_fields($entry['ID']),
+				'custom_fields' => $this->get_custom_fields( $entry['ID'] ),
 				'wp_post_format' => $post_format,
 				'date_modified' => $post_modified,
 				'date_modified_gmt' => $post_modified_gmt,
 				'sticky' => ( $entry['post_type'] === 'post' && is_sticky( $entry['ID'] ) ),
-				'wp_post_thumbnail' => get_post_thumbnail_id( $entry['ID'] )
+				'wp_post_thumbnail' => get_post_thumbnail_id( $entry['ID'] ),
 			);
-		}
+		}// End foreach().
 
 		return $recent_posts;
 	}
@@ -5767,18 +6066,20 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_posts' ) )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'metaWeblog.getCategories' );
 
 		$categories_struct = array();
 
-		if ( $cats = get_categories(array('get' => 'all')) ) {
+		if ( $cats = get_categories( array( 'get' => 'all' ) ) ) {
 			foreach ( $cats as $cat ) {
 				$struct = array();
 				$struct['categoryId'] = $cat->term_id;
@@ -5786,8 +6087,8 @@
 				$struct['description'] = $cat->name;
 				$struct['categoryDescription'] = $cat->description;
 				$struct['categoryName'] = $cat->name;
-				$struct['htmlUrl'] = esc_html(get_category_link($cat->term_id));
-				$struct['rssUrl'] = esc_html(get_category_feed_link($cat->term_id, 'rss2'));
+				$struct['htmlUrl'] = esc_html( get_category_link( $cat->term_id ) );
+				$struct['rssUrl'] = esc_html( get_category_feed_link( $cat->term_id, 'rss2' ) );
 
 				$categories_struct[] = $struct;
 			}
@@ -5828,13 +6129,14 @@
 		$type = $data['type'];
 		$bits = $data['bits'];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'metaWeblog.newMediaObject' );
 
-		if ( !current_user_can('upload_files') ) {
+		if ( ! current_user_can( 'upload_files' ) ) {
 			$this->error = new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) );
 			return $this->error;
 		}
@@ -5858,8 +6160,8 @@
 			return new IXR_Error( 500, $upload_err );
 		}
 
-		$upload = wp_upload_bits($name, null, $bits);
-		if ( ! empty($upload['error']) ) {
+		$upload = wp_upload_bits( $name, null, $bits );
+		if ( ! empty( $upload['error'] ) ) {
 			/* translators: 1: file name, 2: error message */
 			$errorString = sprintf( __( 'Could not write file %1$s (%2$s).' ), $name, $upload['error'] );
 			return new IXR_Error( 500, $errorString );
@@ -5869,8 +6171,9 @@
 		if ( ! empty( $data['post_id'] ) ) {
 			$post_id = (int) $data['post_id'];
 
-			if ( ! current_user_can( 'edit_post', $post_id ) )
+			if ( ! current_user_can( 'edit_post', $post_id ) ) {
 				return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
+			}
 		}
 		$attachment = array(
 			'post_title' => $name,
@@ -5878,11 +6181,11 @@
 			'post_type' => 'attachment',
 			'post_parent' => $post_id,
 			'post_mime_type' => $type,
-			'guid' => $upload[ 'url' ]
+			'guid' => $upload['url'],
 		);
 
 		// Save the data
-		$id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id );
+		$id = wp_insert_attachment( $attachment, $upload['file'], $post_id );
 		wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );
 
 		/**
@@ -5929,29 +6232,31 @@
 
 		$username = $args[1];
 		$password = $args[2];
-		if ( isset( $args[3] ) )
+		if ( isset( $args[3] ) ) {
 			$query = array( 'numberposts' => absint( $args[3] ) );
-		else
-			$query = array();
+		} else { $query = array();
+		}
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'mt.getRecentPostTitles' );
 
 		$posts_list = wp_get_recent_posts( $query );
 
-		if ( !$posts_list ) {
-			$this->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.'));
+		if ( ! $posts_list ) {
+			$this->error = new IXR_Error( 500, __( 'Either there are no posts, or something went wrong.' ) );
 			return $this->error;
 		}
 
 		$recent_posts = array();
 
-		foreach ($posts_list as $entry) {
-			if ( !current_user_can( 'edit_post', $entry['ID'] ) )
+		foreach ( $posts_list as $entry ) {
+			if ( ! current_user_can( 'edit_post', $entry['ID'] ) ) {
 				continue;
+			}
 
 			$post_date = $this->_convert_date( $entry['post_date'] );
 			$post_date_gmt = $this->_convert_date_gmt( $entry['post_date_gmt'], $entry['post_date'] );
@@ -5962,7 +6267,7 @@
 				'postid' => (string) $entry['ID'],
 				'title' => $entry['post_title'],
 				'post_status' => $entry['post_status'],
-				'date_created_gmt' => $post_date_gmt
+				'date_created_gmt' => $post_date_gmt,
 			);
 		}
 
@@ -5989,18 +6294,20 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( !current_user_can( 'edit_posts' ) )
+		if ( ! current_user_can( 'edit_posts' ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'mt.getCategoryList' );
 
 		$categories_struct = array();
 
-		if ( $cats = get_categories(array('hide_empty' => 0, 'hierarchical' => 0)) ) {
+		if ( $cats = get_categories( array( 'hide_empty' => 0, 'hierarchical' => 0 ) ) ) {
 			foreach ( $cats as $cat ) {
 				$struct = array();
 				$struct['categoryId'] = $cat->term_id;
@@ -6034,27 +6341,30 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
-		if ( ! get_post( $post_ID ) )
+		if ( ! get_post( $post_ID ) ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( !current_user_can( 'edit_post', $post_ID ) )
+		if ( ! current_user_can( 'edit_post', $post_ID ) ) {
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'mt.getPostCategories' );
 
 		$categories = array();
-		$catids = wp_get_post_categories(intval($post_ID));
+		$catids = wp_get_post_categories( intval( $post_ID ) );
 		// first listed category will be the primary category
 		$isPrimary = true;
 		foreach ( $catids as $catid ) {
 			$categories[] = array(
-				'categoryName' => get_cat_name($catid),
+				'categoryName' => get_cat_name( $catid ),
 				'categoryId' => (string) $catid,
-				'isPrimary' => $isPrimary
+				'isPrimary' => $isPrimary,
 			);
 			$isPrimary = false;
 		}
@@ -6085,24 +6395,27 @@
 		$password   = $args[2];
 		$categories = $args[3];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'mt.setPostCategories' );
 
-		if ( ! get_post( $post_ID ) )
+		if ( ! get_post( $post_ID ) ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( !current_user_can('edit_post', $post_ID) )
-			return new IXR_Error(401, __('Sorry, you are not allowed to edit this post.'));
+		if ( ! current_user_can( 'edit_post', $post_ID ) ) {
+			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
+		}
 
 		$catids = array();
 		foreach ( $categories as $cat ) {
 			$catids[] = $cat['categoryId'];
 		}
 
-		wp_set_post_categories($post_ID, $catids);
+		wp_set_post_categories( $post_ID, $catids );
 
 		return true;
 	}
@@ -6156,25 +6469,27 @@
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'mt.getTrackbackPings' );
 
-		$actual_post = get_post($post_ID, ARRAY_A);
+		$actual_post = get_post( $post_ID, ARRAY_A );
 
-		if ( !$actual_post )
-			return new IXR_Error(404, __('Sorry, no such post.'));
+		if ( ! $actual_post ) {
+			return new IXR_Error( 404, __( 'Sorry, no such post.' ) );
+		}
 
-		$comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
+		$comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID ) );
 
-		if ( !$comments )
+		if ( ! $comments ) {
 			return array();
+		}
 
 		$trackback_pings = array();
 		foreach ( $comments as $comment ) {
 			if ( 'trackback' == $comment->comment_type ) {
 				$content = $comment->comment_content;
-				$title = substr($content, 8, (strpos($content, '</strong>') - 8));
+				$title = substr( $content, 8, (strpos( $content, '</strong>' ) - 8) );
 				$trackback_pings[] = array(
 					'pingTitle' => $title,
 					'pingURL'   => $comment->comment_author_url,
-					'pingIP'    => $comment->comment_author_IP
+					'pingIP'    => $comment->comment_author_IP,
 				);
 			}
 		}
@@ -6203,25 +6518,28 @@
 		$username = $args[1];
 		$password = $args[2];
 
-		if ( !$user = $this->login($username, $password) )
+		if ( ! $user = $this->login( $username, $password ) ) {
 			return $this->error;
+		}
 
 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
 		do_action( 'xmlrpc_call', 'mt.publishPost' );
 
-		$postdata = get_post($post_ID, ARRAY_A);
-		if ( ! $postdata )
+		$postdata = get_post( $post_ID, ARRAY_A );
+		if ( ! $postdata ) {
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+		}
 
-		if ( !current_user_can('publish_posts') || !current_user_can('edit_post', $post_ID) )
-			return new IXR_Error(401, __('Sorry, you are not allowed to publish this post.'));
+		if ( ! current_user_can( 'publish_posts' ) || ! current_user_can( 'edit_post', $post_ID ) ) {
+			return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) );
+		}
 
 		$postdata['post_status'] = 'publish';
 
 		// retain old cats
-		$cats = wp_get_post_categories($post_ID);
+		$cats = wp_get_post_categories( $post_ID );
 		$postdata['post_category'] = $cats;
-		$this->escape($postdata);
+		$this->escape( $postdata );
 
 		return wp_update_post( $postdata );
 	}
@@ -6265,69 +6583,75 @@
 		 */
 		$pagelinkedfrom = apply_filters( 'pingback_ping_source_uri', $pagelinkedfrom, $pagelinkedto );
 
-		if ( ! $pagelinkedfrom )
+		if ( ! $pagelinkedfrom ) {
 			return $this->pingback_error( 0, __( 'A valid URL was not provided.' ) );
+		}
 
 		// Check if the page linked to is in our site
-		$pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', get_option('home')));
-		if ( !$pos1 )
+		$pos1 = strpos( $pagelinkedto, str_replace( array( 'http://www.', 'http://', 'https://www.', 'https://' ), '', get_option( 'home' ) ) );
+		if ( ! $pos1 ) {
 			return $this->pingback_error( 0, __( 'Is there no link to us?' ) );
+		}
 
 		// let's find which post is linked to
 		// FIXME: does url_to_postid() cover all these cases already?
 		//        if so, then let's use it and drop the old code.
-		$urltest = parse_url($pagelinkedto);
-		if ( $post_ID = url_to_postid($pagelinkedto) ) {
+		$urltest = parse_url( $pagelinkedto );
+		if ( $post_ID = url_to_postid( $pagelinkedto ) ) {
 			// $way
-		} elseif ( isset( $urltest['path'] ) && preg_match('#p/[0-9]{1,}#', $urltest['path'], $match) ) {
+		} elseif ( isset( $urltest['path'] ) && preg_match( '#p/[0-9]{1,}#', $urltest['path'], $match ) ) {
 			// the path defines the post_ID (archives/p/XXXX)
-			$blah = explode('/', $match[0]);
+			$blah = explode( '/', $match[0] );
 			$post_ID = (int) $blah[1];
-		} elseif ( isset( $urltest['query'] ) && preg_match('#p=[0-9]{1,}#', $urltest['query'], $match) ) {
+		} elseif ( isset( $urltest['query'] ) && preg_match( '#p=[0-9]{1,}#', $urltest['query'], $match ) ) {
 			// the querystring defines the post_ID (?p=XXXX)
-			$blah = explode('=', $match[0]);
+			$blah = explode( '=', $match[0] );
 			$post_ID = (int) $blah[1];
-		} elseif ( isset($urltest['fragment']) ) {
+		} elseif ( isset( $urltest['fragment'] ) ) {
 			// an #anchor is there, it's either...
-			if ( intval($urltest['fragment']) ) {
+			if ( intval( $urltest['fragment'] ) ) {
 				// ...an integer #XXXX (simplest case)
 				$post_ID = (int) $urltest['fragment'];
-			} elseif ( preg_match('/post-[0-9]+/',$urltest['fragment']) ) {
+			} elseif ( preg_match( '/post-[0-9]+/',$urltest['fragment'] ) ) {
 				// ...a post id in the form 'post-###'
-				$post_ID = preg_replace('/[^0-9]+/', '', $urltest['fragment']);
-			} elseif ( is_string($urltest['fragment']) ) {
+				$post_ID = preg_replace( '/[^0-9]+/', '', $urltest['fragment'] );
+			} elseif ( is_string( $urltest['fragment'] ) ) {
 				// ...or a string #title, a little more complicated
-				$title = preg_replace('/[^a-z0-9]/i', '.', $urltest['fragment']);
-				$sql = $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title RLIKE %s", $title );
-				if (! ($post_ID = $wpdb->get_var($sql)) ) {
+				$title = preg_replace( '/[^a-z0-9]/i', '.', $urltest['fragment'] );
+				$sql = $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title RLIKE %s", $title );
+				if ( ! ($post_ID = $wpdb->get_var( $sql )) ) {
 					// returning unknown error '0' is better than die()ing
-			  		return $this->pingback_error( 0, '' );
+					  return $this->pingback_error( 0, '' );
 				}
 			}
 		} else {
 			// TODO: Attempt to extract a post ID from the given URL
-	  		return $this->pingback_error( 33, __('The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
+			  return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
 		}
 		$post_ID = (int) $post_ID;
 
-		$post = get_post($post_ID);
+		$post = get_post( $post_ID );
 
-		if ( !$post ) // Post_ID not found
-	  		return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
+		if ( ! $post ) { // Post_ID not found
+			  return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
+		}
 
-		if ( $post_ID == url_to_postid($pagelinkedfrom) )
+		if ( $post_ID == url_to_postid( $pagelinkedfrom ) ) {
 			return $this->pingback_error( 0, __( 'The source URL and the target URL cannot both point to the same resource.' ) );
+		}
 
 		// Check if pings are on
-		if ( !pings_open($post) )
-	  		return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
+		if ( ! pings_open( $post ) ) {
+			  return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
+		}
 
 		// Let's check that the remote site didn't already pingback this entry
-		if ( $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom) ) )
+		if ( $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom ) ) ) {
 			return $this->pingback_error( 48, __( 'The pingback has already been registered.' ) );
+		}
 
 		// very stupid, but gives time to the 'from' server to publish !
-		sleep(1);
+		sleep( 1 );
 
 		$remote_ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
 
@@ -6365,7 +6689,7 @@
 		// Work around bug in strip_tags():
 		$remote_source = str_replace( '<!DOC', '<DOC', $remote_source );
 		$remote_source = preg_replace( '/[\r\n\t ]+/', ' ', $remote_source ); // normalize spaces
-		$remote_source = preg_replace( "/<\/*(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/", "\n\n", $remote_source );
+		$remote_source = preg_replace( '/<\/*(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/', "\n\n", $remote_source );
 
 		preg_match( '|<title>([^<]*?)</title>|is', $remote_source, $matchtitle );
 		$title = isset( $matchtitle[1] ) ? $matchtitle[1] : '';
@@ -6377,39 +6701,42 @@
 
 		$p = explode( "\n\n", $remote_source );
 
-		$preg_target = preg_quote($pagelinkedto, '|');
+		$preg_target = preg_quote( $pagelinkedto, '|' );
 
 		foreach ( $p as $para ) {
-			if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link?
-				preg_match("|<a[^>]+?".$preg_target."[^>]*>([^>]+?)</a>|", $para, $context);
+			if ( strpos( $para, $pagelinkedto ) !== false ) { // it exists, but is it a link?
+				preg_match( '|<a[^>]+?' . $preg_target . '[^>]*>([^>]+?)</a>|', $para, $context );
 
 				// If the URL isn't in a link context, keep looking
-				if ( empty($context) )
+				if ( empty( $context ) ) {
 					continue;
+				}
 
 				// We're going to use this fake tag to mark the context in a bit
 				// the marker is needed in case the link text appears more than once in the paragraph
-				$excerpt = preg_replace('|\</?wpcontext\>|', '', $para);
+				$excerpt = preg_replace( '|\</?wpcontext\>|', '', $para );
 
 				// prevent really long link text
-				if ( strlen($context[1]) > 100 )
-					$context[1] = substr($context[1], 0, 100) . '&#8230;';
+				if ( strlen( $context[1] ) > 100 ) {
+					$context[1] = substr( $context[1], 0, 100 ) . '&#8230;';
+				}
 
-				$marker = '<wpcontext>'.$context[1].'</wpcontext>';    // set up our marker
-				$excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker
-				$excerpt = strip_tags($excerpt, '<wpcontext>');        // strip all tags but our context marker
-				$excerpt = trim($excerpt);
-				$preg_marker = preg_quote($marker, '|');
-				$excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt);
-				$excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper
+				$marker = '<wpcontext>' . $context[1] . '</wpcontext>';    // set up our marker
+				$excerpt = str_replace( $context[0], $marker, $excerpt ); // swap out the link for our marker
+				$excerpt = strip_tags( $excerpt, '<wpcontext>' );        // strip all tags but our context marker
+				$excerpt = trim( $excerpt );
+				$preg_marker = preg_quote( $marker, '|' );
+				$excerpt = preg_replace( "|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt );
+				$excerpt = strip_tags( $excerpt ); // YES, again, to remove the marker wrapper
 				break;
 			}
 		}
 
-		if ( empty($context) ) // Link to target not found
+		if ( empty( $context ) ) { // Link to target not found
 			return $this->pingback_error( 17, __( 'The source URL does not contain a link to the target URL, and so cannot be used as a source.' ) );
+		}
 
-		$pagelinkedfrom = str_replace('&', '&amp;', $pagelinkedfrom);
+		$pagelinkedfrom = str_replace( '&', '&amp;', $pagelinkedfrom );
 
 		$context = '[&#8230;] ' . esc_html( $excerpt ) . ' [&#8230;]';
 		$pagelinkedfrom = $this->escape( $pagelinkedfrom );
@@ -6417,10 +6744,10 @@
 		$comment_post_ID = (int) $post_ID;
 		$comment_author = $title;
 		$comment_author_email = '';
-		$this->escape($comment_author);
+		$this->escape( $comment_author );
 		$comment_author_url = $pagelinkedfrom;
 		$comment_content = $context;
-		$this->escape($comment_content);
+		$this->escape( $comment_content );
 		$comment_type = 'pingback';
 
 		$commentdata = compact(
@@ -6428,7 +6755,7 @@
 			'comment_content', 'comment_type', 'remote_source', 'remote_source_original'
 		);
 
-		$comment_ID = wp_new_comment($commentdata);
+		$comment_ID = wp_new_comment( $commentdata );
 
 		/**
 		 * Fires after a post pingback has been sent.
@@ -6463,28 +6790,30 @@
 
 		$url = $this->escape( $url );
 
-		$post_ID = url_to_postid($url);
-		if ( !$post_ID ) {
+		$post_ID = url_to_postid( $url );
+		if ( ! $post_ID ) {
 			// We aren't sure that the resource is available and/or pingback enabled
-	  		return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
+			  return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
 		}
 
-		$actual_post = get_post($post_ID, ARRAY_A);
+		$actual_post = get_post( $post_ID, ARRAY_A );
 
-		if ( !$actual_post ) {
+		if ( ! $actual_post ) {
 			// No such post = resource not found
-	  		return $this->pingback_error( 32, __('The specified target URL does not exist.' ) );
+			  return $this->pingback_error( 32, __( 'The specified target URL does not exist.' ) );
 		}
 
-		$comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
+		$comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID ) );
 
-		if ( !$comments )
+		if ( ! $comments ) {
 			return array();
+		}
 
 		$pingbacks = array();
 		foreach ( $comments as $comment ) {
-			if ( 'pingback' == $comment->comment_type )
+			if ( 'pingback' == $comment->comment_type ) {
 				$pingbacks[] = $comment->comment_author_url;
+			}
 		}
 
 		return $pingbacks;
Index: src/wp-includes/class-wp.php
===================================================================
--- src/wp-includes/class-wp.php	(revision 40901)
+++ src/wp-includes/class-wp.php	(working copy)
@@ -15,7 +15,7 @@
 	 * @access public
 	 * @var array
 	 */
-	public $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );
+	public $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );
 
 	/**
 	 * Private query variables.
@@ -99,9 +99,10 @@
 	 *
 	 * @param string $qv Query variable name.
 	 */
-	public function add_query_var($qv) {
-		if ( !in_array($qv, $this->public_query_vars) )
+	public function add_query_var( $qv ) {
+		if ( ! in_array( $qv, $this->public_query_vars ) ) {
 			$this->public_query_vars[] = $qv;
+		}
 	}
 
 	/**
@@ -125,8 +126,8 @@
 	 * @param string $key Query variable name.
 	 * @param mixed $value Query variable value.
 	 */
-	public function set_query_var($key, $value) {
-		$this->query_vars[$key] = $value;
+	public function set_query_var( $key, $value ) {
+		$this->query_vars[ $key ] = $value;
 	}
 
 	/**
@@ -142,7 +143,7 @@
 	 *
 	 * @param array|string $extra_query_vars Set the extra query variables.
 	 */
-	public function parse_request($extra_query_vars = '') {
+	public function parse_request( $extra_query_vars = '' ) {
 		global $wp_rewrite;
 
 		/**
@@ -154,8 +155,9 @@
 		 * @param WP           $this             Current WordPress environment instance.
 		 * @param array|string $extra_query_vars Extra passed query variables.
 		 */
-		if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) )
+		if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) ) {
 			return;
+		}
 
 		$this->query_vars = array();
 		$post_type_query_vars = array();
@@ -170,14 +172,14 @@
 		// Fetch the rewrite rules.
 		$rewrite = $wp_rewrite->wp_rewrite_rules();
 
-		if ( ! empty($rewrite) ) {
+		if ( ! empty( $rewrite ) ) {
 			// If we match a rewrite rule, this will be cleared.
 			$error = '404';
 			$this->did_permalink = true;
 
 			$pathinfo = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : '';
 			list( $pathinfo ) = explode( '?', $pathinfo );
-			$pathinfo = str_replace( "%", "%25", $pathinfo );
+			$pathinfo = str_replace( '%', '%25', $pathinfo );
 
 			list( $req_uri ) = explode( '?', $_SERVER['REQUEST_URI'] );
 			$self = $_SERVER['PHP_SELF'];
@@ -188,25 +190,26 @@
 			// front. For path info requests, this leaves us with the requesting
 			// filename, if any. For 404 requests, this leaves us with the
 			// requested permalink.
-			$req_uri = str_replace($pathinfo, '', $req_uri);
-			$req_uri = trim($req_uri, '/');
+			$req_uri = str_replace( $pathinfo, '', $req_uri );
+			$req_uri = trim( $req_uri, '/' );
 			$req_uri = preg_replace( $home_path_regex, '', $req_uri );
-			$req_uri = trim($req_uri, '/');
-			$pathinfo = trim($pathinfo, '/');
+			$req_uri = trim( $req_uri, '/' );
+			$pathinfo = trim( $pathinfo, '/' );
 			$pathinfo = preg_replace( $home_path_regex, '', $pathinfo );
-			$pathinfo = trim($pathinfo, '/');
-			$self = trim($self, '/');
+			$pathinfo = trim( $pathinfo, '/' );
+			$self = trim( $self, '/' );
 			$self = preg_replace( $home_path_regex, '', $self );
-			$self = trim($self, '/');
+			$self = trim( $self, '/' );
 
 			// The requested permalink is in $pathinfo for path info requests and
 			//  $req_uri for other requests.
-			if ( ! empty($pathinfo) && !preg_match('|^.*' . $wp_rewrite->index . '$|', $pathinfo) ) {
+			if ( ! empty( $pathinfo ) && ! preg_match( '|^.*' . $wp_rewrite->index . '$|', $pathinfo ) ) {
 				$requested_path = $pathinfo;
 			} else {
 				// If the request uri is the index, blank it out so that we don't try to match it against a rule.
-				if ( $req_uri == $wp_rewrite->index )
+				if ( $req_uri == $wp_rewrite->index ) {
 					$req_uri = '';
+				}
 				$requested_path = $req_uri;
 			}
 			$requested_file = $req_uri;
@@ -220,22 +223,23 @@
 				if ( isset( $rewrite['$'] ) ) {
 					$this->matched_rule = '$';
 					$query = $rewrite['$'];
-					$matches = array('');
+					$matches = array( '' );
 				}
 			} else {
 				foreach ( (array) $rewrite as $match => $query ) {
 					// If the requested file is the anchor of the match, prepend it to the path info.
-					if ( ! empty($requested_file) && strpos($match, $requested_file) === 0 && $requested_file != $requested_path )
+					if ( ! empty( $requested_file ) && strpos( $match, $requested_file ) === 0 && $requested_file != $requested_path ) {
 						$request_match = $requested_file . '/' . $requested_path;
+					}
 
-					if ( preg_match("#^$match#", $request_match, $matches) ||
-						preg_match("#^$match#", urldecode($request_match), $matches) ) {
+					if ( preg_match( "#^$match#", $request_match, $matches ) ||
+						preg_match( "#^$match#", urldecode( $request_match ), $matches ) ) {
 
 						if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$matches\[([0-9]+)\]/', $query, $varmatch ) ) {
 							// This is a verbose page match, let's check to be sure about it.
 							$page = get_page_by_path( $matches[ $varmatch[1] ] );
 							if ( ! $page ) {
-						 		continue;
+								 continue;
 							}
 
 							$post_status_obj = get_post_status_object( $page->post_status );
@@ -250,35 +254,37 @@
 						break;
 					}
 				}
-			}
+			}// End if().
 
 			if ( isset( $this->matched_rule ) ) {
 				// Trim the query of everything up to the '?'.
-				$query = preg_replace("!^.+\?!", '', $query);
+				$query = preg_replace( '!^.+\?!', '', $query );
 
 				// Substitute the substring matches into the query.
-				$query = addslashes(WP_MatchesMapRegex::apply($query, $matches));
+				$query = addslashes( WP_MatchesMapRegex::apply( $query, $matches ) );
 
 				$this->matched_query = $query;
 
 				// Parse the query.
-				parse_str($query, $perma_query_vars);
+				parse_str( $query, $perma_query_vars );
 
 				// If we're processing a 404 request, clear the error var since we found something.
-				if ( '404' == $error )
+				if ( '404' == $error ) {
 					unset( $error, $_GET['error'] );
+				}
 			}
 
 			// If req_uri is empty or if it is a request for ourself, unset error.
-			if ( empty($requested_path) || $requested_file == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) {
+			if ( empty( $requested_path ) || $requested_file == $self || strpos( $_SERVER['PHP_SELF'], 'wp-admin/' ) !== false ) {
 				unset( $error, $_GET['error'] );
 
-				if ( isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false )
+				if ( isset( $perma_query_vars ) && strpos( $_SERVER['PHP_SELF'], 'wp-admin/' ) !== false ) {
 					unset( $perma_query_vars );
+				}
 
 				$this->did_permalink = false;
 			}
-		}
+		}// End if().
 
 		/**
 		 * Filters the query variables whitelist before processing.
@@ -295,46 +301,51 @@
 
 		foreach ( get_post_types( array(), 'objects' ) as $post_type => $t ) {
 			if ( is_post_type_viewable( $t ) && $t->query_var ) {
-				$post_type_query_vars[$t->query_var] = $post_type;
+				$post_type_query_vars[ $t->query_var ] = $post_type;
 			}
 		}
 
 		foreach ( $this->public_query_vars as $wpvar ) {
-			if ( isset( $this->extra_query_vars[$wpvar] ) )
-				$this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar];
-			elseif ( isset( $_POST[$wpvar] ) )
-				$this->query_vars[$wpvar] = $_POST[$wpvar];
-			elseif ( isset( $_GET[$wpvar] ) )
-				$this->query_vars[$wpvar] = $_GET[$wpvar];
-			elseif ( isset( $perma_query_vars[$wpvar] ) )
-				$this->query_vars[$wpvar] = $perma_query_vars[$wpvar];
-
-			if ( !empty( $this->query_vars[$wpvar] ) ) {
-				if ( ! is_array( $this->query_vars[$wpvar] ) ) {
-					$this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar];
+			if ( isset( $this->extra_query_vars[ $wpvar ] ) ) {
+				$this->query_vars[ $wpvar ] = $this->extra_query_vars[ $wpvar ];
+			} elseif ( isset( $_POST[ $wpvar ] ) ) {
+				$this->query_vars[ $wpvar ] = $_POST[ $wpvar ];
+			} elseif ( isset( $_GET[ $wpvar ] ) ) {
+				$this->query_vars[ $wpvar ] = $_GET[ $wpvar ];
+			} elseif ( isset( $perma_query_vars[ $wpvar ] ) ) {
+				$this->query_vars[ $wpvar ] = $perma_query_vars[ $wpvar ];
+			}
+
+			if ( ! empty( $this->query_vars[ $wpvar ] ) ) {
+				if ( ! is_array( $this->query_vars[ $wpvar ] ) ) {
+					$this->query_vars[ $wpvar ] = (string) $this->query_vars[ $wpvar ];
 				} else {
-					foreach ( $this->query_vars[$wpvar] as $vkey => $v ) {
-						if ( !is_object( $v ) ) {
-							$this->query_vars[$wpvar][$vkey] = (string) $v;
+					foreach ( $this->query_vars[ $wpvar ] as $vkey => $v ) {
+						if ( ! is_object( $v ) ) {
+							$this->query_vars[ $wpvar ][ $vkey ] = (string) $v;
 						}
 					}
 				}
 
-				if ( isset($post_type_query_vars[$wpvar] ) ) {
-					$this->query_vars['post_type'] = $post_type_query_vars[$wpvar];
-					$this->query_vars['name'] = $this->query_vars[$wpvar];
+				if ( isset( $post_type_query_vars[ $wpvar ] ) ) {
+					$this->query_vars['post_type'] = $post_type_query_vars[ $wpvar ];
+					$this->query_vars['name'] = $this->query_vars[ $wpvar ];
 				}
 			}
 		}
 
 		// Convert urldecoded spaces back into +
-		foreach ( get_taxonomies( array() , 'objects' ) as $taxonomy => $t )
-			if ( $t->query_var && isset( $this->query_vars[$t->query_var] ) )
-				$this->query_vars[$t->query_var] = str_replace( ' ', '+', $this->query_vars[$t->query_var] );
+		foreach ( get_taxonomies( array() , 'objects' ) as $taxonomy => $t ) {
+			if ( $t->query_var && isset( $this->query_vars[ $t->query_var ] ) ) {
+				$this->query_vars[ $t->query_var ] = str_replace( ' ', '+', $this->query_vars[ $t->query_var ] );
+			}
+		}
 
 		// Don't allow non-publicly queryable taxonomies to be queried from the front end.
 		if ( ! is_admin() ) {
-			foreach ( get_taxonomies( array( 'publicly_queryable' => false ), 'objects' ) as $taxonomy => $t ) {
+			foreach ( get_taxonomies( array(
+				'publicly_queryable' => false,
+			), 'objects' ) as $taxonomy => $t ) {
 				/*
 				 * Disallow when set to the 'taxonomy' query var.
 				 * Non-publicly queryable taxonomies cannot register custom query vars. See register_taxonomy().
@@ -346,11 +357,14 @@
 		}
 
 		// Limit publicly queried post_types to those that are publicly_queryable
-		if ( isset( $this->query_vars['post_type']) ) {
-			$queryable_post_types = get_post_types( array('publicly_queryable' => true) );
+		if ( isset( $this->query_vars['post_type'] ) ) {
+			$queryable_post_types = get_post_types( array(
+				'publicly_queryable' => true,
+			) );
 			if ( ! is_array( $this->query_vars['post_type'] ) ) {
-				if ( ! in_array( $this->query_vars['post_type'], $queryable_post_types ) )
+				if ( ! in_array( $this->query_vars['post_type'], $queryable_post_types ) ) {
 					unset( $this->query_vars['post_type'] );
+				}
 			} else {
 				$this->query_vars['post_type'] = array_intersect( $this->query_vars['post_type'], $queryable_post_types );
 			}
@@ -359,13 +373,15 @@
 		// Resolve conflicts between posts with numeric slugs and date archive queries.
 		$this->query_vars = wp_resolve_numeric_slug_conflicts( $this->query_vars );
 
-		foreach ( (array) $this->private_query_vars as $var) {
-			if ( isset($this->extra_query_vars[$var]) )
-				$this->query_vars[$var] = $this->extra_query_vars[$var];
+		foreach ( (array) $this->private_query_vars as $var ) {
+			if ( isset( $this->extra_query_vars[ $var ] ) ) {
+				$this->query_vars[ $var ] = $this->extra_query_vars[ $var ];
+			}
 		}
 
-		if ( isset($error) )
+		if ( isset( $error ) ) {
 			$this->query_vars['error'] = $error;
+		}
 
 		/**
 		 * Filters the array of parsed query variables.
@@ -401,19 +417,21 @@
 		$status = null;
 		$exit_required = false;
 
-		if ( is_user_logged_in() )
-			$headers = array_merge($headers, wp_get_nocache_headers());
+		if ( is_user_logged_in() ) {
+			$headers = array_merge( $headers, wp_get_nocache_headers() );
+		}
 		if ( ! empty( $this->query_vars['error'] ) ) {
 			$status = (int) $this->query_vars['error'];
 			if ( 404 === $status ) {
-				if ( ! is_user_logged_in() )
-					$headers = array_merge($headers, wp_get_nocache_headers());
-				$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
+				if ( ! is_user_logged_in() ) {
+					$headers = array_merge( $headers, wp_get_nocache_headers() );
+				}
+				$headers['Content-Type'] = get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' );
 			} elseif ( in_array( $status, array( 403, 500, 502, 503 ) ) ) {
 				$exit_required = true;
 			}
 		} elseif ( empty( $this->query_vars['feed'] ) ) {
-			$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
+			$headers['Content-Type'] = get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' );
 		} else {
 			// Set the correct content type for feeds
 			$type = $this->query_vars['feed'];
@@ -424,16 +442,16 @@
 
 			// We're showing a feed, so WP is indeed the only thing that last changed.
 			if ( ! empty( $this->query_vars['withcomments'] )
-			     || false !== strpos( $this->query_vars['feed'], 'comments-' )
-			     || ( empty( $this->query_vars['withoutcomments'] )
-			          && ( ! empty( $this->query_vars['p'] )
-			               || ! empty( $this->query_vars['name'] )
-			               || ! empty( $this->query_vars['page_id'] )
-			               || ! empty( $this->query_vars['pagename'] )
-			               || ! empty( $this->query_vars['attachment'] )
-			               || ! empty( $this->query_vars['attachment_id'] )
-			          )
-			     )
+				 || false !== strpos( $this->query_vars['feed'], 'comments-' )
+				 || ( empty( $this->query_vars['withoutcomments'] )
+					  && ( ! empty( $this->query_vars['p'] )
+						   || ! empty( $this->query_vars['name'] )
+						   || ! empty( $this->query_vars['page_id'] )
+						   || ! empty( $this->query_vars['pagename'] )
+						   || ! empty( $this->query_vars['attachment'] )
+						   || ! empty( $this->query_vars['attachment_id'] )
+					  )
+				 )
 			) {
 				$wp_last_modified = mysql2date( 'D, d M Y H:i:s', get_lastcommentmodified( 'GMT' ), false );
 			} else {
@@ -446,21 +464,22 @@
 
 			$wp_last_modified .= ' GMT';
 
-			$wp_etag = '"' . md5($wp_last_modified) . '"';
+			$wp_etag = '"' . md5( $wp_last_modified ) . '"';
 			$headers['Last-Modified'] = $wp_last_modified;
 			$headers['ETag'] = $wp_etag;
 
 			// Support for Conditional GET
-			if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
+			if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ) {
 				$client_etag = wp_unslash( $_SERVER['HTTP_IF_NONE_MATCH'] );
-			else $client_etag = false;
+			} else { $client_etag = false;
+			}
 
-			$client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']);
+			$client_last_modified = empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? '' : trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
 			// If string is empty, return 0. If not, attempt to parse into a timestamp
-			$client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0;
+			$client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;
 
 			// Make a timestamp for our most recent modification...
-			$wp_modified_timestamp = strtotime($wp_last_modified);
+			$wp_modified_timestamp = strtotime( $wp_last_modified );
 
 			if ( ($client_last_modified && $client_etag) ?
 					 (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) :
@@ -468,7 +487,7 @@
 				$status = 304;
 				$exit_required = true;
 			}
-		}
+		}// End if().
 
 		/**
 		 * Filters the HTTP headers before they're sent to the browser.
@@ -480,8 +499,9 @@
 		 */
 		$headers = apply_filters( 'wp_headers', $headers, $this );
 
-		if ( ! empty( $status ) )
+		if ( ! empty( $status ) ) {
 			status_header( $status );
+		}
 
 		// If Last-Modified is set to false, it should not be sent (no-cache situation).
 		if ( isset( $headers['Last-Modified'] ) && false === $headers['Last-Modified'] ) {
@@ -502,11 +522,13 @@
 			}
 		}
 
-		foreach ( (array) $headers as $name => $field_value )
-			@header("{$name}: {$field_value}");
+		foreach ( (array) $headers as $name => $field_value ) {
+			@header( "{$name}: {$field_value}" );
+		}
 
-		if ( $exit_required )
+		if ( $exit_required ) {
 			exit();
+		}
 
 		/**
 		 * Fires once the requested HTTP headers for caching, content type, etc. have been sent.
@@ -529,12 +551,13 @@
 	 */
 	public function build_query_string() {
 		$this->query_string = '';
-		foreach ( (array) array_keys($this->query_vars) as $wpvar) {
-			if ( '' != $this->query_vars[$wpvar] ) {
-				$this->query_string .= (strlen($this->query_string) < 1) ? '' : '&';
-				if ( !is_scalar($this->query_vars[$wpvar]) ) // Discard non-scalars.
+		foreach ( (array) array_keys( $this->query_vars ) as $wpvar ) {
+			if ( '' != $this->query_vars[ $wpvar ] ) {
+				$this->query_string .= (strlen( $this->query_string ) < 1) ? '' : '&';
+				if ( ! is_scalar( $this->query_vars[ $wpvar ] ) ) { // Discard non-scalars.
 					continue;
-				$this->query_string .= $wpvar . '=' . rawurlencode($this->query_vars[$wpvar]);
+				}
+				$this->query_string .= $wpvar . '=' . rawurlencode( $this->query_vars[ $wpvar ] );
 			}
 		}
 
@@ -548,7 +571,7 @@
 			 * @param string $query_string The query string to modify.
 			 */
 			$this->query_string = apply_filters( 'query_string', $this->query_string );
-			parse_str($this->query_string, $this->query_vars);
+			parse_str( $this->query_string, $this->query_vars );
 		}
 	}
 
@@ -589,8 +612,9 @@
 			$GLOBALS['single'] = 1;
 		}
 
-		if ( $wp_query->is_author() && isset( $wp_query->post ) )
+		if ( $wp_query->is_author() && isset( $wp_query->post ) ) {
 			$GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );
+		}
 	}
 
 	/**
@@ -614,10 +638,10 @@
 	public function query_posts() {
 		global $wp_the_query;
 		$this->build_query_string();
-		$wp_the_query->query($this->query_vars);
- 	}
+		$wp_the_query->query( $this->query_vars );
+	}
 
- 	/**
+	 /**
 	 * Set the Headers for 404, if nothing is found for requested URL.
 	 *
 	 * Issue a 404 if a request doesn't match any posts and doesn't match
@@ -631,10 +655,10 @@
 	 * a 404 so that canonical redirection logic can kick in.
 	 *
 	 * @since 2.0.0
-     * @access public
+	 * @access public
 	 *
 	 * @global WP_Query $wp_query
- 	 */
+	  */
 	public function handle_404() {
 		global $wp_query;
 
@@ -654,8 +678,9 @@
 		}
 
 		// If we've already issued a 404, bail.
-		if ( is_404() )
+		if ( is_404() ) {
 			return;
+		}
 
 		// Never 404 for the admin, robots, or if we found posts.
 		if ( is_admin() || is_robots() || $wp_query->posts ) {
@@ -728,9 +753,9 @@
 	 *
 	 * @param string|array $query_args Passed to parse_request().
 	 */
-	public function main($query_args = '') {
+	public function main( $query_args = '' ) {
 		$this->init();
-		$this->parse_request($query_args);
+		$this->parse_request( $query_args );
 		$this->send_headers();
 		$this->query_posts();
 		$this->handle_404();
Index: src/wp-includes/class.wp-dependencies.php
===================================================================
--- src/wp-includes/class.wp-dependencies.php	(revision 40901)
+++ src/wp-includes/class.wp-dependencies.php	(working copy)
@@ -104,17 +104,18 @@
 		$this->all_deps( $handles );
 
 		foreach ( $this->to_do as $key => $handle ) {
-			if ( !in_array($handle, $this->done, true) && isset($this->registered[$handle]) ) {
+			if ( ! in_array( $handle, $this->done, true ) && isset( $this->registered[ $handle ] ) ) {
 				/*
 				 * Attempt to process the item. If successful,
 				 * add the handle to the done array.
 				 *
 				 * Unset the item from the to_do array.
 				 */
-				if ( $this->do_item( $handle, $group ) )
+				if ( $this->do_item( $handle, $group ) ) {
 					$this->done[] = $handle;
+				}
 
-				unset( $this->to_do[$key] );
+				unset( $this->to_do[ $key ] );
 			}
 		}
 
@@ -131,7 +132,7 @@
 	 * @return bool True on success, false if not set.
 	 */
 	public function do_item( $handle ) {
-		return isset($this->registered[$handle]);
+		return isset( $this->registered[ $handle ] );
 	}
 
 	/**
@@ -151,46 +152,52 @@
 	 * @return bool True on success, false on failure.
 	 */
 	public function all_deps( $handles, $recursion = false, $group = false ) {
-		if ( !$handles = (array) $handles )
+		if ( ! $handles = (array) $handles ) {
 			return false;
+		}
 
 		foreach ( $handles as $handle ) {
-			$handle_parts = explode('?', $handle);
+			$handle_parts = explode( '?', $handle );
 			$handle = $handle_parts[0];
-			$queued = in_array($handle, $this->to_do, true);
+			$queued = in_array( $handle, $this->to_do, true );
 
-			if ( in_array($handle, $this->done, true) ) // Already done
+			if ( in_array( $handle, $this->done, true ) ) { // Already done
 				continue;
+			}
 
 			$moved     = $this->set_group( $handle, $recursion, $group );
 			$new_group = $this->groups[ $handle ];
 
-			if ( $queued && !$moved ) // already queued and in the right group
+			if ( $queued && ! $moved ) { // already queued and in the right group
 				continue;
+			}
 
 			$keep_going = true;
-			if ( !isset($this->registered[$handle]) )
+			if ( ! isset( $this->registered[ $handle ] ) ) {
 				$keep_going = false; // Item doesn't exist.
-			elseif ( $this->registered[$handle]->deps && array_diff($this->registered[$handle]->deps, array_keys($this->registered)) )
+			} elseif ( $this->registered[ $handle ]->deps && array_diff( $this->registered[ $handle ]->deps, array_keys( $this->registered ) ) ) {
 				$keep_going = false; // Item requires dependencies that don't exist.
-			elseif ( $this->registered[$handle]->deps && !$this->all_deps( $this->registered[$handle]->deps, true, $new_group ) )
+			} elseif ( $this->registered[ $handle ]->deps && ! $this->all_deps( $this->registered[ $handle ]->deps, true, $new_group ) ) {
 				$keep_going = false; // Item requires dependencies that don't exist.
+			}
 
 			if ( ! $keep_going ) { // Either item or its dependencies don't exist.
-				if ( $recursion )
+				if ( $recursion ) {
 					return false; // Abort this branch.
-				else
-					continue; // We're at the top level. Move on to the next one.
+				} else { continue; // End if().
+				}
 			}
 
-			if ( $queued ) // Already grabbed it and its dependencies.
+			if ( $queued ) { // Already grabbed it and its dependencies.
 				continue;
+			}
 
-			if ( isset($handle_parts[1]) )
-				$this->args[$handle] = $handle_parts[1];
+			if ( isset( $handle_parts[1] ) ) {
+				$this->args[ $handle ] = $handle_parts[1];
+			}
 
 			$this->to_do[] = $handle;
-		}
+		}// End foreach().
 
 		return true;
 	}
@@ -215,9 +222,10 @@
 	 * @return bool Whether the item has been registered. True on success, false on failure.
 	 */
 	public function add( $handle, $src, $deps = array(), $ver = false, $args = null ) {
-		if ( isset($this->registered[$handle]) )
+		if ( isset( $this->registered[ $handle ] ) ) {
 			return false;
-		$this->registered[$handle] = new _WP_Dependency( $handle, $src, $deps, $ver, $args );
+		}
+		$this->registered[ $handle ] = new _WP_Dependency( $handle, $src, $deps, $ver, $args );
 		return true;
 	}
 
@@ -235,10 +243,11 @@
 	 * @return bool True on success, false on failure.
 	 */
 	public function add_data( $handle, $key, $value ) {
-		if ( !isset( $this->registered[$handle] ) )
+		if ( ! isset( $this->registered[ $handle ] ) ) {
 			return false;
+		}
 
-		return $this->registered[$handle]->add_data( $key, $value );
+		return $this->registered[ $handle ]->add_data( $key, $value );
 	}
 
 	/**
@@ -254,13 +263,15 @@
 	 * @return mixed Extra item data (string), false otherwise.
 	 */
 	public function get_data( $handle, $key ) {
-		if ( !isset( $this->registered[$handle] ) )
+		if ( ! isset( $this->registered[ $handle ] ) ) {
 			return false;
+		}
 
-		if ( !isset( $this->registered[$handle]->extra[$key] ) )
+		if ( ! isset( $this->registered[ $handle ]->extra[ $key ] ) ) {
 			return false;
+		}
 
-		return $this->registered[$handle]->extra[$key];
+		return $this->registered[ $handle ]->extra[ $key ];
 	}
 
 	/**
@@ -274,8 +285,9 @@
 	 * @return void
 	 */
 	public function remove( $handles ) {
-		foreach ( (array) $handles as $handle )
-			unset($this->registered[$handle]);
+		foreach ( (array) $handles as $handle ) {
+			unset( $this->registered[ $handle ] );
+		}
 	}
 
 	/**
@@ -294,11 +306,12 @@
 	 */
 	public function enqueue( $handles ) {
 		foreach ( (array) $handles as $handle ) {
-			$handle = explode('?', $handle);
-			if ( !in_array($handle[0], $this->queue) && isset($this->registered[$handle[0]]) ) {
+			$handle = explode( '?', $handle );
+			if ( ! in_array( $handle[0], $this->queue ) && isset( $this->registered[ $handle[0] ] ) ) {
 				$this->queue[] = $handle[0];
-				if ( isset($handle[1]) )
-					$this->args[$handle[0]] = $handle[1];
+				if ( isset( $handle[1] ) ) {
+					$this->args[ $handle[0] ] = $handle[1];
+				}
 			}
 		}
 	}
@@ -317,11 +330,11 @@
 	 */
 	public function dequeue( $handles ) {
 		foreach ( (array) $handles as $handle ) {
-			$handle = explode('?', $handle);
-			$key = array_search($handle[0], $this->queue);
+			$handle = explode( '?', $handle );
+			$key = array_search( $handle[0], $this->queue );
 			if ( false !== $key ) {
-				unset($this->queue[$key]);
-				unset($this->args[$handle[0]]);
+				unset( $this->queue[ $key ] );
+				unset( $this->args[ $handle[0] ] );
 			}
 		}
 	}
@@ -366,8 +379,9 @@
 		switch ( $list ) {
 			case 'registered' :
 			case 'scripts': // back compat
-				if ( isset( $this->registered[ $handle ] ) )
+				if ( isset( $this->registered[ $handle ] ) ) {
 					return $this->registered[ $handle ];
+				}
 				return false;
 
 			case 'enqueued' :
Index: src/wp-includes/class.wp-scripts.php
===================================================================
--- src/wp-includes/class.wp-scripts.php	(revision 40901)
+++ src/wp-includes/class.wp-scripts.php	(working copy)
@@ -159,7 +159,7 @@
 		 *
 		 * @param WP_Scripts &$this WP_Scripts instance, passed by reference.
 		 */
-		do_action_ref_array( 'wp_default_scripts', array(&$this) );
+		do_action_ref_array( 'wp_default_scripts', array( &$this ) );
 	}
 
 	/**
@@ -213,11 +213,13 @@
 	 * @return bool|string|void Void if no data exists, extra scripts if `$echo` is true, true otherwise.
 	 */
 	public function print_extra_script( $handle, $echo = true ) {
-		if ( !$output = $this->get_data( $handle, 'data' ) )
+		if ( ! $output = $this->get_data( $handle, 'data' ) ) {
 			return;
+		}
 
-		if ( !$echo )
+		if ( ! $echo ) {
 			return $output;
+		}
 
 		echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5
 		echo "/* <![CDATA[ */\n";
@@ -242,18 +244,20 @@
 	 * @return bool True on success, false on failure.
 	 */
 	public function do_item( $handle, $group = false ) {
-		if ( !parent::do_item($handle) )
+		if ( ! parent::do_item( $handle ) ) {
 			return false;
+		}
 
-		if ( 0 === $group && $this->groups[$handle] > 0 ) {
+		if ( 0 === $group && $this->groups[ $handle ] > 0 ) {
 			$this->in_footer[] = $handle;
 			return false;
 		}
 
-		if ( false === $group && in_array($handle, $this->in_footer, true) )
+		if ( false === $group && in_array( $handle, $this->in_footer, true ) ) {
 			$this->in_footer = array_diff( $this->in_footer, (array) $handle );
+		}
 
-		$obj = $this->registered[$handle];
+		$obj = $this->registered[ $handle ];
 
 		if ( null === $obj->ver ) {
 			$ver = '';
@@ -261,8 +265,9 @@
 			$ver = $obj->ver ? $obj->ver : $this->default_version;
 		}
 
-		if ( isset($this->args[$handle]) )
-			$ver = $ver ? $ver . '&amp;' . $this->args[$handle] : $this->args[$handle];
+		if ( isset( $this->args[ $handle ] ) ) {
+			$ver = $ver ? $ver . '&amp;' . $this->args[ $handle ] : $this->args[ $handle ];
+		}
 
 		$src = $obj->src;
 		$cond_before = $cond_after = '';
@@ -333,14 +338,16 @@
 			$src = $this->base_url . $src;
 		}
 
-		if ( ! empty( $ver ) )
+		if ( ! empty( $ver ) ) {
 			$src = add_query_arg( 'ver', $ver, $src );
+		}
 
 		/** This filter is documented in wp-includes/class.wp-scripts.php */
 		$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
 
-		if ( ! $src )
+		if ( ! $src ) {
 			return true;
+		}
 
 		$tag = "{$cond_before}{$before_handle}<script type='text/javascript' src='$src'></script>\n{$after_handle}{$cond_after}";
 
@@ -432,30 +439,34 @@
 	 * @return bool
 	 */
 	public function localize( $handle, $object_name, $l10n ) {
-		if ( $handle === 'jquery' )
+		if ( $handle === 'jquery' ) {
 			$handle = 'jquery-core';
+		}
 
-		if ( is_array($l10n) && isset($l10n['l10n_print_after']) ) { // back compat, preserve the code in 'l10n_print_after' if present
+		if ( is_array( $l10n ) && isset( $l10n['l10n_print_after'] ) ) { // back compat, preserve the code in 'l10n_print_after' if present
 			$after = $l10n['l10n_print_after'];
-			unset($l10n['l10n_print_after']);
+			unset( $l10n['l10n_print_after'] );
 		}
 
 		foreach ( (array) $l10n as $key => $value ) {
-			if ( !is_scalar($value) )
+			if ( ! is_scalar( $value ) ) {
 				continue;
+			}
 
-			$l10n[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
+			$l10n[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
 		}
 
 		$script = "var $object_name = " . wp_json_encode( $l10n ) . ';';
 
-		if ( !empty($after) )
+		if ( ! empty( $after ) ) {
 			$script .= "\n$after;";
+		}
 
 		$data = $this->get_data( $handle, 'data' );
 
-		if ( !empty( $data ) )
+		if ( ! empty( $data ) ) {
 			$script = "$data\n$script";
+		}
 
 		return $this->add_data( $handle, 'data', $script );
 	}
@@ -474,20 +485,21 @@
 	 * @return bool Not already in the group or a lower group
 	 */
 	public function set_group( $handle, $recursion, $group = false ) {
-		if ( isset( $this->registered[$handle]->args ) && $this->registered[$handle]->args === 1 )
+		if ( isset( $this->registered[ $handle ]->args ) && $this->registered[ $handle ]->args === 1 ) {
 			$grp = 1;
-		else
-			$grp = (int) $this->get_data( $handle, 'group' );
+		} else { $grp = (int) $this->get_data( $handle, 'group' );
+		}
 
-		if ( false !== $group && $grp > $group )
+		if ( false !== $group && $grp > $group ) {
 			$grp = $group;
+		}
 
 		return parent::set_group( $handle, $recursion, $grp );
 	}
 
 	/**
 	 * Determines script dependencies.
-     *
+	 *
 	 * @since 2.1.0
 	 * @access public
 	 *
@@ -524,7 +536,7 @@
 	 * @return array Handles of items that have been processed.
 	 */
 	public function do_head_items() {
-		$this->do_items(false, 0);
+		$this->do_items( false, 0 );
 		return $this->done;
 	}
 
@@ -539,7 +551,7 @@
 	 * @return array Handles of items that have been processed.
 	 */
 	public function do_footer_items() {
-		$this->do_items(false, 1);
+		$this->do_items( false, 1 );
 		return $this->done;
 	}
 
Index: src/wp-includes/class.wp-styles.php
===================================================================
--- src/wp-includes/class.wp-styles.php	(revision 40901)
+++ src/wp-includes/class.wp-styles.php	(working copy)
@@ -124,7 +124,7 @@
 		 *
 		 * @param WP_Styles &$this WP_Styles instance, passed by reference.
 		 */
-		do_action_ref_array( 'wp_default_styles', array(&$this) );
+		do_action_ref_array( 'wp_default_styles', array( &$this ) );
 	}
 
 	/**
@@ -139,20 +139,22 @@
 	 * @return bool True on success, false on failure.
 	 */
 	public function do_item( $handle ) {
-		if ( !parent::do_item($handle) )
+		if ( ! parent::do_item( $handle ) ) {
 			return false;
+		}
 
-		$obj = $this->registered[$handle];
-		if ( null === $obj->ver )
+		$obj = $this->registered[ $handle ];
+		if ( null === $obj->ver ) {
 			$ver = '';
-		else
-			$ver = $obj->ver ? $obj->ver : $this->default_version;
+		} else { $ver = $obj->ver ? $obj->ver : $this->default_version;
+		}
 
-		if ( isset($this->args[$handle]) )
-			$ver = $ver ? $ver . '&amp;' . $this->args[$handle] : $this->args[$handle];
+		if ( isset( $this->args[ $handle ] ) ) {
+			$ver = $ver ? $ver . '&amp;' . $this->args[ $handle ] : $this->args[ $handle ];
+		}
 
 		if ( $this->do_concat ) {
-			if ( $this->in_default_dir($obj->src) && !isset($obj->extra['conditional']) && !isset($obj->extra['alt']) ) {
+			if ( $this->in_default_dir( $obj->src ) && ! isset( $obj->extra['conditional'] ) && ! isset( $obj->extra['alt'] ) ) {
 				$this->concat .= "$handle,";
 				$this->concat_version .= "$handle$ver";
 
@@ -162,10 +164,10 @@
 			}
 		}
 
-		if ( isset($obj->args) )
+		if ( isset( $obj->args ) ) {
 			$media = esc_attr( $obj->args );
-		else
-			$media = 'all';
+		} else { $media = 'all';
+		}
 
 		// A single item may alias a set of items, by having dependencies, but no source.
 		if ( ! $obj->src ) {
@@ -185,8 +187,8 @@
 			return true;
 		}
 
-		$rel = isset($obj->extra['alt']) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';
-		$title = isset($obj->extra['title']) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : '';
+		$rel = isset( $obj->extra['alt'] ) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';
+		$title = isset( $obj->extra['title'] ) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : '';
 
 		/**
 		 * Filters the HTML link tag of an enqueued style.
@@ -200,11 +202,11 @@
 		 * @param string $href   The stylesheet's source URL.
 		 * @param string $media  The stylesheet's media attribute.
 		 */
-		$tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle, $href, $media);
-		if ( 'rtl' === $this->text_direction && isset($obj->extra['rtl']) && $obj->extra['rtl'] ) {
+		$tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle, $href, $media );
+		if ( 'rtl' === $this->text_direction && isset( $obj->extra['rtl'] ) && $obj->extra['rtl'] ) {
 			if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) {
 				$suffix = isset( $obj->extra['suffix'] ) ? $obj->extra['suffix'] : '';
-				$rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $obj->src , $ver, "$handle-rtl" ));
+				$rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $obj->src , $ver, "$handle-rtl" ) );
 			} else {
 				$rtl_href = $this->_css_href( $obj->extra['rtl'], $ver, "$handle-rtl" );
 			}
@@ -336,12 +338,13 @@
 	 * @return string Style's fully-qualified URL.
 	 */
 	public function _css_href( $src, $ver, $handle ) {
-		if ( !is_bool($src) && !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
+		if ( ! is_bool( $src ) && ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {
 			$src = $this->base_url . $src;
 		}
 
-		if ( !empty($ver) )
-			$src = add_query_arg('ver', $ver, $src);
+		if ( ! empty( $ver ) ) {
+			$src = add_query_arg( 'ver', $ver, $src );
+		}
 
 		/**
 		 * Filters an enqueued style's fully-qualified URL.
@@ -365,12 +368,14 @@
 	 * @return bool True if found, false if not.
 	 */
 	public function in_default_dir( $src ) {
-		if ( ! $this->default_dirs )
+		if ( ! $this->default_dirs ) {
 			return true;
+		}
 
 		foreach ( (array) $this->default_dirs as $test ) {
-			if ( 0 === strpos($src, $test) )
+			if ( 0 === strpos( $src, $test ) ) {
 				return true;
+			}
 		}
 		return false;
 	}
@@ -388,7 +393,7 @@
 	 * @return array Handles of items that have been processed.
 	 */
 	public function do_footer_items() {
-		$this->do_items(false, 1);
+		$this->do_items( false, 1 );
 		return $this->done;
 	}
 
Index: src/wp-includes/comment-template.php
===================================================================
--- src/wp-includes/comment-template.php	(revision 40901)
+++ src/wp-includes/comment-template.php	(working copy)
@@ -25,10 +25,10 @@
 	$comment = get_comment( $comment_ID );
 
 	if ( empty( $comment->comment_author ) ) {
-		if ( $comment->user_id && $user = get_userdata( $comment->user_id ) )
+		if ( $comment->user_id && $user = get_userdata( $comment->user_id ) ) {
 			$author = $user->display_name;
-		else
-			$author = __('Anonymous');
+		} else { $author = __( 'Anonymous' );
+		}
 	} else {
 		$author = $comment->comment_author;
 	}
@@ -189,11 +189,11 @@
 	 */
 	$email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
 
-	if ((!empty($email)) && ($email != '@')) {
-	$display = ($linktext != '') ? $linktext : $email;
+	if ( ( ! empty( $email )) && ($email != '@') ) {
+		$display = ($linktext != '') ? $linktext : $email;
 		$return  = $before;
 		$return .= sprintf( '<a href="%1$s">%2$s</a>', esc_url( 'mailto:' . $email ), esc_html( $display ) );
-	 	$return .= $after;
+		 $return .= $after;
 		return $return;
 	} else {
 		return '';
@@ -218,10 +218,10 @@
 	$url     = get_comment_author_url( $comment );
 	$author  = get_comment_author( $comment );
 
-	if ( empty( $url ) || 'http://' == $url )
+	if ( empty( $url ) || 'http://' == $url ) {
 		$return = $author;
-	else
-		$return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
+	} else { $return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
+	}
 
 	/**
 	 * Filters the comment author's link for display.
@@ -376,8 +376,8 @@
 	$display = str_replace( 'http://www.', '', $display );
 	$display = str_replace( 'http://', '', $display );
 
-	if ( '/' == substr($display, -1) ) {
-		$display = substr($display, 0, -1);
+	if ( '/' == substr( $display, -1 ) ) {
+		$display = substr( $display, 0, -1 );
 	}
 
 	$return = "$before<a href='$url' rel='external'>$display</a>$after";
@@ -428,10 +428,10 @@
 function comment_class( $class = '', $comment = null, $post_id = null, $echo = true ) {
 	// Separates classes with a single space, collates classes for comment DIV
 	$class = 'class="' . join( ' ', get_comment_class( $class, $comment, $post_id ) ) . '"';
-	if ( $echo)
+	if ( $echo ) {
 		echo $class;
-	else
-		return $class;
+	} else { return $class;
+	}
 }
 
 /**
@@ -467,19 +467,22 @@
 		$classes[] = 'byuser';
 		$classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id );
 		// For comment authors who are the author of the post
-		if ( $post = get_post($post_id) ) {
+		if ( $post = get_post( $post_id ) ) {
 			if ( $comment->user_id === $post->post_author ) {
 				$classes[] = 'bypostauthor';
 			}
 		}
 	}
 
-	if ( empty($comment_alt) )
+	if ( empty( $comment_alt ) ) {
 		$comment_alt = 0;
-	if ( empty($comment_depth) )
+	}
+	if ( empty( $comment_depth ) ) {
 		$comment_depth = 1;
-	if ( empty($comment_thread_alt) )
+	}
+	if ( empty( $comment_thread_alt ) ) {
 		$comment_thread_alt = 0;
+	}
 
 	if ( $comment_alt % 2 ) {
 		$classes[] = 'odd';
@@ -503,13 +506,14 @@
 
 	$classes[] = "depth-$comment_depth";
 
-	if ( !empty($class) ) {
-		if ( !is_array( $class ) )
-			$class = preg_split('#\s+#', $class);
-		$classes = array_merge($classes, $class);
+	if ( ! empty( $class ) ) {
+		if ( ! is_array( $class ) ) {
+			$class = preg_split( '#\s+#', $class );
+		}
+		$classes = array_merge( $classes, $class );
 	}
 
-	$classes = array_map('esc_attr', $classes);
+	$classes = array_map( 'esc_attr', $classes );
 
 	/**
 	 * Filters the returned CSS classes for the current comment.
@@ -538,10 +542,10 @@
  */
 function get_comment_date( $d = '', $comment_ID = 0 ) {
 	$comment = get_comment( $comment_ID );
-	if ( '' == $d )
-		$date = mysql2date(get_option('date_format'), $comment->comment_date);
-	else
-		$date = mysql2date($d, $comment->comment_date);
+	if ( '' == $d ) {
+		$date = mysql2date( get_option( 'date_format' ), $comment->comment_date );
+	} else { $date = mysql2date( $d, $comment->comment_date );
+	}
 	/**
 	 * Filters the returned comment date.
 	 *
@@ -702,11 +706,13 @@
 function get_comment_link( $comment = null, $args = array() ) {
 	global $wp_rewrite, $in_comment_loop;
 
-	$comment = get_comment($comment);
+	$comment = get_comment( $comment );
 
 	// Back-compat.
 	if ( ! is_array( $args ) ) {
-		$args = array( 'page' => $args );
+		$args = array(
+			'page' => $args,
+		);
 	}
 
 	$defaults = array(
@@ -724,10 +730,10 @@
 	if ( ! is_null( $args['cpage'] ) ) {
 		$cpage = $args['cpage'];
 
-	// No 'cpage' is provided, so we calculate one.
+		// No 'cpage' is provided, so we calculate one.
 	} else {
 		if ( '' === $args['per_page'] && get_option( 'page_comments' ) ) {
-			$args['per_page'] = get_option('comments_per_page');
+			$args['per_page'] = get_option( 'comments_per_page' );
 		}
 
 		if ( empty( $args['per_page'] ) ) {
@@ -765,7 +771,6 @@
 		} elseif ( $cpage ) {
 			$link = add_query_arg( 'cpage', $cpage, $link );
 		}
-
 	}
 
 	if ( $wp_rewrite->using_permalinks() ) {
@@ -822,10 +827,12 @@
  * @param string $deprecated_2 Not Used.
  */
 function comments_link( $deprecated = '', $deprecated_2 = '' ) {
-	if ( !empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '0.72' );
-	if ( !empty( $deprecated_2 ) )
+	}
+	if ( ! empty( $deprecated_2 ) ) {
 		_deprecated_argument( __FUNCTION__, '1.3.0' );
+	}
 	echo esc_url( get_comments_link() );
 }
 
@@ -1010,10 +1017,10 @@
 	$comment = get_comment();
 
 	$comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
-	if ( '' == $d )
-		$date = mysql2date(get_option('time_format'), $comment_date, $translate);
-	else
-		$date = mysql2date($d, $comment_date, $translate);
+	if ( '' == $d ) {
+		$date = mysql2date( get_option( 'time_format' ), $comment_date, $translate );
+	} else { $date = mysql2date( $d, $comment_date, $translate );
+	}
 
 	/**
 	 * Filters the returned comment time.
@@ -1037,7 +1044,7 @@
  * @param string $d Optional. The format of the time. Default user's settings.
  */
 function comment_time( $d = '' ) {
-	echo get_comment_time($d);
+	echo get_comment_time( $d );
 }
 
 /**
@@ -1052,8 +1059,9 @@
  */
 function get_comment_type( $comment_ID = 0 ) {
 	$comment = get_comment( $comment_ID );
-	if ( '' == $comment->comment_type )
+	if ( '' == $comment->comment_type ) {
 		$comment->comment_type = 'comment';
+	}
 
 	/**
 	 * Filters the returned comment type.
@@ -1078,11 +1086,14 @@
  * @param string $pingbacktxt  Optional. String to display for pingback type. Default false.
  */
 function comment_type( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false ) {
-	if ( false === $commenttxt ) $commenttxt = _x( 'Comment', 'noun' );
-	if ( false === $trackbacktxt ) $trackbacktxt = __( 'Trackback' );
-	if ( false === $pingbacktxt ) $pingbacktxt = __( 'Pingback' );
+	if ( false === $commenttxt ) { $commenttxt = _x( 'Comment', 'noun' );
+	}
+	if ( false === $trackbacktxt ) { $trackbacktxt = __( 'Trackback' );
+	}
+	if ( false === $pingbacktxt ) { $pingbacktxt = __( 'Pingback' );
+	}
 	$type = get_comment_type();
-	switch( $type ) {
+	switch ( $type ) {
 		case 'trackback' :
 			echo $trackbacktxt;
 			break;
@@ -1106,10 +1117,10 @@
  * @return string The trackback URL after being filtered.
  */
 function get_trackback_url() {
-	if ( '' != get_option('permalink_structure') )
-		$tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
-	else
-		$tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID();
+	if ( '' != get_option( 'permalink_structure' ) ) {
+		$tb_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' );
+	} else { $tb_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID();
+	}
 
 	/**
 	 * Filters the returned trackback URL.
@@ -1170,12 +1181,12 @@
 			xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
 		<rdf:Description rdf:about="';
 	the_permalink();
-	echo '"'."\n";
+	echo '"' . "\n";
 	echo '    dc:identifier="';
 	the_permalink();
-	echo '"'."\n";
-	echo '    dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n";
-	echo '    trackback:ping="'.get_trackback_url().'"'." />\n";
+	echo '"' . "\n";
+	echo '    dc:title="' . str_replace( '--', '&#x2d;&#x2d;', wptexturize( strip_tags( get_the_title() ) ) ) . '"' . "\n";
+	echo '    trackback:ping="' . get_trackback_url() . '"' . " />\n";
 	echo '</rdf:RDF>';
 }
 
@@ -1189,7 +1200,7 @@
  */
 function comments_open( $post_id = null ) {
 
-	$_post = get_post($post_id);
+	$_post = get_post( $post_id );
 
 	$post_id = $_post ? $_post->ID : 0;
 	$open = ( 'open' == $_post->comment_status );
@@ -1215,7 +1226,7 @@
  */
 function pings_open( $post_id = null ) {
 
-	$_post = get_post($post_id);
+	$_post = get_post( $post_id );
 
 	$post_id = $_post ? $_post->ID : 0;
 	$open = ( 'open' == $_post->ping_status );
@@ -1293,13 +1304,15 @@
 function comments_template( $file = '/comments.php', $separate_comments = false ) {
 	global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
 
-	if ( !(is_single() || is_page() || $withcomments) || empty($post) )
+	if ( ! (is_single() || is_page() || $withcomments) || empty( $post ) ) {
 		return;
+	}
 
-	if ( empty($file) )
+	if ( empty( $file ) ) {
 		$file = '/comments.php';
+	}
 
-	$req = get_option('require_name_email');
+	$req = get_option( 'require_name_email' );
 
 	/*
 	 * Comment author information fetched from the comment cookies.
@@ -1321,7 +1334,7 @@
 	/*
 	 * The url of the current comment author escaped for use in attributes.
 	 */
-	$comment_author_url = esc_url($commenter['comment_author_url']);
+	$comment_author_url = esc_url( $commenter['comment_author_url'] );
 
 	$comment_args = array(
 		'orderby' => 'comment_date_gmt',
@@ -1332,7 +1345,7 @@
 		'update_comment_meta_cache' => false, // We lazy-load comment meta for performance.
 	);
 
-	if ( get_option('thread_comments') ) {
+	if ( get_option( 'thread_comments' ) ) {
 		$comment_args['hierarchical'] = 'threaded';
 	} else {
 		$comment_args['hierarchical'] = false;
@@ -1380,7 +1393,7 @@
 
 			$comment_args['offset'] = ( ceil( $top_level_count / $per_page ) - 1 ) * $per_page;
 		}
-	}
+	}// End if().
 
 	/**
 	 * Filters the arguments used to query comments in comments_template().
@@ -1417,7 +1430,7 @@
 			$comment_children = $_comment->get_children( array(
 				'format' => 'flat',
 				'status' => $comment_args['status'],
-				'orderby' => $comment_args['orderby']
+				'orderby' => $comment_args['orderby'],
 			) );
 
 			foreach ( $comment_children as $comment_child ) {
@@ -1439,11 +1452,11 @@
 	$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );
 
 	$comments = &$wp_query->comments;
-	$wp_query->comment_count = count($wp_query->comments);
+	$wp_query->comment_count = count( $wp_query->comments );
 	$wp_query->max_num_comment_pages = $comment_query->max_num_pages;
 
 	if ( $separate_comments ) {
-		$wp_query->comments_by_type = separate_comments($comments);
+		$wp_query->comments_by_type = separate_comments( $comments );
 		$comments_by_type = &$wp_query->comments_by_type;
 	} else {
 		$wp_query->comments_by_type = array();
@@ -1451,12 +1464,13 @@
 
 	$overridden_cpage = false;
 	if ( '' == get_query_var( 'cpage' ) && $wp_query->max_num_comment_pages > 1 ) {
-		set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 );
+		set_query_var( 'cpage', 'newest' == get_option( 'default_comments_page' ) ? get_comment_pages_count() : 1 );
 		$overridden_cpage = true;
 	}
 
-	if ( !defined('COMMENTS_TEMPLATE') )
-		define('COMMENTS_TEMPLATE', true);
+	if ( ! defined( 'COMMENTS_TEMPLATE' ) ) {
+		define( 'COMMENTS_TEMPLATE', true );
+	}
 
 	$theme_template = STYLESHEETPATH . $file;
 	/**
@@ -1467,12 +1481,13 @@
 	 * @param string $theme_template The path to the theme template file.
 	 */
 	$include = apply_filters( 'comments_template', $theme_template );
-	if ( file_exists( $include ) )
+	if ( file_exists( $include ) ) {
 		require( $include );
-	elseif ( file_exists( TEMPLATEPATH . $file ) )
+	} elseif ( file_exists( TEMPLATEPATH . $file ) ) {
 		require( TEMPLATEPATH . $file );
-	else // Backward compat code will be removed in a future release
-		require( ABSPATH . WPINC . '/theme-compat/comments.php');
+	} else { // End if().
+		require( ABSPATH . WPINC . '/theme-compat/comments.php' );
+	}
 }
 
 /**
@@ -1515,8 +1530,8 @@
 		$none = sprintf( __( 'Comments Off<span class="screen-reader-text"> on %s</span>' ), $title );
 	}
 
-	if ( 0 == $number && !comments_open() && !pings_open() ) {
-		echo '<span' . ((!empty($css_class)) ? ' class="' . esc_attr( $css_class ) . '"' : '') . '>' . $none . '</span>';
+	if ( 0 == $number && ! comments_open() && ! pings_open() ) {
+		echo '<span' . (( ! empty( $css_class )) ? ' class="' . esc_attr( $css_class ) . '"' : '') . '>' . $none . '</span>';
 		return;
 	}
 
@@ -1542,8 +1557,8 @@
 	}
 	echo '"';
 
-	if ( !empty( $css_class ) ) {
-		echo ' class="'.$css_class.'" ';
+	if ( ! empty( $css_class ) ) {
+		echo ' class="' . $css_class . '" ';
 	}
 
 	$attributes = '';
@@ -1600,7 +1615,7 @@
 		'max_depth'     => 0,
 		'depth'         => 0,
 		'before'        => '',
-		'after'         => ''
+		'after'         => '',
 	);
 
 	$args = wp_parse_args( $args, $defaults );
@@ -1644,7 +1659,7 @@
 		);
 
 		$link = sprintf( "<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>",
-			esc_url( add_query_arg( 'replytocom', $comment->comment_ID, get_permalink( $post->ID ) ) ) . "#" . $args['respond_id'],
+			esc_url( add_query_arg( 'replytocom', $comment->comment_ID, get_permalink( $post->ID ) ) ) . '#' . $args['respond_id'],
 			$onclick,
 			esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),
 			$args['reply_text']
@@ -1677,8 +1692,8 @@
  *                             Default current post.
  * @return mixed Link to show comment form, if successful. False, if comments are closed.
  */
-function comment_reply_link($args = array(), $comment = null, $post = null) {
-	echo get_comment_reply_link($args, $comment, $post);
+function comment_reply_link( $args = array(), $comment = null, $post = null ) {
+	echo get_comment_reply_link( $args, $comment, $post );
 }
 
 /**
@@ -1704,25 +1719,25 @@
  *                             Default current post.
  * @return false|null|string Link to show comment form, if successful. False, if comments are closed.
  */
-function get_post_reply_link($args = array(), $post = null) {
+function get_post_reply_link( $args = array(), $post = null ) {
 	$defaults = array(
 		'add_below'  => 'post',
 		'respond_id' => 'respond',
-		'reply_text' => __('Leave a Comment'),
-		'login_text' => __('Log in to leave a Comment'),
+		'reply_text' => __( 'Leave a Comment' ),
+		'login_text' => __( 'Log in to leave a Comment' ),
 		'before'     => '',
 		'after'      => '',
 	);
 
-	$args = wp_parse_args($args, $defaults);
+	$args = wp_parse_args( $args, $defaults );
 
-	$post = get_post($post);
+	$post = get_post( $post );
 
 	if ( ! comments_open( $post->ID ) ) {
 		return false;
 	}
 
-	if ( get_option('comment_registration') && ! is_user_logged_in() ) {
+	if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {
 		$link = sprintf( '<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>',
 			wp_login_url( get_permalink() ),
 			$args['login_text']
@@ -1763,8 +1778,8 @@
  *                          Default current post.
  * @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
  */
-function post_reply_link($args = array(), $post = null) {
-	echo get_post_reply_link($args, $post);
+function post_reply_link( $args = array(), $post = null ) {
+	echo get_post_reply_link( $args, $post );
 }
 
 /**
@@ -1776,11 +1791,12 @@
  * @return string
  */
 function get_cancel_comment_reply_link( $text = '' ) {
-	if ( empty($text) )
-		$text = __('Click here to cancel reply.');
+	if ( empty( $text ) ) {
+		$text = __( 'Click here to cancel reply.' );
+	}
 
-	$style = isset($_GET['replytocom']) ? '' : ' style="display:none;"';
-	$link = esc_html( remove_query_arg('replytocom') ) . '#respond';
+	$style = isset( $_GET['replytocom'] ) ? '' : ' style="display:none;"';
+	$link = esc_html( remove_query_arg( 'replytocom' ) ) . '#respond';
 
 	$formatted_link = '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>';
 
@@ -1804,7 +1820,7 @@
  * @param string $text Optional. Text to display for cancel reply link. Default empty.
  */
 function cancel_comment_reply_link( $text = '' ) {
-	echo get_cancel_comment_reply_link($text);
+	echo get_cancel_comment_reply_link( $text );
 }
 
 /**
@@ -1816,10 +1832,11 @@
  * @return string Hidden input HTML for replying to comments
  */
 function get_comment_id_fields( $id = 0 ) {
-	if ( empty( $id ) )
+	if ( empty( $id ) ) {
 		$id = get_the_ID();
+	}
 
-	$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
+	$replytoid = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0;
 	$result  = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
 	$result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";
 
@@ -1869,16 +1886,18 @@
 function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) {
 	global $comment;
 
-	if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' );
-	if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' );
+	if ( false === $noreplytext ) { $noreplytext = __( 'Leave a Reply' );
+	}
+	if ( false === $replytext ) { $replytext = __( 'Leave a Reply to %s' );
+	}
 
-	$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
+	$replytoid = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0;
 
-	if ( 0 == $replytoid )
+	if ( 0 == $replytoid ) {
 		echo $noreplytext;
-	else {
+	} else {
 		// Sets the global so that template tags can be used in the comment form.
-		$comment = get_comment($replytoid);
+		$comment = get_comment( $replytoid );
 		$author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author( $comment ) . '</a>' : get_comment_author( $comment );
 		printf( $replytext, $author );
 	}
@@ -1963,13 +1982,15 @@
 	// Figure out what comments we'll be looping through ($_comments)
 	if ( null !== $comments ) {
 		$comments = (array) $comments;
-		if ( empty($comments) )
+		if ( empty( $comments ) ) {
 			return;
+		}
 		if ( 'all' != $r['type'] ) {
-			$comments_by_type = separate_comments($comments);
-			if ( empty($comments_by_type[$r['type']]) )
+			$comments_by_type = separate_comments( $comments );
+			if ( empty( $comments_by_type[ $r['type'] ] ) ) {
 				return;
-			$_comments = $comments_by_type[$r['type']];
+			}
+			$_comments = $comments_by_type[ $r['type'] ];
 		} else {
 			$_comments = $comments;
 		}
@@ -2015,17 +2036,18 @@
 					$_comments = $comments;
 				}
 			}
-
-		// Otherwise, fall back on the comments from `$wp_query->comments`.
 		} else {
-			if ( empty($wp_query->comments) )
+			if ( empty( $wp_query->comments ) ) {
 				return;
+			}
 			if ( 'all' != $r['type'] ) {
-				if ( empty($wp_query->comments_by_type) )
-					$wp_query->comments_by_type = separate_comments($wp_query->comments);
-				if ( empty($wp_query->comments_by_type[$r['type']]) )
+				if ( empty( $wp_query->comments_by_type ) ) {
+					$wp_query->comments_by_type = separate_comments( $wp_query->comments );
+				}
+				if ( empty( $wp_query->comments_by_type[ $r['type'] ] ) ) {
 					return;
-				$_comments = $wp_query->comments_by_type[$r['type']];
+				}
+				$_comments = $wp_query->comments_by_type[ $r['type'] ];
 			} else {
 				$_comments = $wp_query->comments;
 			}
@@ -2036,10 +2058,10 @@
 				if ( 'newest' === $default_comments_page ) {
 					$r['cpage'] = $cpage;
 
-				/*
-				 * When first page shows oldest comments, post permalink is the same as
-				 * the comment permalink.
-				 */
+					/*
+					* When first page shows oldest comments, post permalink is the same as
+					* the comment permalink.
+					*/
 				} elseif ( $cpage == 1 ) {
 					$r['cpage'] = '';
 				} else {
@@ -2049,41 +2071,43 @@
 				$r['page'] = 0;
 				$r['per_page'] = 0;
 			}
-		}
-	}
+		}// End if().
+	}// End if().
 
 	if ( '' === $r['per_page'] && get_option( 'page_comments' ) ) {
-		$r['per_page'] = get_query_var('comments_per_page');
+		$r['per_page'] = get_query_var( 'comments_per_page' );
 	}
 
-	if ( empty($r['per_page']) ) {
+	if ( empty( $r['per_page'] ) ) {
 		$r['per_page'] = 0;
 		$r['page'] = 0;
 	}
 
 	if ( '' === $r['max_depth'] ) {
-		if ( get_option('thread_comments') )
-			$r['max_depth'] = get_option('thread_comments_depth');
-		else
-			$r['max_depth'] = -1;
+		if ( get_option( 'thread_comments' ) ) {
+			$r['max_depth'] = get_option( 'thread_comments_depth' );
+		} else { $r['max_depth'] = -1;
+		}
 	}
 
 	if ( '' === $r['page'] ) {
-		if ( empty($overridden_cpage) ) {
-			$r['page'] = get_query_var('cpage');
+		if ( empty( $overridden_cpage ) ) {
+			$r['page'] = get_query_var( 'cpage' );
 		} else {
 			$threaded = ( -1 != $r['max_depth'] );
-			$r['page'] = ( 'newest' == get_option('default_comments_page') ) ? get_comment_pages_count($_comments, $r['per_page'], $threaded) : 1;
+			$r['page'] = ( 'newest' == get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $r['per_page'], $threaded ) : 1;
 			set_query_var( 'cpage', $r['page'] );
 		}
 	}
 	// Validation check
-	$r['page'] = intval($r['page']);
-	if ( 0 == $r['page'] && 0 != $r['per_page'] )
+	$r['page'] = intval( $r['page'] );
+	if ( 0 == $r['page'] && 0 != $r['per_page'] ) {
 		$r['page'] = 1;
+	}
 
-	if ( null === $r['reverse_top_level'] )
-		$r['reverse_top_level'] = ( 'desc' == get_option('comment_order') );
+	if ( null === $r['reverse_top_level'] ) {
+		$r['reverse_top_level'] = ( 'desc' == get_option( 'comment_order' ) );
+	}
 
 	wp_queue_comments_for_comment_meta_lazyload( $_comments );
 
@@ -2167,8 +2191,9 @@
  * @param int|WP_Post $post_id Post ID or WP_Post object to generate the form for. Default current post.
  */
 function comment_form( $args = array(), $post_id = null ) {
-	if ( null === $post_id )
+	if ( null === $post_id ) {
 		$post_id = get_the_ID();
+	}
 
 	// Exit the function when comments for the post are closed.
 	if ( ! comments_open( $post_id ) ) {
@@ -2187,23 +2212,24 @@
 	$user_identity = $user->exists() ? $user->display_name : '';
 
 	$args = wp_parse_args( $args );
-	if ( ! isset( $args['format'] ) )
+	if ( ! isset( $args['format'] ) ) {
 		$args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
+	}
 
 	$req      = get_option( 'require_name_email' );
 	$aria_req = ( $req ? " aria-required='true'" : '' );
 	$html_req = ( $req ? " required='required'" : '' );
 	$html5    = 'html5' === $args['format'];
-	$fields   =  array(
+	$fields   = array(
 		'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
-		            '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . $html_req . ' /></p>',
+					'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . $html_req . ' /></p>',
 		'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
-		            '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . $html_req  . ' /></p>',
+					'<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . $html_req . ' /></p>',
 		'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
-		            '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
+					'<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
 	);
 
-	$required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
+	$required_text = sprintf( ' ' . __( 'Required fields are marked %s' ), '<span class="required">*</span>' );
 
 	/**
 	 * Filters the default comment form fields.
@@ -2218,21 +2244,21 @@
 		'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
 		/** This filter is documented in wp-includes/link-template.php */
 		'must_log_in'          => '<p class="must-log-in">' . sprintf(
-		                              /* translators: %s: login URL */
-		                              __( 'You must be <a href="%s">logged in</a> to post a comment.' ),
-		                              wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
-		                          ) . '</p>',
+			/* translators: %s: login URL */
+									  __( 'You must be <a href="%s">logged in</a> to post a comment.' ),
+			wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
+		) . '</p>',
 		/** This filter is documented in wp-includes/link-template.php */
 		'logged_in_as'         => '<p class="logged-in-as">' . sprintf(
-		                              /* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
-		                              __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
-		                              get_edit_user_link(),
-		                              /* translators: %s: user name */
-		                              esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
-		                              $user_identity,
-		                              wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
-		                          ) . '</p>',
-		'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>'. ( $req ? $required_text : '' ) . '</p>',
+			/* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
+									  __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
+			get_edit_user_link(),
+			/* translators: %s: user name */
+									  esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
+			$user_identity,
+			wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
+		) . '</p>',
+		'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>' . ( $req ? $required_text : '' ) . '</p>',
 		'comment_notes_after'  => '',
 		'action'               => site_url( '/wp-comments-post.php' ),
 		'id_form'              => 'commentform',
@@ -2288,7 +2314,7 @@
 
 		echo $args['title_reply_after'];
 
-		if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) :
+		if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) :
 			echo $args['must_log_in'];
 			/**
 			 * Fires after the HTML-formatted 'must log in after' message in the comment form.
@@ -2339,7 +2365,9 @@
 				endif;
 
 				// Prepare an array of all fields, including the textarea
-				$comment_fields = array( 'comment' => $args['comment_field'] ) + (array) $args['fields'];
+				$comment_fields = array(
+					'comment' => $args['comment_field'],
+				) + (array) $args['fields'];
 
 				/**
 				 * Filters the comment form fields, including the textarea.
@@ -2403,8 +2431,8 @@
 							 */
 							do_action( 'comment_form_after_fields' );
 						}
-					}
-				}
+					}// End if().
+				}// End foreach().
 
 				$submit_button = sprintf(
 					$args['submit_button'],
Index: src/wp-includes/comment.php
===================================================================
--- src/wp-includes/comment.php	(revision 40901)
+++ src/wp-includes/comment.php	(working copy)
@@ -36,12 +36,13 @@
  *		                       trackback, or pingback.
  * @return bool If all checks pass, true, otherwise false.
  */
-function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) {
+function check_comment( $author, $email, $url, $comment, $user_ip, $user_agent, $comment_type ) {
 	global $wpdb;
 
 	// If manual moderation is enabled, skip all checks and return false.
-	if ( 1 == get_option('comment_moderation') )
+	if ( 1 == get_option( 'comment_moderation' ) ) {
 		return false;
+	}
 
 	/** This filter is documented in wp-includes/comment-template.php */
 	$comment = apply_filters( 'comment_text', $comment, null, array() );
@@ -66,42 +67,50 @@
 		 * If the number of links in the comment exceeds the allowed amount,
 		 * fail the check by returning false.
 		 */
-		if ( $num_links >= $max_links )
+		if ( $num_links >= $max_links ) {
 			return false;
+		}
 	}
 
-	$mod_keys = trim(get_option('moderation_keys'));
+	$mod_keys = trim( get_option( 'moderation_keys' ) );
 
 	// If moderation 'keys' (keywords) are set, process them.
-	if ( !empty($mod_keys) ) {
-		$words = explode("\n", $mod_keys );
+	if ( ! empty( $mod_keys ) ) {
+		$words = explode( "\n", $mod_keys );
 
-		foreach ( (array) $words as $word) {
-			$word = trim($word);
+		foreach ( (array) $words as $word ) {
+			$word = trim( $word );
 
 			// Skip empty lines.
-			if ( empty($word) )
+			if ( empty( $word ) ) {
 				continue;
+			}
 
 			/*
 			 * Do some escaping magic so that '#' (number of) characters in the spam
 			 * words don't break things:
 			 */
-			$word = preg_quote($word, '#');
+			$word = preg_quote( $word, '#' );
 
 			/*
 			 * Check the comment fields for moderation keywords. If any are found,
 			 * fail the check for the given field by returning false.
 			 */
 			$pattern = "#$word#i";
-			if ( preg_match($pattern, $author) ) return false;
-			if ( preg_match($pattern, $email) ) return false;
-			if ( preg_match($pattern, $url) ) return false;
-			if ( preg_match($pattern, $comment) ) return false;
-			if ( preg_match($pattern, $user_ip) ) return false;
-			if ( preg_match($pattern, $user_agent) ) return false;
+			if ( preg_match( $pattern, $author ) ) { return false;
+			}
+			if ( preg_match( $pattern, $email ) ) { return false;
+			}
+			if ( preg_match( $pattern, $url ) ) { return false;
+			}
+			if ( preg_match( $pattern, $comment ) ) { return false;
+			}
+			if ( preg_match( $pattern, $user_ip ) ) { return false;
+			}
+			if ( preg_match( $pattern, $user_agent ) ) { return false;
+			}
 		}
-	}
+	}// End if().
 
 	/*
 	 * Check if the option to approve comments by previously-approved authors is enabled.
@@ -110,7 +119,7 @@
 	 * as well as whether there are any moderation keywords (if set) present in the author
 	 * email address. If both checks pass, return true. Otherwise, return false.
 	 */
-	if ( 1 == get_option('comment_whitelist')) {
+	if ( 1 == get_option( 'comment_whitelist' ) ) {
 		if ( 'trackback' != $comment_type && 'pingback' != $comment_type && $author != '' && $email != '' ) {
 			$comment_user = get_user_by( 'email', wp_unslash( $email ) );
 			if ( ! empty( $comment_user->ID ) ) {
@@ -120,10 +129,10 @@
 				$ok_to_comment = $wpdb->get_var( $wpdb->prepare( "SELECT comment_approved FROM $wpdb->comments WHERE comment_author = %s AND comment_author_email = %s and comment_approved = '1' LIMIT 1", $author, $email ) );
 			}
 			if ( ( 1 == $ok_to_comment ) &&
-				( empty($mod_keys) || false === strpos( $email, $mod_keys) ) )
+				( empty( $mod_keys ) || false === strpos( $email, $mod_keys ) ) ) {
 					return true;
-			else
-				return false;
+			} else { return false;
+			}
 		} else {
 			return false;
 		}
@@ -356,7 +365,7 @@
 
 	$where = '';
 	if ( $post_id > 0 ) {
-		$where = $wpdb->prepare("WHERE comment_post_ID = %d", $post_id);
+		$where = $wpdb->prepare( 'WHERE comment_post_ID = %d', $post_id );
 	}
 
 	$totals = (array) $wpdb->get_results("
@@ -422,8 +431,8 @@
  * @param bool $unique Optional, default is false. Whether the same key should not be added.
  * @return int|bool Meta ID on success, false on failure.
  */
-function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) {
-	return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique);
+function add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false ) {
+	return add_metadata( 'comment', $comment_id, $meta_key, $meta_value, $unique );
 }
 
 /**
@@ -441,8 +450,8 @@
  * @param mixed $meta_value Optional. Metadata value.
  * @return bool True on success, false on failure.
  */
-function delete_comment_meta($comment_id, $meta_key, $meta_value = '') {
-	return delete_metadata('comment', $comment_id, $meta_key, $meta_value);
+function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) {
+	return delete_metadata( 'comment', $comment_id, $meta_key, $meta_value );
 }
 
 /**
@@ -457,8 +466,8 @@
  * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
  *  is true.
  */
-function get_comment_meta($comment_id, $key = '', $single = false) {
-	return get_metadata('comment', $comment_id, $key, $single);
+function get_comment_meta( $comment_id, $key = '', $single = false ) {
+	return get_metadata( 'comment', $comment_id, $key, $single );
 }
 
 /**
@@ -478,8 +487,8 @@
  * @param mixed $prev_value Optional. Previous value to check before removing.
  * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
  */
-function update_comment_meta($comment_id, $meta_key, $meta_value, $prev_value = '') {
-	return update_metadata('comment', $comment_id, $meta_key, $meta_value, $prev_value);
+function update_comment_meta( $comment_id, $meta_key, $meta_value, $prev_value = '' ) {
+	return update_metadata( 'comment', $comment_id, $meta_key, $meta_value, $prev_value );
 }
 
 /**
@@ -515,9 +524,10 @@
  *
  * @since 3.4.0
  */
-function wp_set_comment_cookies($comment, $user) {
-	if ( $user->exists() )
+function wp_set_comment_cookies( $comment, $user ) {
+	if ( $user->exists() ) {
 		return;
+	}
 
 	/**
 	 * Filters the lifetime of the comment cookie in seconds.
@@ -530,7 +540,7 @@
 	$secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) );
 	setcookie( 'comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
 	setcookie( 'comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
-	setcookie( 'comment_author_url_' . COOKIEHASH, esc_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
+	setcookie( 'comment_author_url_' . COOKIEHASH, esc_url( $comment->comment_author_url ), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
 }
 
 /**
@@ -542,7 +552,7 @@
  * @since 2.0.4
  */
 function sanitize_comment_cookies() {
-	if ( isset( $_COOKIE['comment_author_' . COOKIEHASH] ) ) {
+	if ( isset( $_COOKIE[ 'comment_author_' . COOKIEHASH ] ) ) {
 		/**
 		 * Filters the comment author's name cookie before it is set.
 		 *
@@ -553,13 +563,13 @@
 		 *
 		 * @param string $author_cookie The comment author name cookie.
 		 */
-		$comment_author = apply_filters( 'pre_comment_author_name', $_COOKIE['comment_author_' . COOKIEHASH] );
-		$comment_author = wp_unslash($comment_author);
-		$comment_author = esc_attr($comment_author);
-		$_COOKIE['comment_author_' . COOKIEHASH] = $comment_author;
+		$comment_author = apply_filters( 'pre_comment_author_name', $_COOKIE[ 'comment_author_' . COOKIEHASH ] );
+		$comment_author = wp_unslash( $comment_author );
+		$comment_author = esc_attr( $comment_author );
+		$_COOKIE[ 'comment_author_' . COOKIEHASH ] = $comment_author;
 	}
 
-	if ( isset( $_COOKIE['comment_author_email_' . COOKIEHASH] ) ) {
+	if ( isset( $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] ) ) {
 		/**
 		 * Filters the comment author's email cookie before it is set.
 		 *
@@ -570,13 +580,13 @@
 		 *
 		 * @param string $author_email_cookie The comment author email cookie.
 		 */
-		$comment_author_email = apply_filters( 'pre_comment_author_email', $_COOKIE['comment_author_email_' . COOKIEHASH] );
-		$comment_author_email = wp_unslash($comment_author_email);
-		$comment_author_email = esc_attr($comment_author_email);
-		$_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email;
+		$comment_author_email = apply_filters( 'pre_comment_author_email', $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] );
+		$comment_author_email = wp_unslash( $comment_author_email );
+		$comment_author_email = esc_attr( $comment_author_email );
+		$_COOKIE[ 'comment_author_email_' . COOKIEHASH ] = $comment_author_email;
 	}
 
-	if ( isset( $_COOKIE['comment_author_url_' . COOKIEHASH] ) ) {
+	if ( isset( $_COOKIE[ 'comment_author_url_' . COOKIEHASH ] ) ) {
 		/**
 		 * Filters the comment author's URL cookie before it is set.
 		 *
@@ -587,9 +597,9 @@
 		 *
 		 * @param string $author_url_cookie The comment author URL cookie.
 		 */
-		$comment_author_url = apply_filters( 'pre_comment_author_url', $_COOKIE['comment_author_url_' . COOKIEHASH] );
-		$comment_author_url = wp_unslash($comment_author_url);
-		$_COOKIE['comment_author_url_'.COOKIEHASH] = $comment_author_url;
+		$comment_author_url = apply_filters( 'pre_comment_author_url', $_COOKIE[ 'comment_author_url_' . COOKIEHASH ] );
+		$comment_author_url = wp_unslash( $comment_author_url );
+		$_COOKIE[ 'comment_author_url_' . COOKIEHASH ] = $comment_author_url;
 	}
 }
 
@@ -622,12 +632,12 @@
 	);
 	if ( $commentdata['comment_author_email'] ) {
 		$dupe .= $wpdb->prepare(
-			"AND comment_author_email = %s ",
+			'AND comment_author_email = %s ',
 			wp_unslash( $commentdata['comment_author_email'] )
 		);
 	}
 	$dupe .= $wpdb->prepare(
-		") AND comment_content = %s LIMIT 1",
+		') AND comment_content = %s LIMIT 1',
 		wp_unslash( $commentdata['comment_content'] )
 	);
 
@@ -658,7 +668,7 @@
 			return new WP_Error( 'comment_duplicate', __( 'Duplicate comment detected; it looks as though you&#8217;ve already said that!' ), 409 );
 		} else {
 			if ( wp_doing_ajax() ) {
-				die( __('Duplicate comment detected; it looks as though you&#8217;ve already said that!') );
+				die( __( 'Duplicate comment detected; it looks as though you&#8217;ve already said that!' ) );
 			}
 
 			wp_die( __( 'Duplicate comment detected; it looks as though you&#8217;ve already said that!' ), 409 );
@@ -829,8 +839,8 @@
 	);
 	$lasttime = $wpdb->get_var( $sql );
 	if ( $lasttime ) {
-		$time_lastcomment = mysql2date('U', $lasttime, false);
-		$time_newcomment  = mysql2date('U', $date, false);
+		$time_lastcomment = mysql2date( 'U', $lasttime, false );
+		$time_newcomment  = mysql2date( 'U', $date, false );
 		/**
 		 * Filters the comment flood status.
 		 *
@@ -855,7 +865,7 @@
 				return true;
 			} else {
 				if ( wp_doing_ajax() ) {
-					die( __('You are posting comments too quickly. Slow down.') );
+					die( __( 'You are posting comments too quickly. Slow down.' ) );
 				}
 
 				wp_die( __( 'You are posting comments too quickly. Slow down.' ), 429 );
@@ -874,16 +884,23 @@
  * @param array $comments Array of comments
  * @return array Array of comments keyed by comment_type.
  */
-function separate_comments(&$comments) {
-	$comments_by_type = array('comment' => array(), 'trackback' => array(), 'pingback' => array(), 'pings' => array());
-	$count = count($comments);
+function separate_comments( &$comments ) {
+	$comments_by_type = array(
+		'comment' => array(),
+		'trackback' => array(),
+		'pingback' => array(),
+		'pings' => array(),
+	);
+	$count = count( $comments );
 	for ( $i = 0; $i < $count; $i++ ) {
-		$type = $comments[$i]->comment_type;
-		if ( empty($type) )
+		$type = $comments[ $i ]->comment_type;
+		if ( empty( $type ) ) {
 			$type = 'comment';
-		$comments_by_type[$type][] = &$comments[$i];
-		if ( 'trackback' == $type || 'pingback' == $type )
-			$comments_by_type['pings'][] = &$comments[$i];
+		}
+		$comments_by_type[ $type ][] = &$comments[ $i ];
+		if ( 'trackback' == $type || 'pingback' == $type ) {
+			$comments_by_type['pings'][] = &$comments[ $i ];
+		}
 	}
 
 	return $comments_by_type;
@@ -906,28 +923,35 @@
 function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) {
 	global $wp_query;
 
-	if ( null === $comments && null === $per_page && null === $threaded && !empty($wp_query->max_num_comment_pages) )
+	if ( null === $comments && null === $per_page && null === $threaded && ! empty( $wp_query->max_num_comment_pages ) ) {
 		return $wp_query->max_num_comment_pages;
+	}
 
-	if ( ( ! $comments || ! is_array( $comments ) ) && ! empty( $wp_query->comments )  )
+	if ( ( ! $comments || ! is_array( $comments ) ) && ! empty( $wp_query->comments ) ) {
 		$comments = $wp_query->comments;
+	}
 
-	if ( empty($comments) )
+	if ( empty( $comments ) ) {
 		return 0;
+	}
 
 	if ( ! get_option( 'page_comments' ) ) {
 		return 1;
 	}
 
-	if ( !isset($per_page) )
-		$per_page = (int) get_query_var('comments_per_page');
-	if ( 0 === $per_page )
-		$per_page = (int) get_option('comments_per_page');
-	if ( 0 === $per_page )
+	if ( ! isset( $per_page ) ) {
+		$per_page = (int) get_query_var( 'comments_per_page' );
+	}
+	if ( 0 === $per_page ) {
+		$per_page = (int) get_option( 'comments_per_page' );
+	}
+	if ( 0 === $per_page ) {
 		return 1;
+	}
 
-	if ( !isset($threaded) )
-		$threaded = get_option('thread_comments');
+	if ( ! isset( $threaded ) ) {
+		$threaded = get_option( 'thread_comments' );
+	}
 
 	if ( $threaded ) {
 		$walker = new Walker_Comment;
@@ -964,10 +988,16 @@
 
 	$page = null;
 
-	if ( !$comment = get_comment( $comment_ID ) )
+	if ( ! $comment = get_comment( $comment_ID ) ) {
 		return;
+	}
 
-	$defaults = array( 'type' => 'all', 'page' => '', 'per_page' => '', 'max_depth' => '' );
+	$defaults = array(
+		'type' => 'all',
+		'page' => '',
+		'per_page' => '',
+		'max_depth' => '',
+	);
 	$args = wp_parse_args( $args, $defaults );
 	$original_args = $args;
 
@@ -982,7 +1012,7 @@
 		}
 	}
 
-	if ( empty($args['per_page']) ) {
+	if ( empty( $args['per_page'] ) ) {
 		$args['per_page'] = 0;
 		$args['page'] = 0;
 	}
@@ -993,15 +1023,16 @@
 
 	if ( null === $page ) {
 		if ( '' === $args['max_depth'] ) {
-			if ( get_option('thread_comments') )
-				$args['max_depth'] = get_option('thread_comments_depth');
-			else
-				$args['max_depth'] = -1;
+			if ( get_option( 'thread_comments' ) ) {
+				$args['max_depth'] = get_option( 'thread_comments_depth' );
+			} else { $args['max_depth'] = -1;
+			}
 		}
 
 		// Find this comment's top level parent if threading is enabled
-		if ( $args['max_depth'] > 1 && 0 != $comment->comment_parent )
+		if ( $args['max_depth'] > 1 && 0 != $comment->comment_parent ) {
 			return get_page_of_comment( $comment->comment_parent, $args );
+		}
 
 		$comment_args = array(
 			'type'       => $args['type'],
@@ -1014,7 +1045,7 @@
 				array(
 					'column' => "$wpdb->comments.comment_date_gmt",
 					'before' => $comment->comment_date_gmt,
-				)
+				),
 			),
 		);
 
@@ -1025,11 +1056,11 @@
 		if ( 0 == $older_comment_count ) {
 			$page = 1;
 
-		// Divide comments older than this one by comments per page to get this comment's page number
+			// Divide comments older than this one by comments per page to get this comment's page number
 		} else {
 			$page = ceil( ( $older_comment_count + 1 ) / $args['per_page'] );
 		}
-	}
+	}// End if().
 
 	/**
 	 * Filters the calculated page on which a comment appears.
@@ -1160,7 +1191,7 @@
  * @param string $user_agent The author's browser user agent
  * @return bool True if comment contains blacklisted content, false if comment does not
  */
-function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) {
+function wp_blacklist_check( $author, $email, $url, $comment, $user_ip, $user_agent ) {
 	/**
 	 * Fires before the comment is tested for blacklisted characters or words.
 	 *
@@ -1175,36 +1206,38 @@
 	 */
 	do_action( 'wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent );
 
-	$mod_keys = trim( get_option('blacklist_keys') );
-	if ( '' == $mod_keys )
+	$mod_keys = trim( get_option( 'blacklist_keys' ) );
+	if ( '' == $mod_keys ) {
 		return false; // If moderation keys are empty
+	}
 
 	// Ensure HTML tags are not being used to bypass the blacklist.
 	$comment_without_html = wp_strip_all_tags( $comment );
 
-	$words = explode("\n", $mod_keys );
+	$words = explode( "\n", $mod_keys );
 
 	foreach ( (array) $words as $word ) {
-		$word = trim($word);
+		$word = trim( $word );
 
 		// Skip empty lines
-		if ( empty($word) ) { continue; }
+		if ( empty( $word ) ) { continue; }
 
 		// Do some escaping magic so that '#' chars in the
 		// spam words don't break things:
-		$word = preg_quote($word, '#');
+		$word = preg_quote( $word, '#' );
 
 		$pattern = "#$word#i";
 		if (
-			   preg_match($pattern, $author)
-			|| preg_match($pattern, $email)
-			|| preg_match($pattern, $url)
-			|| preg_match($pattern, $comment)
-			|| preg_match($pattern, $comment_without_html)
-			|| preg_match($pattern, $user_ip)
-			|| preg_match($pattern, $user_agent)
-		 )
+			   preg_match( $pattern, $author )
+			|| preg_match( $pattern, $email )
+			|| preg_match( $pattern, $url )
+			|| preg_match( $pattern, $comment )
+			|| preg_match( $pattern, $comment_without_html )
+			|| preg_match( $pattern, $user_ip )
+			|| preg_match( $pattern, $user_agent )
+		 ) {
 			return true;
+		}
 	}
 	return false;
 }
@@ -1273,13 +1306,15 @@
  * @param bool           $force_delete Whether to bypass trash and force deletion. Default is false.
  * @return bool True on success, false on failure.
  */
-function wp_delete_comment($comment_id, $force_delete = false) {
+function wp_delete_comment( $comment_id, $force_delete = false ) {
 	global $wpdb;
-	if (!$comment = get_comment($comment_id))
+	if ( ! $comment = get_comment( $comment_id ) ) {
 		return false;
+	}
 
-	if ( !$force_delete && EMPTY_TRASH_DAYS && !in_array( wp_get_comment_status( $comment ), array( 'trash', 'spam' ) ) )
-		return wp_trash_comment($comment_id);
+	if ( ! $force_delete && EMPTY_TRASH_DAYS && ! in_array( wp_get_comment_status( $comment ), array( 'trash', 'spam' ) ) ) {
+		return wp_trash_comment( $comment_id );
+	}
 
 	/**
 	 * Fires immediately before a comment is deleted from the database.
@@ -1291,19 +1326,21 @@
 	do_action( 'delete_comment', $comment->comment_ID );
 
 	// Move children up a level.
-	$children = $wpdb->get_col( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment->comment_ID) );
-	if ( !empty($children) ) {
-		$wpdb->update($wpdb->comments, array('comment_parent' => $comment->comment_parent), array('comment_parent' => $comment->comment_ID));
-		clean_comment_cache($children);
+	$children = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment->comment_ID ) );
+	if ( ! empty( $children ) ) {
+		$wpdb->update( $wpdb->comments, array( 'comment_parent' => $comment->comment_parent ), array( 'comment_parent' => $comment->comment_ID ) );
+		clean_comment_cache( $children );
 	}
 
 	// Delete metadata
 	$meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->commentmeta WHERE comment_id = %d", $comment->comment_ID ) );
-	foreach ( $meta_ids as $mid )
+	foreach ( $meta_ids as $mid ) {
 		delete_metadata_by_mid( 'comment', $mid );
+	}
 
-	if ( ! $wpdb->delete( $wpdb->comments, array( 'comment_ID' => $comment->comment_ID ) ) )
+	if ( ! $wpdb->delete( $wpdb->comments, array( 'comment_ID' => $comment->comment_ID ) ) ) {
 		return false;
+	}
 
 	/**
 	 * Fires immediately after a comment is deleted from the database.
@@ -1315,15 +1352,16 @@
 	do_action( 'deleted_comment', $comment->comment_ID );
 
 	$post_id = $comment->comment_post_ID;
-	if ( $post_id && $comment->comment_approved == 1 )
-		wp_update_comment_count($post_id);
+	if ( $post_id && $comment->comment_approved == 1 ) {
+		wp_update_comment_count( $post_id );
+	}
 
 	clean_comment_cache( $comment->comment_ID );
 
 	/** This action is documented in wp-includes/comment.php */
 	do_action( 'wp_set_comment_status', $comment->comment_ID, 'delete' );
 
-	wp_transition_comment_status('delete', $comment->comment_approved, $comment);
+	wp_transition_comment_status( 'delete', $comment->comment_approved, $comment );
 	return true;
 }
 
@@ -1337,12 +1375,14 @@
  * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
  * @return bool True on success, false on failure.
  */
-function wp_trash_comment($comment_id) {
-	if ( !EMPTY_TRASH_DAYS )
-		return wp_delete_comment($comment_id, true);
+function wp_trash_comment( $comment_id ) {
+	if ( ! EMPTY_TRASH_DAYS ) {
+		return wp_delete_comment( $comment_id, true );
+	}
 
-	if ( !$comment = get_comment($comment_id) )
+	if ( ! $comment = get_comment( $comment_id ) ) {
 		return false;
+	}
 
 	/**
 	 * Fires immediately before a comment is sent to the Trash.
@@ -1381,7 +1421,7 @@
  * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
  * @return bool True on success, false on failure.
  */
-function wp_untrash_comment($comment_id) {
+function wp_untrash_comment( $comment_id ) {
 	$comment = get_comment( $comment_id );
 	if ( ! $comment ) {
 		return false;
@@ -1397,8 +1437,9 @@
 	do_action( 'untrash_comment', $comment->comment_ID );
 
 	$status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true );
-	if ( empty($status) )
+	if ( empty( $status ) ) {
 		$status = '0';
+	}
 
 	if ( wp_set_comment_status( $comment, $status ) ) {
 		delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
@@ -1483,8 +1524,9 @@
 	do_action( 'unspam_comment', $comment->comment_ID );
 
 	$status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true );
-	if ( empty($status) )
+	if ( empty( $status ) ) {
 		$status = '0';
+	}
 
 	if ( wp_set_comment_status( $comment, $status ) ) {
 		delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
@@ -1511,25 +1553,26 @@
  * @param int|WP_Comment $comment_id Comment ID or WP_Comment object
  * @return false|string Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.
  */
-function wp_get_comment_status($comment_id) {
-	$comment = get_comment($comment_id);
-	if ( !$comment )
+function wp_get_comment_status( $comment_id ) {
+	$comment = get_comment( $comment_id );
+	if ( ! $comment ) {
 		return false;
+	}
 
 	$approved = $comment->comment_approved;
 
-	if ( $approved == null )
+	if ( $approved == null ) {
 		return false;
-	elseif ( $approved == '1' )
+	} elseif ( $approved == '1' ) {
 		return 'approved';
-	elseif ( $approved == '0' )
+	} elseif ( $approved == '0' ) {
 		return 'unapproved';
-	elseif ( $approved == 'spam' )
+	} elseif ( $approved == 'spam' ) {
 		return 'spam';
-	elseif ( $approved == 'trash' )
+	} elseif ( $approved == 'trash' ) {
 		return 'trash';
-	else
-		return false;
+	} else { return false;
+	}
 }
 
 /**
@@ -1550,7 +1593,7 @@
  * @param string $old_status Previous comment status.
  * @param object $comment Comment data.
  */
-function wp_transition_comment_status($new_status, $old_status, $comment) {
+function wp_transition_comment_status( $new_status, $old_status, $comment ) {
 	/*
 	 * Translate raw statuses to human readable formats for the hooks.
 	 * This is not a complete list of comment status, it's only the ones
@@ -1562,8 +1605,10 @@
 		1         => 'approved',
 		'approve' => 'approved', // wp_set_comment_status() uses "approve"
 	);
-	if ( isset($comment_statuses[$new_status]) ) $new_status = $comment_statuses[$new_status];
-	if ( isset($comment_statuses[$old_status]) ) $old_status = $comment_statuses[$old_status];
+	if ( isset( $comment_statuses[ $new_status ] ) ) { $new_status = $comment_statuses[ $new_status ];
+	}
+	if ( isset( $comment_statuses[ $old_status ] ) ) { $old_status = $comment_statuses[ $old_status ];
+	}
 
 	// Call the hooks
 	if ( $new_status != $old_status ) {
@@ -1642,16 +1687,19 @@
 	// Cookies should already be sanitized.
 
 	$comment_author = '';
-	if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) )
-		$comment_author = $_COOKIE['comment_author_'.COOKIEHASH];
+	if ( isset( $_COOKIE[ 'comment_author_' . COOKIEHASH ] ) ) {
+		$comment_author = $_COOKIE[ 'comment_author_' . COOKIEHASH ];
+	}
 
 	$comment_author_email = '';
-	if ( isset($_COOKIE['comment_author_email_'.COOKIEHASH]) )
-		$comment_author_email = $_COOKIE['comment_author_email_'.COOKIEHASH];
+	if ( isset( $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] ) ) {
+		$comment_author_email = $_COOKIE[ 'comment_author_email_' . COOKIEHASH ];
+	}
 
 	$comment_author_url = '';
-	if ( isset($_COOKIE['comment_author_url_'.COOKIEHASH]) )
-		$comment_author_url = $_COOKIE['comment_author_url_'.COOKIEHASH];
+	if ( isset( $_COOKIE[ 'comment_author_url_' . COOKIEHASH ] ) ) {
+		$comment_author_url = $_COOKIE[ 'comment_author_url_' . COOKIEHASH ];
+	}
 
 	/**
 	 * Filters the current commenter's name, email, and URL.
@@ -1666,7 +1714,7 @@
 	 *     @type string $comment_author_url   The URL address of the `$comment_author`. Default empty.
 	 * }
 	 */
-	return apply_filters( 'wp_get_current_commenter', compact('comment_author', 'comment_author_email', 'comment_author_url') );
+	return apply_filters( 'wp_get_current_commenter', compact( 'comment_author', 'comment_author_email', 'comment_author_url' ) );
 }
 
 /**
@@ -1777,7 +1825,7 @@
  * @param array $commentdata Contains information on the comment.
  * @return array Parsed comment information.
  */
-function wp_filter_comment($commentdata) {
+function wp_filter_comment( $commentdata ) {
 	if ( isset( $commentdata['user_ID'] ) ) {
 		/**
 		 * Filters the comment author's user id before it is set.
@@ -1839,11 +1887,13 @@
  * @param int $time_newcomment Timestamp for new comment.
  * @return bool Whether comment should be blocked.
  */
-function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment) {
-	if ( $block ) // a plugin has already blocked... we'll let that decision stand
+function wp_throttle_comment_flood( $block, $time_lastcomment, $time_newcomment ) {
+	if ( $block ) { // a plugin has already blocked... we'll let that decision stand
 		return $block;
-	if ( ($time_newcomment - $time_lastcomment) < 15 )
+	}
+	if ( ($time_newcomment - $time_lastcomment) < 15 ) {
 		return true;
+	}
 	return false;
 }
 
@@ -1916,8 +1966,8 @@
 		$commentdata['user_id'] = (int) $commentdata['user_id'];
 	}
 
-	$commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0;
-	$parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : '';
+	$commentdata['comment_parent'] = isset( $commentdata['comment_parent'] ) ? absint( $commentdata['comment_parent'] ) : 0;
+	$parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status( $commentdata['comment_parent'] ) : '';
 	$commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0;
 
 	if ( ! isset( $commentdata['comment_author_IP'] ) ) {
@@ -1931,21 +1981,21 @@
 	$commentdata['comment_agent'] = substr( $commentdata['comment_agent'], 0, 254 );
 
 	if ( empty( $commentdata['comment_date'] ) ) {
-		$commentdata['comment_date'] = current_time('mysql');
+		$commentdata['comment_date'] = current_time( 'mysql' );
 	}
 
 	if ( empty( $commentdata['comment_date_gmt'] ) ) {
 		$commentdata['comment_date_gmt'] = current_time( 'mysql', 1 );
 	}
 
-	$commentdata = wp_filter_comment($commentdata);
+	$commentdata = wp_filter_comment( $commentdata );
 
 	$commentdata['comment_approved'] = wp_allow_comment( $commentdata, $avoid_die );
 	if ( is_wp_error( $commentdata['comment_approved'] ) ) {
 		return $commentdata['comment_approved'];
 	}
 
-	$comment_ID = wp_insert_comment($commentdata);
+	$comment_ID = wp_insert_comment( $commentdata );
 	if ( ! $comment_ID ) {
 		$fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' );
 
@@ -2065,7 +2115,7 @@
  * @param bool           $wp_error       Whether to return a WP_Error object if there is a failure. Default is false.
  * @return bool|WP_Error True on success, false or WP_Error on failure.
  */
-function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) {
+function wp_set_comment_status( $comment_id, $comment_status, $wp_error = false ) {
 	global $wpdb;
 
 	switch ( $comment_status ) {
@@ -2088,13 +2138,13 @@
 			return false;
 	}
 
-	$comment_old = clone get_comment($comment_id);
+	$comment_old = clone get_comment( $comment_id );
 
-	if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array( 'comment_ID' => $comment_old->comment_ID ) ) ) {
-		if ( $wp_error )
-			return new WP_Error('db_update_error', __('Could not update comment status'), $wpdb->last_error);
-		else
-			return false;
+	if ( ! $wpdb->update( $wpdb->comments, array( 'comment_approved' => $status ), array( 'comment_ID' => $comment_old->comment_ID ) ) ) {
+		if ( $wp_error ) {
+			return new WP_Error( 'db_update_error', __( 'Could not update comment status' ), $wpdb->last_error );
+		} else { return false;
+		}
 	}
 
 	clean_comment_cache( $comment_old->comment_ID );
@@ -2113,9 +2163,9 @@
 	 */
 	do_action( 'wp_set_comment_status', $comment->comment_ID, $comment_status );
 
-	wp_transition_comment_status($comment_status, $comment_old->comment_approved, $comment);
+	wp_transition_comment_status( $comment_status, $comment_old->comment_approved, $comment );
 
-	wp_update_comment_count($comment->comment_post_ID);
+	wp_update_comment_count( $comment->comment_post_ID );
 
 	return true;
 }
@@ -2132,11 +2182,11 @@
  * @param array $commentarr Contains information on the comment.
  * @return int Comment was updated if value is 1, or was not updated if value is 0.
  */
-function wp_update_comment($commentarr) {
+function wp_update_comment( $commentarr ) {
 	global $wpdb;
 
 	// First, get all of the original fields
-	$comment = get_comment($commentarr['comment_ID'], ARRAY_A);
+	$comment = get_comment( $commentarr['comment_ID'], ARRAY_A );
 	if ( empty( $comment ) ) {
 		return 0;
 	}
@@ -2147,12 +2197,12 @@
 	}
 
 	// Escape data pulled from DB.
-	$comment = wp_slash($comment);
+	$comment = wp_slash( $comment );
 
 	$old_status = $comment['comment_approved'];
 
 	// Merge old and new fields with new fields overwriting old ones.
-	$commentarr = array_merge($comment, $commentarr);
+	$commentarr = array_merge( $comment, $commentarr );
 
 	$commentarr = wp_filter_comment( $commentarr );
 
@@ -2213,8 +2263,8 @@
 	 * @param array $data       Comment data.
 	 */
 	do_action( 'edit_comment', $comment_ID, $data );
-	$comment = get_comment($comment_ID);
-	wp_transition_comment_status($comment->comment_approved, $old_status, $comment);
+	$comment = get_comment( $comment_ID );
+	wp_transition_comment_status( $comment->comment_approved, $old_status, $comment );
 	return $rval;
 }
 
@@ -2232,14 +2282,15 @@
  * @param bool $defer
  * @return bool
  */
-function wp_defer_comment_counting($defer=null) {
+function wp_defer_comment_counting( $defer = null ) {
 	static $_defer = false;
 
-	if ( is_bool($defer) ) {
+	if ( is_bool( $defer ) ) {
 		$_defer = $defer;
 		// flush any deferred counts
-		if ( !$defer )
+		if ( ! $defer ) {
 			wp_update_comment_count( null, true );
+		}
 	}
 
 	return $_defer;
@@ -2267,7 +2318,7 @@
  * @return bool|void True on success, false on failure or if post with ID does
  *                   not exist.
  */
-function wp_update_comment_count($post_id, $do_deferred=false) {
+function wp_update_comment_count( $post_id, $do_deferred = false ) {
 	static $_deferred = array();
 
 	if ( empty( $post_id ) && ! $do_deferred ) {
@@ -2275,19 +2326,18 @@
 	}
 
 	if ( $do_deferred ) {
-		$_deferred = array_unique($_deferred);
+		$_deferred = array_unique( $_deferred );
 		foreach ( $_deferred as $i => $_post_id ) {
-			wp_update_comment_count_now($_post_id);
-			unset( $_deferred[$i] ); /** @todo Move this outside of the foreach and reset $_deferred to an array instead */
+			wp_update_comment_count_now( $_post_id );
+			unset( $_deferred[ $i ] ); /** @todo Move this outside of the foreach and reset $_deferred to an array instead */
 		}
 	}
 
 	if ( wp_defer_comment_counting() ) {
 		$_deferred[] = $post_id;
 		return true;
-	}
-	elseif ( $post_id ) {
-		return wp_update_comment_count_now($post_id);
+	} elseif ( $post_id ) {
+		return wp_update_comment_count_now( $post_id );
 	}
 
 }
@@ -2302,17 +2352,19 @@
  * @param int $post_id Post ID
  * @return bool True on success, false on '0' $post_id or if post with ID does not exist.
  */
-function wp_update_comment_count_now($post_id) {
+function wp_update_comment_count_now( $post_id ) {
 	global $wpdb;
 	$post_id = (int) $post_id;
-	if ( !$post_id )
+	if ( ! $post_id ) {
 		return false;
+	}
 
 	wp_cache_delete( 'comments-0', 'counts' );
 	wp_cache_delete( "comments-{$post_id}", 'counts' );
 
-	if ( !$post = get_post($post_id) )
+	if ( ! $post = get_post( $post_id ) ) {
 		return false;
+	}
 
 	$old = (int) $post->comment_count;
 
@@ -2333,7 +2385,7 @@
 		$new = (int) $new;
 	}
 
-	$wpdb->update( $wpdb->posts, array('comment_count' => $new), array('ID' => $post_id) );
+	$wpdb->update( $wpdb->posts, array( 'comment_count' => $new ), array( 'ID' => $post_id ) );
 
 	clean_post_cache( $post );
 
@@ -2371,53 +2423,60 @@
  * @return false|string False on failure, string containing URI on success.
  */
 function discover_pingback_server_uri( $url, $deprecated = '' ) {
-	if ( !empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '2.7.0' );
+	}
 
 	$pingback_str_dquote = 'rel="pingback"';
 	$pingback_str_squote = 'rel=\'pingback\'';
 
 	/** @todo Should use Filter Extension or custom preg_match instead. */
-	$parsed_url = parse_url($url);
+	$parsed_url = parse_url( $url );
 
-	if ( ! isset( $parsed_url['host'] ) ) // Not a URL. This should never happen.
+	if ( ! isset( $parsed_url['host'] ) ) { // Not a URL. This should never happen.
 		return false;
+	}
 
 	//Do not search for a pingback server on our own uploads
 	$uploads_dir = wp_get_upload_dir();
-	if ( 0 === strpos($url, $uploads_dir['baseurl']) )
+	if ( 0 === strpos( $url, $uploads_dir['baseurl'] ) ) {
 		return false;
+	}
 
 	$response = wp_safe_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
 
-	if ( is_wp_error( $response ) )
+	if ( is_wp_error( $response ) ) {
 		return false;
+	}
 
-	if ( wp_remote_retrieve_header( $response, 'x-pingback' ) )
+	if ( wp_remote_retrieve_header( $response, 'x-pingback' ) ) {
 		return wp_remote_retrieve_header( $response, 'x-pingback' );
+	}
 
 	// Not an (x)html, sgml, or xml page, no use going further.
-	if ( preg_match('#(image|audio|video|model)/#is', wp_remote_retrieve_header( $response, 'content-type' )) )
+	if ( preg_match( '#(image|audio|video|model)/#is', wp_remote_retrieve_header( $response, 'content-type' ) ) ) {
 		return false;
+	}
 
 	// Now do a GET since we're going to look in the html headers (and we're sure it's not a binary file)
 	$response = wp_safe_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
 
-	if ( is_wp_error( $response ) )
+	if ( is_wp_error( $response ) ) {
 		return false;
+	}
 
 	$contents = wp_remote_retrieve_body( $response );
 
-	$pingback_link_offset_dquote = strpos($contents, $pingback_str_dquote);
-	$pingback_link_offset_squote = strpos($contents, $pingback_str_squote);
+	$pingback_link_offset_dquote = strpos( $contents, $pingback_str_dquote );
+	$pingback_link_offset_squote = strpos( $contents, $pingback_str_squote );
 	if ( $pingback_link_offset_dquote || $pingback_link_offset_squote ) {
 		$quote = ($pingback_link_offset_dquote) ? '"' : '\'';
-		$pingback_link_offset = ($quote=='"') ? $pingback_link_offset_dquote : $pingback_link_offset_squote;
-		$pingback_href_pos = @strpos($contents, 'href=', $pingback_link_offset);
-		$pingback_href_start = $pingback_href_pos+6;
-		$pingback_href_end = @strpos($contents, $quote, $pingback_href_start);
+		$pingback_link_offset = ($quote == '"') ? $pingback_link_offset_dquote : $pingback_link_offset_squote;
+		$pingback_href_pos = @strpos( $contents, 'href=', $pingback_link_offset );
+		$pingback_href_start = $pingback_href_pos + 6;
+		$pingback_href_end = @strpos( $contents, $quote, $pingback_href_start );
 		$pingback_server_url_len = $pingback_href_end - $pingback_href_start;
-		$pingback_server_url = substr($contents, $pingback_href_start, $pingback_server_url_len);
+		$pingback_server_url = substr( $contents, $pingback_href_start, $pingback_server_url_len );
 
 		// We may find rel="pingback" but an incomplete pingback URL
 		if ( $pingback_server_url_len > 0 ) { // We got it!
@@ -2439,22 +2498,24 @@
 	global $wpdb;
 
 	// Do pingbacks
-	while ($ping = $wpdb->get_row("SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) {
+	while ( $ping = $wpdb->get_row( "SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1" ) ) {
 		delete_metadata_by_mid( 'post', $ping->meta_id );
 		pingback( $ping->post_content, $ping->ID );
 	}
 
 	// Do Enclosures
-	while ($enclosure = $wpdb->get_row("SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) {
+	while ( $enclosure = $wpdb->get_row( "SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1" ) ) {
 		delete_metadata_by_mid( 'post', $enclosure->meta_id );
 		do_enclose( $enclosure->post_content, $enclosure->ID );
 	}
 
 	// Do Trackbacks
-	$trackbacks = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE to_ping <> '' AND post_status = 'publish'");
-	if ( is_array($trackbacks) )
-		foreach ( $trackbacks as $trackback )
-			do_trackbacks($trackback);
+	$trackbacks = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE to_ping <> '' AND post_status = 'publish'" );
+	if ( is_array( $trackbacks ) ) {
+		foreach ( $trackbacks as $trackback ) {
+			do_trackbacks( $trackback );
+		}
+	}
 
 	//Do Update Services/Generic Pings
 	generic_ping();
@@ -2480,11 +2541,11 @@
 	$to_ping = get_to_ping( $post );
 	$pinged  = get_pung( $post );
 	if ( empty( $to_ping ) ) {
-		$wpdb->update($wpdb->posts, array( 'to_ping' => '' ), array( 'ID' => $post->ID ) );
+		$wpdb->update( $wpdb->posts, array( 'to_ping' => '' ), array( 'ID' => $post->ID ) );
 		return;
 	}
 
-	if ( empty($post->post_excerpt) ) {
+	if ( empty( $post->post_excerpt ) ) {
 		/** This filter is documented in wp-includes/post-template.php */
 		$excerpt = apply_filters( 'the_content', $post->post_content, $post->ID );
 	} else {
@@ -2492,17 +2553,17 @@
 		$excerpt = apply_filters( 'the_excerpt', $post->post_excerpt );
 	}
 
-	$excerpt = str_replace(']]>', ']]&gt;', $excerpt);
-	$excerpt = wp_html_excerpt($excerpt, 252, '&#8230;');
+	$excerpt = str_replace( ']]>', ']]&gt;', $excerpt );
+	$excerpt = wp_html_excerpt( $excerpt, 252, '&#8230;' );
 
 	/** This filter is documented in wp-includes/post-template.php */
 	$post_title = apply_filters( 'the_title', $post->post_title, $post->ID );
-	$post_title = strip_tags($post_title);
+	$post_title = strip_tags( $post_title );
 
 	if ( $to_ping ) {
 		foreach ( (array) $to_ping as $tb_ping ) {
-			$tb_ping = trim($tb_ping);
-			if ( !in_array($tb_ping, $pinged) ) {
+			$tb_ping = trim( $tb_ping );
+			if ( ! in_array( $tb_ping, $pinged ) ) {
 				trackback( $tb_ping, $post_title, $excerpt, $post->ID );
 				$pinged[] = $tb_ping;
 			} else {
@@ -2522,13 +2583,14 @@
  * @return int Same as Post ID from parameter
  */
 function generic_ping( $post_id = 0 ) {
-	$services = get_option('ping_sites');
+	$services = get_option( 'ping_sites' );
 
-	$services = explode("\n", $services);
+	$services = explode( "\n", $services );
 	foreach ( (array) $services as $service ) {
-		$service = trim($service);
-		if ( '' != $service )
-			weblog_ping($service);
+		$service = trim( $service );
+		if ( '' != $service ) {
+			weblog_ping( $service );
+		}
 	}
 
 	return $post_id;
@@ -2576,12 +2638,13 @@
 
 	foreach ( (array) $post_links_temp as $link_test ) :
 		if ( ! in_array( $link_test, $pung ) && ( url_to_postid( $link_test ) != $post->ID ) // If we haven't pung it already and it isn't a link to itself
-				&& !is_local_attachment($link_test) ) : // Also, let's never ping local attachments.
-			if ( $test = @parse_url($link_test) ) {
-				if ( isset($test['query']) )
+				&& ! is_local_attachment( $link_test ) ) : // Also, let's never ping local attachments.
+			if ( $test = @parse_url( $link_test ) ) {
+				if ( isset( $test['query'] ) ) {
 					$post_links[] = $link_test;
-				elseif ( isset( $test['path'] ) && ( $test['path'] != '/' ) && ( $test['path'] != '' ) )
+				} elseif ( isset( $test['path'] ) && ( $test['path'] != '/' ) && ( $test['path'] != '' ) ) {
 					$post_links[] = $link_test;
+				}
 			}
 		endif;
 	endforeach;
@@ -2607,7 +2670,7 @@
 			$pagelinkedfrom = get_permalink( $post );
 
 			// using a timeout of 3 seconds should be enough to cover slow servers
-			$client = new WP_HTTP_IXR_Client($pingback_server_url);
+			$client = new WP_HTTP_IXR_Client( $pingback_server_url );
 			$client->timeout = 3;
 			/**
 			 * Filters the user agent sent when pinging-back a URL.
@@ -2625,8 +2688,9 @@
 			// when set to true, this outputs debug messages by itself
 			$client->debug = false;
 
-			if ( $client->query('pingback.ping', $pagelinkedfrom, $pagelinkedto) || ( isset($client->error->code) && 48 == $client->error->code ) ) // Already registered
+			if ( $client->query( 'pingback.ping', $pagelinkedfrom, $pagelinkedto ) || ( isset( $client->error->code ) && 48 == $client->error->code ) ) { // Already registered
 				add_ping( $post, $pagelinkedto );
+			}
 		}
 	}
 }
@@ -2639,11 +2703,11 @@
  * @param mixed $sites Will return if blog is public, will not return if not public.
  * @return mixed Empty string if blog is not public, returns $sites, if site is public.
  */
-function privacy_ping_filter($sites) {
-	if ( '0' != get_option('blog_public') )
+function privacy_ping_filter( $sites ) {
+	if ( '0' != get_option( 'blog_public' ) ) {
 		return $sites;
-	else
-		return '';
+	} else { return '';
+	}
 }
 
 /**
@@ -2661,28 +2725,30 @@
  * @param int $ID Post ID.
  * @return int|false|void Database query from update.
  */
-function trackback($trackback_url, $title, $excerpt, $ID) {
+function trackback( $trackback_url, $title, $excerpt, $ID ) {
 	global $wpdb;
 
-	if ( empty($trackback_url) )
+	if ( empty( $trackback_url ) ) {
 		return;
+	}
 
 	$options = array();
 	$options['timeout'] = 10;
 	$options['body'] = array(
 		'title' => $title,
-		'url' => get_permalink($ID),
-		'blog_name' => get_option('blogname'),
-		'excerpt' => $excerpt
+		'url' => get_permalink( $ID ),
+		'blog_name' => get_option( 'blogname' ),
+		'excerpt' => $excerpt,
 	);
 
 	$response = wp_safe_remote_post( $trackback_url, $options );
 
-	if ( is_wp_error( $response ) )
+	if ( is_wp_error( $response ) ) {
 		return;
+	}
 
-	$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $ID) );
-	return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $ID) );
+	$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $ID ) );
+	return $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $ID ) );
 }
 
 /**
@@ -2693,20 +2759,21 @@
  * @param string $server Host of blog to connect to.
  * @param string $path Path to send the ping.
  */
-function weblog_ping($server = '', $path = '') {
+function weblog_ping( $server = '', $path = '' ) {
 	include_once( ABSPATH . WPINC . '/class-IXR.php' );
 	include_once( ABSPATH . WPINC . '/class-wp-http-ixr-client.php' );
 
 	// using a timeout of 3 seconds should be enough to cover slow servers
-	$client = new WP_HTTP_IXR_Client($server, ((!strlen(trim($path)) || ('/' == $path)) ? false : $path));
+	$client = new WP_HTTP_IXR_Client( $server, (( ! strlen( trim( $path ) ) || ('/' == $path)) ? false : $path) );
 	$client->timeout = 3;
 	$client->useragent .= ' -- WordPress/' . get_bloginfo( 'version' );
 
 	// when set to true, this outputs debug messages by itself
 	$client->debug = false;
 	$home = trailingslashit( home_url() );
-	if ( !$client->query('weblogUpdates.extendedPing', get_option('blogname'), $home, get_bloginfo('rss2_url') ) ) // then try a normal ping
-		$client->query('weblogUpdates.ping', get_option('blogname'), $home);
+	if ( ! $client->query( 'weblogUpdates.extendedPing', get_option( 'blogname' ), $home, get_bloginfo( 'rss2_url' ) ) ) { // then try a normal ping
+		$client->query( 'weblogUpdates.ping', get_option( 'blogname' ), $home );
+	}
 }
 
 /**
@@ -2735,8 +2802,9 @@
  * @return IXR_Error
  */
 function xmlrpc_pingback_error( $ixr_error ) {
-	if ( $ixr_error->code === 48 )
+	if ( $ixr_error->code === 48 ) {
 		return $ixr_error;
+	}
 	return new IXR_Error( 0, '' );
 }
 
@@ -2751,7 +2819,7 @@
  *
  * @param int|array $ids Comment ID or an array of comment IDs to remove from cache.
  */
-function clean_comment_cache($ids) {
+function clean_comment_cache( $ids ) {
 	foreach ( (array) $ids as $id ) {
 		wp_cache_delete( $id, 'comment' );
 
@@ -2782,8 +2850,9 @@
  * @param bool  $update_meta_cache Whether to update commentmeta cache. Default true.
  */
 function update_comment_cache( $comments, $update_meta_cache = true ) {
-	foreach ( (array) $comments as $comment )
-		wp_cache_add($comment->comment_ID, $comment, 'comment');
+	foreach ( (array) $comments as $comment ) {
+		wp_cache_add( $comment->comment_ID, $comment, 'comment' );
+	}
 
 	if ( $update_meta_cache ) {
 		// Avoid `wp_list_pluck()` in case `$comments` is passed by reference.
@@ -2811,8 +2880,8 @@
 	global $wpdb;
 
 	$non_cached_ids = _get_non_cached_ids( $comment_ids, 'comment' );
-	if ( !empty( $non_cached_ids ) ) {
-		$fresh_comments = $wpdb->get_results( sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", join( ",", array_map( 'intval', $non_cached_ids ) ) ) );
+	if ( ! empty( $non_cached_ids ) ) {
+		$fresh_comments = $wpdb->get_results( sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) );
 
 		update_comment_cache( $fresh_comments, $update_meta_cache );
 	}
@@ -2833,8 +2902,9 @@
  * @return array
  */
 function _close_comments_for_old_posts( $posts, $query ) {
-	if ( empty( $posts ) || ! $query->is_singular() || ! get_option( 'close_comments_for_old_posts' ) )
+	if ( empty( $posts ) || ! $query->is_singular() || ! get_option( 'close_comments_for_old_posts' ) ) {
 		return $posts;
+	}
 
 	/**
 	 * Filters the list of post types to automatically close comments for.
@@ -2844,12 +2914,14 @@
 	 * @param array $post_types An array of registered post types. Default array with 'post'.
 	 */
 	$post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
-	if ( ! in_array( $posts[0]->post_type, $post_types ) )
+	if ( ! in_array( $posts[0]->post_type, $post_types ) ) {
 		return $posts;
+	}
 
 	$days_old = (int) get_option( 'close_comments_days_old' );
-	if ( ! $days_old )
+	if ( ! $days_old ) {
 		return $posts;
+	}
 
 	if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) {
 		$posts[0]->comment_status = 'closed';
@@ -2870,30 +2942,35 @@
  * @return bool $open
  */
 function _close_comments_for_old_post( $open, $post_id ) {
-	if ( ! $open )
+	if ( ! $open ) {
 		return $open;
+	}
 
-	if ( !get_option('close_comments_for_old_posts') )
+	if ( ! get_option( 'close_comments_for_old_posts' ) ) {
 		return $open;
+	}
 
-	$days_old = (int) get_option('close_comments_days_old');
-	if ( !$days_old )
+	$days_old = (int) get_option( 'close_comments_days_old' );
+	if ( ! $days_old ) {
 		return $open;
+	}
 
-	$post = get_post($post_id);
+	$post = get_post( $post_id );
 
 	/** This filter is documented in wp-includes/comment.php */
 	$post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
-	if ( ! in_array( $post->post_type, $post_types ) )
+	if ( ! in_array( $post->post_type, $post_types ) ) {
 		return $open;
+	}
 
 	// Undated drafts should not show up as comments closed.
 	if ( '0000-00-00 00:00:00' === $post->post_date_gmt ) {
 		return $open;
 	}
 
-	if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) )
+	if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) {
 		return false;
+	}
 
 	return $open;
 }
@@ -3005,13 +3082,12 @@
 		 * @param int $comment_post_ID Post ID.
 		 */
 		do_action( 'comment_on_draft', $comment_post_ID );
-		
+
 		if ( current_user_can( 'read_post', $comment_post_ID ) ) {
 			return new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 );
 		} else {
 			return new WP_Error( 'comment_on_draft' );
 		}
-
 	} elseif ( post_password_required( $comment_post_ID ) ) {
 
 		/**
@@ -3036,13 +3112,13 @@
 		 */
 		do_action( 'pre_comment_on_post', $comment_post_ID );
 
-	}
+	}// End if().
 
 	// If the user is logged in
 	$user = wp_get_current_user();
 	if ( $user->exists() ) {
 		if ( empty( $user->display_name ) ) {
-			$user->display_name=$user->user_login;
+			$user->display_name = $user->user_login;
 		}
 		$comment_author       = $user->display_name;
 		$comment_author_email = $user->user_email;
Index: src/wp-includes/compat.php
===================================================================
--- src/wp-includes/compat.php	(revision 40901)
+++ src/wp-includes/compat.php	(working copy)
@@ -7,8 +7,8 @@
  */
 
 // If gettext isn't available
-if ( !function_exists('_') ) {
-	function _($string) {
+if ( ! function_exists( '_' ) ) {
+	function _( $string ) {
 		return $string;
 	}
 }
@@ -125,7 +125,7 @@
 
 		$chars = array_merge( $chars, $pieces );
 
-	// If there's anything left over, repeat the loop.
+		// If there's anything left over, repeat the loop.
 	} while ( count( $pieces ) > 1 && $str = array_pop( $pieces ) );
 
 	return join( '', array_slice( $chars, $start, $length ) );
@@ -209,15 +209,15 @@
 		// Increment.
 		$count += count( $pieces );
 
-	// If there's anything left over, repeat the loop.
+		// If there's anything left over, repeat the loop.
 	} while ( $str = array_pop( $pieces ) );
 
 	// Fencepost: preg_split() always returns one extra item in the array.
 	return --$count;
 }
 
-if ( !function_exists('hash_hmac') ):
-/**
+if ( ! function_exists( 'hash_hmac' ) ) :
+	/**
  * Compat function to mimic hash_hmac().
  *
  * @ignore
@@ -233,9 +233,9 @@
  * @return string|false The hash in output determined by `$raw_output`. False if `$algo`
  *                      is unknown or invalid.
  */
-function hash_hmac($algo, $data, $key, $raw_output = false) {
-	return _hash_hmac($algo, $data, $key, $raw_output);
-}
+	function hash_hmac( $algo, $data, $key, $raw_output = false ) {
+		return _hash_hmac( $algo, $data, $key, $raw_output );
+	}
 endif;
 
 /**
@@ -252,30 +252,36 @@
  * @return string|false The hash in output determined by `$raw_output`. False if `$algo`
  *                      is unknown or invalid.
  */
-function _hash_hmac($algo, $data, $key, $raw_output = false) {
-	$packs = array('md5' => 'H32', 'sha1' => 'H40');
+function _hash_hmac( $algo, $data, $key, $raw_output = false ) {
+	$packs = array(
+		'md5' => 'H32',
+		'sha1' => 'H40',
+	);
 
-	if ( !isset($packs[$algo]) )
+	if ( ! isset( $packs[ $algo ] ) ) {
 		return false;
+	}
 
-	$pack = $packs[$algo];
+	$pack = $packs[ $algo ];
 
-	if (strlen($key) > 64)
-		$key = pack($pack, $algo($key));
+	if ( strlen( $key ) > 64 ) {
+		$key = pack( $pack, $algo($key) );
+	}
 
-	$key = str_pad($key, 64, chr(0));
+	$key = str_pad( $key, 64, chr( 0 ) );
 
-	$ipad = (substr($key, 0, 64) ^ str_repeat(chr(0x36), 64));
-	$opad = (substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64));
+	$ipad = (substr( $key, 0, 64 ) ^ str_repeat( chr( 0x36 ), 64 ));
+	$opad = (substr( $key, 0, 64 ) ^ str_repeat( chr( 0x5C ), 64 ));
 
-	$hmac = $algo($opad . pack($pack, $algo($ipad . $data)));
+	$hmac = $algo($opad . pack( $pack, $algo($ipad . $data) ));
 
-	if ( $raw_output )
+	if ( $raw_output ) {
 		return pack( $pack, $hmac );
+	}
 	return $hmac;
 }
 
-if ( !function_exists('json_encode') ) {
+if ( ! function_exists( 'json_encode' ) ) {
 	function json_encode( $string ) {
 		global $wp_json;
 
@@ -288,7 +294,7 @@
 	}
 }
 
-if ( !function_exists('json_decode') ) {
+if ( ! function_exists( 'json_decode' ) ) {
 	/**
 	 * @global Services_JSON $wp_json
 	 * @param string $string
@@ -304,8 +310,9 @@
 		}
 
 		$res = $wp_json->decode( $string );
-		if ( $assoc_array )
+		if ( $assoc_array ) {
 			$res = _json_decode_object_helper( $res );
+		}
 		return $res;
 	}
 
@@ -313,15 +320,16 @@
 	 * @param object $data
 	 * @return array
 	 */
-	function _json_decode_object_helper($data) {
-		if ( is_object($data) )
-			$data = get_object_vars($data);
-		return is_array($data) ? array_map(__FUNCTION__, $data) : $data;
+	function _json_decode_object_helper( $data ) {
+		if ( is_object( $data ) ) {
+			$data = get_object_vars( $data );
+		}
+		return is_array( $data ) ? array_map( __FUNCTION__, $data ) : $data;
 	}
 }
 
 if ( ! function_exists( 'hash_equals' ) ) :
-/**
+	/**
  * Timing attack safe string comparison
  *
  * Compares two strings using the same time whether they're equal or not.
@@ -336,20 +344,20 @@
  * @param string $b Actual, user supplied, string.
  * @return bool Whether strings are equal.
  */
-function hash_equals( $a, $b ) {
-	$a_length = strlen( $a );
-	if ( $a_length !== strlen( $b ) ) {
-		return false;
-	}
-	$result = 0;
+	function hash_equals( $a, $b ) {
+		$a_length = strlen( $a );
+		if ( $a_length !== strlen( $b ) ) {
+			return false;
+		}
+		$result = 0;
 
-	// Do not attempt to "optimize" this.
-	for ( $i = 0; $i < $a_length; $i++ ) {
-		$result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );
-	}
+		// Do not attempt to "optimize" this.
+		for ( $i = 0; $i < $a_length; $i++ ) {
+			$result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );
+		}
 
-	return $result === 0;
-}
+		return $result === 0;
+	}
 endif;
 
 // JSON_PRETTY_PRINT was introduced in PHP 5.4
@@ -472,8 +480,8 @@
 
 				foreach ( array_keys( $head ) as $key ) {
 					if ( isset( $key, $bref ) &&
-					     isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) &&
-					     isset( $head[ $key ] ) && is_array( $head[ $key ] )
+						 isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) &&
+						 isset( $head[ $key ] ) && is_array( $head[ $key ] )
 					) {
 						$bref_stack[] = &$bref[ $key ];
 						$head_stack[] = $head[ $key ];
@@ -489,7 +497,7 @@
 endif;
 
 // SPL can be disabled on PHP 5.2
-if ( ! function_exists( 'spl_autoload_register' ) ):
+if ( ! function_exists( 'spl_autoload_register' ) ) :
 	$_wp_spl_autoloaders = array();
 
 	/**
Index: src/wp-includes/cron.php
===================================================================
--- src/wp-includes/cron.php	(revision 40901)
+++ src/wp-includes/cron.php	(working copy)
@@ -24,20 +24,25 @@
  * @param array $args Optional. Arguments to pass to the hook's callback function.
  * @return false|void False if the event does not get scheduled.
  */
-function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
+function wp_schedule_single_event( $timestamp, $hook, $args = array() ) {
 	// Make sure timestamp is a positive integer
 	if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
 		return false;
 	}
 
 	// Don't schedule a duplicate if there's already an identical event due within 10 minutes of it
-	$next = wp_next_scheduled($hook, $args);
+	$next = wp_next_scheduled( $hook, $args );
 	if ( $next && abs( $next - $timestamp ) <= 10 * MINUTE_IN_SECONDS ) {
 		return false;
 	}
 
 	$crons = _get_cron_array();
-	$event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => false, 'args' => $args );
+	$event = (object) array(
+		'hook' => $hook,
+		'timestamp' => $timestamp,
+		'schedule' => false,
+		'args' => $args,
+	);
 	/**
 	 * Filters a single event before it is scheduled.
 	 *
@@ -55,13 +60,17 @@
 	$event = apply_filters( 'schedule_event', $event );
 
 	// A plugin disallowed this event
-	if ( ! $event )
+	if ( ! $event ) {
 		return false;
+	}
 
-	$key = md5(serialize($event->args));
+	$key = md5( serialize( $event->args ) );
 
-	$crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args );
-	uksort( $crons, "strnatcasecmp" );
+	$crons[ $event->timestamp ][ $event->hook ][ $key ] = array(
+		'schedule' => $event->schedule,
+		'args' => $event->args,
+	);
+	uksort( $crons, 'strnatcasecmp' );
 	_set_cron_array( $crons );
 }
 
@@ -85,7 +94,7 @@
  * @param array $args Optional. Arguments to pass to the hook's callback function.
  * @return false|void False if the event does not get scheduled.
  */
-function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) {
+function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array() ) {
 	// Make sure timestamp is a positive integer
 	if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
 		return false;
@@ -94,21 +103,33 @@
 	$crons = _get_cron_array();
 	$schedules = wp_get_schedules();
 
-	if ( !isset( $schedules[$recurrence] ) )
+	if ( ! isset( $schedules[ $recurrence ] ) ) {
 		return false;
+	}
 
-	$event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] );
+	$event = (object) array(
+		'hook' => $hook,
+		'timestamp' => $timestamp,
+		'schedule' => $recurrence,
+		'args' => $args,
+		'interval' => $schedules[ $recurrence ]['interval'],
+	);
 	/** This filter is documented in wp-includes/cron.php */
 	$event = apply_filters( 'schedule_event', $event );
 
 	// A plugin disallowed this event
-	if ( ! $event )
+	if ( ! $event ) {
 		return false;
+	}
 
-	$key = md5(serialize($event->args));
+	$key = md5( serialize( $event->args ) );
 
-	$crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args, 'interval' => $event->interval );
-	uksort( $crons, "strnatcasecmp" );
+	$crons[ $event->timestamp ][ $event->hook ][ $key ] = array(
+		'schedule' => $event->schedule,
+		'args' => $event->args,
+		'interval' => $event->interval,
+	);
+	uksort( $crons, 'strnatcasecmp' );
 	_set_cron_array( $crons );
 }
 
@@ -181,12 +202,14 @@
 	}
 
 	$crons = _get_cron_array();
-	$key = md5(serialize($args));
-	unset( $crons[$timestamp][$hook][$key] );
-	if ( empty($crons[$timestamp][$hook]) )
-		unset( $crons[$timestamp][$hook] );
-	if ( empty($crons[$timestamp]) )
-		unset( $crons[$timestamp] );
+	$key = md5( serialize( $args ) );
+	unset( $crons[ $timestamp ][ $hook ][ $key ] );
+	if ( empty( $crons[ $timestamp ][ $hook ] ) ) {
+		unset( $crons[ $timestamp ][ $hook ] );
+	}
+	if ( empty( $crons[ $timestamp ] ) ) {
+		unset( $crons[ $timestamp ] );
+	}
 	_set_cron_array( $crons );
 }
 
@@ -201,8 +224,8 @@
 function wp_clear_scheduled_hook( $hook, $args = array() ) {
 	// Backward compatibility
 	// Previously this function took the arguments as discrete vars rather than an array like the rest of the API
-	if ( !is_array($args) ) {
-		_deprecated_argument( __FUNCTION__, '3.0.0', __('This argument has changed to an array to match the behavior of the other cron functions.') );
+	if ( ! is_array( $args ) ) {
+		_deprecated_argument( __FUNCTION__, '3.0.0', __( 'This argument has changed to an array to match the behavior of the other cron functions.' ) );
 		$args = array_slice( func_get_args(), 1 );
 	}
 
@@ -210,8 +233,9 @@
 	// It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing,
 	// and, wp_next_scheduled() returns the same schedule in an infinite loop.
 	$crons = _get_cron_array();
-	if ( empty( $crons ) )
+	if ( empty( $crons ) ) {
 		return;
+	}
 
 	$key = md5( serialize( $args ) );
 	foreach ( $crons as $timestamp => $cron ) {
@@ -232,12 +256,14 @@
  */
 function wp_next_scheduled( $hook, $args = array() ) {
 	$crons = _get_cron_array();
-	$key = md5(serialize($args));
-	if ( empty($crons) )
+	$key = md5( serialize( $args ) );
+	if ( empty( $crons ) ) {
 		return false;
+	}
 	foreach ( $crons as $timestamp => $cron ) {
-		if ( isset( $cron[$hook][$key] ) )
+		if ( isset( $cron[ $hook ][ $key ] ) ) {
 			return $timestamp;
+		}
 	}
 	return false;
 }
@@ -250,11 +276,13 @@
  * @param int $gmt_time Optional. Unix timestamp (UTC). Default 0 (current time is used).
  */
 function spawn_cron( $gmt_time = 0 ) {
-	if ( ! $gmt_time )
+	if ( ! $gmt_time ) {
 		$gmt_time = microtime( true );
+	}
 
-	if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) )
+	if ( defined( 'DOING_CRON' ) || isset( $_GET['doing_wp_cron'] ) ) {
 		return;
+	}
 
 	/*
 	 * Get the cron lock, which is a Unix timestamp of when the last cron was spawned
@@ -263,23 +291,27 @@
 	 * Multiple processes on multiple web servers can run this code concurrently,
 	 * this lock attempts to make spawning as atomic as possible.
 	 */
-	$lock = get_transient('doing_cron');
+	$lock = get_transient( 'doing_cron' );
 
-	if ( $lock > $gmt_time + 10 * MINUTE_IN_SECONDS )
+	if ( $lock > $gmt_time + 10 * MINUTE_IN_SECONDS ) {
 		$lock = 0;
+	}
 
 	// don't run if another process is currently running it or more than once every 60 sec.
-	if ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time )
+	if ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time ) {
 		return;
+	}
 
 	//sanity check
 	$crons = _get_cron_array();
-	if ( !is_array($crons) )
+	if ( ! is_array( $crons ) ) {
 		return;
+	}
 
 	$keys = array_keys( $crons );
-	if ( isset($keys[0]) && $keys[0] > $gmt_time )
+	if ( isset( $keys[0] ) && $keys[0] > $gmt_time ) {
 		return;
+	}
 
 	if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {
 		if ( 'GET' !== $_SERVER['REQUEST_METHOD'] || defined( 'DOING_AJAX' ) ||  defined( 'XMLRPC_REQUEST' ) ) {
@@ -294,7 +326,7 @@
 		echo ' ';
 
 		// flush any buffers and send the headers
-		while ( @ob_end_flush() );
+		while ( @ob_end_flush() ) {}
 		flush();
 
 		WP_DEBUG ? include_once( ABSPATH . 'wp-cron.php' ) : @include_once( ABSPATH . 'wp-cron.php' );
@@ -333,8 +365,8 @@
 			'timeout'   => 0.01,
 			'blocking'  => false,
 			/** This filter is documented in wp-includes/class-wp-http-streams.php */
-			'sslverify' => apply_filters( 'https_local_ssl_verify', false )
-		)
+			'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
+		),
 	), $doing_wp_cron );
 
 	wp_remote_post( $cron_request['url'], $cron_request['args'] );
@@ -347,23 +379,28 @@
  */
 function wp_cron() {
 	// Prevent infinite loops caused by lack of wp-cron.php
-	if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false || ( defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ) )
+	if ( strpos( $_SERVER['REQUEST_URI'], '/wp-cron.php' ) !== false || ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ) {
 		return;
+	}
 
-	if ( false === $crons = _get_cron_array() )
+	if ( false === $crons = _get_cron_array() ) {
 		return;
+	}
 
 	$gmt_time = microtime( true );
 	$keys = array_keys( $crons );
-	if ( isset($keys[0]) && $keys[0] > $gmt_time )
+	if ( isset( $keys[0] ) && $keys[0] > $gmt_time ) {
 		return;
+	}
 
 	$schedules = wp_get_schedules();
 	foreach ( $crons as $timestamp => $cronhooks ) {
-		if ( $timestamp > $gmt_time ) break;
+		if ( $timestamp > $gmt_time ) { break;
+		}
 		foreach ( (array) $cronhooks as $hook => $args ) {
-			if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) )
+			if ( isset( $schedules[ $hook ]['callback'] ) && ! call_user_func( $schedules[ $hook ]['callback'] ) ) {
 				continue;
+			}
 			spawn_cron( $gmt_time );
 			break 2;
 		}
@@ -402,9 +439,18 @@
  */
 function wp_get_schedules() {
 	$schedules = array(
-		'hourly'     => array( 'interval' => HOUR_IN_SECONDS,      'display' => __( 'Once Hourly' ) ),
-		'twicedaily' => array( 'interval' => 12 * HOUR_IN_SECONDS, 'display' => __( 'Twice Daily' ) ),
-		'daily'      => array( 'interval' => DAY_IN_SECONDS,       'display' => __( 'Once Daily' ) ),
+		'hourly'     => array(
+			'interval' => HOUR_IN_SECONDS,
+			'display' => __( 'Once Hourly' ),
+		),
+		'twicedaily' => array(
+			'interval' => 12 * HOUR_IN_SECONDS,
+			'display' => __( 'Twice Daily' ),
+		),
+		'daily'      => array(
+			'interval' => DAY_IN_SECONDS,
+			'display' => __( 'Once Daily' ),
+		),
 	);
 	/**
 	 * Filters the non-default cron schedules.
@@ -427,14 +473,16 @@
  * @param array $args Optional. Arguments passed to the event's callback function.
  * @return string|false False, if no schedule. Schedule name on success.
  */
-function wp_get_schedule($hook, $args = array()) {
+function wp_get_schedule( $hook, $args = array() ) {
 	$crons = _get_cron_array();
-	$key = md5(serialize($args));
-	if ( empty($crons) )
+	$key = md5( serialize( $args ) );
+	if ( empty( $crons ) ) {
 		return false;
+	}
 	foreach ( $crons as $timestamp => $cron ) {
-		if ( isset( $cron[$hook][$key] ) )
-			return $cron[$hook][$key]['schedule'];
+		if ( isset( $cron[ $hook ][ $key ] ) ) {
+			return $cron[ $hook ][ $key ]['schedule'];
+		}
 	}
 	return false;
 }
@@ -451,15 +499,17 @@
  *
  * @return false|array CRON info array.
  */
-function _get_cron_array()  {
-	$cron = get_option('cron');
-	if ( ! is_array($cron) )
+function _get_cron_array() {
+	$cron = get_option( 'cron' );
+	if ( ! is_array( $cron ) ) {
 		return false;
+	}
 
-	if ( !isset($cron['version']) )
-		$cron = _upgrade_cron_array($cron);
+	if ( ! isset( $cron['version'] ) ) {
+		$cron = _upgrade_cron_array( $cron );
+	}
 
-	unset($cron['version']);
+	unset( $cron['version'] );
 
 	return $cron;
 }
@@ -472,7 +522,7 @@
  *
  * @param array $cron Cron info array from _get_cron_array().
  */
-function _set_cron_array($cron) {
+function _set_cron_array( $cron ) {
 	$cron['version'] = 2;
 	update_option( 'cron', $cron );
 }
@@ -488,16 +538,17 @@
  * @param array $cron Cron info array from _get_cron_array().
  * @return array An upgraded Cron info array.
  */
-function _upgrade_cron_array($cron) {
-	if ( isset($cron['version']) && 2 == $cron['version'])
+function _upgrade_cron_array( $cron ) {
+	if ( isset( $cron['version'] ) && 2 == $cron['version'] ) {
 		return $cron;
+	}
 
 	$new_cron = array();
 
-	foreach ( (array) $cron as $timestamp => $hooks) {
+	foreach ( (array) $cron as $timestamp => $hooks ) {
 		foreach ( (array) $hooks as $hook => $args ) {
-			$key = md5(serialize($args['args']));
-			$new_cron[$timestamp][$hook][$key] = $args;
+			$key = md5( serialize( $args['args'] ) );
+			$new_cron[ $timestamp ][ $hook ][ $key ] = $args;
 		}
 	}
 
Index: src/wp-includes/customize/class-wp-customize-background-position-control.php
===================================================================
--- src/wp-includes/customize/class-wp-customize-background-position-control.php	(revision 40901)
+++ src/wp-includes/customize/class-wp-customize-background-position-control.php	(working copy)
@@ -42,19 +42,46 @@
 	public function content_template() {
 		$options = array(
 			array(
-				'left top'   => array( 'label' => __( 'Top Left' ), 'icon' => 'dashicons dashicons-arrow-left-alt' ),
-				'center top' => array( 'label' => __( 'Top' ), 'icon' => 'dashicons dashicons-arrow-up-alt' ),
-				'right top'  => array( 'label' => __( 'Top Right' ), 'icon' => 'dashicons dashicons-arrow-right-alt' ),
+				'left top'   => array(
+					'label' => __( 'Top Left' ),
+					'icon' => 'dashicons dashicons-arrow-left-alt',
+				),
+				'center top' => array(
+					'label' => __( 'Top' ),
+					'icon' => 'dashicons dashicons-arrow-up-alt',
+				),
+				'right top'  => array(
+					'label' => __( 'Top Right' ),
+					'icon' => 'dashicons dashicons-arrow-right-alt',
+				),
 			),
 			array(
-				'left center'   => array( 'label' => __( 'Left' ), 'icon' => 'dashicons dashicons-arrow-left-alt' ),
-				'center center' => array( 'label' => __( 'Center' ), 'icon' => 'background-position-center-icon' ),
-				'right center'  => array( 'label' => __( 'Right' ), 'icon' => 'dashicons dashicons-arrow-right-alt' ),
+				'left center'   => array(
+					'label' => __( 'Left' ),
+					'icon' => 'dashicons dashicons-arrow-left-alt',
+				),
+				'center center' => array(
+					'label' => __( 'Center' ),
+					'icon' => 'background-position-center-icon',
+				),
+				'right center'  => array(
+					'label' => __( 'Right' ),
+					'icon' => 'dashicons dashicons-arrow-right-alt',
+				),
 			),
 			array(
-				'left bottom'   => array( 'label' => __( 'Bottom Left' ), 'icon' => 'dashicons dashicons-arrow-left-alt' ),
-				'center bottom' => array( 'label' => __( 'Bottom' ), 'icon' => 'dashicons dashicons-arrow-down-alt' ),
-				'right bottom'  => array( 'label' => __( 'Bottom Right' ), 'icon' => 'dashicons dashicons-arrow-right-alt' ),
+				'left bottom'   => array(
+					'label' => __( 'Bottom Left' ),
+					'icon' => 'dashicons dashicons-arrow-left-alt',
+				),
+				'center bottom' => array(
+					'label' => __( 'Bottom' ),
+					'icon' => 'dashicons dashicons-arrow-down-alt',
+				),
+				'right bottom'  => array(
+					'label' => __( 'Bottom Right' ),
+					'icon' => 'dashicons dashicons-arrow-right-alt',
+				),
 			),
 		);
 		?>
Index: src/wp-includes/customize/class-wp-customize-color-control.php
===================================================================
--- src/wp-includes/customize/class-wp-customize-color-control.php	(revision 40901)
+++ src/wp-includes/customize/class-wp-customize-color-control.php	(working copy)
@@ -51,7 +51,9 @@
 	 * @param array                $args    Optional. Arguments to override class property defaults.
 	 */
 	public function __construct( $manager, $id, $args = array() ) {
-		$this->statuses = array( '' => __('Default') );
+		$this->statuses = array(
+			'' => __( 'Default' ),
+		);
 		parent::__construct( $manager, $id, $args );
 	}
 
Index: src/wp-includes/customize/class-wp-customize-header-image-control.php
===================================================================
--- src/wp-includes/customize/class-wp-customize-header-image-control.php	(revision 40901)
+++ src/wp-includes/customize/class-wp-customize-header-image-control.php	(working copy)
@@ -62,7 +62,7 @@
 				'remove' => wp_create_nonce( 'header-remove' ),
 			),
 			'uploads' => $this->uploaded_headers,
-			'defaults' => $this->default_headers
+			'defaults' => $this->default_headers,
 		) );
 
 		parent::enqueue();
@@ -168,7 +168,7 @@
 		<div class="customize-control-content">
 			<?php if ( current_theme_supports( 'custom-header', 'video' ) ) {
 				echo '<span class="customize-control-title">' . $this->label . '</span>';
-			} ?>
+} ?>
 			<div class="customize-control-notifications-container"></div>
 			<p class="customizer-section-intro customize-control-description">
 				<?php
@@ -202,7 +202,7 @@
 				</div>
 			</div>
 			<div class="actions">
-				<?php if ( current_user_can( 'upload_files' ) ): ?>
+				<?php if ( current_user_can( 'upload_files' ) ) : ?>
 				<button type="button"<?php echo $visibility; ?> class="button remove" aria-label="<?php esc_attr_e( 'Hide header image' ); ?>"><?php _e( 'Hide image' ); ?></button>
 				<button type="button" class="button new" id="header_image-button" aria-label="<?php esc_attr_e( 'Add new header image' ); ?>"><?php _e( 'Add new image' ); ?></button>
 				<?php endif; ?>
Index: src/wp-includes/customize/class-wp-customize-header-image-setting.php
===================================================================
--- src/wp-includes/customize/class-wp-customize-header-image-setting.php	(revision 40901)
+++ src/wp-includes/customize/class-wp-customize-header-image-setting.php	(working copy)
@@ -40,12 +40,13 @@
 
 		// If the value doesn't exist (removed or random),
 		// use the header_image value.
-		if ( ! $value )
-			$value = $this->manager->get_setting('header_image')->post_value();
+		if ( ! $value ) {
+			$value = $this->manager->get_setting( 'header_image' )->post_value();
+		}
 
-		if ( is_array( $value ) && isset( $value['choice'] ) )
+		if ( is_array( $value ) && isset( $value['choice'] ) ) {
 			$custom_image_header->set_header_image( $value['choice'] );
-		else
-			$custom_image_header->set_header_image( $value );
+		} else { $custom_image_header->set_header_image( $value );
+		}
 	}
 }
Index: src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
===================================================================
--- src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php	(revision 40901)
+++ src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php	(working copy)
@@ -261,7 +261,7 @@
 			$this->value = $value;
 			$this->populate_value();
 			$value = $this->value;
-		}
+		}// End if().
 
 		if ( ! empty( $value ) && empty( $value['type_label'] ) ) {
 			$value['type_label'] = $this->get_type_label( (object) $value );
@@ -779,7 +779,6 @@
 				} else {
 					$this->update_status = 'deleted';
 				}
-				// @todo send back the IDs for all associated nav menu items deleted, so these settings (and controls) can be removed from Customizer?
 			}
 		} else {
 
@@ -870,7 +869,7 @@
 					$this->update_status = 'updated';
 				}
 			}
-		}
+		}// End if().
 
 	}
 
Index: src/wp-includes/customize/class-wp-customize-nav-menu-setting.php
===================================================================
--- src/wp-includes/customize/class-wp-customize-nav-menu-setting.php	(revision 40901)
+++ src/wp-includes/customize/class-wp-customize-nav-menu-setting.php	(working copy)
@@ -376,7 +376,7 @@
 				'term_group'       => 0,
 				'taxonomy'         => self::TAXONOMY,
 				'filter'           => 'raw',
-			), $setting_value );
+		), $setting_value );
 
 		return $menu_obj;
 	}
@@ -546,7 +546,7 @@
 
 				$auto_add = $value['auto_add'];
 			}
-		}
+		}// End if().
 
 		if ( null !== $auto_add ) {
 			$nav_menu_options = $this->filter_nav_menu_options_value(
Index: src/wp-includes/customize/class-wp-customize-nav-menus-panel.php
===================================================================
--- src/wp-includes/customize/class-wp-customize-nav-menus-panel.php	(revision 40901)
+++ src/wp-includes/customize/class-wp-customize-nav-menus-panel.php	(working copy)
@@ -40,7 +40,9 @@
 
 		// Display screen options.
 		$screen = WP_Screen::get( 'nav-menus.php' );
-		$screen->render_screen_options( array( 'wrap' => false ) );
+		$screen->render_screen_options( array(
+			'wrap' => false,
+		) );
 	}
 
 	/**
Index: src/wp-includes/customize/class-wp-customize-partial.php
===================================================================
--- src/wp-includes/customize/class-wp-customize-partial.php	(revision 40901)
+++ src/wp-includes/customize/class-wp-customize-partial.php	(working copy)
@@ -171,7 +171,7 @@
 		// Process settings.
 		if ( ! isset( $this->settings ) ) {
 			$this->settings = array( $id );
-		} else if ( is_string( $this->settings ) ) {
+		} elseif ( is_string( $this->settings ) ) {
 			$this->settings = array( $this->settings );
 		}
 
Index: src/wp-includes/customize/class-wp-customize-selective-refresh.php
===================================================================
--- src/wp-includes/customize/class-wp-customize-selective-refresh.php	(revision 40901)
+++ src/wp-includes/customize/class-wp-customize-selective-refresh.php	(working copy)
@@ -281,7 +281,7 @@
 
 			$this->add_partial( $partial );
 			$new_partials[] = $partial;
-		}
+		}// End foreach().
 		return $new_partials;
 	}
 
Index: src/wp-includes/date.php
===================================================================
--- src/wp-includes/date.php	(revision 40901)
+++ src/wp-includes/date.php	(working copy)
@@ -272,8 +272,9 @@
 	 * @return string The comparison operator.
 	 */
 	public function get_compare( $query ) {
-		if ( ! empty( $query['compare'] ) && in_array( $query['compare'], array( '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) )
+		if ( ! empty( $query['compare'] ) && in_array( $query['compare'], array( '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
 			return strtoupper( $query['compare'] );
+		}
 
 		return $this->compare;
 	}
@@ -303,11 +304,11 @@
 		 * validation routine continue to be sure that all invalid
 		 * values generate errors too.
 		 */
-		if ( array_key_exists( 'before', $date_query ) && is_array( $date_query['before'] ) ){
+		if ( array_key_exists( 'before', $date_query ) && is_array( $date_query['before'] ) ) {
 			$valid = $this->validate_date_values( $date_query['before'] );
 		}
 
-		if ( array_key_exists( 'after', $date_query ) && is_array( $date_query['after'] ) ){
+		if ( array_key_exists( 'after', $date_query ) && is_array( $date_query['after'] ) ) {
 			$valid = $this->validate_date_values( $date_query['after'] );
 		}
 
@@ -334,25 +335,25 @@
 
 		$min_max_checks['dayofyear'] = array(
 			'min' => 1,
-			'max' => $max_days_of_year
+			'max' => $max_days_of_year,
 		);
 
 		// Days per week.
 		$min_max_checks['dayofweek'] = array(
 			'min' => 1,
-			'max' => 7
+			'max' => 7,
 		);
 
 		// Days per week.
 		$min_max_checks['dayofweek_iso'] = array(
 			'min' => 1,
-			'max' => 7
+			'max' => 7,
 		);
 
 		// Months per year.
 		$min_max_checks['month'] = array(
 			'min' => 1,
-			'max' => 12
+			'max' => 12,
 		);
 
 		// Weeks per year.
@@ -370,31 +371,31 @@
 
 		$min_max_checks['week'] = array(
 			'min' => 1,
-			'max' => $week_count
+			'max' => $week_count,
 		);
 
 		// Days per month.
 		$min_max_checks['day'] = array(
 			'min' => 1,
-			'max' => 31
+			'max' => 31,
 		);
 
 		// Hours per day.
 		$min_max_checks['hour'] = array(
 			'min' => 0,
-			'max' => 23
+			'max' => 23,
 		);
 
 		// Minutes per hour.
 		$min_max_checks['minute'] = array(
 			'min' => 0,
-			'max' => 59
+			'max' => 59,
 		);
 
 		// Seconds per minute.
 		$min_max_checks['second'] = array(
 			'min' => 0,
-			'max' => 59
+			'max' => 59,
 		);
 
 		// Concatenate and throw a notice for each invalid value.
@@ -448,7 +449,6 @@
 
 				$valid = false;
 			}
-
 		} elseif ( $day_exists && $month_exists ) {
 			/*
 			 * 2. checking day, month combination
@@ -491,9 +491,15 @@
 		global $wpdb;
 
 		$valid_columns = array(
-			'post_date', 'post_date_gmt', 'post_modified',
-			'post_modified_gmt', 'comment_date', 'comment_date_gmt',
-			'user_registered', 'registered', 'last_updated',
+			'post_date',
+		'post_date_gmt',
+		'post_modified',
+			'post_modified_gmt',
+		'comment_date',
+		'comment_date_gmt',
+			'user_registered',
+		'registered',
+		'last_updated',
 		);
 
 		// Attempt to detect a table prefix.
@@ -540,8 +546,7 @@
 					break;
 				}
 			}
-
-		}
+		}// End if().
 
 		// Remove unsafe characters.
 		return preg_replace( '/[^a-zA-Z0-9_$\.]/', '', $column );
@@ -629,7 +634,7 @@
 
 		$indent = '';
 		for ( $i = 0; $i < $depth; $i++ ) {
-			$indent .= "  ";
+			$indent .= '  ';
 		}
 
 		foreach ( $query as $key => $clause ) {
@@ -651,7 +656,7 @@
 					}
 
 					$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );
-				// This is a subquery, so we recurse.
+					// This is a subquery, so we recurse.
 				} else {
 					$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );
 
@@ -750,8 +755,9 @@
 		}
 		// Specific value queries.
 
-		if ( isset( $query['year'] ) && $value = $this->build_value( $compare, $query['year'] ) )
+		if ( isset( $query['year'] ) && $value = $this->build_value( $compare, $query['year'] ) ) {
 			$where_parts[] = "YEAR( $column ) $compare $value";
+		}
 
 		if ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) ) {
 			$where_parts[] = "MONTH( $column ) $compare $value";
@@ -763,17 +769,21 @@
 		} elseif ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) ) {
 			$where_parts[] = _wp_mysql_week( $column ) . " $compare $value";
 		}
-		if ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) )
+		if ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) ) {
 			$where_parts[] = "DAYOFYEAR( $column ) $compare $value";
+		}
 
-		if ( isset( $query['day'] ) && $value = $this->build_value( $compare, $query['day'] ) )
+		if ( isset( $query['day'] ) && $value = $this->build_value( $compare, $query['day'] ) ) {
 			$where_parts[] = "DAYOFMONTH( $column ) $compare $value";
+		}
 
-		if ( isset( $query['dayofweek'] ) && $value = $this->build_value( $compare, $query['dayofweek'] ) )
+		if ( isset( $query['dayofweek'] ) && $value = $this->build_value( $compare, $query['dayofweek'] ) ) {
 			$where_parts[] = "DAYOFWEEK( $column ) $compare $value";
+		}
 
-		if ( isset( $query['dayofweek_iso'] ) && $value = $this->build_value( $compare, $query['dayofweek_iso'] ) )
+		if ( isset( $query['dayofweek_iso'] ) && $value = $this->build_value( $compare, $query['dayofweek_iso'] ) ) {
 			$where_parts[] = "WEEKDAY( $column ) + 1 $compare $value";
+		}
 
 		if ( isset( $query['hour'] ) || isset( $query['minute'] ) || isset( $query['second'] ) ) {
 			// Avoid notices.
@@ -809,8 +819,9 @@
 	 * @return string|false|int The value to be used in SQL or false on error.
 	 */
 	public function build_value( $compare, $value ) {
-		if ( ! isset( $value ) )
+		if ( ! isset( $value ) ) {
 			return false;
+		}
 
 		switch ( $compare ) {
 			case 'IN':
@@ -851,7 +862,7 @@
 				}
 
 				return (int) $value;
-		}
+		}// End switch().
 	}
 
 	/**
@@ -917,27 +928,33 @@
 				// @todo Timezone issues here possibly
 				return gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) );
 			}
-		}
+		}// End if().
 
 		$datetime = array_map( 'absint', $datetime );
 
-		if ( ! isset( $datetime['year'] ) )
+		if ( ! isset( $datetime['year'] ) ) {
 			$datetime['year'] = gmdate( 'Y', $now );
+		}
 
-		if ( ! isset( $datetime['month'] ) )
+		if ( ! isset( $datetime['month'] ) ) {
 			$datetime['month'] = ( $default_to_max ) ? 12 : 1;
+		}
 
-		if ( ! isset( $datetime['day'] ) )
+		if ( ! isset( $datetime['day'] ) ) {
 			$datetime['day'] = ( $default_to_max ) ? (int) date( 't', mktime( 0, 0, 0, $datetime['month'], 1, $datetime['year'] ) ) : 1;
+		}
 
-		if ( ! isset( $datetime['hour'] ) )
+		if ( ! isset( $datetime['hour'] ) ) {
 			$datetime['hour'] = ( $default_to_max ) ? 23 : 0;
+		}
 
-		if ( ! isset( $datetime['minute'] ) )
+		if ( ! isset( $datetime['minute'] ) ) {
 			$datetime['minute'] = ( $default_to_max ) ? 59 : 0;
+		}
 
-		if ( ! isset( $datetime['second'] ) )
+		if ( ! isset( $datetime['second'] ) ) {
 			$datetime['second'] = ( $default_to_max ) ? 59 : 0;
+		}
 
 		return sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $datetime['year'], $datetime['month'], $datetime['day'], $datetime['hour'], $datetime['minute'], $datetime['second'] );
 	}
@@ -963,21 +980,25 @@
 		global $wpdb;
 
 		// Have to have at least one
-		if ( ! isset( $hour ) && ! isset( $minute ) && ! isset( $second ) )
+		if ( ! isset( $hour ) && ! isset( $minute ) && ! isset( $second ) ) {
 			return false;
+		}
 
 		// Complex combined queries aren't supported for multi-value queries
 		if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
 			$return = array();
 
-			if ( isset( $hour ) && false !== ( $value = $this->build_value( $compare, $hour ) ) )
+			if ( isset( $hour ) && false !== ( $value = $this->build_value( $compare, $hour ) ) ) {
 				$return[] = "HOUR( $column ) $compare $value";
+			}
 
-			if ( isset( $minute ) && false !== ( $value = $this->build_value( $compare, $minute ) ) )
+			if ( isset( $minute ) && false !== ( $value = $this->build_value( $compare, $minute ) ) ) {
 				$return[] = "MINUTE( $column ) $compare $value";
+			}
 
-			if ( isset( $second ) && false !== ( $value = $this->build_value( $compare, $second ) ) )
+			if ( isset( $second ) && false !== ( $value = $this->build_value( $compare, $second ) ) ) {
 				$return[] = "SECOND( $column ) $compare $value";
+			}
 
 			return implode( ' AND ', $return );
 		}
@@ -992,8 +1013,9 @@
 		}
 
 		// Single units were already handled. Since hour & second isn't allowed, minute must to be set.
-		if ( ! isset( $minute ) )
+		if ( ! isset( $minute ) ) {
 			return false;
+		}
 
 		$format = $time = '';
 
Index: src/wp-includes/default-constants.php
===================================================================
--- src/wp-includes/default-constants.php	(revision 40901)
+++ src/wp-includes/default-constants.php	(working copy)
@@ -58,27 +58,33 @@
 		@ini_set( 'memory_limit', WP_MEMORY_LIMIT );
 	}
 
-	if ( ! isset($blog_id) )
+	if ( ! isset( $blog_id ) ) {
 		$blog_id = 1;
+	}
 
-	if ( !defined('WP_CONTENT_DIR') )
+	if ( ! defined( 'WP_CONTENT_DIR' ) ) {
 		define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down
+	}
 
 	// Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development.
-	if ( !defined('WP_DEBUG') )
+	if ( ! defined( 'WP_DEBUG' ) ) {
 		define( 'WP_DEBUG', false );
+	}
 
 	// Add define('WP_DEBUG_DISPLAY', null); to wp-config.php use the globally configured setting for
 	// display_errors and not force errors to be displayed. Use false to force display_errors off.
-	if ( !defined('WP_DEBUG_DISPLAY') )
+	if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) {
 		define( 'WP_DEBUG_DISPLAY', true );
+	}
 
 	// Add define('WP_DEBUG_LOG', true); to enable error logging to wp-content/debug.log.
-	if ( !defined('WP_DEBUG_LOG') )
-		define('WP_DEBUG_LOG', false);
+	if ( ! defined( 'WP_DEBUG_LOG' ) ) {
+		define( 'WP_DEBUG_LOG', false );
+	}
 
-	if ( !defined('WP_CACHE') )
-		define('WP_CACHE', false);
+	if ( ! defined( 'WP_CACHE' ) ) {
+		define( 'WP_CACHE', false );
+	}
 
 	// Add define('SCRIPT_DEBUG', true); to wp-config.php to enable loading of non-minified,
 	// non-concatenated scripts and stylesheets.
@@ -95,11 +101,13 @@
 	/**
 	 * Private
 	 */
-	if ( !defined('MEDIA_TRASH') )
-		define('MEDIA_TRASH', false);
+	if ( ! defined( 'MEDIA_TRASH' ) ) {
+		define( 'MEDIA_TRASH', false );
+	}
 
-	if ( !defined('SHORTINIT') )
-		define('SHORTINIT', false);
+	if ( ! defined( 'SHORTINIT' ) ) {
+		define( 'SHORTINIT', false );
+	}
 
 	// Constants for features added to WP that should short-circuit their plugin implementations
 	define( 'WP_FEATURE_BETTER_PASSWORDS', true );
@@ -119,10 +127,10 @@
 	 */
 	define( 'MINUTE_IN_SECONDS', 60 );
 	define( 'HOUR_IN_SECONDS',   60 * MINUTE_IN_SECONDS );
-	define( 'DAY_IN_SECONDS',    24 * HOUR_IN_SECONDS   );
-	define( 'WEEK_IN_SECONDS',    7 * DAY_IN_SECONDS    );
-	define( 'MONTH_IN_SECONDS',  30 * DAY_IN_SECONDS    );
-	define( 'YEAR_IN_SECONDS',  365 * DAY_IN_SECONDS    );
+	define( 'DAY_IN_SECONDS',    24 * HOUR_IN_SECONDS );
+	define( 'WEEK_IN_SECONDS',    7 * DAY_IN_SECONDS );
+	define( 'MONTH_IN_SECONDS',  30 * DAY_IN_SECONDS );
+	define( 'YEAR_IN_SECONDS',  365 * DAY_IN_SECONDS );
 	/**#@-*/
 }
 
@@ -134,24 +142,27 @@
  * @since 3.0.0
  */
 function wp_plugin_directory_constants() {
-	if ( !defined('WP_CONTENT_URL') )
-		define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
+	if ( ! defined( 'WP_CONTENT_URL' ) ) {
+		define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); // full url - WP_CONTENT_DIR is defined further up
+	}
 
 	/**
 	 * Allows for the plugins directory to be moved from the default location.
 	 *
 	 * @since 2.6.0
 	 */
-	if ( !defined('WP_PLUGIN_DIR') )
+	if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
 		define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash
+	}
 
 	/**
 	 * Allows for the plugins directory to be moved from the default location.
 	 *
 	 * @since 2.6.0
 	 */
-	if ( !defined('WP_PLUGIN_URL') )
+	if ( ! defined( 'WP_PLUGIN_URL' ) ) {
 		define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash
+	}
 
 	/**
 	 * Allows for the plugins directory to be moved from the default location.
@@ -159,24 +170,27 @@
 	 * @since 2.1.0
 	 * @deprecated
 	 */
-	if ( !defined('PLUGINDIR') )
+	if ( ! defined( 'PLUGINDIR' ) ) {
 		define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
+	}
 
 	/**
 	 * Allows for the mu-plugins directory to be moved from the default location.
 	 *
 	 * @since 2.8.0
 	 */
-	if ( !defined('WPMU_PLUGIN_DIR') )
+	if ( ! defined( 'WPMU_PLUGIN_DIR' ) ) {
 		define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash
+	}
 
 	/**
 	 * Allows for the mu-plugins directory to be moved from the default location.
 	 *
 	 * @since 2.8.0
 	 */
-	if ( !defined('WPMU_PLUGIN_URL') )
+	if ( ! defined( 'WPMU_PLUGIN_URL' ) ) {
 		define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash
+	}
 
 	/**
 	 * Allows for the mu-plugins directory to be moved from the default location.
@@ -184,8 +198,9 @@
 	 * @since 2.8.0
 	 * @deprecated
 	 */
-	if ( !defined( 'MUPLUGINDIR' ) )
+	if ( ! defined( 'MUPLUGINDIR' ) ) {
 		define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.
+	}
 }
 
 /**
@@ -200,79 +215,90 @@
 	 *
 	 * @since 1.5.0
 	 */
-	if ( !defined( 'COOKIEHASH' ) ) {
+	if ( ! defined( 'COOKIEHASH' ) ) {
 		$siteurl = get_site_option( 'siteurl' );
-		if ( $siteurl )
+		if ( $siteurl ) {
 			define( 'COOKIEHASH', md5( $siteurl ) );
-		else
-			define( 'COOKIEHASH', '' );
+		} else { define( 'COOKIEHASH', '' );
+		}
 	}
 
 	/**
 	 * @since 2.0.0
 	 */
-	if ( !defined('USER_COOKIE') )
-		define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
+	if ( ! defined( 'USER_COOKIE' ) ) {
+		define( 'USER_COOKIE', 'wordpressuser_' . COOKIEHASH );
+	}
 
 	/**
 	 * @since 2.0.0
 	 */
-	if ( !defined('PASS_COOKIE') )
-		define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
+	if ( ! defined( 'PASS_COOKIE' ) ) {
+		define( 'PASS_COOKIE', 'wordpresspass_' . COOKIEHASH );
+	}
 
 	/**
 	 * @since 2.5.0
 	 */
-	if ( !defined('AUTH_COOKIE') )
-		define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
+	if ( ! defined( 'AUTH_COOKIE' ) ) {
+		define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH );
+	}
 
 	/**
 	 * @since 2.6.0
 	 */
-	if ( !defined('SECURE_AUTH_COOKIE') )
-		define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH);
+	if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) {
+		define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH );
+	}
 
 	/**
 	 * @since 2.6.0
 	 */
-	if ( !defined('LOGGED_IN_COOKIE') )
-		define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);
+	if ( ! defined( 'LOGGED_IN_COOKIE' ) ) {
+		define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH );
+	}
 
 	/**
 	 * @since 2.3.0
 	 */
-	if ( !defined('TEST_COOKIE') )
-		define('TEST_COOKIE', 'wordpress_test_cookie');
+	if ( ! defined( 'TEST_COOKIE' ) ) {
+		define( 'TEST_COOKIE', 'wordpress_test_cookie' );
+	}
 
 	/**
 	 * @since 1.2.0
 	 */
-	if ( !defined('COOKIEPATH') )
-		define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
+	if ( ! defined( 'COOKIEPATH' ) ) {
+		define( 'COOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'home' ) . '/' ) );
+	}
 
 	/**
 	 * @since 1.5.0
 	 */
-	if ( !defined('SITECOOKIEPATH') )
-		define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
+	if ( ! defined( 'SITECOOKIEPATH' ) ) {
+		define( 'SITECOOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'siteurl' ) . '/' ) );
+	}
 
 	/**
 	 * @since 2.6.0
 	 */
-	if ( !defined('ADMIN_COOKIE_PATH') )
+	if ( ! defined( 'ADMIN_COOKIE_PATH' ) ) {
 		define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
+	}
 
 	/**
 	 * @since 2.6.0
 	 */
-	if ( !defined('PLUGINS_COOKIE_PATH') )
-		define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL)  );
+	if ( ! defined( 'PLUGINS_COOKIE_PATH' ) ) {
+		define( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL ) );
+	}
 
 	/**
 	 * @since 2.0.0
 	 */
-	if ( !defined('COOKIE_DOMAIN') )
-		define('COOKIE_DOMAIN', false);
+	if ( ! defined( 'COOKIE_DOMAIN' ) ) {
+		define( 'COOKIE_DOMAIN', false );
+	}
 }
 
 /**
@@ -284,7 +310,7 @@
 	/**
 	 * @since 2.6.0
 	 */
-	if ( !defined( 'FORCE_SSL_ADMIN' ) ) {
+	if ( ! defined( 'FORCE_SSL_ADMIN' ) ) {
 		if ( 'https' === parse_url( get_option( 'siteurl' ), PHP_URL_SCHEME ) ) {
 			define( 'FORCE_SSL_ADMIN', true );
 		} else {
@@ -311,23 +337,27 @@
 	/**
 	 * @since 2.5.0
 	 */
-	if ( !defined( 'AUTOSAVE_INTERVAL' ) )
+	if ( ! defined( 'AUTOSAVE_INTERVAL' ) ) {
 		define( 'AUTOSAVE_INTERVAL', 60 );
+	}
 
 	/**
 	 * @since 2.9.0
 	 */
-	if ( !defined( 'EMPTY_TRASH_DAYS' ) )
+	if ( ! defined( 'EMPTY_TRASH_DAYS' ) ) {
 		define( 'EMPTY_TRASH_DAYS', 30 );
+	}
 
-	if ( !defined('WP_POST_REVISIONS') )
-		define('WP_POST_REVISIONS', true);
+	if ( ! defined( 'WP_POST_REVISIONS' ) ) {
+		define( 'WP_POST_REVISIONS', true );
+	}
 
 	/**
 	 * @since 3.3.0
 	 */
-	if ( !defined( 'WP_CRON_LOCK_TIMEOUT' ) )
-		define('WP_CRON_LOCK_TIMEOUT', 60);  // In seconds
+	if ( ! defined( 'WP_CRON_LOCK_TIMEOUT' ) ) {
+		define( 'WP_CRON_LOCK_TIMEOUT', 60 );  // In seconds
+	}
 }
 
 /**
@@ -340,13 +370,13 @@
 	 * Filesystem path to the current active template directory
 	 * @since 1.5.0
 	 */
-	define('TEMPLATEPATH', get_template_directory());
+	define( 'TEMPLATEPATH', get_template_directory() );
 
 	/**
 	 * Filesystem path to the current active template stylesheet directory
 	 * @since 2.1.0
 	 */
-	define('STYLESHEETPATH', get_stylesheet_directory());
+	define( 'STYLESHEETPATH', get_stylesheet_directory() );
 
 	/**
 	 * Slug of the default theme for this install.
@@ -356,7 +386,8 @@
 	 * @since 3.0.0
 	 * @see WP_Theme::get_core_default_theme()
 	 */
-	if ( !defined('WP_DEFAULT_THEME') )
+	if ( ! defined( 'WP_DEFAULT_THEME' ) ) {
 		define( 'WP_DEFAULT_THEME', 'twentyseventeen' );
+	}
 
 }
Index: src/wp-includes/default-filters.php
===================================================================
--- src/wp-includes/default-filters.php	(revision 40901)
+++ src/wp-includes/default-filters.php	(working copy)
@@ -14,8 +14,8 @@
 
 // Strip, trim, kses, special chars for string saves
 foreach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) {
-	add_filter( $filter, 'sanitize_text_field'  );
-	add_filter( $filter, 'wp_filter_kses'       );
+	add_filter( $filter, 'sanitize_text_field' );
+	add_filter( $filter, 'wp_filter_kses' );
 	add_filter( $filter, '_wp_specialchars', 30 );
 }
 
@@ -23,8 +23,8 @@
 foreach ( array( 'term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname' ) as $filter ) {
 	if ( is_admin() ) {
 		// These are expensive. Run only on admin pages for defense in depth.
-		add_filter( $filter, 'sanitize_text_field'  );
-		add_filter( $filter, 'wp_kses_data'       );
+		add_filter( $filter, 'sanitize_text_field' );
+		add_filter( $filter, 'wp_kses_data' );
 	}
 	add_filter( $filter, '_wp_specialchars', 30 );
 }
@@ -44,7 +44,7 @@
 
 // Email saves
 foreach ( array( 'pre_comment_author_email', 'pre_user_email' ) as $filter ) {
-	add_filter( $filter, 'trim'           );
+	add_filter( $filter, 'trim' );
 	add_filter( $filter, 'sanitize_email' );
 	add_filter( $filter, 'wp_filter_kses' );
 }
@@ -52,25 +52,34 @@
 // Email admin display
 foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) {
 	add_filter( $filter, 'sanitize_email' );
-	if ( is_admin() )
+	if ( is_admin() ) {
 		add_filter( $filter, 'wp_kses_data' );
+	}
 }
 
 // Save URL
-foreach ( array( 'pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image',
-	'pre_link_rss', 'pre_post_guid' ) as $filter ) {
+foreach ( array(
+'pre_comment_author_url',
+'pre_user_url',
+'pre_link_url',
+'pre_link_image',
+	'pre_link_rss',
+'pre_post_guid',
+) as $filter ) {
 	add_filter( $filter, 'wp_strip_all_tags' );
-	add_filter( $filter, 'esc_url_raw'       );
-	add_filter( $filter, 'wp_filter_kses'    );
+	add_filter( $filter, 'esc_url_raw' );
+	add_filter( $filter, 'wp_filter_kses' );
 }
 
 // Display URL
 foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url', 'post_guid' ) as $filter ) {
-	if ( is_admin() )
+	if ( is_admin() ) {
 		add_filter( $filter, 'wp_strip_all_tags' );
-	add_filter( $filter, 'esc_url'           );
-	if ( is_admin() )
-		add_filter( $filter, 'wp_kses_data'    );
+	}
+	add_filter( $filter, 'esc_url' );
+	if ( is_admin() ) {
+		add_filter( $filter, 'wp_kses_data' );
+	}
 }
 
 // Slugs
@@ -97,28 +106,29 @@
 
 // Format strings for display.
 foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title' ) as $filter ) {
-	add_filter( $filter, 'wptexturize'   );
+	add_filter( $filter, 'wptexturize' );
 	add_filter( $filter, 'convert_chars' );
-	add_filter( $filter, 'esc_html'      );
+	add_filter( $filter, 'esc_html' );
 }
 
 // Format WordPress
-foreach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter )
+foreach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter ) {
 	add_filter( $filter, 'capital_P_dangit', 11 );
+}
 add_filter( 'comment_text', 'capital_P_dangit', 31 );
 
 // Format titles
 foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) {
 	add_filter( $filter, 'wptexturize' );
-	add_filter( $filter, 'strip_tags'  );
+	add_filter( $filter, 'strip_tags' );
 }
 
 // Format text area for display.
 foreach ( array( 'term_description' ) as $filter ) {
-	add_filter( $filter, 'wptexturize'      );
-	add_filter( $filter, 'convert_chars'    );
-	add_filter( $filter, 'wpautop'          );
-	add_filter( $filter, 'shortcode_unautop');
+	add_filter( $filter, 'wptexturize' );
+	add_filter( $filter, 'convert_chars' );
+	add_filter( $filter, 'wpautop' );
+	add_filter( $filter, 'shortcode_unautop' );
 }
 
 // Format for RSS
@@ -129,30 +139,30 @@
 add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 );
 
 // Display filters
-add_filter( 'the_title', 'wptexturize'   );
+add_filter( 'the_title', 'wptexturize' );
 add_filter( 'the_title', 'convert_chars' );
-add_filter( 'the_title', 'trim'          );
+add_filter( 'the_title', 'trim' );
 
-add_filter( 'the_content', 'wptexturize'                       );
+add_filter( 'the_content', 'wptexturize' );
 add_filter( 'the_content', 'convert_smilies',               20 );
-add_filter( 'the_content', 'wpautop'                           );
-add_filter( 'the_content', 'shortcode_unautop'                 );
-add_filter( 'the_content', 'prepend_attachment'                );
+add_filter( 'the_content', 'wpautop' );
+add_filter( 'the_content', 'shortcode_unautop' );
+add_filter( 'the_content', 'prepend_attachment' );
 add_filter( 'the_content', 'wp_make_content_images_responsive' );
 
-add_filter( 'the_excerpt',     'wptexturize'      );
-add_filter( 'the_excerpt',     'convert_smilies'  );
-add_filter( 'the_excerpt',     'convert_chars'    );
-add_filter( 'the_excerpt',     'wpautop'          );
-add_filter( 'the_excerpt',     'shortcode_unautop');
-add_filter( 'get_the_excerpt', 'wp_trim_excerpt'  );
+add_filter( 'the_excerpt',     'wptexturize' );
+add_filter( 'the_excerpt',     'convert_smilies' );
+add_filter( 'the_excerpt',     'convert_chars' );
+add_filter( 'the_excerpt',     'wpautop' );
+add_filter( 'the_excerpt',     'shortcode_unautop' );
+add_filter( 'get_the_excerpt', 'wp_trim_excerpt' );
 
-add_filter( 'the_post_thumbnail_caption', 'wptexturize'     );
+add_filter( 'the_post_thumbnail_caption', 'wptexturize' );
 add_filter( 'the_post_thumbnail_caption', 'convert_smilies' );
-add_filter( 'the_post_thumbnail_caption', 'convert_chars'   );
+add_filter( 'the_post_thumbnail_caption', 'convert_chars' );
 
-add_filter( 'comment_text', 'wptexturize'            );
-add_filter( 'comment_text', 'convert_chars'          );
+add_filter( 'comment_text', 'wptexturize' );
+add_filter( 'comment_text', 'convert_chars' );
 add_filter( 'comment_text', 'make_clickable',      9 );
 add_filter( 'comment_text', 'force_balance_tags', 25 );
 add_filter( 'comment_text', 'convert_smilies',    20 );
@@ -164,32 +174,32 @@
 
 add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 );
 
-add_filter( 'widget_text',         'balanceTags'          );
+add_filter( 'widget_text',         'balanceTags' );
 add_filter( 'widget_text_content', 'capital_P_dangit', 11 );
-add_filter( 'widget_text_content', 'wptexturize'          );
+add_filter( 'widget_text_content', 'wptexturize' );
 add_filter( 'widget_text_content', 'convert_smilies',  20 );
-add_filter( 'widget_text_content', 'wpautop'              );
+add_filter( 'widget_text_content', 'wpautop' );
 
 add_filter( 'widget_html_code_content', 'balanceTags' );
 
 add_filter( 'date_i18n', 'wp_maybe_decline_date' );
 
 // RSS filters
-add_filter( 'the_title_rss',      'strip_tags'                    );
+add_filter( 'the_title_rss',      'strip_tags' );
 add_filter( 'the_title_rss',      'ent2ncr',                    8 );
-add_filter( 'the_title_rss',      'esc_html'                      );
+add_filter( 'the_title_rss',      'esc_html' );
 add_filter( 'the_content_rss',    'ent2ncr',                    8 );
-add_filter( 'the_content_feed',   'wp_staticize_emoji'            );
-add_filter( 'the_content_feed',   '_oembed_filter_feed_content'   );
-add_filter( 'the_excerpt_rss',    'convert_chars'                 );
+add_filter( 'the_content_feed',   'wp_staticize_emoji' );
+add_filter( 'the_content_feed',   '_oembed_filter_feed_content' );
+add_filter( 'the_excerpt_rss',    'convert_chars' );
 add_filter( 'the_excerpt_rss',    'ent2ncr',                    8 );
 add_filter( 'comment_author_rss', 'ent2ncr',                    8 );
 add_filter( 'comment_text_rss',   'ent2ncr',                    8 );
-add_filter( 'comment_text_rss',   'esc_html'                      );
-add_filter( 'comment_text_rss',   'wp_staticize_emoji'            );
+add_filter( 'comment_text_rss',   'esc_html' );
+add_filter( 'comment_text_rss',   'wp_staticize_emoji' );
 add_filter( 'bloginfo_rss',       'ent2ncr',                    8 );
 add_filter( 'the_author',         'ent2ncr',                    8 );
-add_filter( 'the_guid',           'esc_url'                       );
+add_filter( 'the_guid',           'esc_url' );
 
 // Email filters
 add_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
@@ -200,30 +210,30 @@
 }
 
 // Misc filters
-add_filter( 'option_ping_sites',        'privacy_ping_filter'                 );
-add_filter( 'option_blog_charset',      '_wp_specialchars'                    ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop
-add_filter( 'option_blog_charset',      '_canonical_charset'                  );
-add_filter( 'option_home',              '_config_wp_home'                     );
-add_filter( 'option_siteurl',           '_config_wp_siteurl'                  );
-add_filter( 'tiny_mce_before_init',     '_mce_set_direction'                  );
-add_filter( 'teeny_mce_before_init',    '_mce_set_direction'                  );
-add_filter( 'pre_kses',                 'wp_pre_kses_less_than'               );
+add_filter( 'option_ping_sites',        'privacy_ping_filter' );
+add_filter( 'option_blog_charset',      '_wp_specialchars' ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop
+add_filter( 'option_blog_charset',      '_canonical_charset' );
+add_filter( 'option_home',              '_config_wp_home' );
+add_filter( 'option_siteurl',           '_config_wp_siteurl' );
+add_filter( 'tiny_mce_before_init',     '_mce_set_direction' );
+add_filter( 'teeny_mce_before_init',    '_mce_set_direction' );
+add_filter( 'pre_kses',                 'wp_pre_kses_less_than' );
 add_filter( 'sanitize_title',           'sanitize_title_with_dashes',   10, 3 );
 add_action( 'check_comment_flood',      'check_comment_flood_db',       10, 4 );
 add_filter( 'comment_flood_filter',     'wp_throttle_comment_flood',    10, 3 );
-add_filter( 'pre_comment_content',      'wp_rel_nofollow',              15    );
-add_filter( 'comment_email',            'antispambot'                         );
-add_filter( 'option_tag_base',          '_wp_filter_taxonomy_base'            );
-add_filter( 'option_category_base',     '_wp_filter_taxonomy_base'            );
-add_filter( 'the_posts',                '_close_comments_for_old_posts', 10, 2);
+add_filter( 'pre_comment_content',      'wp_rel_nofollow',              15 );
+add_filter( 'comment_email',            'antispambot' );
+add_filter( 'option_tag_base',          '_wp_filter_taxonomy_base' );
+add_filter( 'option_category_base',     '_wp_filter_taxonomy_base' );
+add_filter( 'the_posts',                '_close_comments_for_old_posts', 10, 2 );
 add_filter( 'comments_open',            '_close_comments_for_old_post', 10, 2 );
 add_filter( 'pings_open',               '_close_comments_for_old_post', 10, 2 );
-add_filter( 'editable_slug',            'urldecode'                           );
-add_filter( 'editable_slug',            'esc_textarea'                        );
-add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object'        );
-add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri'            );
-add_filter( 'xmlrpc_pingback_error',    'xmlrpc_pingback_error'               );
-add_filter( 'title_save_pre',           'trim'                                );
+add_filter( 'editable_slug',            'urldecode' );
+add_filter( 'editable_slug',            'esc_textarea' );
+add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' );
+add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri' );
+add_filter( 'xmlrpc_pingback_error',    'xmlrpc_pingback_error' );
+add_filter( 'title_save_pre',           'trim' );
 
 add_action( 'transition_comment_status', '_clear_modified_cache_on_transition_comment_status', 10, 2 );
 
@@ -241,41 +251,42 @@
 add_filter( 'rest_authentication_errors', 'rest_cookie_check_errors', 100 );
 
 // Actions
-add_action( 'wp_head',             '_wp_render_title_tag',            1     );
-add_action( 'wp_head',             'wp_enqueue_scripts',              1     );
-add_action( 'wp_head',             'wp_resource_hints',               2     );
-add_action( 'wp_head',             'feed_links',                      2     );
-add_action( 'wp_head',             'feed_links_extra',                3     );
-add_action( 'wp_head',             'rsd_link'                               );
-add_action( 'wp_head',             'wlwmanifest_link'                       );
+add_action( 'wp_head',             '_wp_render_title_tag',            1 );
+add_action( 'wp_head',             'wp_enqueue_scripts',              1 );
+add_action( 'wp_head',             'wp_resource_hints',               2 );
+add_action( 'wp_head',             'feed_links',                      2 );
+add_action( 'wp_head',             'feed_links_extra',                3 );
+add_action( 'wp_head',             'rsd_link' );
+add_action( 'wp_head',             'wlwmanifest_link' );
 add_action( 'wp_head',             'adjacent_posts_rel_link_wp_head', 10, 0 );
-add_action( 'wp_head',             'locale_stylesheet'                      );
+add_action( 'wp_head',             'locale_stylesheet' );
 add_action( 'publish_future_post', 'check_and_publish_future_post',   10, 1 );
-add_action( 'wp_head',             'noindex',                          1    );
-add_action( 'wp_head',             'print_emoji_detection_script',     7    );
-add_action( 'wp_head',             'wp_print_styles',                  8    );
-add_action( 'wp_head',             'wp_print_head_scripts',            9    );
-add_action( 'wp_head',             'wp_generator'                           );
-add_action( 'wp_head',             'rel_canonical'                          );
+add_action( 'wp_head',             'noindex',                          1 );
+add_action( 'wp_head',             'print_emoji_detection_script',     7 );
+add_action( 'wp_head',             'wp_print_styles',                  8 );
+add_action( 'wp_head',             'wp_print_head_scripts',            9 );
+add_action( 'wp_head',             'wp_generator' );
+add_action( 'wp_head',             'rel_canonical' );
 add_action( 'wp_head',             'wp_shortlink_wp_head',            10, 0 );
-add_action( 'wp_head',             'wp_custom_css_cb',                101   );
-add_action( 'wp_head',             'wp_site_icon',                    99    );
-add_action( 'wp_footer',           'wp_print_footer_scripts',         20    );
+add_action( 'wp_head',             'wp_custom_css_cb',                101 );
+add_action( 'wp_head',             'wp_site_icon',                    99 );
+add_action( 'wp_footer',           'wp_print_footer_scripts',         20 );
 add_action( 'template_redirect',   'wp_shortlink_header',             11, 0 );
-add_action( 'wp_print_footer_scripts', '_wp_footer_scripts'                 );
-add_action( 'init',                'check_theme_switched',            99    );
-add_action( 'after_switch_theme',  '_wp_sidebars_changed'                   );
-add_action( 'wp_print_styles',     'print_emoji_styles'                     );
+add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' );
+add_action( 'init',                'check_theme_switched',            99 );
+add_action( 'after_switch_theme',  '_wp_sidebars_changed' );
+add_action( 'wp_print_styles',     'print_emoji_styles' );
 
-if ( isset( $_GET['replytocom'] ) )
-    add_action( 'wp_head', 'wp_no_robots' );
+if ( isset( $_GET['replytocom'] ) ) {
+	add_action( 'wp_head', 'wp_no_robots' );
+}
 
 // Login actions
-add_filter( 'login_head',          'wp_resource_hints',             8     );
-add_action( 'login_head',          'wp_print_head_scripts',         9     );
-add_action( 'login_head',          'print_admin_styles',            9     );
-add_action( 'login_head',          'wp_site_icon',                  99    );
-add_action( 'login_footer',        'wp_print_footer_scripts',       20    );
+add_filter( 'login_head',          'wp_resource_hints',             8 );
+add_action( 'login_head',          'wp_print_head_scripts',         9 );
+add_action( 'login_head',          'print_admin_styles',            9 );
+add_action( 'login_head',          'wp_site_icon',                  99 );
+add_action( 'login_footer',        'wp_print_footer_scripts',       20 );
 add_action( 'login_init',          'send_frame_options_header',     10, 0 );
 
 // Feed Generator Tags
@@ -289,8 +300,9 @@
 
 
 // WP Cron
-if ( !defined( 'DOING_CRON' ) )
+if ( ! defined( 'DOING_CRON' ) ) {
 	add_action( 'init', 'wp_cron' );
+}
 
 // 2 Actions 2 Furious
 add_action( 'do_feed_rdf',                'do_feed_rdf',                             10, 1 );
@@ -298,43 +310,43 @@
 add_action( 'do_feed_rss2',               'do_feed_rss2',                            10, 1 );
 add_action( 'do_feed_atom',               'do_feed_atom',                            10, 1 );
 add_action( 'do_pings',                   'do_all_pings',                            10, 1 );
-add_action( 'do_robots',                  'do_robots'                                      );
+add_action( 'do_robots',                  'do_robots' );
 add_action( 'set_comment_cookies',        'wp_set_comment_cookies',                  10, 2 );
-add_action( 'sanitize_comment_cookies',   'sanitize_comment_cookies'                       );
-add_action( 'admin_print_scripts',        'print_emoji_detection_script'                   );
-add_action( 'admin_print_scripts',        'print_head_scripts',                      20    );
-add_action( 'admin_print_footer_scripts', '_wp_footer_scripts'                             );
-add_action( 'admin_print_styles',         'print_emoji_styles'                             );
-add_action( 'admin_print_styles',         'print_admin_styles',                      20    );
-add_action( 'init',                       'smilies_init',                             5    );
-add_action( 'plugins_loaded',             'wp_maybe_load_widgets',                    0    );
-add_action( 'plugins_loaded',             'wp_maybe_load_embeds',                     0    );
-add_action( 'shutdown',                   'wp_ob_end_flush_all',                      1    );
+add_action( 'sanitize_comment_cookies',   'sanitize_comment_cookies' );
+add_action( 'admin_print_scripts',        'print_emoji_detection_script' );
+add_action( 'admin_print_scripts',        'print_head_scripts',                      20 );
+add_action( 'admin_print_footer_scripts', '_wp_footer_scripts' );
+add_action( 'admin_print_styles',         'print_emoji_styles' );
+add_action( 'admin_print_styles',         'print_admin_styles',                      20 );
+add_action( 'init',                       'smilies_init',                             5 );
+add_action( 'plugins_loaded',             'wp_maybe_load_widgets',                    0 );
+add_action( 'plugins_loaded',             'wp_maybe_load_embeds',                     0 );
+add_action( 'shutdown',                   'wp_ob_end_flush_all',                      1 );
 // Create a revision whenever a post is updated.
 add_action( 'post_updated',               'wp_save_post_revision',                   10, 1 );
 add_action( 'publish_post',               '_publish_post_hook',                       5, 1 );
 add_action( 'transition_post_status',     '_transition_post_status',                  5, 3 );
 add_action( 'transition_post_status',     '_update_term_count_on_transition_post_status', 10, 3 );
-add_action( 'comment_form',               'wp_comment_form_unfiltered_html_nonce'          );
-add_action( 'wp_scheduled_delete',        'wp_scheduled_delete'                            );
-add_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts'                      );
+add_action( 'comment_form',               'wp_comment_form_unfiltered_html_nonce' );
+add_action( 'wp_scheduled_delete',        'wp_scheduled_delete' );
+add_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts' );
 add_action( 'admin_init',                 'send_frame_options_header',               10, 0 );
-add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment'                           );
-add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment'                           );
-add_action( 'welcome_panel',              'wp_welcome_panel'                               );
+add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' );
+add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment' );
+add_action( 'welcome_panel',              'wp_welcome_panel' );
 
 // Navigation menu actions
-add_action( 'delete_post',                '_wp_delete_post_menu_item'         );
+add_action( 'delete_post',                '_wp_delete_post_menu_item' );
 add_action( 'delete_term',                '_wp_delete_tax_menu_item',   10, 3 );
 add_action( 'transition_post_status',     '_wp_auto_add_pages_to_menu', 10, 3 );
 add_action( 'delete_post',                '_wp_delete_customize_changeset_dependent_auto_drafts' );
 
 // Post Thumbnail CSS class filtering
-add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add'    );
+add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' );
 add_action( 'end_fetch_post_thumbnail_html',   '_wp_post_thumbnail_class_filter_remove' );
 
 // Redirect Old Slugs
-add_action( 'template_redirect',  'wp_old_slug_redirect'              );
+add_action( 'template_redirect',  'wp_old_slug_redirect' );
 add_action( 'post_updated',       'wp_check_for_changed_slugs', 12, 3 );
 add_action( 'attachment_updated', 'wp_check_for_changed_slugs', 12, 3 );
 
@@ -348,7 +360,7 @@
 add_filter( 'pre_option_gmt_offset','wp_timezone_override_offset' );
 
 // Admin Color Schemes
-add_action( 'admin_init', 'register_admin_color_schemes', 1);
+add_action( 'admin_init', 'register_admin_color_schemes', 1 );
 add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
 
 // If the upgrade hasn't run yet, assume link manager is used.
@@ -368,8 +380,8 @@
 // Default authentication filters
 add_filter( 'authenticate', 'wp_authenticate_username_password',  20, 3 );
 add_filter( 'authenticate', 'wp_authenticate_email_password',     20, 3 );
-add_filter( 'authenticate', 'wp_authenticate_spam_check',         99    );
-add_filter( 'determine_current_user', 'wp_validate_auth_cookie'          );
+add_filter( 'authenticate', 'wp_authenticate_spam_check',         99 );
+add_filter( 'determine_current_user', 'wp_validate_auth_cookie' );
 add_filter( 'determine_current_user', 'wp_validate_logged_in_cookie', 20 );
 
 // Split term updates.
@@ -480,34 +492,34 @@
 add_filter( 'media_send_to_editor', 'image_media_send_to_editor', 10, 3 );
 
 // Embeds
-add_action( 'rest_api_init',          'wp_oembed_register_route'              );
+add_action( 'rest_api_init',          'wp_oembed_register_route' );
 add_filter( 'rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4 );
 
-add_action( 'wp_head',                'wp_oembed_add_discovery_links'         );
-add_action( 'wp_head',                'wp_oembed_add_host_js'                 );
+add_action( 'wp_head',                'wp_oembed_add_discovery_links' );
+add_action( 'wp_head',                'wp_oembed_add_host_js' );
 
-add_action( 'embed_head',             'enqueue_embed_scripts',           1    );
-add_action( 'embed_head',             'print_emoji_detection_script'          );
-add_action( 'embed_head',             'print_embed_styles'                    );
-add_action( 'embed_head',             'wp_print_head_scripts',          20    );
-add_action( 'embed_head',             'wp_print_styles',                20    );
-add_action( 'embed_head',             'wp_no_robots'                          );
-add_action( 'embed_head',             'rel_canonical'                         );
-add_action( 'embed_head',             'locale_stylesheet',              30    );
-
-add_action( 'embed_content_meta',     'print_embed_comments_button'           );
-add_action( 'embed_content_meta',     'print_embed_sharing_button'            );
-
-add_action( 'embed_footer',           'print_embed_sharing_dialog'            );
-add_action( 'embed_footer',           'print_embed_scripts'                   );
-add_action( 'embed_footer',           'wp_print_footer_scripts',        20    );
-
-add_filter( 'excerpt_more',           'wp_embed_excerpt_more',          20    );
-add_filter( 'the_excerpt_embed',      'wptexturize'                           );
-add_filter( 'the_excerpt_embed',      'convert_chars'                         );
-add_filter( 'the_excerpt_embed',      'wpautop'                               );
-add_filter( 'the_excerpt_embed',      'shortcode_unautop'                     );
-add_filter( 'the_excerpt_embed',      'wp_embed_excerpt_attachment'           );
+add_action( 'embed_head',             'enqueue_embed_scripts',           1 );
+add_action( 'embed_head',             'print_emoji_detection_script' );
+add_action( 'embed_head',             'print_embed_styles' );
+add_action( 'embed_head',             'wp_print_head_scripts',          20 );
+add_action( 'embed_head',             'wp_print_styles',                20 );
+add_action( 'embed_head',             'wp_no_robots' );
+add_action( 'embed_head',             'rel_canonical' );
+add_action( 'embed_head',             'locale_stylesheet',              30 );
+
+add_action( 'embed_content_meta',     'print_embed_comments_button' );
+add_action( 'embed_content_meta',     'print_embed_sharing_button' );
+
+add_action( 'embed_footer',           'print_embed_sharing_dialog' );
+add_action( 'embed_footer',           'print_embed_scripts' );
+add_action( 'embed_footer',           'wp_print_footer_scripts',        20 );
+
+add_filter( 'excerpt_more',           'wp_embed_excerpt_more',          20 );
+add_filter( 'the_excerpt_embed',      'wptexturize' );
+add_filter( 'the_excerpt_embed',      'convert_chars' );
+add_filter( 'the_excerpt_embed',      'wpautop' );
+add_filter( 'the_excerpt_embed',      'shortcode_unautop' );
+add_filter( 'the_excerpt_embed',      'wp_embed_excerpt_attachment' );
 
 add_filter( 'oembed_dataparse',       'wp_filter_oembed_result',        10, 3 );
 add_filter( 'oembed_response_data',   'get_oembed_response_data_rich',  10, 4 );
Index: src/wp-includes/deprecated.php
===================================================================
--- src/wp-includes/deprecated.php	(revision 40901)
+++ src/wp-includes/deprecated.php	(working copy)
@@ -22,12 +22,12 @@
  * @param int $postid Post ID.
  * @return array Post data.
  */
-function get_postdata($postid) {
+function get_postdata( $postid ) {
 	_deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' );
 
-	$post = get_post($postid);
+	$post = get_post( $postid );
 
-	$postdata = array (
+	$postdata = array(
 		'ID' => $post->ID,
 		'Author_ID' => $post->post_author,
 		'Date' => $post->post_date,
@@ -42,7 +42,7 @@
 		'to_ping' => $post->to_ping,
 		'pinged' => $post->pinged,
 		'post_type' => $post->post_type,
-		'post_name' => $post->post_name
+		'post_name' => $post->post_name,
 	);
 
 	return $postdata;
@@ -61,7 +61,7 @@
 function start_wp() {
 	global $wp_query;
 
-	_deprecated_function( __FUNCTION__, '1.5.0', __('new WordPress Loop') );
+	_deprecated_function( __FUNCTION__, '1.5.0', __( 'new WordPress Loop' ) );
 
 	// Since the old style loop is being used, advance the query iterator here.
 	$wp_query->next_post();
@@ -79,15 +79,16 @@
  * @param bool $echo Optional. Whether to echo the output. Default true.
  * @return int Category ID.
  */
-function the_category_ID($echo = true) {
+function the_category_ID( $echo = true ) {
 	_deprecated_function( __FUNCTION__, '0.71', 'get_the_category()' );
 
 	// Grab the first cat in the list.
 	$categories = get_the_category();
 	$cat = $categories[0]->term_id;
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $cat;
+	}
 
 	return $cat;
 }
@@ -112,7 +113,7 @@
 	$currentcat = $categories[0]->category_id;
 	if ( $currentcat != $previouscat ) {
 		echo $before;
-		echo get_the_category_by_ID($currentcat);
+		echo get_the_category_by_ID( $currentcat );
 		echo $after;
 		$previouscat = $currentcat;
 	}
@@ -132,25 +133,27 @@
  * @param int    $limitprev
  * @param string $excluded_categories
  */
-function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
+function previous_post( $format = '%', $previous = 'previous post: ', $title = 'yes', $in_same_cat = 'no', $limitprev = 1, $excluded_categories = '' ) {
 
 	_deprecated_function( __FUNCTION__, '2.0.0', 'previous_post_link()' );
 
-	if ( empty($in_same_cat) || 'no' == $in_same_cat )
+	if ( empty( $in_same_cat ) || 'no' == $in_same_cat ) {
 		$in_same_cat = false;
-	else
-		$in_same_cat = true;
+	} else { $in_same_cat = true;
+	}
 
-	$post = get_previous_post($in_same_cat, $excluded_categories);
+	$post = get_previous_post( $in_same_cat, $excluded_categories );
 
-	if ( !$post )
+	if ( ! $post ) {
 		return;
+	}
 
-	$string = '<a href="'.get_permalink($post->ID).'">'.$previous;
-	if ( 'yes' == $title )
-		$string .= apply_filters('the_title', $post->post_title, $post->ID);
+	$string = '<a href="' . get_permalink( $post->ID ) . '">' . $previous;
+	if ( 'yes' == $title ) {
+		$string .= apply_filters( 'the_title', $post->post_title, $post->ID );
+	}
 	$string .= '</a>';
-	$format = str_replace('%', $string, $format);
+	$format = str_replace( '%', $string, $format );
 	echo $format;
 }
 
@@ -168,24 +171,26 @@
  * @param int $limitnext
  * @param string $excluded_categories
  */
-function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
+function next_post( $format = '%', $next = 'next post: ', $title = 'yes', $in_same_cat = 'no', $limitnext = 1, $excluded_categories = '' ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'next_post_link()' );
 
-	if ( empty($in_same_cat) || 'no' == $in_same_cat )
+	if ( empty( $in_same_cat ) || 'no' == $in_same_cat ) {
 		$in_same_cat = false;
-	else
-		$in_same_cat = true;
+	} else { $in_same_cat = true;
+	}
 
-	$post = get_next_post($in_same_cat, $excluded_categories);
+	$post = get_next_post( $in_same_cat, $excluded_categories );
 
-	if ( !$post	)
+	if ( ! $post ) {
 		return;
+	}
 
-	$string = '<a href="'.get_permalink($post->ID).'">'.$next;
-	if ( 'yes' == $title )
-		$string .= apply_filters('the_title', $post->post_title, $post->ID);
+	$string = '<a href="' . get_permalink( $post->ID ) . '">' . $next;
+	if ( 'yes' == $title ) {
+		$string .= apply_filters( 'the_title', $post->post_title, $post->ID );
+	}
 	$string .= '</a>';
-	$format = str_replace('%', $string, $format);
+	$format = str_replace( '%', $string, $format );
 	echo $format;
 }
 
@@ -201,10 +206,10 @@
  * @param int $category_id Not Used
  * @return bool
  */
-function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') {
+function user_can_create_post( $user_id, $blog_id = 1, $category_id = 'None' ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
 
-	$author_data = get_userdata($user_id);
+	$author_data = get_userdata( $user_id );
 	return ($author_data->user_level > 1);
 }
 
@@ -220,10 +225,10 @@
  * @param int $category_id Not Used
  * @return bool
  */
-function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') {
+function user_can_create_draft( $user_id, $blog_id = 1, $category_id = 'None' ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
 
-	$author_data = get_userdata($user_id);
+	$author_data = get_userdata( $user_id );
 	return ($author_data->user_level >= 1);
 }
 
@@ -239,14 +244,14 @@
  * @param int $blog_id Not Used
  * @return bool
  */
-function user_can_edit_post($user_id, $post_id, $blog_id = 1) {
+function user_can_edit_post( $user_id, $post_id, $blog_id = 1 ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
 
-	$author_data = get_userdata($user_id);
-	$post = get_post($post_id);
-	$post_author_data = get_userdata($post->post_author);
+	$author_data = get_userdata( $user_id );
+	$post = get_post( $post_id );
+	$post_author_data = get_userdata( $post->post_author );
 
-	if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2))
+	if ( (($user_id == $post_author_data->ID) && ! ($post->post_status == 'publish' && $author_data->user_level < 2))
 			 || ($author_data->user_level > $post_author_data->user_level)
 			 || ($author_data->user_level >= 10) ) {
 		return true;
@@ -267,11 +272,11 @@
  * @param int $blog_id Not Used
  * @return bool
  */
-function user_can_delete_post($user_id, $post_id, $blog_id = 1) {
+function user_can_delete_post( $user_id, $post_id, $blog_id = 1 ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
 
 	// right now if one can edit, one can delete
-	return user_can_edit_post($user_id, $post_id, $blog_id);
+	return user_can_edit_post( $user_id, $post_id, $blog_id );
 }
 
 /**
@@ -286,11 +291,11 @@
  * @param int $category_id Not Used
  * @return bool
  */
-function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') {
+function user_can_set_post_date( $user_id, $blog_id = 1, $category_id = 'None' ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
 
-	$author_data = get_userdata($user_id);
-	return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id));
+	$author_data = get_userdata( $user_id );
+	return (($author_data->user_level > 4) && user_can_create_post( $user_id, $blog_id, $category_id ));
 }
 
 /**
@@ -305,11 +310,11 @@
  * @param int $blog_id Not Used
  * @return bool returns true if $user_id can edit $post_id's date
  */
-function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) {
+function user_can_edit_post_date( $user_id, $post_id, $blog_id = 1 ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
 
-	$author_data = get_userdata($user_id);
-	return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id));
+	$author_data = get_userdata( $user_id );
+	return (($author_data->user_level > 4) && user_can_edit_post( $user_id, $post_id, $blog_id ));
 }
 
 /**
@@ -324,11 +329,11 @@
  * @param int $blog_id Not Used
  * @return bool returns true if $user_id can edit $post_id's comments
  */
-function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) {
+function user_can_edit_post_comments( $user_id, $post_id, $blog_id = 1 ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
 
 	// right now if one can edit a post, one can edit comments made on it
-	return user_can_edit_post($user_id, $post_id, $blog_id);
+	return user_can_edit_post( $user_id, $post_id, $blog_id );
 }
 
 /**
@@ -343,11 +348,11 @@
  * @param int $blog_id Not Used
  * @return bool returns true if $user_id can delete $post_id's comments
  */
-function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) {
+function user_can_delete_post_comments( $user_id, $post_id, $blog_id = 1 ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
 
 	// right now if one can edit comments, one can delete comments
-	return user_can_edit_post_comments($user_id, $post_id, $blog_id);
+	return user_can_edit_post_comments( $user_id, $post_id, $blog_id );
 }
 
 /**
@@ -361,15 +366,15 @@
  * @param int $other_user
  * @return bool
  */
-function user_can_edit_user($user_id, $other_user) {
+function user_can_edit_user( $user_id, $other_user ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
 
-	$user  = get_userdata($user_id);
-	$other = get_userdata($other_user);
-	if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )
+	$user  = get_userdata( $user_id );
+	$other = get_userdata( $other_user );
+	if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID ) {
 		return true;
-	else
-		return false;
+	} else { return false;
+	}
 }
 
 /**
@@ -392,17 +397,18 @@
  * @param int $limit		Optional. Limit to X entries. If not specified, all entries are shown.
  * @param int $show_updated Optional. Whether to show last updated timestamp
  */
-function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id',
+function get_linksbyname( $cat_name = 'noname', $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'id',
 						 $show_description = true, $show_rating = false,
-						 $limit = -1, $show_updated = 0) {
+						 $limit = -1, $show_updated = 0 ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
 
 	$cat_id = -1;
-	$cat = get_term_by('name', $cat_name, 'link_category');
-	if ( $cat )
+	$cat = get_term_by( 'name', $cat_name, 'link_category' );
+	if ( $cat ) {
 		$cat_id = $cat->term_id;
+	}
 
-	get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated);
+	get_links( $cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated );
 }
 
 /**
@@ -416,8 +422,8 @@
  * @param string $args
  * @return string|null
  */
-function wp_get_linksbyname($category, $args = '') {
-	_deprecated_function(__FUNCTION__, '2.1.0', 'wp_list_bookmarks()');
+function wp_get_linksbyname( $category, $args = '' ) {
+	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_bookmarks()' );
 
 	$defaults = array(
 		'after' => '<br />',
@@ -432,7 +438,7 @@
 
 	$r = wp_parse_args( $args, $defaults );
 
-	return wp_list_bookmarks($r);
+	return wp_list_bookmarks( $r );
 }
 
 /**
@@ -454,15 +460,16 @@
  * @param int $limit Limit to X entries. If not specified, all entries are shown.
  * @return array
  */
-function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) {
+function get_linkobjectsbyname( $cat_name = 'noname', $orderby = 'name', $limit = -1 ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
 
 	$cat_id = -1;
-	$cat = get_term_by('name', $cat_name, 'link_category');
-	if ( $cat )
+	$cat = get_term_by( 'name', $cat_name, 'link_category' );
+	if ( $cat ) {
 		$cat_id = $cat->term_id;
+	}
 
-	return get_linkobjects($cat_id, $orderby, $limit);
+	return get_linkobjects( $cat_id, $orderby, $limit );
 }
 
 /**
@@ -505,14 +512,19 @@
  * @param int $limit Limit to X entries. If not specified, all entries are shown.
  * @return array
  */
-function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) {
+function get_linkobjects( $category = 0, $orderby = 'name', $limit = 0 ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
 
-	$links = get_bookmarks( array( 'category' => $category, 'orderby' => $orderby, 'limit' => $limit ) ) ;
+	$links = get_bookmarks( array(
+		'category' => $category,
+		'orderby' => $orderby,
+		'limit' => $limit,
+	) );
 
 	$links_array = array();
-	foreach ($links as $link)
+	foreach ( $links as $link ) {
 		$links_array[] = $link;
+	}
 
 	return $links_array;
 }
@@ -537,11 +549,11 @@
  * @param int $limit Limit to X entries. If not specified, all entries are shown.
  * @param int $show_updated Whether to show last updated timestamp
  */
-function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ",
-									$show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
+function get_linksbyname_withrating( $cat_name = 'noname', $before = '', $after = '<br />', $between = ' ',
+									$show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0 ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
 
-	get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
+	get_linksbyname( $cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated );
 }
 
 /**
@@ -564,11 +576,11 @@
  * @param int $limit Limit to X entries. If not specified, all entries are shown.
  * @param int $show_updated Whether to show last updated timestamp
  */
-function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true,
-							  $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
+function get_links_withrating( $category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true,
+							  $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0 ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
 
-	get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
+	get_links( $category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated );
 }
 
 /**
@@ -580,7 +592,7 @@
  * @param int $id The category to get. If no category supplied uses 0
  * @return int Only returns 0.
  */
-function get_autotoggle($id = 0) {
+function get_autotoggle( $id = 0 ) {
 	_deprecated_function( __FUNCTION__, '2.1.0' );
 	return 0;
 }
@@ -612,14 +624,14 @@
  * @param bool $hierarchical
  * @return false|null
  */
-function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
-				   $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,
-				   $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) {
+function list_cats( $optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
+				   $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children = false, $child_of = 0, $categories = 0,
+				   $recurse = 0, $feed = '', $feed_image = '', $exclude = '', $hierarchical = false ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );
 
 	$query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children',
-		'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical');
-	return wp_list_cats($query);
+	'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical');
+	return wp_list_cats( $query );
 }
 
 /**
@@ -632,27 +644,33 @@
  * @param string|array $args
  * @return false|null|string
  */
-function wp_list_cats($args = '') {
+function wp_list_cats( $args = '' ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );
 
 	$r = wp_parse_args( $args );
 
 	// Map to new names.
-	if ( isset($r['optionall']) && isset($r['all']))
+	if ( isset( $r['optionall'] ) && isset( $r['all'] ) ) {
 		$r['show_option_all'] = $r['all'];
-	if ( isset($r['sort_column']) )
+	}
+	if ( isset( $r['sort_column'] ) ) {
 		$r['orderby'] = $r['sort_column'];
-	if ( isset($r['sort_order']) )
+	}
+	if ( isset( $r['sort_order'] ) ) {
 		$r['order'] = $r['sort_order'];
-	if ( isset($r['optiondates']) )
+	}
+	if ( isset( $r['optiondates'] ) ) {
 		$r['show_last_update'] = $r['optiondates'];
-	if ( isset($r['optioncount']) )
+	}
+	if ( isset( $r['optioncount'] ) ) {
 		$r['show_count'] = $r['optioncount'];
-	if ( isset($r['list']) )
+	}
+	if ( isset( $r['list'] ) ) {
 		$r['style'] = $r['list'] ? 'list' : 'break';
+	}
 	$r['title_li'] = '';
 
-	return wp_list_categories($r);
+	return wp_list_categories( $r );
 }
 
 /**
@@ -674,23 +692,25 @@
  * @param int $exclude
  * @return string
  */
-function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc',
+function dropdown_cats( $optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc',
 		$show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false,
-		$selected = 0, $exclude = 0) {
+		$selected = 0, $exclude = 0 ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_dropdown_categories()' );
 
 	$show_option_all = '';
-	if ( $optionall )
+	if ( $optionall ) {
 		$show_option_all = $all;
+	}
 
 	$show_option_none = '';
-	if ( $optionnone )
-		$show_option_none = __('None');
+	if ( $optionnone ) {
+		$show_option_none = __( 'None' );
+	}
 
 	$vars = compact('show_option_all', 'show_option_none', 'orderby', 'order',
-					'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude');
-	$query = add_query_arg($vars, '');
-	return wp_dropdown_categories($query);
+	'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude');
+	$query = add_query_arg( $vars, '' );
+	return wp_dropdown_categories( $query );
 }
 
 /**
@@ -708,11 +728,11 @@
  * @param string $feed_image
  * @return null|string
  */
-function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
+function list_authors( $optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '' ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_authors()' );
 
-	$args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image');
-	return wp_list_authors($args);
+	$args = compact( 'optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image' );
+	return wp_list_authors( $args );
 }
 
 /**
@@ -726,9 +746,9 @@
  * @param int $post_ID
  * @return array
  */
-function wp_get_post_cats($blogid = '1', $post_ID = 0) {
+function wp_get_post_cats( $blogid = '1', $post_ID = 0 ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_get_post_categories()' );
-	return wp_get_post_categories($post_ID);
+	return wp_get_post_categories( $post_ID );
 }
 
 /**
@@ -744,9 +764,9 @@
  * @param array $post_categories
  * @return bool|mixed
  */
-function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) {
+function wp_set_post_cats( $blogid = '1', $post_ID = 0, $post_categories = array() ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_set_post_categories()' );
-	return wp_set_post_categories($post_ID, $post_categories);
+	return wp_set_post_categories( $post_ID, $post_categories );
 }
 
 /**
@@ -764,10 +784,10 @@
  * @param bool $show_post_count
  * @return string|null
  */
-function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) {
+function get_archives( $type = '', $limit = '', $format = 'html', $before = '', $after = '', $show_post_count = false ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_get_archives()' );
-	$args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count');
-	return wp_get_archives($args);
+	$args = compact( 'type', 'limit', 'format', 'before', 'after', 'show_post_count' );
+	return wp_get_archives( $args );
 }
 
 /**
@@ -782,13 +802,14 @@
  * @param string $author_nicename Optional.
  * @return string|null
  */
-function get_author_link($echo, $author_id, $author_nicename = '') {
+function get_author_link( $echo, $author_id, $author_nicename = '' ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_author_posts_url()' );
 
-	$link = get_author_posts_url($author_id, $author_nicename);
+	$link = get_author_posts_url( $author_id, $author_nicename );
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $link;
+	}
 	return $link;
 }
 
@@ -808,12 +829,12 @@
  * @param string $more_file
  * @return string
  */
-function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page',
-					$pagelink='%', $more_file='') {
+function link_pages( $before = '<br />', $after = '<br />', $next_or_number = 'number', $nextpagelink = 'next page', $previouspagelink = 'previous page',
+					$pagelink = '%', $more_file = '' ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_link_pages()' );
 
-	$args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file');
-	return wp_link_pages($args);
+	$args = compact( 'before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file' );
+	return wp_link_pages( $args );
 }
 
 /**
@@ -826,10 +847,10 @@
  * @param string $option
  * @return string
  */
-function get_settings($option) {
+function get_settings( $option ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_option()' );
 
-	return get_option($option);
+	return get_option( $option );
 }
 
 /**
@@ -853,7 +874,7 @@
  *
  * @param string $deprecated
  */
-function permalink_single_rss($deprecated = '') {
+function permalink_single_rss( $deprecated = '' ) {
 	_deprecated_function( __FUNCTION__, '2.3.0', 'the_permalink_rss()' );
 	the_permalink_rss();
 }
@@ -868,7 +889,7 @@
  * @param string $args a query string
  * @return null|string
  */
-function wp_get_links($args = '') {
+function wp_get_links( $args = '' ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_bookmarks()' );
 
 	if ( strpos( $args, '=' ) === false ) {
@@ -894,7 +915,7 @@
 
 	$r = wp_parse_args( $args, $defaults );
 
-	return wp_list_bookmarks($r);
+	return wp_list_bookmarks( $r );
 }
 
 /**
@@ -921,84 +942,104 @@
  * @param bool $echo whether to echo the results, or return them instead
  * @return null|string
  */
-function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
-			$show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) {
+function get_links( $category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
+			$show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
 
 	$order = 'ASC';
-	if ( substr($orderby, 0, 1) == '_' ) {
+	if ( substr( $orderby, 0, 1 ) == '_' ) {
 		$order = 'DESC';
-		$orderby = substr($orderby, 1);
+		$orderby = substr( $orderby, 1 );
 	}
 
-	if ( $category == -1 ) //get_bookmarks uses '' to signify all categories
+	if ( $category == -1 ) { //get_bookmarks uses '' to signify all categories
 		$category = '';
+	}
 
-	$results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit));
+	$results = get_bookmarks( array(
+		'category' => $category,
+		'orderby' => $orderby,
+		'order' => $order,
+		'show_updated' => $show_updated,
+		'limit' => $limit,
+	) );
 
-	if ( !$results )
+	if ( ! $results ) {
 		return;
+	}
 
 	$output = '';
 
 	foreach ( (array) $results as $row ) {
-		if ( !isset($row->recently_updated) )
+		if ( ! isset( $row->recently_updated ) ) {
 			$row->recently_updated = false;
+		}
 		$output .= $before;
-		if ( $show_updated && $row->recently_updated )
-			$output .= get_option('links_recently_updated_prepend');
+		if ( $show_updated && $row->recently_updated ) {
+			$output .= get_option( 'links_recently_updated_prepend' );
+		}
 		$the_link = '#';
-		if ( !empty($row->link_url) )
-			$the_link = esc_url($row->link_url);
+		if ( ! empty( $row->link_url ) ) {
+			$the_link = esc_url( $row->link_url );
+		}
 		$rel = $row->link_rel;
-		if ( '' != $rel )
+		if ( '' != $rel ) {
 			$rel = ' rel="' . $rel . '"';
+		}
 
-		$desc = esc_attr(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display'));
-		$name = esc_attr(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display'));
+		$desc = esc_attr( sanitize_bookmark_field( 'link_description', $row->link_description, $row->link_id, 'display' ) );
+		$name = esc_attr( sanitize_bookmark_field( 'link_name', $row->link_name, $row->link_id, 'display' ) );
 		$title = $desc;
 
-		if ( $show_updated )
-			if (substr($row->link_updated_f, 0, 2) != '00')
-				$title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)) . ')';
+		if ( $show_updated ) {
+			if ( substr( $row->link_updated_f, 0, 2 ) != '00' ) {
+				$title .= ' (' . __( 'Last updated' ) . ' ' . date( get_option( 'links_updated_date_format' ), $row->link_updated_f + (get_option( 'gmt_offset' ) * HOUR_IN_SECONDS) ) . ')';
+			}
+		}
 
-		if ( '' != $title )
+		if ( '' != $title ) {
 			$title = ' title="' . $title . '"';
+		}
 
 		$alt = ' alt="' . $name . '"';
 
 		$target = $row->link_target;
-		if ( '' != $target )
+		if ( '' != $target ) {
 			$target = ' target="' . $target . '"';
+		}
 
-		$output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
+		$output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>';
 
 		if ( $row->link_image != null && $show_images ) {
-			if ( strpos($row->link_image, 'http') !== false )
+			if ( strpos( $row->link_image, 'http' ) !== false ) {
 				$output .= "<img src=\"$row->link_image\" $alt $title />";
-			else // If it's a relative path
-				$output .= "<img src=\"" . get_option('siteurl') . "$row->link_image\" $alt $title />";
+			} else { // End if().
+				$output .= '<img src="' . get_option( 'siteurl' ) . "$row->link_image\" $alt $title />";
+			}
 		} else {
 			$output .= $name;
 		}
 
 		$output .= '</a>';
 
-		if ( $show_updated && $row->recently_updated )
-			$output .= get_option('links_recently_updated_append');
+		if ( $show_updated && $row->recently_updated ) {
+			$output .= get_option( 'links_recently_updated_append' );
+		}
 
-		if ( $show_description && '' != $desc )
+		if ( $show_description && '' != $desc ) {
 			$output .= $between . $desc;
+		}
 
-		if ($show_rating) {
-			$output .= $between . get_linkrating($row);
+		if ( $show_rating ) {
+			$output .= $between . get_linkrating( $row );
 		}
 
 		$output .= "$after\n";
-	} // end while
+	} // End foreach().
 
-	if ( !$echo )
+	if ( ! $echo ) {
 		return $output;
+	}
 	echo $output;
 }
 
@@ -1014,22 +1055,28 @@
  *
  * @param string $order Sort link categories by 'name' or 'id'
  */
-function get_links_list($order = 'name') {
+function get_links_list( $order = 'name' ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_bookmarks()' );
 
-	$order = strtolower($order);
+	$order = strtolower( $order );
 
 	// Handle link category sorting
 	$direction = 'ASC';
-	if ( '_' == substr($order,0,1) ) {
+	if ( '_' == substr( $order,0,1 ) ) {
 		$direction = 'DESC';
-		$order = substr($order,1);
+		$order = substr( $order,1 );
 	}
 
-	if ( !isset($direction) )
+	if ( ! isset( $direction ) ) {
 		$direction = '';
+	}
 
-	$cats = get_categories(array('type' => 'link', 'orderby' => $order, 'order' => $direction, 'hierarchical' => 0));
+	$cats = get_categories( array(
+		'type' => 'link',
+		'orderby' => $order,
+		'order' => $direction,
+		'hierarchical' => 0,
+	) );
 
 	// Display each category
 	if ( $cats ) {
@@ -1037,9 +1084,9 @@
 			// Handle each category.
 
 			// Display the category name
-			echo '  <li id="linkcat-' . $cat->term_id . '" class="linkcat"><h2>' . apply_filters('link_category', $cat->name ) . "</h2>\n\t<ul>\n";
+			echo '  <li id="linkcat-' . $cat->term_id . '" class="linkcat"><h2>' . apply_filters( 'link_category', $cat->name ) . "</h2>\n\t<ul>\n";
 			// Call get_links() with all the appropriate params
-			get_links($cat->term_id, '<li>', "</li>", "\n", true, 'name', false);
+			get_links( $cat->term_id, '<li>', '</li>', "\n", true, 'name', false );
 
 			// Close the last category
 			echo "\n\t</ul>\n</li>\n";
@@ -1059,7 +1106,7 @@
  * @param string $file the page to open in the popup window
  * @param bool $count the number of links in the db
  */
-function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) {
+function links_popup_script( $text = 'Links', $width = 400, $height = 400, $file = 'links.all.php', $count = true ) {
 	_deprecated_function( __FUNCTION__, '2.1.0' );
 }
 
@@ -1075,7 +1122,7 @@
  */
 function get_linkrating( $link ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'sanitize_bookmark_field()' );
-	return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display');
+	return sanitize_bookmark_field( 'link_rating', $link->link_rating, $link->link_id, 'display' );
 }
 
 /**
@@ -1088,22 +1135,24 @@
  * @param int $id The category to get. If no category supplied uses 0
  * @return string
  */
-function get_linkcatname($id = 0) {
+function get_linkcatname( $id = 0 ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_category()' );
 
 	$id = (int) $id;
 
-	if ( empty($id) )
+	if ( empty( $id ) ) {
 		return '';
+	}
 
-	$cats = wp_get_link_cats($id);
+	$cats = wp_get_link_cats( $id );
 
-	if ( empty($cats) || ! is_array($cats) )
+	if ( empty( $cats ) || ! is_array( $cats ) ) {
 		return '';
+	}
 
 	$cat_id = (int) $cats[0]; // Take the first cat.
 
-	$cat = get_category($cat_id);
+	$cat = get_category( $cat_id );
 	return $cat->name;
 }
 
@@ -1116,9 +1165,9 @@
  *
  * @param string $link_text
  */
-function comments_rss_link($link_text = 'Comments RSS') {
+function comments_rss_link( $link_text = 'Comments RSS' ) {
 	_deprecated_function( __FUNCTION__, '2.5.0', 'post_comments_feed_link()' );
-	post_comments_feed_link($link_text);
+	post_comments_feed_link( $link_text );
 }
 
 /**
@@ -1132,13 +1181,14 @@
  * @param int $cat_ID
  * @return string
  */
-function get_category_rss_link($echo = false, $cat_ID = 1) {
+function get_category_rss_link( $echo = false, $cat_ID = 1 ) {
 	_deprecated_function( __FUNCTION__, '2.5.0', 'get_category_feed_link()' );
 
-	$link = get_category_feed_link($cat_ID, 'rss2');
+	$link = get_category_feed_link( $cat_ID, 'rss2' );
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $link;
+	}
 	return $link;
 }
 
@@ -1153,12 +1203,13 @@
  * @param int $author_id
  * @return string
  */
-function get_author_rss_link($echo = false, $author_id = 1) {
+function get_author_rss_link( $echo = false, $author_id = 1 ) {
 	_deprecated_function( __FUNCTION__, '2.5.0', 'get_author_feed_link()' );
 
-	$link = get_author_feed_link($author_id);
-	if ( $echo )
+	$link = get_author_feed_link( $author_id );
+	if ( $echo ) {
 		echo $link;
+	}
 	return $link;
 }
 
@@ -1188,9 +1239,9 @@
  * @param string $email    The user's email.
  * @return int The new user's ID.
  */
-function create_user($username, $password, $email) {
+function create_user( $username, $password, $email ) {
 	_deprecated_function( __FUNCTION__, '2.0.0', 'wp_create_user()' );
-	return wp_create_user($username, $password, $email);
+	return wp_create_user( $username, $password, $email );
 }
 
 /**
@@ -1217,7 +1268,7 @@
  */
 function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) {
 	_deprecated_function( __FUNCTION__, '2.7.0', 'get_comment()' );
-	return get_comment($comment_ID, ARRAY_A);
+	return get_comment( $comment_ID, ARRAY_A );
 }
 
 /**
@@ -1250,22 +1301,25 @@
  */
 function get_category_children( $id, $before = '/', $after = '', $visited = array() ) {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_term_children()' );
-	if ( 0 == $id )
+	if ( 0 == $id ) {
 		return '';
+	}
 
 	$chain = '';
 	/** TODO: consult hierarchy */
 	$cat_ids = get_all_category_ids();
 	foreach ( (array) $cat_ids as $cat_id ) {
-		if ( $cat_id == $id )
+		if ( $cat_id == $id ) {
 			continue;
+		}
 
 		$category = get_category( $cat_id );
-		if ( is_wp_error( $category ) )
+		if ( is_wp_error( $category ) ) {
 			return $category;
-		if ( $category->parent == $id && !in_array( $category->term_id, $visited ) ) {
+		}
+		if ( $category->parent == $id && ! in_array( $category->term_id, $visited ) ) {
 			$visited[] = $category->term_id;
-			$chain .= $before.$category->term_id.$after;
+			$chain .= $before . $category->term_id . $after;
 			$chain .= get_category_children( $category->term_id, $before, $after );
 		}
 	}
@@ -1287,7 +1341,10 @@
 	_deprecated_function( __FUNCTION__, '4.0.0', 'get_terms()' );
 
 	if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
-		$cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );
+		$cat_ids = get_terms( 'category', array(
+			'fields' => 'ids',
+			'get' => 'all',
+		) );
 		wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
 	}
 
@@ -1305,7 +1362,7 @@
  */
 function get_the_author_description() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'description\')' );
-	return get_the_author_meta('description');
+	return get_the_author_meta( 'description' );
 }
 
 /**
@@ -1317,7 +1374,7 @@
  */
 function the_author_description() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'description\')' );
-	the_author_meta('description');
+	the_author_meta( 'description' );
 }
 
 /**
@@ -1331,7 +1388,7 @@
  */
 function get_the_author_login() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'login\')' );
-	return get_the_author_meta('login');
+	return get_the_author_meta( 'login' );
 }
 
 /**
@@ -1343,7 +1400,7 @@
  */
 function the_author_login() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'login\')' );
-	the_author_meta('login');
+	the_author_meta( 'login' );
 }
 
 /**
@@ -1357,7 +1414,7 @@
  */
 function get_the_author_firstname() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'first_name\')' );
-	return get_the_author_meta('first_name');
+	return get_the_author_meta( 'first_name' );
 }
 
 /**
@@ -1369,7 +1426,7 @@
  */
 function the_author_firstname() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'first_name\')' );
-	the_author_meta('first_name');
+	the_author_meta( 'first_name' );
 }
 
 /**
@@ -1383,7 +1440,7 @@
  */
 function get_the_author_lastname() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'last_name\')' );
-	return get_the_author_meta('last_name');
+	return get_the_author_meta( 'last_name' );
 }
 
 /**
@@ -1395,7 +1452,7 @@
  */
 function the_author_lastname() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'last_name\')' );
-	the_author_meta('last_name');
+	the_author_meta( 'last_name' );
 }
 
 /**
@@ -1409,7 +1466,7 @@
  */
 function get_the_author_nickname() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'nickname\')' );
-	return get_the_author_meta('nickname');
+	return get_the_author_meta( 'nickname' );
 }
 
 /**
@@ -1421,7 +1478,7 @@
  */
 function the_author_nickname() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'nickname\')' );
-	the_author_meta('nickname');
+	the_author_meta( 'nickname' );
 }
 
 /**
@@ -1435,7 +1492,7 @@
  */
 function get_the_author_email() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'email\')' );
-	return get_the_author_meta('email');
+	return get_the_author_meta( 'email' );
 }
 
 /**
@@ -1447,7 +1504,7 @@
  */
 function the_author_email() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'email\')' );
-	the_author_meta('email');
+	the_author_meta( 'email' );
 }
 
 /**
@@ -1461,7 +1518,7 @@
  */
 function get_the_author_icq() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'icq\')' );
-	return get_the_author_meta('icq');
+	return get_the_author_meta( 'icq' );
 }
 
 /**
@@ -1473,7 +1530,7 @@
  */
 function the_author_icq() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'icq\')' );
-	the_author_meta('icq');
+	the_author_meta( 'icq' );
 }
 
 /**
@@ -1487,7 +1544,7 @@
  */
 function get_the_author_yim() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'yim\')' );
-	return get_the_author_meta('yim');
+	return get_the_author_meta( 'yim' );
 }
 
 /**
@@ -1499,7 +1556,7 @@
  */
 function the_author_yim() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'yim\')' );
-	the_author_meta('yim');
+	the_author_meta( 'yim' );
 }
 
 /**
@@ -1513,7 +1570,7 @@
  */
 function get_the_author_msn() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'msn\')' );
-	return get_the_author_meta('msn');
+	return get_the_author_meta( 'msn' );
 }
 
 /**
@@ -1525,7 +1582,7 @@
  */
 function the_author_msn() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'msn\')' );
-	the_author_meta('msn');
+	the_author_meta( 'msn' );
 }
 
 /**
@@ -1539,7 +1596,7 @@
  */
 function get_the_author_aim() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'aim\')' );
-	return get_the_author_meta('aim');
+	return get_the_author_meta( 'aim' );
 }
 
 /**
@@ -1551,7 +1608,7 @@
  */
 function the_author_aim() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'aim\')' );
-	the_author_meta('aim');
+	the_author_meta( 'aim' );
 }
 
 /**
@@ -1566,7 +1623,7 @@
  */
 function get_author_name( $auth_id = false ) {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'display_name\')' );
-	return get_the_author_meta('display_name', $auth_id);
+	return get_the_author_meta( 'display_name', $auth_id );
 }
 
 /**
@@ -1580,7 +1637,7 @@
  */
 function get_the_author_url() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'url\')' );
-	return get_the_author_meta('url');
+	return get_the_author_meta( 'url' );
 }
 
 /**
@@ -1592,7 +1649,7 @@
  */
 function the_author_url() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'url\')' );
-	the_author_meta('url');
+	the_author_meta( 'url' );
 }
 
 /**
@@ -1606,7 +1663,7 @@
  */
 function get_the_author_ID() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'ID\')' );
-	return get_the_author_meta('ID');
+	return get_the_author_meta( 'ID' );
 }
 
 /**
@@ -1618,7 +1675,7 @@
  */
 function the_author_ID() {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'ID\')' );
-	the_author_meta('ID');
+	the_author_meta( 'ID' );
 }
 
 /**
@@ -1649,37 +1706,39 @@
  * @param int $cut Optional. Amount of words to keep for the content.
  * @param int $encode_html Optional. How to encode the content.
  */
-function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
+function the_content_rss( $more_link_text = '(more...)', $stripteaser = 0, $more_file = '', $cut = 0, $encode_html = 0 ) {
 	_deprecated_function( __FUNCTION__, '2.9.0', 'the_content_feed' );
-	$content = get_the_content($more_link_text, $stripteaser);
-	$content = apply_filters('the_content_rss', $content);
-	if ( $cut && !$encode_html )
+	$content = get_the_content( $more_link_text, $stripteaser );
+	$content = apply_filters( 'the_content_rss', $content );
+	if ( $cut && ! $encode_html ) {
 		$encode_html = 2;
-	if ( 1== $encode_html ) {
-		$content = esc_html($content);
+	}
+	if ( 1 == $encode_html ) {
+		$content = esc_html( $content );
 		$cut = 0;
 	} elseif ( 0 == $encode_html ) {
-		$content = make_url_footnote($content);
+		$content = make_url_footnote( $content );
 	} elseif ( 2 == $encode_html ) {
-		$content = strip_tags($content);
+		$content = strip_tags( $content );
 	}
 	if ( $cut ) {
-		$blah = explode(' ', $content);
-		if ( count($blah) > $cut ) {
+		$blah = explode( ' ', $content );
+		if ( count( $blah ) > $cut ) {
 			$k = $cut;
 			$use_dotdotdot = 1;
 		} else {
-			$k = count($blah);
+			$k = count( $blah );
 			$use_dotdotdot = 0;
 		}
 
 		/** @todo Check performance, might be faster to use array slice instead. */
-		for ( $i=0; $i<$k; $i++ )
-			$excerpt .= $blah[$i].' ';
+		for ( $i = 0; $i < $k; $i++ ) {
+			$excerpt .= $blah[ $i ] . ' ';
+		}
 		$excerpt .= ($use_dotdotdot) ? '...' : '';
 		$content = $excerpt;
 	}
-	$content = str_replace(']]>', ']]&gt;', $content);
+	$content = str_replace( ']]>', ']]&gt;', $content );
 	echo $content;
 }
 
@@ -1700,10 +1759,10 @@
 	preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
 	$links_summary = "\n";
 	for ( $i = 0, $c = count( $matches[0] ); $i < $c; $i++ ) {
-		$link_match = $matches[0][$i];
-		$link_number = '['.($i+1).']';
-		$link_url = $matches[2][$i];
-		$link_text = $matches[4][$i];
+		$link_match = $matches[0][ $i ];
+		$link_number = '[' . ($i + 1) . ']';
+		$link_url = $matches[2][ $i ];
+		$link_text = $matches[4][ $i ];
 		$content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );
 		$link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
 		$links_summary .= "\n" . $link_number . ' ' . $link_url;
@@ -1787,7 +1846,7 @@
 function __ngettext() {
 	_deprecated_function( __FUNCTION__, '2.8.0', '_n()' );
 	$args = func_get_args();
-	return call_user_func_array('_n', $args);
+	return call_user_func_array( '_n', $args );
 }
 
 /**
@@ -1800,7 +1859,7 @@
 function __ngettext_noop() {
 	_deprecated_function( __FUNCTION__, '2.8.0', '_n_noop()' );
 	$args = func_get_args();
-	return call_user_func_array('_n_noop', $args);
+	return call_user_func_array( '_n_noop', $args );
 
 }
 
@@ -1831,20 +1890,22 @@
  * @param bool $permalink Optional, default is false. Whether to include permalink to image.
  * @return string
  */
-function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {
+function get_the_attachment_link( $id = 0, $fullsize = false, $max_dims = false, $permalink = false ) {
 	_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_link()' );
 	$id = (int) $id;
-	$_post = get_post($id);
+	$_post = get_post( $id );
 
-	if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )
-		return __('Missing Attachment');
+	if ( ('attachment' != $_post->post_type) || ! $url = wp_get_attachment_url( $_post->ID ) ) {
+		return __( 'Missing Attachment' );
+	}
 
-	if ( $permalink )
-		$url = get_attachment_link($_post->ID);
+	if ( $permalink ) {
+		$url = get_attachment_link( $_post->ID );
+	}
 
-	$post_title = esc_attr($_post->post_title);
+	$post_title = esc_attr( $_post->post_title );
 
-	$innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims);
+	$innerHTML = get_attachment_innerHTML( $_post->ID, $fullsize, $max_dims );
 	return "<a href='$url' title='$post_title'>$innerHTML</a>";
 }
 
@@ -1862,15 +1923,16 @@
 function get_attachment_icon_src( $id = 0, $fullsize = false ) {
 	_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image_src()' );
 	$id = (int) $id;
-	if ( !$post = get_post($id) )
+	if ( ! $post = get_post( $id ) ) {
 		return false;
+	}
 
 	$file = get_attached_file( $post->ID );
 
-	if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
+	if ( ! $fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
 		// We have a thumbnail desired, specified and existing
 
-		$src_file = basename($src);
+		$src_file = basename( $src );
 	} elseif ( wp_attachment_is_image( $post->ID ) ) {
 		// We have an image without a thumbnail
 
@@ -1880,13 +1942,14 @@
 		// No thumb, no image. We'll look for a mime-related icon instead.
 
 		$icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
-		$src_file = $icon_dir . '/' . basename($src);
+		$src_file = $icon_dir . '/' . basename( $src );
 	}
 
-	if ( !isset($src) || !$src )
+	if ( ! isset( $src ) || ! $src ) {
 		return false;
+	}
 
-	return array($src, $src_file);
+	return array( $src, $src_file );
 }
 
 /**
@@ -1904,41 +1967,43 @@
 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
 	_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image()' );
 	$id = (int) $id;
-	if ( !$post = get_post($id) )
+	if ( ! $post = get_post( $id ) ) {
 		return false;
+	}
 
-	if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )
+	if ( ! $src = get_attachment_icon_src( $post->ID, $fullsize ) ) {
 		return false;
+	}
 
 	list($src, $src_file) = $src;
 
 	// Do we need to constrain the image?
-	if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {
+	if ( ($max_dims = apply_filters( 'attachment_max_dims', $max_dims )) && file_exists( $src_file ) ) {
 
-		$imagesize = getimagesize($src_file);
+		$imagesize = getimagesize( $src_file );
 
-		if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
+		if ( ($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
 			$actual_aspect = $imagesize[0] / $imagesize[1];
 			$desired_aspect = $max_dims[0] / $max_dims[1];
 
 			if ( $actual_aspect >= $desired_aspect ) {
 				$height = $actual_aspect * $max_dims[0];
 				$constraint = "width='{$max_dims[0]}' ";
-				$post->iconsize = array($max_dims[0], $height);
+				$post->iconsize = array( $max_dims[0], $height );
 			} else {
 				$width = $max_dims[1] / $actual_aspect;
 				$constraint = "height='{$max_dims[1]}' ";
-				$post->iconsize = array($width, $max_dims[1]);
+				$post->iconsize = array( $width, $max_dims[1] );
 			}
 		} else {
-			$post->iconsize = array($imagesize[0], $imagesize[1]);
+			$post->iconsize = array( $imagesize[0], $imagesize[1] );
 			$constraint = '';
 		}
 	} else {
 		$constraint = '';
 	}
 
-	$post_title = esc_attr($post->post_title);
+	$post_title = esc_attr( $post->post_title );
 
 	$icon = "<img src='$src' title='$post_title' alt='$post_title' $constraint/>";
 
@@ -1957,18 +2022,20 @@
  * @param array $max_dims Optional. Dimensions of image.
  * @return false|string
  */
-function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
+function get_attachment_innerHTML( $id = 0, $fullsize = false, $max_dims = false ) {
 	_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image()' );
 	$id = (int) $id;
-	if ( !$post = get_post($id) )
+	if ( ! $post = get_post( $id ) ) {
 		return false;
+	}
 
-	if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
+	if ( $innerHTML = get_attachment_icon( $post->ID, $fullsize, $max_dims ) ) {
 		return $innerHTML;
+	}
 
-	$innerHTML = esc_attr($post->post_title);
+	$innerHTML = esc_attr( $post->post_title );
 
-	return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
+	return apply_filters( 'attachment_innerHTML', $innerHTML, $post->ID );
 }
 
 /**
@@ -1987,7 +2054,7 @@
  */
 function get_link( $bookmark_id, $output = OBJECT, $filter = 'raw' ) {
 	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmark()' );
-	return get_bookmark($bookmark_id, $output, $filter);
+	return get_bookmark( $bookmark_id, $output, $filter );
 }
 
 /**
@@ -2023,10 +2090,10 @@
  * @return string The cleaned $url after the {@see 'clean_url'} filter is applied.
  */
 function clean_url( $url, $protocols = null, $context = 'display' ) {
-	if ( $context == 'db' )
+	if ( $context == 'db' ) {
 		_deprecated_function( 'clean_url( $context = \'db\' )', '3.0.0', 'esc_url_raw()' );
-	else
-		_deprecated_function( __FUNCTION__, '3.0.0', 'esc_url()' );
+	} else { _deprecated_function( __FUNCTION__, '3.0.0', 'esc_url()' );
+	}
 	return esc_url( $url, $protocols, $context );
 }
 
@@ -2103,26 +2170,28 @@
  * @param string     $classname       Optional. Classname widget option. Default empty.
  * @param mixed      $params ,...     Widget parameters.
  */
-function register_sidebar_widget($name, $output_callback, $classname = '') {
+function register_sidebar_widget( $name, $output_callback, $classname = '' ) {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'wp_register_sidebar_widget()' );
 	// Compat
-	if ( is_array($name) ) {
-		if ( count($name) == 3 )
-			$name = sprintf($name[0], $name[2]);
-		else
-			$name = $name[0];
+	if ( is_array( $name ) ) {
+		if ( count( $name ) == 3 ) {
+			$name = sprintf( $name[0], $name[2] );
+		} else { $name = $name[0];
+		}
 	}
 
-	$id = sanitize_title($name);
+	$id = sanitize_title( $name );
 	$options = array();
-	if ( !empty($classname) && is_string($classname) )
+	if ( ! empty( $classname ) && is_string( $classname ) ) {
 		$options['classname'] = $classname;
-	$params = array_slice(func_get_args(), 2);
-	$args = array($id, $name, $output_callback, $options);
-	if ( !empty($params) )
-		$args = array_merge($args, $params);
+	}
+	$params = array_slice( func_get_args(), 2 );
+	$args = array( $id, $name, $output_callback, $options );
+	if ( ! empty( $params ) ) {
+		$args = array_merge( $args, $params );
+	}
 
-	call_user_func_array('wp_register_sidebar_widget', $args);
+	call_user_func_array( 'wp_register_sidebar_widget', $args );
 }
 
 /**
@@ -2134,9 +2203,9 @@
  *
  * @param int|string $id Widget ID.
  */
-function unregister_sidebar_widget($id) {
+function unregister_sidebar_widget( $id ) {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'wp_unregister_sidebar_widget()' );
-	return wp_unregister_sidebar_widget($id);
+	return wp_unregister_sidebar_widget( $id );
 }
 
 /**
@@ -2158,28 +2227,31 @@
  * @param int $width Widget width.
  * @param int $height Widget height.
  */
-function register_widget_control($name, $control_callback, $width = '', $height = '') {
+function register_widget_control( $name, $control_callback, $width = '', $height = '' ) {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'wp_register_widget_control()' );
 	// Compat
-	if ( is_array($name) ) {
-		if ( count($name) == 3 )
-			$name = sprintf($name[0], $name[2]);
-		else
-			$name = $name[0];
+	if ( is_array( $name ) ) {
+		if ( count( $name ) == 3 ) {
+			$name = sprintf( $name[0], $name[2] );
+		} else { $name = $name[0];
+		}
 	}
 
-	$id = sanitize_title($name);
+	$id = sanitize_title( $name );
 	$options = array();
-	if ( !empty($width) )
+	if ( ! empty( $width ) ) {
 		$options['width'] = $width;
-	if ( !empty($height) )
+	}
+	if ( ! empty( $height ) ) {
 		$options['height'] = $height;
-	$params = array_slice(func_get_args(), 4);
-	$args = array($id, $name, $control_callback, $options);
-	if ( !empty($params) )
-		$args = array_merge($args, $params);
+	}
+	$params = array_slice( func_get_args(), 4 );
+	$args = array( $id, $name, $control_callback, $options );
+	if ( ! empty( $params ) ) {
+		$args = array_merge( $args, $params );
+	}
 
-	call_user_func_array('wp_register_widget_control', $args);
+	call_user_func_array( 'wp_register_widget_control', $args );
 }
 
 /**
@@ -2191,9 +2263,9 @@
  *
  * @param int|string $id Widget ID.
  */
-function unregister_widget_control($id) {
+function unregister_widget_control( $id ) {
 	_deprecated_function( __FUNCTION__, '2.8.0', 'wp_unregister_widget_control()' );
-	return wp_unregister_widget_control($id);
+	return wp_unregister_widget_control( $id );
 }
 
 /**
@@ -2211,29 +2283,33 @@
 function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
 	_deprecated_function( __FUNCTION__, '3.0.0', 'delete_user_meta()' );
 	global $wpdb;
-	if ( !is_numeric( $user_id ) )
+	if ( ! is_numeric( $user_id ) ) {
 		return false;
-	$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
+	}
+	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
 
-	if ( is_array($meta_value) || is_object($meta_value) )
-		$meta_value = serialize($meta_value);
+	if ( is_array( $meta_value ) || is_object( $meta_value ) ) {
+		$meta_value = serialize( $meta_value );
+	}
 	$meta_value = trim( $meta_value );
 
-	$cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
+	$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key ) );
 
-	if ( $cur && $cur->umeta_id )
+	if ( $cur && $cur->umeta_id ) {
 		do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
+	}
 
-	if ( ! empty($meta_value) )
-		$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) );
-	else
-		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
+	if ( ! empty( $meta_value ) ) {
+		$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 ) );
+	} else { $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key ) );
+	}
 
 	clean_user_cache( $user_id );
 	wp_cache_delete( $user_id, 'user_meta' );
 
-	if ( $cur && $cur->umeta_id )
+	if ( $cur && $cur->umeta_id ) {
 		do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
+	}
 
 	return true;
 }
@@ -2259,34 +2335,35 @@
 	global $wpdb;
 	$user_id = (int) $user_id;
 
-	if ( !$user_id )
+	if ( ! $user_id ) {
 		return false;
+	}
 
-	if ( !empty($meta_key) ) {
-		$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
-		$user = wp_cache_get($user_id, 'users');
+	if ( ! empty( $meta_key ) ) {
+		$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
+		$user = wp_cache_get( $user_id, 'users' );
 		// Check the cached user object
-		if ( false !== $user && isset($user->$meta_key) )
-			$metas = array($user->$meta_key);
-		else
-			$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
+		if ( false !== $user && isset( $user->$meta_key ) ) {
+			$metas = array( $user->$meta_key );
+		} else { $metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key ) );
+		}
 	} else {
-		$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user_id) );
+		$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user_id ) );
 	}
 
-	if ( empty($metas) ) {
-		if ( empty($meta_key) )
+	if ( empty( $metas ) ) {
+		if ( empty( $meta_key ) ) {
 			return array();
-		else
-			return '';
+		} else { return '';
+		}
 	}
 
-	$metas = array_map('maybe_unserialize', $metas);
+	$metas = array_map( 'maybe_unserialize', $metas );
 
-	if ( count($metas) == 1 )
+	if ( count( $metas ) == 1 ) {
 		return $metas[0];
-	else
-		return $metas;
+	} else { return $metas;
+	}
 }
 
 /**
@@ -2310,38 +2387,41 @@
 function update_usermeta( $user_id, $meta_key, $meta_value ) {
 	_deprecated_function( __FUNCTION__, '3.0.0', 'update_user_meta()' );
 	global $wpdb;
-	if ( !is_numeric( $user_id ) )
+	if ( ! is_numeric( $user_id ) ) {
 		return false;
-	$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
+	}
+	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
 
 	/** @todo Might need fix because usermeta data is assumed to be already escaped */
-	if ( is_string($meta_value) )
-		$meta_value = stripslashes($meta_value);
-	$meta_value = maybe_serialize($meta_value);
+	if ( is_string( $meta_value ) ) {
+		$meta_value = stripslashes( $meta_value );
+	}
+	$meta_value = maybe_serialize( $meta_value );
 
-	if (empty($meta_value)) {
-		return delete_usermeta($user_id, $meta_key);
+	if ( empty( $meta_value ) ) {
+		return delete_usermeta( $user_id, $meta_key );
 	}
 
-	$cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
+	$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key ) );
 
-	if ( $cur )
+	if ( $cur ) {
 		do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
+	}
 
-	if ( !$cur )
-		$wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') );
-	elseif ( $cur->meta_value != $meta_value )
-		$wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') );
-	else
-		return false;
+	if ( ! $cur ) {
+		$wpdb->insert( $wpdb->usermeta, compact( 'user_id', 'meta_key', 'meta_value' ) );
+	} elseif ( $cur->meta_value != $meta_value ) {
+		$wpdb->update( $wpdb->usermeta, compact( 'meta_value' ), compact( 'user_id', 'meta_key' ) );
+	} else { return false;
+	}
 
 	clean_user_cache( $user_id );
 	wp_cache_delete( $user_id, 'user_meta' );
 
-	if ( !$cur )
+	if ( ! $cur ) {
 		do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value );
-	else
-		do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
+	} else { do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
+	}
 
 	return true;
 }
@@ -2368,7 +2448,7 @@
 	if ( empty( $id ) ) {
 		$id = get_current_blog_id();
 	}
-	$blog_prefix = $wpdb->get_blog_prefix($id);
+	$blog_prefix = $wpdb->get_blog_prefix( $id );
 	$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" );
 	return $users;
 }
@@ -2385,10 +2465,10 @@
 function automatic_feed_links( $add = true ) {
 	_deprecated_function( __FUNCTION__, '3.0.0', "add_theme_support( 'automatic-feed-links' )" );
 
-	if ( $add )
+	if ( $add ) {
 		add_theme_support( 'automatic-feed-links' );
-	else
-		remove_action( 'wp_head', 'feed_links_extra', 3 ); // Just do this yourself in 3.0+
+	} else { remove_action( 'wp_head', 'feed_links_extra', 3 ); // End if().
+	}
 }
 
 /**
@@ -2436,8 +2516,8 @@
  * @param array $matches Single Match
  * @return string An HTML entity
  */
-function funky_javascript_callback($matches) {
-	return "&#".base_convert($matches[1],16,10).";";
+function funky_javascript_callback( $matches ) {
+	return '&#' . base_convert( $matches[1],16,10 ) . ';';
 }
 
 /**
@@ -2454,15 +2534,16 @@
  * @param string $text Text to be made safe.
  * @return string Fixed text.
  */
-function funky_javascript_fix($text) {
+function funky_javascript_fix( $text ) {
 	_deprecated_function( __FUNCTION__, '3.0.0' );
 	// Fixes for browsers' JavaScript bugs.
 	global $is_macIE, $is_winIE;
 
-	if ( $is_winIE || $is_macIE )
-		$text =  preg_replace_callback("/\%u([0-9A-F]{4,4})/",
-					"funky_javascript_callback",
-					$text);
+	if ( $is_winIE || $is_macIE ) {
+		$text = preg_replace_callback('/\%u([0-9A-F]{4,4})/',
+			'funky_javascript_callback',
+		$text);
+	}
 
 	return $text;
 }
@@ -2512,12 +2593,13 @@
  * @return bool
  */
 function is_plugin_page() {
-	_deprecated_function( __FUNCTION__, '3.1.0'  );
+	_deprecated_function( __FUNCTION__, '3.1.0' );
 
 	global $plugin_page;
 
-	if ( isset($plugin_page) )
+	if ( isset( $plugin_page ) ) {
 		return true;
+	}
 
 	return false;
 }
@@ -2535,7 +2617,7 @@
  * @return bool Always return True
  */
 function update_category_cache() {
-	_deprecated_function( __FUNCTION__, '3.1.0'  );
+	_deprecated_function( __FUNCTION__, '3.1.0' );
 
 	return true;
 }
@@ -2568,10 +2650,12 @@
  * @param int    $tab_index     Optional. Unused.
  * @param bool   $extended      Optional. Unused.
  */
-function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) {
+function the_editor( $content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true ) {
 	_deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
 
-	wp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) );
+	wp_editor( $content, $id, array(
+		'media_buttons' => $media_buttons,
+	) );
 }
 
 /**
@@ -2583,21 +2667,26 @@
  * @param array $ids User ID numbers list.
  * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays.
  */
-function get_user_metavalues($ids) {
+function get_user_metavalues( $ids ) {
 	_deprecated_function( __FUNCTION__, '3.3.0' );
 
 	$objects = array();
 
-	$ids = array_map('intval', $ids);
-	foreach ( $ids as $id )
-		$objects[$id] = array();
+	$ids = array_map( 'intval', $ids );
+	foreach ( $ids as $id ) {
+		$objects[ $id ] = array();
+	}
 
-	$metas = update_meta_cache('user', $ids);
+	$metas = update_meta_cache( 'user', $ids );
 
 	foreach ( $metas as $id => $meta ) {
 		foreach ( $meta as $key => $metavalues ) {
 			foreach ( $metavalues as $value ) {
-				$objects[$id][] = (object)array( 'user_id' => $id, 'meta_key' => $key, 'meta_value' => $value);
+				$objects[ $id ][] = (object) array(
+					'user_id' => $id,
+					'meta_key' => $key,
+					'meta_value' => $value,
+				);
 			}
 		}
 	}
@@ -2617,25 +2706,29 @@
  * @param string $context Optional, default is 'display'. How to sanitize user fields.
  * @return object|array The now sanitized User Object or Array (will be the same type as $user)
  */
-function sanitize_user_object($user, $context = 'display') {
+function sanitize_user_object( $user, $context = 'display' ) {
 	_deprecated_function( __FUNCTION__, '3.3.0' );
 
-	if ( is_object($user) ) {
-		if ( !isset($user->ID) )
+	if ( is_object( $user ) ) {
+		if ( ! isset( $user->ID ) ) {
 			$user->ID = 0;
+		}
 		if ( ! ( $user instanceof WP_User ) ) {
-			$vars = get_object_vars($user);
-			foreach ( array_keys($vars) as $field ) {
-				if ( is_string($user->$field) || is_numeric($user->$field) )
-					$user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context);
+			$vars = get_object_vars( $user );
+			foreach ( array_keys( $vars ) as $field ) {
+				if ( is_string( $user->$field ) || is_numeric( $user->$field ) ) {
+					$user->$field = sanitize_user_field( $field, $user->$field, $user->ID, $context );
+				}
 			}
 		}
 		$user->filter = $context;
 	} else {
-		if ( !isset($user['ID']) )
+		if ( ! isset( $user['ID'] ) ) {
 			$user['ID'] = 0;
-		foreach ( array_keys($user) as $field )
-			$user[$field] = sanitize_user_field($field, $user[$field], $user['ID'], $context);
+		}
+		foreach ( array_keys( $user ) as $field ) {
+			$user[ $field ] = sanitize_user_field( $field, $user[ $field ], $user['ID'], $context );
+		}
 		$user['filter'] = $context;
 	}
 
@@ -2656,29 +2749,31 @@
  * @param bool $start Optional, default is true. Whether to display link to first or last post.
  * @return string
  */
-function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {
+function get_boundary_post_rel_link( $title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true ) {
 	_deprecated_function( __FUNCTION__, '3.3.0' );
 
-	$posts = get_boundary_post($in_same_cat, $excluded_categories, $start);
+	$posts = get_boundary_post( $in_same_cat, $excluded_categories, $start );
 	// If there is no post stop.
-	if ( empty($posts) )
+	if ( empty( $posts ) ) {
 		return;
+	}
 
 	// Even though we limited get_posts to return only 1 item it still returns an array of objects.
 	$post = $posts[0];
 
-	if ( empty($post->post_title) )
-		$post->post_title = $start ? __('First Post') : __('Last Post');
+	if ( empty( $post->post_title ) ) {
+		$post->post_title = $start ? __( 'First Post' ) : __( 'Last Post' );
+	}
 
-	$date = mysql2date(get_option('date_format'), $post->post_date);
+	$date = mysql2date( get_option( 'date_format' ), $post->post_date );
 
-	$title = str_replace('%title', $post->post_title, $title);
-	$title = str_replace('%date', $date, $title);
-	$title = apply_filters('the_title', $title, $post->ID);
+	$title = str_replace( '%title', $post->post_title, $title );
+	$title = str_replace( '%date', $date, $title );
+	$title = apply_filters( 'the_title', $title, $post->ID );
 
 	$link = $start ? "<link rel='start' title='" : "<link rel='end' title='";
-	$link .= esc_attr($title);
-	$link .= "' href='" . get_permalink($post) . "' />\n";
+	$link .= esc_attr( $title );
+	$link .= "' href='" . get_permalink( $post ) . "' />\n";
 
 	$boundary = $start ? 'start' : 'end';
 	return apply_filters( "{$boundary}_post_rel_link", $link );
@@ -2694,10 +2789,10 @@
  * @param bool $in_same_cat Optional. Whether link should be in a same category.
  * @param string $excluded_categories Optional. Excluded categories IDs.
  */
-function start_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {
+function start_post_rel_link( $title = '%title', $in_same_cat = false, $excluded_categories = '' ) {
 	_deprecated_function( __FUNCTION__, '3.3.0' );
 
-	echo get_boundary_post_rel_link($title, $in_same_cat, $excluded_categories, true);
+	echo get_boundary_post_rel_link( $title, $in_same_cat, $excluded_categories, true );
 }
 
 /**
@@ -2712,7 +2807,7 @@
 	_deprecated_function( __FUNCTION__, '3.3.0' );
 
 	$link = "<link rel='index' title='" . esc_attr( get_bloginfo( 'name', 'display' ) ) . "' href='" . esc_url( user_trailingslashit( get_bloginfo( 'url', 'display' ) ) ) . "' />\n";
-	return apply_filters( "index_rel_link", $link );
+	return apply_filters( 'index_rel_link', $link );
 }
 
 /**
@@ -2739,23 +2834,25 @@
 function get_parent_post_rel_link( $title = '%title' ) {
 	_deprecated_function( __FUNCTION__, '3.3.0' );
 
-	if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) )
-		$post = get_post($GLOBALS['post']->post_parent);
+	if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) ) {
+		$post = get_post( $GLOBALS['post']->post_parent );
+	}
 
-	if ( empty($post) )
+	if ( empty( $post ) ) {
 		return;
+	}
 
-	$date = mysql2date(get_option('date_format'), $post->post_date);
+	$date = mysql2date( get_option( 'date_format' ), $post->post_date );
 
-	$title = str_replace('%title', $post->post_title, $title);
-	$title = str_replace('%date', $date, $title);
-	$title = apply_filters('the_title', $title, $post->ID);
+	$title = str_replace( '%title', $post->post_title, $title );
+	$title = str_replace( '%date', $date, $title );
+	$title = apply_filters( 'the_title', $title, $post->ID );
 
 	$link = "<link rel='up' title='";
 	$link .= esc_attr( $title );
-	$link .= "' href='" . get_permalink($post) . "' />\n";
+	$link .= "' href='" . get_permalink( $post ) . "' />\n";
 
-	return apply_filters( "parent_post_rel_link", $link );
+	return apply_filters( 'parent_post_rel_link', $link );
 }
 
 /**
@@ -2769,7 +2866,7 @@
 function parent_post_rel_link( $title = '%title' ) {
 	_deprecated_function( __FUNCTION__, '3.3.0' );
 
-	echo get_parent_post_rel_link($title);
+	echo get_parent_post_rel_link( $title );
 }
 
 /**
@@ -2786,12 +2883,24 @@
 	$user_id = get_current_user_id();
 
 	if ( 0 != $user_id ) {
-		if ( is_admin() )
-			$wp_admin_bar->add_menu( array( 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url() ) );
-		elseif ( is_multisite() )
-			$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );
-		else
-			$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );
+		if ( is_admin() ) {
+			$wp_admin_bar->add_menu( array(
+				'id' => 'view-site',
+				'title' => __( 'Visit Site' ),
+				'href' => home_url(),
+			) );
+		} elseif ( is_multisite() ) {
+			$wp_admin_bar->add_menu( array(
+				'id' => 'dashboard',
+				'title' => __( 'Dashboard' ),
+				'href' => get_dashboard_url( $user_id ),
+			) );
+		} else { $wp_admin_bar->add_menu( array(
+			'id' => 'dashboard',
+			'title' => __( 'Dashboard' ),
+			'href' => admin_url(),
+		) );
+		}
 	}
 }
 
@@ -2843,8 +2952,9 @@
  */
 function debug_fwrite( $fp, $string ) {
 	_deprecated_function( __FUNCTION__, 'error_log()' );
-	if ( ! empty( $GLOBALS['debug'] ) )
+	if ( ! empty( $GLOBALS['debug'] ) ) {
 		error_log( $string );
+	}
 }
 
 /**
@@ -2879,18 +2989,19 @@
 	_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_themes()' );
 
 	global $wp_themes;
-	if ( isset( $wp_themes ) )
+	if ( isset( $wp_themes ) ) {
 		return $wp_themes;
+	}
 
 	$themes = wp_get_themes();
 	$wp_themes = array();
 
 	foreach ( $themes as $theme ) {
-		$name = $theme->get('Name');
-		if ( isset( $wp_themes[ $name ] ) )
+		$name = $theme->get( 'Name' );
+		if ( isset( $wp_themes[ $name ] ) ) {
 			$wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
-		else
-			$wp_themes[ $name ] = $theme;
+		} else { $wp_themes[ $name ] = $theme;
+		}
 	}
 
 	return $wp_themes;
@@ -2910,8 +3021,9 @@
 	_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme( $stylesheet )' );
 
 	$themes = get_themes();
-	if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
+	if ( is_array( $themes ) && array_key_exists( $theme, $themes ) ) {
 		return $themes[ $theme ];
+	}
 	return null;
 }
 
@@ -2927,10 +3039,11 @@
 function get_current_theme() {
 	_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );
 
-	if ( $theme = get_option( 'current_theme' ) )
+	if ( $theme = get_option( 'current_theme' ) ) {
 		return $theme;
+	}
 
-	return wp_get_theme()->get('Name');
+	return wp_get_theme()->get( 'Name' );
 }
 
 /**
@@ -2945,17 +3058,17 @@
  * @param array|string $matches The array or string
  * @return string The pre block without paragraph/line-break conversion.
  */
-function clean_pre($matches) {
+function clean_pre( $matches ) {
 	_deprecated_function( __FUNCTION__, '3.4.0' );
 
-	if ( is_array($matches) )
-		$text = $matches[1] . $matches[2] . "</pre>";
-	else
-		$text = $matches;
-
-	$text = str_replace(array('<br />', '<br/>', '<br>'), array('', '', ''), $text);
-	$text = str_replace('<p>', "\n", $text);
-	$text = str_replace('</p>', '', $text);
+	if ( is_array( $matches ) ) {
+		$text = $matches[1] . $matches[2] . '</pre>';
+	} else { $text = $matches;
+	}
+
+	$text = str_replace( array( '<br />', '<br/>', '<br>' ), array( '', '', '' ), $text );
+	$text = str_replace( '<p>', "\n", $text );
+	$text = str_replace( '</p>', '', $text );
 
 	return $text;
 }
@@ -2978,8 +3091,9 @@
 		'wp-head-callback'    => $wp_head_callback,
 		'admin-head-callback' => $admin_head_callback,
 	);
-	if ( $admin_preview_callback )
+	if ( $admin_preview_callback ) {
 		$args['admin-preview-callback'] = $admin_preview_callback;
+	}
 	return add_theme_support( 'custom-header', $args );
 }
 
@@ -3011,12 +3125,15 @@
 function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {
 	_deprecated_function( __FUNCTION__, '3.4.0', 'add_theme_support( \'custom-background\', $args )' );
 	$args = array();
-	if ( $wp_head_callback )
+	if ( $wp_head_callback ) {
 		$args['wp-head-callback'] = $wp_head_callback;
-	if ( $admin_head_callback )
+	}
+	if ( $admin_head_callback ) {
 		$args['admin-head-callback'] = $admin_head_callback;
-	if ( $admin_preview_callback )
+	}
+	if ( $admin_preview_callback ) {
 		$args['admin-preview-callback'] = $admin_preview_callback;
+	}
 	return add_theme_support( 'custom-background', $args );
 }
 
@@ -3049,22 +3166,23 @@
 	$theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );
 
 	$theme_data = array(
-		'Name' => $theme->get('Name'),
-		'URI' => $theme->display('ThemeURI', true, false),
-		'Description' => $theme->display('Description', true, false),
-		'Author' => $theme->display('Author', true, false),
-		'AuthorURI' => $theme->display('AuthorURI', true, false),
-		'Version' => $theme->get('Version'),
-		'Template' => $theme->get('Template'),
-		'Status' => $theme->get('Status'),
-		'Tags' => $theme->get('Tags'),
-		'Title' => $theme->get('Name'),
-		'AuthorName' => $theme->get('Author'),
+		'Name' => $theme->get( 'Name' ),
+		'URI' => $theme->display( 'ThemeURI', true, false ),
+		'Description' => $theme->display( 'Description', true, false ),
+		'Author' => $theme->display( 'Author', true, false ),
+		'AuthorURI' => $theme->display( 'AuthorURI', true, false ),
+		'Version' => $theme->get( 'Version' ),
+		'Template' => $theme->get( 'Template' ),
+		'Status' => $theme->get( 'Status' ),
+		'Tags' => $theme->get( 'Tags' ),
+		'Title' => $theme->get( 'Name' ),
+		'AuthorName' => $theme->get( 'Author' ),
 	);
 
 	foreach ( apply_filters( 'extra_theme_headers', array() ) as $extra_header ) {
-		if ( ! isset( $theme_data[ $extra_header ] ) )
+		if ( ! isset( $theme_data[ $extra_header ] ) ) {
 			$theme_data[ $extra_header ] = $theme->get( $extra_header );
+		}
 	}
 
 	return $theme_data;
@@ -3133,8 +3251,9 @@
  */
 function sticky_class( $post_id = null ) {
 	_deprecated_function( __FUNCTION__, '3.5.0', 'post_class()' );
-	if ( is_sticky( $post_id ) )
+	if ( is_sticky( $post_id ) ) {
 		echo ' sticky';
+	}
 }
 
 /**
@@ -3166,16 +3285,18 @@
 function wp_load_image( $file ) {
 	_deprecated_function( __FUNCTION__, '3.5.0', 'wp_get_image_editor()' );
 
-	if ( is_numeric( $file ) )
+	if ( is_numeric( $file ) ) {
 		$file = get_attached_file( $file );
+	}
 
 	if ( ! is_file( $file ) ) {
 		/* translators: %s: file name */
 		return sprintf( __( 'File &#8220;%s&#8221; doesn&#8217;t exist?' ), $file );
 	}
 
-	if ( ! function_exists('imagecreatefromstring') )
-		return __('The GD image library is not installed.');
+	if ( ! function_exists( 'imagecreatefromstring' ) ) {
+		return __( 'The GD image library is not installed.' );
+	}
 
 	// Set artificially high because GD uses uncompressed images in memory.
 	wp_raise_memory_limit( 'image' );
@@ -3218,19 +3339,22 @@
 	_deprecated_function( __FUNCTION__, '3.5.0', 'wp_get_image_editor()' );
 
 	$editor = wp_get_image_editor( $file );
-	if ( is_wp_error( $editor ) )
+	if ( is_wp_error( $editor ) ) {
 		return $editor;
+	}
 	$editor->set_quality( $jpeg_quality );
 
 	$resized = $editor->resize( $max_w, $max_h, $crop );
-	if ( is_wp_error( $resized ) )
+	if ( is_wp_error( $resized ) ) {
 		return $resized;
+	}
 
 	$dest_file = $editor->generate_filename( $suffix, $dest_path );
 	$saved = $editor->save( $dest_file );
 
-	if ( is_wp_error( $saved ) )
+	if ( is_wp_error( $saved ) ) {
 		return $saved;
+	}
 
 	return $dest_file;
 }
@@ -3265,11 +3389,12 @@
  * @param string $user_pass User password.
  * @return bool False if does not authenticate, true if username and password authenticates.
  */
-function user_pass_ok($user_login, $user_pass) {
+function user_pass_ok( $user_login, $user_pass ) {
 	_deprecated_function( __FUNCTION__, '3.5.0', 'wp_authenticate()' );
 	$user = wp_authenticate( $user_login, $user_pass );
-	if ( is_wp_error( $user ) )
+	if ( is_wp_error( $user ) ) {
 		return false;
+	}
 
 	return true;
 }
@@ -3292,11 +3417,11 @@
  * @param string $mime_type
  * @return bool
  */
-function gd_edit_image_support($mime_type) {
+function gd_edit_image_support( $mime_type ) {
 	_deprecated_function( __FUNCTION__, '3.5.0', 'wp_image_editor_supports()' );
 
-	if ( function_exists('imagetypes') ) {
-		switch( $mime_type ) {
+	if ( function_exists( 'imagetypes' ) ) {
+		switch ( $mime_type ) {
 			case 'image/jpeg':
 				return (imagetypes() & IMG_JPG) != 0;
 			case 'image/png':
@@ -3305,13 +3430,13 @@
 				return (imagetypes() & IMG_GIF) != 0;
 		}
 	} else {
-		switch( $mime_type ) {
+		switch ( $mime_type ) {
 			case 'image/jpeg':
-				return function_exists('imagecreatefromjpeg');
+				return function_exists( 'imagecreatefromjpeg' );
 			case 'image/png':
-				return function_exists('imagecreatefrompng');
+				return function_exists( 'imagecreatefrompng' );
 			case 'image/gif':
-				return function_exists('imagecreatefromgif');
+				return function_exists( 'imagecreatefromgif' );
 		}
 	}
 	return false;
@@ -3330,7 +3455,13 @@
 function wp_convert_bytes_to_hr( $bytes ) {
 	_deprecated_function( __FUNCTION__, '3.6.0', 'size_format()' );
 
-	$units = array( 0 => 'B', 1 => 'KB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );
+	$units = array(
+		0 => 'B',
+		1 => 'KB',
+		2 => 'MB',
+		3 => 'GB',
+		4 => 'TB',
+	);
 	$log   = log( $bytes, KB_IN_BYTES );
 	$power = (int) $log;
 	$size  = pow( KB_IN_BYTES, $log - $power );
@@ -3375,8 +3506,9 @@
 	global $wp_rich_edit_exists;
 	_deprecated_function( __FUNCTION__, '3.9.0' );
 
-	if ( ! isset( $wp_rich_edit_exists ) )
+	if ( ! isset( $wp_rich_edit_exists ) ) {
 		$wp_rich_edit_exists = file_exists( ABSPATH . WPINC . '/js/tinymce/tinymce.js' );
+	}
 
 	return $wp_rich_edit_exists;
 }
@@ -3421,9 +3553,9 @@
  * @param string $text The text to be escaped.
  * @return string text, safe for inclusion in LIKE query.
  */
-function like_escape($text) {
+function like_escape( $text ) {
 	_deprecated_function( __FUNCTION__, '4.0.0', 'wpdb::esc_like()' );
-	return str_replace( array( "%", "_" ), array( "\\%", "\\_" ), $text );
+	return str_replace( array( '%', '_' ), array( '\\%', '\\_' ), $text );
 }
 
 /**
@@ -3443,7 +3575,7 @@
 
 	$response = wp_remote_get( set_url_scheme( $url, 'https' ) );
 
-	if ( !is_wp_error( $response ) ) {
+	if ( ! is_wp_error( $response ) ) {
 		$status = wp_remote_retrieve_response_code( $response );
 		if ( 200 == $status || 401 == $status ) {
 			return true;
@@ -3538,7 +3670,7 @@
  * @param string $text The text to be formatted.
  * @return string The formatted text after filter is applied.
  */
-function wp_richedit_pre($text) {
+function wp_richedit_pre( $text ) {
 	_deprecated_function( __FUNCTION__, '4.3.0', 'format_for_editor()' );
 
 	if ( empty( $text ) ) {
@@ -3560,9 +3692,9 @@
 		return apply_filters( 'richedit_pre', '' );
 	}
 
-	$output = convert_chars($text);
-	$output = wpautop($output);
-	$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
+	$output = convert_chars( $text );
+	$output = wpautop( $output );
+	$output = htmlspecialchars( $output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
 
 	/** This filter is documented in wp-includes/deprecated.php */
 	return apply_filters( 'richedit_pre', $output );
@@ -3581,11 +3713,12 @@
  * @param string $output The text to be formatted.
  * @return string Formatted text after filter applied.
  */
-function wp_htmledit_pre($output) {
+function wp_htmledit_pre( $output ) {
 	_deprecated_function( __FUNCTION__, '4.3.0', 'format_for_editor()' );
 
-	if ( !empty($output) )
-		$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
+	if ( ! empty( $output ) ) {
+		$output = htmlspecialchars( $output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
+	}
 
 	/**
 	 * Filters the text before it is formatted for the HTML editor.
@@ -3635,40 +3768,44 @@
 
 	@set_time_limit( 60 );
 
-	if ( $red > 5 )
+	if ( $red > 5 ) {
 		return false;
+	}
 
 	$options = array();
 	$options['redirection'] = 5;
 
-	if ( false == $file_path )
+	if ( false == $file_path ) {
 		$options['method'] = 'HEAD';
-	else
-		$options['method'] = 'GET';
+	} else { $options['method'] = 'GET';
+	}
 
 	$response = wp_safe_remote_request( $url, $options );
 
-	if ( is_wp_error( $response ) )
+	if ( is_wp_error( $response ) ) {
 		return false;
+	}
 
 	$headers = wp_remote_retrieve_headers( $response );
 	$headers['response'] = wp_remote_retrieve_response_code( $response );
 
 	// WP_HTTP no longer follows redirects for HEAD requests.
-	if ( 'HEAD' == $options['method'] && in_array($headers['response'], array(301, 302)) && isset( $headers['location'] ) ) {
+	if ( 'HEAD' == $options['method'] && in_array( $headers['response'], array( 301, 302 ) ) && isset( $headers['location'] ) ) {
 		return wp_get_http( $headers['location'], $file_path, ++$red );
 	}
 
-	if ( false == $file_path )
+	if ( false == $file_path ) {
 		return $headers;
+	}
 
 	// GET request - write it to the supplied filename
-	$out_fp = fopen($file_path, 'w');
-	if ( !$out_fp )
+	$out_fp = fopen( $file_path, 'w' );
+	if ( ! $out_fp ) {
 		return $headers;
+	}
 
 	fwrite( $out_fp,  wp_remote_retrieve_body( $response ) );
-	fclose($out_fp);
+	fclose( $out_fp );
 	clearstatcache();
 
 	return $headers;
@@ -3738,7 +3875,7 @@
  */
 function popuplinks( $text ) {
 	_deprecated_function( __FUNCTION__, '4.5.0' );
-	$text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);
+	$text = preg_replace( '/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text );
 	return $text;
 }
 
@@ -3816,12 +3953,12 @@
 function _usort_terms_by_ID( $a, $b ) {
 	_deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' );
 
-	if ( $a->term_id > $b->term_id )
+	if ( $a->term_id > $b->term_id ) {
 		return 1;
-	elseif ( $a->term_id < $b->term_id )
+	} elseif ( $a->term_id < $b->term_id ) {
 		return -1;
-	else
-		return 0;
+	} else { return 0;
+	}
 }
 
 /**
@@ -3862,19 +3999,21 @@
 
 	_deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' );
 
-	if ( empty( $_menu_item_sort_prop ) )
+	if ( empty( $_menu_item_sort_prop ) ) {
 		return 0;
+	}
 
-	if ( ! isset( $a->$_menu_item_sort_prop ) || ! isset( $b->$_menu_item_sort_prop ) )
+	if ( ! isset( $a->$_menu_item_sort_prop ) || ! isset( $b->$_menu_item_sort_prop ) ) {
 		return 0;
+	}
 
 	$_a = (int) $a->$_menu_item_sort_prop;
 	$_b = (int) $b->$_menu_item_sort_prop;
 
-	if ( $a->$_menu_item_sort_prop == $b->$_menu_item_sort_prop )
+	if ( $a->$_menu_item_sort_prop == $b->$_menu_item_sort_prop ) {
 		return 0;
-	elseif ( $_a == $a->$_menu_item_sort_prop && $_b == $b->$_menu_item_sort_prop )
+	} elseif ( $_a == $a->$_menu_item_sort_prop && $_b == $b->$_menu_item_sort_prop ) {
 		return $_a < $_b ? -1 : 1;
-	else
-		return strcmp( $a->$_menu_item_sort_prop, $b->$_menu_item_sort_prop );
+	} else { return strcmp( $a->$_menu_item_sort_prop, $b->$_menu_item_sort_prop );
+	}
 }
Index: src/wp-includes/embed.php
===================================================================
--- src/wp-includes/embed.php	(revision 40901)
+++ src/wp-includes/embed.php	(working copy)
@@ -61,11 +61,13 @@
  * @return array Default embed parameters.
  */
 function wp_embed_defaults( $url = '' ) {
-	if ( ! empty( $GLOBALS['content_width'] ) )
+	if ( ! empty( $GLOBALS['content_width'] ) ) {
 		$width = (int) $GLOBALS['content_width'];
+	}
 
-	if ( empty( $width ) )
+	if ( empty( $width ) ) {
 		$width = 500;
+	}
 
 	$height = min( ceil( $width * 1.5 ), 1000 );
 
@@ -132,7 +134,7 @@
 function wp_oembed_add_provider( $format, $provider, $regex = false ) {
 	if ( did_action( 'plugins_loaded' ) ) {
 		$oembed = _wp_oembed_get_object();
-		$oembed->providers[$format] = array( $provider, $regex );
+		$oembed->providers[ $format ] = array( $provider, $regex );
 	} else {
 		WP_oEmbed::_add_provider_early( $format, $provider, $regex );
 	}
@@ -226,7 +228,7 @@
  */
 function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
 	global $wp_embed;
-	$embed = $wp_embed->autoembed( sprintf( "https://youtube.com/watch?v=%s", urlencode( $matches[2] ) ) );
+	$embed = $wp_embed->autoembed( sprintf( 'https://youtube.com/watch?v=%s', urlencode( $matches[2] ) ) );
 
 	/**
 	 * Filters the YoutTube embed output.
@@ -363,10 +365,14 @@
 	}
 
 	$embed_url     = trailingslashit( get_permalink( $post ) ) . user_trailingslashit( 'embed' );
-	$path_conflict = get_page_by_path( str_replace( home_url(), '', $embed_url ), OBJECT, get_post_types( array( 'public' => true ) ) );
+	$path_conflict = get_page_by_path( str_replace( home_url(), '', $embed_url ), OBJECT, get_post_types( array(
+		'public' => true,
+	) ) );
 
 	if ( ! get_option( 'permalink_structure' ) || $path_conflict ) {
-		$embed_url = add_query_arg( array( 'embed' => 'true' ), get_permalink( $post ) );
+		$embed_url = add_query_arg( array(
+			'embed' => 'true',
+		), get_permalink( $post ) );
 	}
 
 	/**
@@ -449,7 +455,7 @@
 		 * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
 		 * and edit wp-embed.js directly.
 		 */
-		$output .=<<<JS
+		$output .= <<<JS
 		include "js/wp-embed.min.js"
 JS;
 	}
@@ -519,7 +525,7 @@
 	 */
 	$min_max_width = apply_filters( 'oembed_min_max_width', array(
 		'min' => 200,
-		'max' => 600
+		'max' => 600,
 	) );
 
 	$width  = min( max( $min_max_width['min'], $width ), $min_max_width['max'] );
@@ -582,7 +588,7 @@
 	if ( 'attachment' === get_post_type( $post ) ) {
 		if ( wp_attachment_is_image( $post ) ) {
 			$thumbnail_id = $post->ID;
-		} else if ( wp_attachment_is( 'video', $post ) ) {
+		} elseif ( wp_attachment_is( 'video', $post ) ) {
 			$thumbnail_id = get_post_thumbnail_id( $post );
 			$data['type'] = 'video';
 		}
@@ -723,7 +729,9 @@
 	$wp_oembed = _wp_oembed_get_object();
 
 	// Don't modify the HTML for trusted providers.
-	if ( false !== $wp_oembed->get_provider( $url, array( 'discover' => false ) ) ) {
+	if ( false !== $wp_oembed->get_provider( $url, array(
+		'discover' => false,
+	) ) ) {
 		return $result;
 	}
 
@@ -867,23 +875,23 @@
 	?>
 	<style type="text/css">
 	<?php
-		if ( SCRIPT_DEBUG ) {
-			readfile( ABSPATH . WPINC . "/css/wp-embed-template.css" );
-		} else {
-			/*
-			 * If you're looking at a src version of this file, you'll see an "include"
-			 * statement below. This is used by the `grunt build` process to directly
-			 * include a minified version of wp-oembed-embed.css, instead of using the
-			 * readfile() method from above.
-			 *
-			 * If you're looking at a build version of this file, you'll see a string of
-			 * minified CSS. If you need to debug it, please turn on SCRIPT_DEBUG
-			 * and edit wp-embed-template.css directly.
-			 */
-			?>
-			include "css/wp-embed-template.min.css"
-			<?php
-		}
+	if ( SCRIPT_DEBUG ) {
+		readfile( ABSPATH . WPINC . '/css/wp-embed-template.css' );
+	} else {
+		/*
+		* If you're looking at a src version of this file, you'll see an "include"
+		* statement below. This is used by the `grunt build` process to directly
+		* include a minified version of wp-oembed-embed.css, instead of using the
+		* readfile() method from above.
+		*
+		* If you're looking at a build version of this file, you'll see a string of
+		* minified CSS. If you need to debug it, please turn on SCRIPT_DEBUG
+		* and edit wp-embed-template.css directly.
+		*/
+		?>
+		include "css/wp-embed-template.min.css"
+		<?php
+	}
 	?>
 	</style>
 	<?php
@@ -898,23 +906,23 @@
 	?>
 	<script type="text/javascript">
 	<?php
-		if ( SCRIPT_DEBUG ) {
-			readfile( ABSPATH . WPINC . "/js/wp-embed-template.js" );
-		} else {
-			/*
-			 * If you're looking at a src version of this file, you'll see an "include"
-			 * statement below. This is used by the `grunt build` process to directly
-			 * include a minified version of wp-embed-template.js, instead of using the
-			 * readfile() method from above.
-			 *
-			 * If you're looking at a build version of this file, you'll see a string of
-			 * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
-			 * and edit wp-embed-template.js directly.
-			 */
-			?>
-			include "js/wp-embed-template.min.js"
-			<?php
-		}
+	if ( SCRIPT_DEBUG ) {
+		readfile( ABSPATH . WPINC . '/js/wp-embed-template.js' );
+	} else {
+		/*
+		* If you're looking at a src version of this file, you'll see an "include"
+		* statement below. This is used by the `grunt build` process to directly
+		* include a minified version of wp-embed-template.js, instead of using the
+		* readfile() method from above.
+		*
+		* If you're looking at a build version of this file, you'll see a string of
+		* minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
+		* and edit wp-embed-template.js directly.
+		*/
+		?>
+		include "js/wp-embed-template.min.js"
+		<?php
+	}
 	?>
 	</script>
 	<?php
Index: src/wp-includes/feed-atom-comments.php
===================================================================
--- src/wp-includes/feed-atom-comments.php	(revision 40901)
+++ src/wp-includes/feed-atom-comments.php	(working copy)
@@ -5,8 +5,8 @@
  * @package WordPress
  */
 
-header('Content-Type: ' . feed_content_type('atom') . '; charset=' . get_option('blog_charset'), true);
-echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>';
+header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );
+echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '" ?' . '>';
 
 /** This action is documented in wp-includes/feed-rss2.php */
 do_action( 'rss_tag_pre', 'atom-comments' );
@@ -28,18 +28,18 @@
 	?>
 >
 	<title type="text"><?php
-		if ( is_singular() ) {
-			/* translators: Comments feed title. 1: Post title */
-			printf( ent2ncr( __( 'Comments on %s' ) ), get_the_title_rss() );
-		} elseif ( is_search() ) {
-			/* translators: Comments feed title. 1: Site name, 2: Search query */
-			printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
-		} else {
-			/* translators: Comments feed title. 1: Site name */
-			printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
-		}
+	if ( is_singular() ) {
+		/* translators: Comments feed title. 1: Post title */
+		printf( ent2ncr( __( 'Comments on %s' ) ), get_the_title_rss() );
+	} elseif ( is_search() ) {
+		/* translators: Comments feed title. 1: Site name, 2: Search query */
+		printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
+	} else {
+		/* translators: Comments feed title. 1: Site name */
+		printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
+	}
 	?></title>
-	<subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle>
+	<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle>
 
 	<updated><?php
 		$date = get_lastcommentmodified( 'GMT' );
@@ -47,17 +47,17 @@
 	?></updated>
 
 <?php if ( is_singular() ) { ?>
-	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php comments_link_feed(); ?>" />
-	<link rel="self" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link('', 'atom') ); ?>" />
-	<id><?php echo esc_url( get_post_comments_feed_link('', 'atom') ); ?></id>
-<?php } elseif (is_search()) { ?>
-	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo home_url() . '?s=' . get_search_query(); ?>" />
-	<link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" />
-	<id><?php echo get_search_comments_feed_link('', 'atom'); ?></id>
+	<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php comments_link_feed(); ?>" />
+	<link rel="self" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link( '', 'atom' ) ); ?>" />
+	<id><?php echo esc_url( get_post_comments_feed_link( '', 'atom' ) ); ?></id>
+<?php } elseif ( is_search() ) { ?>
+	<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php echo home_url() . '?s=' . get_search_query(); ?>" />
+	<link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link( '', 'atom' ); ?>" />
+	<id><?php echo get_search_comments_feed_link( '', 'atom' ); ?></id>
 <?php } else { ?>
-	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('url'); ?>" />
-	<link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
-	<id><?php bloginfo_rss('comments_atom_url'); ?></id>
+	<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ); ?>" />
+	<link rel="self" type="application/atom+xml" href="<?php bloginfo_rss( 'comments_atom_url' ); ?>" />
+	<id><?php bloginfo_rss( 'comments_atom_url' ); ?></id>
 <?php } ?>
 <?php
 	/**
@@ -69,45 +69,45 @@
 ?>
 <?php
 if ( have_comments() ) : while ( have_comments() ) : the_comment();
-	$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
+		$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
 ?>
 	<entry>
 		<title><?php
-			if ( !is_singular() ) {
-				$title = get_the_title($comment_post->ID);
-				/** This filter is documented in wp-includes/feed.php */
-				$title = apply_filters( 'the_title_rss', $title );
-				/* translators: Individual comment title. 1: Post title, 2: Comment author name */
-				printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
-			} else {
-				/* translators: Comment author title. 1: Comment author name */
-				printf(ent2ncr(__('By: %s')), get_comment_author_rss());
-			}
+		if ( ! is_singular() ) {
+			$title = get_the_title( $comment_post->ID );
+			/** This filter is documented in wp-includes/feed.php */
+			$title = apply_filters( 'the_title_rss', $title );
+			/* translators: Individual comment title. 1: Post title, 2: Comment author name */
+			printf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() );
+		} else {
+			/* translators: Comment author title. 1: Comment author name */
+			printf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() );
+		}
 		?></title>
-		<link rel="alternate" href="<?php comment_link(); ?>" type="<?php bloginfo_rss('html_type'); ?>" />
+		<link rel="alternate" href="<?php comment_link(); ?>" type="<?php bloginfo_rss( 'html_type' ); ?>" />
 
 		<author>
 			<name><?php comment_author_rss(); ?></name>
-			<?php if (get_comment_author_url()) echo '<uri>' . get_comment_author_url() . '</uri>'; ?>
+			<?php if ( get_comment_author_url() ) { echo '<uri>' . get_comment_author_url() . '</uri>';} ?>
 
 		</author>
 
 		<id><?php comment_guid(); ?></id>
-		<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true, false), false); ?></updated>
-		<published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true, false), false); ?></published>
-<?php if ( post_password_required($comment_post) ) : ?>
+		<updated><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', get_comment_time( 'Y-m-d H:i:s', true, false ), false ); ?></updated>
+		<published><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', get_comment_time( 'Y-m-d H:i:s', true, false ), false ); ?></published>
+<?php if ( post_password_required( $comment_post ) ) : ?>
 		<content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content>
 <?php else : // post pass ?>
 		<content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php comment_text(); ?>]]></content>
 <?php endif; // post pass
 	// Return comment threading information (https://www.ietf.org/rfc/rfc4685.txt)
-	if ( $comment->comment_parent == 0 ) : // This comment is top level ?>
-		<thr:in-reply-to ref="<?php the_guid(); ?>" href="<?php the_permalink_rss() ?>" type="<?php bloginfo_rss('html_type'); ?>" />
+if ( $comment->comment_parent == 0 ) : // This comment is top level ?>
+		<thr:in-reply-to ref="<?php the_guid(); ?>" href="<?php the_permalink_rss() ?>" type="<?php bloginfo_rss( 'html_type' ); ?>" />
 <?php else : // This comment is in reply to another comment
-	$parent_comment = get_comment($comment->comment_parent);
+	$parent_comment = get_comment( $comment->comment_parent );
 	// The rel attribute below and the id tag above should be GUIDs, but WP doesn't create them for comments (unlike posts). Either way, it's more important that they both use the same system
 ?>
-		<thr:in-reply-to ref="<?php comment_guid($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" />
+		<thr:in-reply-to ref="<?php comment_guid( $parent_comment ) ?>" href="<?php echo get_comment_link( $parent_comment ) ?>" type="<?php bloginfo_rss( 'html_type' ); ?>" />
 <?php endif;
 	/**
 	 * Fires at the end of each Atom comment feed item.
@@ -120,5 +120,6 @@
 	do_action( 'comment_atom_entry', $comment->comment_ID, $comment_post->ID );
 ?>
 	</entry>
-<?php endwhile; endif; ?>
+<?php endwhile;
+endif; ?>
 </feed>
Index: src/wp-includes/feed-atom.php
===================================================================
--- src/wp-includes/feed-atom.php	(revision 40901)
+++ src/wp-includes/feed-atom.php	(working copy)
@@ -5,10 +5,10 @@
  * @package WordPress
  */
 
-header('Content-Type: ' . feed_content_type('atom') . '; charset=' . get_option('blog_charset'), true);
+header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );
 $more = 1;
 
-echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
+echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
 
 /** This action is documented in wp-includes/feed-rss2.php */
 do_action( 'rss_tag_pre', 'atom' );
@@ -17,26 +17,26 @@
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:thr="http://purl.org/syndication/thread/1.0"
   xml:lang="<?php bloginfo_rss( 'language' ); ?>"
-  xml:base="<?php bloginfo_rss('url') ?>/wp-atom.php"
-  <?php
-  /**
+  xml:base="<?php bloginfo_rss( 'url' ) ?>/wp-atom.php"
+	<?php
+	/**
    * Fires at end of the Atom feed root to add namespaces.
    *
    * @since 2.0.0
    */
-  do_action( 'atom_ns' );
-  ?>
+	do_action( 'atom_ns' );
+	?>
  >
 	<title type="text"><?php wp_title_rss(); ?></title>
-	<subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
+	<subtitle type="text"><?php bloginfo_rss( 'description' ) ?></subtitle>
 
 	<updated><?php
 		$date = get_lastpostmodified( 'GMT' );
 		echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date, false ) : date( 'Y-m-d\TH:i:s\Z' );
 	?></updated>
 
-	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('url') ?>" />
-	<id><?php bloginfo('atom_url'); ?></id>
+	<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ) ?>" />
+	<id><?php bloginfo( 'atom_url' ); ?></id>
 	<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />
 
 	<?php
@@ -52,8 +52,8 @@
 	<entry>
 		<author>
 			<name><?php the_author() ?></name>
-			<?php $author_url = get_the_author_meta('url'); if ( !empty($author_url) ) : ?>
-			<uri><?php the_author_meta('url')?></uri>
+			<?php $author_url = get_the_author_meta( 'url' ); if ( ! empty( $author_url ) ) : ?>
+			<uri><?php the_author_meta( 'url' )?></uri>
 			<?php endif;
 
 			/**
@@ -65,14 +65,14 @@
 		?>
 		</author>
 		<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
-		<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php the_permalink_rss() ?>" />
-		<id><?php the_guid() ; ?></id>
-		<updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated>
-		<published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
-		<?php the_category_rss('atom') ?>
+		<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php the_permalink_rss() ?>" />
+		<id><?php the_guid(); ?></id>
+		<updated><?php echo get_post_modified_time( 'Y-m-d\TH:i:s\Z', true ); ?></updated>
+		<published><?php echo get_post_time( 'Y-m-d\TH:i:s\Z', true ); ?></published>
+		<?php the_category_rss( 'atom' ) ?>
 		<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
-<?php if ( !get_option('rss_use_excerpt') ) : ?>
-		<content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content_feed('atom') ?>]]></content>
+<?php if ( ! get_option( 'rss_use_excerpt' ) ) : ?>
+		<content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content_feed( 'atom' ) ?>]]></content>
 <?php endif; ?>
 	<?php atom_enclosure();
 	/**
@@ -84,8 +84,8 @@
 
 	if ( get_comments_number() || comments_open() ) :
 		?>
-		<link rel="replies" type="<?php bloginfo_rss('html_type'); ?>" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
-		<link rel="replies" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link(0, 'atom') ); ?>" thr:count="<?php echo get_comments_number()?>"/>
+		<link rel="replies" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
+		<link rel="replies" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link( 0, 'atom' ) ); ?>" thr:count="<?php echo get_comments_number()?>"/>
 		<thr:total><?php echo get_comments_number()?></thr:total>
 	<?php endif; ?>
 	</entry>
Index: src/wp-includes/feed-rdf.php
===================================================================
--- src/wp-includes/feed-rdf.php	(revision 40901)
+++ src/wp-includes/feed-rdf.php	(working copy)
@@ -5,10 +5,10 @@
  * @package WordPress
  */
 
-header('Content-Type: ' . feed_content_type('rdf') . '; charset=' . get_option('blog_charset'), true);
+header( 'Content-Type: ' . feed_content_type( 'rdf' ) . '; charset=' . get_option( 'blog_charset' ), true );
 $more = 1;
 
-echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
+echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
 
 /** This action is documented in wp-includes/feed-rss2.php */
 do_action( 'rss_tag_pre', 'rdf' );
@@ -29,10 +29,10 @@
 	do_action( 'rdf_ns' );
 	?>
 >
-<channel rdf:about="<?php bloginfo_rss("url") ?>">
+<channel rdf:about="<?php bloginfo_rss( 'url' ) ?>">
 	<title><?php wp_title_rss(); ?></title>
-	<link><?php bloginfo_rss('url') ?></link>
-	<description><?php bloginfo_rss('description') ?></description>
+	<link><?php bloginfo_rss( 'url' ) ?></link>
+	<description><?php bloginfo_rss( 'description' ) ?></description>
 	<dc:date><?php
 		$date = get_lastpostmodified( 'GMT' );
 		echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date ) : date( 'Y-m-d\TH:i:s\Z' );
@@ -56,24 +56,25 @@
 	?>
 	<items>
 		<rdf:Seq>
-		<?php while (have_posts()): the_post(); ?>
+		<?php while ( have_posts() ) : the_post(); ?>
 			<rdf:li rdf:resource="<?php the_permalink_rss() ?>"/>
 		<?php endwhile; ?>
 		</rdf:Seq>
 	</items>
 </channel>
-<?php rewind_posts(); while (have_posts()): the_post(); ?>
+<?php rewind_posts();
+while ( have_posts() ) : the_post(); ?>
 <item rdf:about="<?php the_permalink_rss() ?>">
 	<title><?php the_title_rss() ?></title>
 	<link><?php the_permalink_rss() ?></link>
-	<dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date>
+	<dc:date><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', $post->post_date_gmt, false ); ?></dc:date>
 	<dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
-	<?php the_category_rss('rdf') ?>
-<?php if (get_option('rss_use_excerpt')) : ?>
+	<?php the_category_rss( 'rdf' ) ?>
+<?php if ( get_option( 'rss_use_excerpt' ) ) : ?>
 	<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
 <?php else : ?>
 	<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
-	<content:encoded><![CDATA[<?php the_content_feed('rdf') ?>]]></content:encoded>
+	<content:encoded><![CDATA[<?php the_content_feed( 'rdf' ) ?>]]></content:encoded>
 <?php endif; ?>
 	<?php
 	/**
Index: src/wp-includes/feed-rss.php
===================================================================
--- src/wp-includes/feed-rss.php	(revision 40901)
+++ src/wp-includes/feed-rss.php	(working copy)
@@ -5,15 +5,15 @@
  * @package WordPress
  */
 
-header('Content-Type: ' . feed_content_type('rss') . '; charset=' . get_option('blog_charset'), true);
+header( 'Content-Type: ' . feed_content_type( 'rss' ) . '; charset=' . get_option( 'blog_charset' ), true );
 $more = 1;
 
-echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
+echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>'; ?>
 <rss version="0.92">
 <channel>
 	<title><?php wp_title_rss(); ?></title>
-	<link><?php bloginfo_rss('url') ?></link>
-	<description><?php bloginfo_rss('description') ?></description>
+	<link><?php bloginfo_rss( 'url' ) ?></link>
+	<description><?php bloginfo_rss( 'description' ) ?></description>
 	<lastBuildDate><?php
 		$date = get_lastpostmodified( 'GMT' );
 		echo $date ? mysql2date( 'D, d M Y H:i:s +0000', $date ) : date( 'D, d M Y H:i:s +0000' );
@@ -30,7 +30,7 @@
 	do_action( 'rss_head' );
 	?>
 
-<?php while (have_posts()) : the_post(); ?>
+<?php while ( have_posts() ) : the_post(); ?>
 	<item>
 		<title><?php the_title_rss() ?></title>
 		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
Index: src/wp-includes/feed-rss2-comments.php
===================================================================
--- src/wp-includes/feed-rss2-comments.php	(revision 40901)
+++ src/wp-includes/feed-rss2-comments.php	(working copy)
@@ -5,9 +5,9 @@
  * @package WordPress
  */
 
-header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
+header( 'Content-Type: ' . feed_content_type( 'rss2' ) . '; charset=' . get_option( 'blog_charset' ), true );
 
-echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
+echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
 
 /** This action is documented in wp-includes/feed-rss2.php */
 do_action( 'rss_tag_pre', 'rss2-comments' );
@@ -33,20 +33,20 @@
 >
 <channel>
 	<title><?php
-		if ( is_singular() ) {
-			/* translators: Comments feed title. 1: Post title */
-			printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );
-		} elseif ( is_search() ) {
-			/* translators: Comments feed title. 1: Site name, 2: Search query */
-			printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
-		} else {
-			/* translators: Comments feed title. 1: Site name */
-			printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
-		}
+	if ( is_singular() ) {
+		/* translators: Comments feed title. 1: Post title */
+		printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );
+	} elseif ( is_search() ) {
+		/* translators: Comments feed title. 1: Site name, 2: Search query */
+		printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
+	} else {
+		/* translators: Comments feed title. 1: Site name */
+		printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
+	}
 	?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
-	<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
-	<description><?php bloginfo_rss("description") ?></description>
+	<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss( 'url' ) ?></link>
+	<description><?php bloginfo_rss( 'description' ) ?></description>
 	<lastBuildDate><?php
 		$date = get_lastcommentmodified( 'GMT' );
 		echo $date ? mysql2date( 'r', $date, false ) : date( 'r' );
@@ -68,27 +68,27 @@
 	do_action( 'commentsrss2_head' );
 
 	if ( have_comments() ) : while ( have_comments() ) : the_comment();
-		$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
+			$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
 	?>
 	<item>
 		<title><?php
-			if ( !is_singular() ) {
-				$title = get_the_title($comment_post->ID);
-				/** This filter is documented in wp-includes/feed.php */
-				$title = apply_filters( 'the_title_rss', $title );
-				/* translators: Individual comment title. 1: Post title, 2: Comment author name */
-				printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
-			} else {
-				/* translators: Comment author title. 1: Comment author name */
-				printf(ent2ncr(__('By: %s')), get_comment_author_rss());
-			}
+		if ( ! is_singular() ) {
+			$title = get_the_title( $comment_post->ID );
+			/** This filter is documented in wp-includes/feed.php */
+			$title = apply_filters( 'the_title_rss', $title );
+			/* translators: Individual comment title. 1: Post title, 2: Comment author name */
+			printf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() );
+		} else {
+			/* translators: Comment author title. 1: Comment author name */
+			printf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() );
+		}
 		?></title>
 		<link><?php comment_link() ?></link>
 		<dc:creator><![CDATA[<?php echo get_comment_author_rss() ?>]]></dc:creator>
-		<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>
+		<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>
 		<guid isPermaLink="false"><?php comment_guid() ?></guid>
-<?php if ( post_password_required($comment_post) ) : ?>
-		<description><?php echo ent2ncr(__('Protected Comments: Please enter your password to view comments.')); ?></description>
+<?php if ( post_password_required( $comment_post ) ) : ?>
+		<description><?php echo ent2ncr( __( 'Protected Comments: Please enter your password to view comments.' ) ); ?></description>
 		<content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
 <?php else : // post pass ?>
 		<description><![CDATA[<?php comment_text_rss() ?>]]></description>
@@ -105,6 +105,7 @@
 	do_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID );
 ?>
 	</item>
-<?php endwhile; endif; ?>
+<?php endwhile;
+endif; ?>
 </channel>
 </rss>
Index: src/wp-includes/feed-rss2.php
===================================================================
--- src/wp-includes/feed-rss2.php	(revision 40901)
+++ src/wp-includes/feed-rss2.php	(working copy)
@@ -5,10 +5,10 @@
  * @package WordPress
  */
 
-header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
+header( 'Content-Type: ' . feed_content_type( 'rss2' ) . '; charset=' . get_option( 'blog_charset' ), true );
 $more = 1;
 
-echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
+echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
 
 /**
  * Fires between the xml and rss tags in a feed.
@@ -40,8 +40,8 @@
 <channel>
 	<title><?php wp_title_rss(); ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
-	<link><?php bloginfo_rss('url') ?></link>
-	<description><?php bloginfo_rss("description") ?></description>
+	<link><?php bloginfo_rss( 'url' ) ?></link>
+	<description><?php bloginfo_rss( 'description' ) ?></description>
 	<lastBuildDate><?php
 		$date = get_lastpostmodified( 'GMT' );
 		echo $date ? mysql2date( 'r', $date, false ) : date( 'r' );
@@ -79,9 +79,9 @@
 	 *
 	 * @since 2.0.0
 	 */
-	do_action( 'rss2_head');
+	do_action( 'rss2_head' );
 
-	while( have_posts()) : the_post();
+	while ( have_posts() ) : the_post();
 	?>
 	<item>
 		<title><?php the_title_rss() ?></title>
@@ -89,16 +89,16 @@
 <?php if ( get_comments_number() || comments_open() ) : ?>
 		<comments><?php comments_link_feed(); ?></comments>
 <?php endif; ?>
-		<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
+		<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
 		<dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
-		<?php the_category_rss('rss2') ?>
+		<?php the_category_rss( 'rss2' ) ?>
 
 		<guid isPermaLink="false"><?php the_guid(); ?></guid>
-<?php if (get_option('rss_use_excerpt')) : ?>
+<?php if ( get_option( 'rss_use_excerpt' ) ) : ?>
 		<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
 <?php else : ?>
 		<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
-	<?php $content = get_the_content_feed('rss2'); ?>
+	<?php $content = get_the_content_feed( 'rss2' ); ?>
 	<?php if ( strlen( $content ) > 0 ) : ?>
 		<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
 	<?php else : ?>
@@ -106,7 +106,7 @@
 	<?php endif; ?>
 <?php endif; ?>
 <?php if ( get_comments_number() || comments_open() ) : ?>
-		<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
+		<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link( null, 'rss2' ) ); ?></wfw:commentRss>
 		<slash:comments><?php echo get_comments_number(); ?></slash:comments>
 <?php endif; ?>
 <?php rss_enclosure(); ?>
Index: src/wp-includes/feed.php
===================================================================
--- src/wp-includes/feed.php	(revision 40901)
+++ src/wp-includes/feed.php	(working copy)
@@ -23,8 +23,8 @@
  * @param string $show See get_bloginfo() for possible values.
  * @return string
  */
-function get_bloginfo_rss($show = '') {
-	$info = strip_tags(get_bloginfo($show));
+function get_bloginfo_rss( $show = '' ) {
+	$info = strip_tags( get_bloginfo( $show ) );
 	/**
 	 * Filters the bloginfo for use in RSS feeds.
 	 *
@@ -51,7 +51,7 @@
  *
  * @param string $show See get_bloginfo() for possible values.
  */
-function bloginfo_rss($show = '') {
+function bloginfo_rss( $show = '' ) {
 	/**
 	 * Filters the bloginfo for display in RSS feeds.
 	 *
@@ -182,13 +182,14 @@
  * @param string $feed_type The type of feed. rss2 | atom | rss | rdf
  * @return string The filtered content.
  */
-function get_the_content_feed($feed_type = null) {
-	if ( !$feed_type )
+function get_the_content_feed( $feed_type = null ) {
+	if ( ! $feed_type ) {
 		$feed_type = get_default_feed();
+	}
 
 	/** This filter is documented in wp-includes/post-template.php */
 	$content = apply_filters( 'the_content', get_the_content() );
-	$content = str_replace(']]>', ']]&gt;', $content);
+	$content = str_replace( ']]>', ']]&gt;', $content );
 	/**
 	 * Filters the post content for use in feeds.
 	 *
@@ -208,8 +209,8 @@
  *
  * @param string $feed_type The type of feed. rss2 | atom | rss | rdf
  */
-function the_content_feed($feed_type = null) {
-	echo get_the_content_feed($feed_type);
+function the_content_feed( $feed_type = null ) {
+	echo get_the_content_feed( $feed_type );
 }
 
 /**
@@ -270,8 +271,8 @@
  *
  * @param int|WP_Comment $comment_id Optional comment object or id. Defaults to global comment object.
  */
-function comment_guid($comment_id = null) {
-	echo esc_url( get_comment_guid($comment_id) );
+function comment_guid( $comment_id = null ) {
+	echo esc_url( get_comment_guid( $comment_id ) );
 }
 
 /**
@@ -282,13 +283,14 @@
  * @param int|WP_Comment $comment_id Optional comment object or id. Defaults to global comment object.
  * @return false|string false on failure or guid for comment on success.
  */
-function get_comment_guid($comment_id = null) {
-	$comment = get_comment($comment_id);
+function get_comment_guid( $comment_id = null ) {
+	$comment = get_comment( $comment_id );
 
-	if ( !is_object($comment) )
+	if ( ! is_object( $comment ) ) {
 		return false;
+	}
 
-	return get_the_guid($comment->comment_post_ID) . '#comment-' . $comment->comment_ID;
+	return get_the_guid( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID;
 }
 
 /**
@@ -371,35 +373,39 @@
  * @param string $type Optional, default is the type returned by get_default_feed().
  * @return string All of the post categories for displaying in the feed.
  */
-function get_the_category_rss($type = null) {
-	if ( empty($type) )
+function get_the_category_rss( $type = null ) {
+	if ( empty( $type ) ) {
 		$type = get_default_feed();
+	}
 	$categories = get_the_category();
 	$tags = get_the_tags();
 	$the_list = '';
 	$cat_names = array();
 
 	$filter = 'rss';
-	if ( 'atom' == $type )
+	if ( 'atom' == $type ) {
 		$filter = 'raw';
+	}
 
-	if ( !empty($categories) ) foreach ( (array) $categories as $category ) {
-		$cat_names[] = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter);
+	if ( ! empty( $categories ) ) { foreach ( (array) $categories as $category ) {
+			$cat_names[] = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', $filter );
+	}
 	}
 
-	if ( !empty($tags) ) foreach ( (array) $tags as $tag ) {
-		$cat_names[] = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter);
+	if ( ! empty( $tags ) ) { foreach ( (array) $tags as $tag ) {
+			$cat_names[] = sanitize_term_field( 'name', $tag->name, $tag->term_id, 'post_tag', $filter );
+	}
 	}
 
-	$cat_names = array_unique($cat_names);
+	$cat_names = array_unique( $cat_names );
 
 	foreach ( $cat_names as $cat_name ) {
-		if ( 'rdf' == $type )
+		if ( 'rdf' == $type ) {
 			$the_list .= "\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n";
-		elseif ( 'atom' == $type )
+		} elseif ( 'atom' == $type ) {
 			$the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', esc_attr( get_bloginfo_rss( 'url' ) ), esc_attr( $cat_name ) );
-		else
-			$the_list .= "\t\t<category><![CDATA[" . @html_entity_decode( $cat_name, ENT_COMPAT, get_option('blog_charset') ) . "]]></category>\n";
+		} else { $the_list .= "\t\t<category><![CDATA[" . @html_entity_decode( $cat_name, ENT_COMPAT, get_option( 'blog_charset' ) ) . "]]></category>\n";
+		}
 	}
 
 	/**
@@ -422,8 +428,8 @@
  *
  * @param string $type Optional, default is the type returned by get_default_feed().
  */
-function the_category_rss($type = null) {
-	echo get_the_category_rss($type);
+function the_category_rss( $type = null ) {
+	echo get_the_category_rss( $type );
 }
 
 /**
@@ -434,11 +440,11 @@
  * @since 2.2.0
  */
 function html_type_rss() {
-	$type = get_bloginfo('html_type');
-	if (strpos($type, 'xhtml') !== false)
+	$type = get_bloginfo( 'html_type' );
+	if ( strpos( $type, 'xhtml' ) !== false ) {
 		$type = 'xhtml';
-	else
-		$type = 'html';
+	} else { $type = 'html';
+	}
 	echo $type;
 }
 
@@ -457,16 +463,17 @@
  * @since 1.5.0
  */
 function rss_enclosure() {
-	if ( post_password_required() )
+	if ( post_password_required() ) {
 		return;
+	}
 
-	foreach ( (array) get_post_custom() as $key => $val) {
-		if ($key == 'enclosure') {
+	foreach ( (array) get_post_custom() as $key => $val ) {
+		if ( $key == 'enclosure' ) {
 			foreach ( (array) $val as $enc ) {
-				$enclosure = explode("\n", $enc);
+				$enclosure = explode( "\n", $enc );
 
 				// only get the first element, e.g. audio/mpeg from 'audio/mpeg mpga mp2 mp3'
-				$t = preg_split('/[ \t]/', trim($enclosure[2]) );
+				$t = preg_split( '/[ \t]/', trim( $enclosure[2] ) );
 				$type = $t[0];
 
 				/**
@@ -496,13 +503,14 @@
  * @since 2.2.0
  */
 function atom_enclosure() {
-	if ( post_password_required() )
+	if ( post_password_required() ) {
 		return;
+	}
 
 	foreach ( (array) get_post_custom() as $key => $val ) {
-		if ($key == 'enclosure') {
+		if ( $key == 'enclosure' ) {
 			foreach ( (array) $val as $enc ) {
-				$enclosure = explode("\n", $enc);
+				$enclosure = explode( "\n", $enc );
 				/**
 				 * Filters the atom enclosure HTML link tag for the current post.
 				 *
@@ -533,9 +541,9 @@
  * @param string $data Input string
  * @return array array(type, value)
  */
-function prep_atom_text_construct($data) {
-	if (strpos($data, '<') === false && strpos($data, '&') === false) {
-		return array('text', $data);
+function prep_atom_text_construct( $data ) {
+	if ( strpos( $data, '<' ) === false && strpos( $data, '&' ) === false ) {
+		return array( 'text', $data );
 	}
 
 	if ( ! function_exists( 'xml_parser_create' ) ) {
@@ -545,23 +553,23 @@
 	}
 
 	$parser = xml_parser_create();
-	xml_parse($parser, '<div>' . $data . '</div>', true);
-	$code = xml_get_error_code($parser);
-	xml_parser_free($parser);
-
-	if (!$code) {
-		if (strpos($data, '<') === false) {
-			return array('text', $data);
+	xml_parse( $parser, '<div>' . $data . '</div>', true );
+	$code = xml_get_error_code( $parser );
+	xml_parser_free( $parser );
+
+	if ( ! $code ) {
+		if ( strpos( $data, '<' ) === false ) {
+			return array( 'text', $data );
 		} else {
 			$data = "<div xmlns='http://www.w3.org/1999/xhtml'>$data</div>";
-			return array('xhtml', $data);
+			return array( 'xhtml', $data );
 		}
 	}
 
-	if (strpos($data, ']]>') === false) {
-		return array('html', "<![CDATA[$data]]>");
+	if ( strpos( $data, ']]>' ) === false ) {
+		return array( 'html', "<![CDATA[$data]]>" );
 	} else {
-		return array('html', htmlspecialchars($data));
+		return array( 'html', htmlspecialchars( $data ) );
 	}
 }
 
@@ -611,7 +619,7 @@
  * @since 2.5.0
  */
 function self_link() {
-	$host = @parse_url(home_url());
+	$host = @parse_url( home_url() );
 	/**
 	 * Filters the current feed URL.
 	 *
@@ -633,18 +641,19 @@
  * @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
  */
 function feed_content_type( $type = '' ) {
-	if ( empty($type) )
+	if ( empty( $type ) ) {
 		$type = get_default_feed();
+	}
 
 	$types = array(
 		'rss'      => 'application/rss+xml',
 		'rss2'     => 'application/rss+xml',
 		'rss-http' => 'text/xml',
 		'atom'     => 'application/atom+xml',
-		'rdf'      => 'application/rdf+xml'
+		'rdf'      => 'application/rdf+xml',
 	);
 
-	$content_type = ( !empty($types[$type]) ) ? $types[$type] : 'application/octet-stream';
+	$content_type = ( ! empty( $types[ $type ] ) ) ? $types[ $type ] : 'application/octet-stream';
 
 	/**
 	 * Filters the content type for a specific feed type.
@@ -703,8 +712,9 @@
 	$feed->init();
 	$feed->set_output_encoding( get_option( 'blog_charset' ) );
 
-	if ( $feed->error() )
+	if ( $feed->error() ) {
 		return new WP_Error( 'simplepie-error', $feed->error() );
+	}
 
 	return $feed;
 }
Index: src/wp-includes/formatting.php
===================================================================
--- src/wp-includes/formatting.php	(revision 40901)
+++ src/wp-includes/formatting.php	(working copy)
@@ -107,11 +107,11 @@
 		/* translators: em dash */
 		$em_dash = _x( '&#8212;', 'em dash' );
 
-		$default_no_texturize_tags = array('pre', 'code', 'kbd', 'style', 'script', 'tt');
-		$default_no_texturize_shortcodes = array('code');
+		$default_no_texturize_tags = array( 'pre', 'code', 'kbd', 'style', 'script', 'tt' );
+		$default_no_texturize_shortcodes = array( 'code' );
 
 		// if a plugin has provided an autocorrect array, use it
-		if ( isset($wp_cockneyreplace) ) {
+		if ( isset( $wp_cockneyreplace ) ) {
 			$cockney = array_keys( $wp_cockneyreplace );
 			$cockneyreplace = array_values( $wp_cockneyreplace );
 		} else {
@@ -120,20 +120,27 @@
 			 * lines of code 'til we have enough of 'em, then we need to insert apostrophes instead of quotes.
 			 */
 			$cockney = explode( ',', _x( "'tain't,'twere,'twas,'tis,'twill,'til,'bout,'nuff,'round,'cause,'em",
-				'Comma-separated list of words to texturize in your language' ) );
+			'Comma-separated list of words to texturize in your language' ) );
 
 			$cockneyreplace = explode( ',', _x( '&#8217;tain&#8217;t,&#8217;twere,&#8217;twas,&#8217;tis,&#8217;twill,&#8217;til,&#8217;bout,&#8217;nuff,&#8217;round,&#8217;cause,&#8217;em',
-				'Comma-separated list of replacement words in your language' ) );
+			'Comma-separated list of replacement words in your language' ) );
 		}
 
 		$static_characters = array_merge( array( '...', '``', '\'\'', ' (tm)' ), $cockney );
 		$static_replacements = array_merge( array( '&#8230;', $opening_quote, $closing_quote, ' &#8482;' ), $cockneyreplace );
 
-
 		// Pattern-based replacements of characters.
 		// Sort the remaining patterns into several arrays for performance tuning.
-		$dynamic_characters = array( 'apos' => array(), 'quote' => array(), 'dash' => array() );
-		$dynamic_replacements = array( 'apos' => array(), 'quote' => array(), 'dash' => array() );
+		$dynamic_characters = array(
+			'apos' => array(),
+			'quote' => array(),
+			'dash' => array(),
+		);
+		$dynamic_replacements = array(
+			'apos' => array(),
+			'quote' => array(),
+			'dash' => array(),
+		);
 		$dynamic = array();
 		$spaces = wp_spaces_regexp();
 
@@ -147,7 +154,7 @@
 
 		// '99 '99s '99's (apostrophe)  But never '9 or '99% or '999 or '99.0.
 		if ( "'" !== $apos ) {
-			$dynamic[ '/\'(?=\d\d(?:\Z|(?![%\d]|[.,]\d)))/' ] = $apos_flag;
+			$dynamic['/\'(?=\d\d(?:\Z|(?![%\d]|[.,]\d)))/'] = $apos_flag;
 		}
 
 		// Quoted Numbers like '0.42'
@@ -184,14 +191,14 @@
 		$dynamic = array();
 
 		// Dashes and spaces
-		$dynamic[ '/---/' ] = $em_dash;
+		$dynamic['/---/'] = $em_dash;
 		$dynamic[ '/(?<=^|' . $spaces . ')--(?=$|' . $spaces . ')/' ] = $em_dash;
-		$dynamic[ '/(?<!xn)--/' ] = $en_dash;
+		$dynamic['/(?<!xn)--/'] = $en_dash;
 		$dynamic[ '/(?<=^|' . $spaces . ')-(?=$|' . $spaces . ')/' ] = $en_dash;
 
 		$dynamic_characters['dash'] = array_keys( $dynamic );
 		$dynamic_replacements['dash'] = array_values( $dynamic );
-	}
+	}// End if().
 
 	// Must do this every time in case plugins use these filters in a context sensitive manner
 	/**
@@ -239,7 +246,6 @@
 
 				_wptexturize_pushpop_element( $curl, $no_texturize_tags_stack, $no_texturize_tags );
 			}
-
 		} elseif ( '' === trim( $curl ) ) {
 			// This is a newline between delimiters.  Performance improves when we check this.
 			continue;
@@ -254,7 +260,6 @@
 				// Looks like an escaped shortcode.
 				continue;
 			}
-
 		} elseif ( empty( $no_texturize_shortcodes_stack ) && empty( $no_texturize_tags_stack ) ) {
 			// This is neither a delimiter, nor is this content inside of no_texturize pairs.  Do texturize.
 
@@ -283,8 +288,8 @@
 
 			// Replace each & with &#038; unless it already looks like an entity.
 			$curl = preg_replace( '/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i', '&#038;', $curl );
-		}
-	}
+		}// End if().
+	}// End foreach().
 
 	return implode( '', $textarr );
 }
@@ -306,7 +311,7 @@
 function wptexturize_primes( $haystack, $needle, $prime, $open_quote, $close_quote ) {
 	$spaces = wp_spaces_regexp();
 	$flag = '<!--wp-prime-or-quote-->';
-	$quote_pattern = "/$needle(?=\\Z|[.,:;!?)}\\-\\]]|&gt;|" . $spaces . ")/";
+	$quote_pattern = "/$needle(?=\\Z|[.,:;!?)}\\-\\]]|&gt;|" . $spaces . ')/';
 	$prime_pattern    = "/(?<=\\d)$needle/";
 	$flag_after_digit = "/(?<=\\d)$flag/";
 	$flag_no_digit    = "/(?<!\\d)$flag/";
@@ -349,11 +354,11 @@
 		} else {
 			$sentence = preg_replace( $prime_pattern, $prime, $sentence );
 			$sentence = preg_replace( $quote_pattern, $close_quote, $sentence );
-		}
+		}// End if().
 		if ( '"' == $needle && false !== strpos( $sentence, '"' ) ) {
 			$sentence = str_replace( '"', $close_quote, $sentence );
 		}
-	}
+	}// End foreach().
 
 	return implode( $open_quote, $sentences );
 }
@@ -429,8 +434,9 @@
 function wpautop( $pee, $br = true ) {
 	$pre_tags = array();
 
-	if ( trim($pee) === '' )
+	if ( trim( $pee ) === '' ) {
 		return '';
+	}
 
 	// Just to make things a little easier, pad the end.
 	$pee = $pee . "\n";
@@ -439,14 +445,14 @@
 	 * Pre tags shouldn't be touched by autop.
 	 * Replace pre tags with placeholders and bring them back after autop.
 	 */
-	if ( strpos($pee, '<pre') !== false ) {
+	if ( strpos( $pee, '<pre' ) !== false ) {
 		$pee_parts = explode( '</pre>', $pee );
-		$last_pee = array_pop($pee_parts);
+		$last_pee = array_pop( $pee_parts );
 		$pee = '';
 		$i = 0;
 
 		foreach ( $pee_parts as $pee_part ) {
-			$start = strpos($pee_part, '<pre');
+			$start = strpos( $pee_part, '<pre' );
 
 			// Malformed html?
 			if ( $start === false ) {
@@ -455,7 +461,7 @@
 			}
 
 			$name = "<pre wp-pre-tag-$i></pre>";
-			$pre_tags[$name] = substr( $pee_part, $start ) . '</pre>';
+			$pre_tags[ $name ] = substr( $pee_part, $start ) . '</pre>';
 
 			$pee .= substr( $pee_part, 0, $start ) . $name;
 			$i++;
@@ -464,21 +470,23 @@
 		$pee .= $last_pee;
 	}
 	// Change multiple <br>s into two line breaks, which will turn into paragraphs.
-	$pee = preg_replace('|<br\s*/?>\s*<br\s*/?>|', "\n\n", $pee);
+	$pee = preg_replace( '|<br\s*/?>\s*<br\s*/?>|', "\n\n", $pee );
 
 	$allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
 
 	// Add a double line break above block-level opening tags.
-	$pee = preg_replace('!(<' . $allblocks . '[\s/>])!', "\n\n$1", $pee);
+	$pee = preg_replace( '!(<' . $allblocks . '[\s/>])!', "\n\n$1", $pee );
 
 	// Add a double line break below block-level closing tags.
-	$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
+	$pee = preg_replace( '!(</' . $allblocks . '>)!', "$1\n\n", $pee );
 
 	// Standardize newline characters to "\n".
-	$pee = str_replace(array("\r\n", "\r"), "\n", $pee);
+	$pee = str_replace( array( "\r\n", "\r" ), "\n", $pee );
 
 	// Find newlines in all elements and add placeholders.
-	$pee = wp_replace_in_html_tags( $pee, array( "\n" => " <!-- wpnl --> " ) );
+	$pee = wp_replace_in_html_tags( $pee, array(
+		"\n" => ' <!-- wpnl --> ',
+	) );
 
 	// Collapse line breaks before and after <option> elements so they don't get autop'd.
 	if ( strpos( $pee, '<option' ) !== false ) {
@@ -513,66 +521,67 @@
 	}
 
 	// Remove more than two contiguous line breaks.
-	$pee = preg_replace("/\n\n+/", "\n\n", $pee);
+	$pee = preg_replace( "/\n\n+/", "\n\n", $pee );
 
 	// Split up the contents into an array of strings, separated by double line breaks.
-	$pees = preg_split('/\n\s*\n/', $pee, -1, PREG_SPLIT_NO_EMPTY);
+	$pees = preg_split( '/\n\s*\n/', $pee, -1, PREG_SPLIT_NO_EMPTY );
 
 	// Reset $pee prior to rebuilding.
 	$pee = '';
 
 	// Rebuild the content as a string, wrapping every bit with a <p>.
 	foreach ( $pees as $tinkle ) {
-		$pee .= '<p>' . trim($tinkle, "\n") . "</p>\n";
+		$pee .= '<p>' . trim( $tinkle, "\n" ) . "</p>\n";
 	}
 
 	// Under certain strange conditions it could create a P of entirely whitespace.
-	$pee = preg_replace('|<p>\s*</p>|', '', $pee);
+	$pee = preg_replace( '|<p>\s*</p>|', '', $pee );
 
 	// Add a closing <p> inside <div>, <address>, or <form> tag if missing.
-	$pee = preg_replace('!<p>([^<]+)</(div|address|form)>!', "<p>$1</p></$2>", $pee);
+	$pee = preg_replace( '!<p>([^<]+)</(div|address|form)>!', '<p>$1</p></$2>', $pee );
 
 	// If an opening or closing block element tag is wrapped in a <p>, unwrap it.
-	$pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
+	$pee = preg_replace( '!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', '$1', $pee );
 
 	// In some cases <li> may get wrapped in <p>, fix them.
-	$pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee);
+	$pee = preg_replace( '|<p>(<li.+?)</p>|', '$1', $pee );
 
 	// If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.
-	$pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
-	$pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
+	$pee = preg_replace( '|<p><blockquote([^>]*)>|i', '<blockquote$1><p>', $pee );
+	$pee = str_replace( '</blockquote></p>', '</p></blockquote>', $pee );
 
 	// If an opening or closing block element tag is preceded by an opening <p> tag, remove it.
-	$pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee);
+	$pee = preg_replace( '!<p>\s*(</?' . $allblocks . '[^>]*>)!', '$1', $pee );
 
 	// If an opening or closing block element tag is followed by a closing <p> tag, remove it.
-	$pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
+	$pee = preg_replace( '!(</?' . $allblocks . '[^>]*>)\s*</p>!', '$1', $pee );
 
 	// Optionally insert line breaks.
 	if ( $br ) {
 		// Replace newlines that shouldn't be touched with a placeholder.
-		$pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee);
+		$pee = preg_replace_callback( '/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee );
 
 		// Normalize <br>
 		$pee = str_replace( array( '<br>', '<br/>' ), '<br />', $pee );
 
 		// Replace any new line characters that aren't preceded by a <br /> with a <br />.
-		$pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee);
+		$pee = preg_replace( '|(?<!<br />)\s*\n|', "<br />\n", $pee );
 
 		// Replace newline placeholders with newlines.
-		$pee = str_replace('<WPPreserveNewline />', "\n", $pee);
+		$pee = str_replace( '<WPPreserveNewline />', "\n", $pee );
 	}
 
 	// If a <br /> tag is after an opening or closing block tag, remove it.
-	$pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*<br />!', "$1", $pee);
+	$pee = preg_replace( '!(</?' . $allblocks . '[^>]*>)\s*<br />!', '$1', $pee );
 
 	// If a <br /> tag is before a subset of opening or closing block tags, remove it.
-	$pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee);
+	$pee = preg_replace( '!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee );
 	$pee = preg_replace( "|\n</p>$|", '</p>', $pee );
 
 	// Replace placeholder <pre> tags with their original content.
-	if ( !empty($pre_tags) )
-		$pee = str_replace(array_keys($pre_tags), array_values($pre_tags), $pee);
+	if ( ! empty( $pre_tags ) ) {
+		$pee = str_replace( array_keys( $pre_tags ), array_values( $pre_tags ), $pee );
+	}
 
 	// Restore newlines in all elements.
 	if ( false !== strpos( $pee, '<!-- wpnl -->' ) ) {
@@ -608,8 +617,8 @@
 		$comments =
 			  '!'           // Start of comment, after the <.
 			. '(?:'         // Unroll the loop: Consume everything until --> is found.
-			.     '-(?!->)' // Dash not followed by end of comment.
-			.     '[^\-]*+' // Consume non-dashes.
+			. '-(?!->)' // Dash not followed by end of comment.
+			. '[^\-]*+' // Consume non-dashes.
 			. ')*+'         // Loop possessively.
 			. '(?:-->)?';   // End of comment. If not found, match all input.
 
@@ -617,33 +626,33 @@
 			  '!\[CDATA\['  // Start of comment, after the <.
 			. '[^\]]*+'     // Consume non-].
 			. '(?:'         // Unroll the loop: Consume everything until ]]> is found.
-			.     '](?!]>)' // One ] not followed by end of comment.
-			.     '[^\]]*+' // Consume non-].
+			. '](?!]>)' // One ] not followed by end of comment.
+			. '[^\]]*+' // Consume non-].
 			. ')*+'         // Loop possessively.
 			. '(?:]]>)?';   // End of comment. If not found, match all input.
 
 		$escaped =
 			  '(?='           // Is the element escaped?
-			.    '!--'
+			. '!--'
 			. '|'
-			.    '!\[CDATA\['
+			. '!\[CDATA\['
 			. ')'
 			. '(?(?=!-)'      // If yes, which type?
-			.     $comments
+			. $comments
 			. '|'
-			.     $cdata
+			. $cdata
 			. ')';
 
 		$regex =
 			  '/('              // Capture the entire match.
-			.     '<'           // Find start of element.
-			.     '(?'          // Conditional expression follows.
-			.         $escaped  // Find end of escaped element.
-			.     '|'           // ... else ...
-			.         '[^>]*>?' // Find end of normal element.
-			.     ')'
+			. '<'           // Find start of element.
+			. '(?'          // Conditional expression follows.
+			. $escaped  // Find end of escaped element.
+			. '|'           // ... else ...
+			. '[^>]*>?' // Find end of normal element.
+			. ')'
 			. ')/';
-	}
+	}// End if().
 
 	return $regex;
 }
@@ -666,17 +675,17 @@
 		$comment_regex =
 			  '!'           // Start of comment, after the <.
 			. '(?:'         // Unroll the loop: Consume everything until --> is found.
-			.     '-(?!->)' // Dash not followed by end of comment.
-			.     '[^\-]*+' // Consume non-dashes.
+			. '-(?!->)' // Dash not followed by end of comment.
+			. '[^\-]*+' // Consume non-dashes.
 			. ')*+'         // Loop possessively.
 			. '(?:-->)?';   // End of comment. If not found, match all input.
 
-		$html_regex =			 // Needs replaced with wp_html_split() per Shortcode API Roadmap.
+		$html_regex = // Needs replaced with wp_html_split() per Shortcode API Roadmap.
 			  '<'                // Find start of element.
 			. '(?(?=!--)'        // Is this a comment?
-			.     $comment_regex // Find end of comment.
+			. $comment_regex // Find end of comment.
 			. '|'
-			.     '[^>]*>?'      // Find end of element. If not found, match all input.
+			. '[^>]*>?'      // Find end of element. If not found, match all input.
 			. ')';
 	}
 
@@ -708,9 +717,9 @@
 		. '[\/\[]?'         // Shortcodes may begin with [/ or [[
 		. $tagregexp        // Only match registered shortcodes, because performance.
 		. '(?:'
-		.     '[^\[\]<>]+'  // Shortcodes do not contain other shortcodes. Quantifier critical.
+		. '[^\[\]<>]+'  // Shortcodes do not contain other shortcodes. Quantifier critical.
 		. '|'
-		.     '<[^\[\]>]*>' // HTML elements permitted. Prevents matching ] before >.
+		. '<[^\[\]>]*>' // HTML elements permitted. Prevents matching ] before >.
 		. ')*+'             // Possessive critical.
 		. '\]'              // Find end of shortcode.
 		. '\]?';            // Shortcodes may end with ]]
@@ -735,12 +744,12 @@
 	// Optimize when searching for one item.
 	if ( 1 === count( $replace_pairs ) ) {
 		// Extract $needle and $replace.
-		foreach ( $replace_pairs as $needle => $replace );
+		foreach ( $replace_pairs as $needle => $replace ) {}
 
 		// Loop through delimiters (elements) only.
 		for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
-			if ( false !== strpos( $textarr[$i], $needle ) ) {
-				$textarr[$i] = str_replace( $needle, $replace, $textarr[$i] );
+			if ( false !== strpos( $textarr[ $i ], $needle ) ) {
+				$textarr[ $i ] = str_replace( $needle, $replace, $textarr[ $i ] );
 				$changed = true;
 			}
 		}
@@ -751,8 +760,8 @@
 		// Loop through delimiters (elements) only.
 		for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
 			foreach ( $needles as $needle ) {
-				if ( false !== strpos( $textarr[$i], $needle ) ) {
-					$textarr[$i] = strtr( $textarr[$i], $replace_pairs );
+				if ( false !== strpos( $textarr[ $i ], $needle ) ) {
+					$textarr[ $i ] = strtr( $textarr[ $i ], $replace_pairs );
 					$changed = true;
 					// After one strtr() break out of the foreach loop and look at next element.
 					break;
@@ -778,7 +787,7 @@
  * @return string
  */
 function _autop_newline_preservation_helper( $matches ) {
-	return str_replace( "\n", "<WPPreserveNewline />", $matches[0] );
+	return str_replace( "\n", '<WPPreserveNewline />', $matches[0] );
 }
 
 /**
@@ -796,7 +805,7 @@
 function shortcode_unautop( $pee ) {
 	global $shortcode_tags;
 
-	if ( empty( $shortcode_tags ) || !is_array( $shortcode_tags ) ) {
+	if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {
 		return $pee;
 	}
 
@@ -808,28 +817,28 @@
 		. '<p>'                              // Opening paragraph
 		. '(?:' . $spaces . ')*+'            // Optional leading whitespace
 		. '('                                // 1: The shortcode
-		.     '\\['                          // Opening bracket
-		.     "($tagregexp)"                 // 2: Shortcode name
-		.     '(?![\\w-])'                   // Not followed by word character or hyphen
-		                                     // Unroll the loop: Inside the opening shortcode tag
-		.     '[^\\]\\/]*'                   // Not a closing bracket or forward slash
-		.     '(?:'
-		.         '\\/(?!\\])'               // A forward slash not followed by a closing bracket
-		.         '[^\\]\\/]*'               // Not a closing bracket or forward slash
-		.     ')*?'
-		.     '(?:'
-		.         '\\/\\]'                   // Self closing tag and closing bracket
-		.     '|'
-		.         '\\]'                      // Closing bracket
-		.         '(?:'                      // Unroll the loop: Optionally, anything between the opening and closing shortcode tags
-		.             '[^\\[]*+'             // Not an opening bracket
-		.             '(?:'
-		.                 '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
-		.                 '[^\\[]*+'         // Not an opening bracket
-		.             ')*+'
-		.             '\\[\\/\\2\\]'         // Closing shortcode tag
-		.         ')?'
-		.     ')'
+		. '\\['                          // Opening bracket
+		. "($tagregexp)"                 // 2: Shortcode name
+		. '(?![\\w-])'                   // Not followed by word character or hyphen
+											 // Unroll the loop: Inside the opening shortcode tag
+		. '[^\\]\\/]*'                   // Not a closing bracket or forward slash
+		. '(?:'
+		. '\\/(?!\\])'               // A forward slash not followed by a closing bracket
+		. '[^\\]\\/]*'               // Not a closing bracket or forward slash
+		. ')*?'
+		. '(?:'
+		. '\\/\\]'                   // Self closing tag and closing bracket
+		. '|'
+		. '\\]'                      // Closing bracket
+		. '(?:'                      // Unroll the loop: Optionally, anything between the opening and closing shortcode tags
+		. '[^\\[]*+'             // Not an opening bracket
+		. '(?:'
+		. '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
+		. '[^\\[]*+'         // Not an opening bracket
+		. ')*+'
+		. '\\[\\/\\2\\]'         // Closing shortcode tag
+		. ')?'
+		. ')'
 		. ')'
 		. '(?:' . $spaces . ')*+'            // optional trailing whitespace
 		. '<\\/p>'                           // closing paragraph
@@ -852,20 +861,22 @@
  */
 function seems_utf8( $str ) {
 	mbstring_binary_safe_encoding();
-	$length = strlen($str);
+	$length = strlen( $str );
 	reset_mbstring_encoding();
-	for ($i=0; $i < $length; $i++) {
-		$c = ord($str[$i]);
-		if ($c < 0x80) $n = 0; // 0bbbbbbb
-		elseif (($c & 0xE0) == 0xC0) $n=1; // 110bbbbb
-		elseif (($c & 0xF0) == 0xE0) $n=2; // 1110bbbb
-		elseif (($c & 0xF8) == 0xF0) $n=3; // 11110bbb
-		elseif (($c & 0xFC) == 0xF8) $n=4; // 111110bb
-		elseif (($c & 0xFE) == 0xFC) $n=5; // 1111110b
-		else return false; // Does not match any model
-		for ($j=0; $j<$n; $j++) { // n bytes matching 10bbbbbb follow ?
-			if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80))
+	for ( $i = 0; $i < $length; $i++ ) {
+		$c = ord( $str[ $i ] );
+		if ( $c < 0x80 ) { $n = 0; // 0bbbbbbb
+		} elseif ( ($c & 0xE0) == 0xC0 ) { $n = 1; // 110bbbbb
+		} elseif ( ($c & 0xF0) == 0xE0 ) { $n = 2; // 1110bbbb
+		} elseif ( ($c & 0xF8) == 0xF0 ) { $n = 3; // 11110bbb
+		} elseif ( ($c & 0xFC) == 0xF8 ) { $n = 4; // 111110bb
+		} elseif ( ($c & 0xFE) == 0xFC ) { $n = 5; // 1111110b
+		} else { return false; // End if().
+		}
+		for ( $j = 0; $j < $n; $j++ ) { // n bytes matching 10bbbbbb follow ?
+			if ( (++$i == $length) || ((ord( $str[ $i ] ) & 0xC0) != 0x80) ) {
 				return false;
+			}
 		}
 	}
 	return true;
@@ -897,18 +908,21 @@
 function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
 	$string = (string) $string;
 
-	if ( 0 === strlen( $string ) )
+	if ( 0 === strlen( $string ) ) {
 		return '';
+	}
 
 	// Don't bother if there are no specialchars - saves some processing
-	if ( ! preg_match( '/[&<>"\']/', $string ) )
+	if ( ! preg_match( '/[&<>"\']/', $string ) ) {
 		return $string;
+	}
 
 	// Account for the previous behaviour of the function when the $quote_style is not an accepted value
-	if ( empty( $quote_style ) )
+	if ( empty( $quote_style ) ) {
 		$quote_style = ENT_NOQUOTES;
-	elseif ( ! in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) )
+	} elseif ( ! in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {
 		$quote_style = ENT_QUOTES;
+	}
 
 	// Store the site charset as a static to avoid multiple calls to wp_load_alloptions()
 	if ( ! $charset ) {
@@ -920,8 +934,9 @@
 		$charset = $_charset;
 	}
 
-	if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) )
+	if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) ) {
 		$charset = 'UTF-8';
+	}
 
 	$_quote_style = $quote_style;
 
@@ -941,8 +956,9 @@
 	$string = @htmlspecialchars( $string, $quote_style, $charset, $double_encode );
 
 	// Back-compat.
-	if ( 'single' === $_quote_style )
+	if ( 'single' === $_quote_style ) {
 		$string = str_replace( "'", '&#039;', $string );
+	}
 
 	return $string;
 }
@@ -982,17 +998,43 @@
 	// Match the previous behaviour of _wp_specialchars() when the $quote_style is not an accepted value
 	if ( empty( $quote_style ) ) {
 		$quote_style = ENT_NOQUOTES;
-	} elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {
+	} elseif ( ! in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {
 		$quote_style = ENT_QUOTES;
 	}
 
 	// More complete than get_html_translation_table( HTML_SPECIALCHARS )
-	$single = array( '&#039;'  => '\'', '&#x27;' => '\'' );
-	$single_preg = array( '/&#0*39;/'  => '&#039;', '/&#x0*27;/i' => '&#x27;' );
-	$double = array( '&quot;' => '"', '&#034;'  => '"', '&#x22;' => '"' );
-	$double_preg = array( '/&#0*34;/'  => '&#034;', '/&#x0*22;/i' => '&#x22;' );
-	$others = array( '&lt;'   => '<', '&#060;'  => '<', '&gt;'   => '>', '&#062;'  => '>', '&amp;'  => '&', '&#038;'  => '&', '&#x26;' => '&' );
-	$others_preg = array( '/&#0*60;/'  => '&#060;', '/&#0*62;/'  => '&#062;', '/&#0*38;/'  => '&#038;', '/&#x0*26;/i' => '&#x26;' );
+	$single = array(
+		'&#039;' => '\'',
+		'&#x27;' => '\'',
+	);
+	$single_preg = array(
+		'/&#0*39;/' => '&#039;',
+		'/&#x0*27;/i' => '&#x27;',
+	);
+	$double = array(
+		'&quot;' => '"',
+		'&#034;' => '"',
+		'&#x22;' => '"',
+	);
+	$double_preg = array(
+		'/&#0*34;/' => '&#034;',
+		'/&#x0*22;/i' => '&#x22;',
+	);
+	$others = array(
+		'&lt;' => '<',
+		'&#060;' => '<',
+		'&gt;' => '>',
+		'&#062;' => '>',
+		'&amp;' => '&',
+		'&#038;' => '&',
+		'&#x26;' => '&',
+	);
+	$others_preg = array(
+		'/&#0*60;/' => '&#060;',
+		'/&#0*62;/' => '&#062;',
+		'/&#0*38;/' => '&#038;',
+		'/&#x0*26;/i' => '&#x26;',
+	);
 
 	if ( $quote_style === ENT_QUOTES ) {
 		$translation = array_merge( $single, $double, $others );
@@ -1049,7 +1091,7 @@
 		$utf8_pcre = @preg_match( '/^./u', 'a' );
 	}
 	// We can't demand utf8 in the PCRE installation, so just return the string in those cases
-	if ( !$utf8_pcre ) {
+	if ( ! $utf8_pcre ) {
 		return $string;
 	}
 
@@ -1085,14 +1127,15 @@
 	$string_length = strlen( $utf8_string );
 	reset_mbstring_encoding();
 
-	for ($i = 0; $i < $string_length; $i++ ) {
+	for ( $i = 0; $i < $string_length; $i++ ) {
 
 		$value = ord( $utf8_string[ $i ] );
 
 		if ( $value < 128 ) {
-			if ( $length && ( $unicode_length >= $length ) )
+			if ( $length && ( $unicode_length >= $length ) ) {
 				break;
-			$unicode .= chr($value);
+			}
+			$unicode .= chr( $value );
 			$unicode_length++;
 		} else {
 			if ( count( $values ) == 0 ) {
@@ -1107,8 +1150,9 @@
 
 			$values[] = $value;
 
-			if ( $length && ( $unicode_length + ($num_octets * 3) ) > $length )
+			if ( $length && ( $unicode_length + ($num_octets * 3) ) > $length ) {
 				break;
+			}
 			if ( count( $values ) == $num_octets ) {
 				for ( $j = 0; $j < $num_octets; $j++ ) {
 					$unicode .= '%' . dechex( $values[ $j ] );
@@ -1120,7 +1164,7 @@
 				$num_octets = 1;
 			}
 		}
-	}
+	}// End for().
 
 	return $unicode;
 }
@@ -1512,234 +1556,388 @@
  * @return string Filtered string with replaced "nice" characters.
  */
 function remove_accents( $string ) {
-	if ( !preg_match('/[\x80-\xff]/', $string) )
+	if ( ! preg_match( '/[\x80-\xff]/', $string ) ) {
 		return $string;
+	}
 
-	if (seems_utf8($string)) {
+	if ( seems_utf8( $string ) ) {
 		$chars = array(
 		// Decompositions for Latin-1 Supplement
-		'ª' => 'a', 'º' => 'o',
-		'À' => 'A', 'Á' => 'A',
-		'Â' => 'A', 'Ã' => 'A',
-		'Ä' => 'A', 'Å' => 'A',
-		'Æ' => 'AE','Ç' => 'C',
-		'È' => 'E', 'É' => 'E',
-		'Ê' => 'E', 'Ë' => 'E',
-		'Ì' => 'I', 'Í' => 'I',
-		'Î' => 'I', 'Ï' => 'I',
-		'Ð' => 'D', 'Ñ' => 'N',
-		'Ò' => 'O', 'Ó' => 'O',
-		'Ô' => 'O', 'Õ' => 'O',
-		'Ö' => 'O', 'Ù' => 'U',
-		'Ú' => 'U', 'Û' => 'U',
-		'Ü' => 'U', 'Ý' => 'Y',
-		'Þ' => 'TH','ß' => 's',
-		'à' => 'a', 'á' => 'a',
-		'â' => 'a', 'ã' => 'a',
-		'ä' => 'a', 'å' => 'a',
-		'æ' => 'ae','ç' => 'c',
-		'è' => 'e', 'é' => 'e',
-		'ê' => 'e', 'ë' => 'e',
-		'ì' => 'i', 'í' => 'i',
-		'î' => 'i', 'ï' => 'i',
-		'ð' => 'd', 'ñ' => 'n',
-		'ò' => 'o', 'ó' => 'o',
-		'ô' => 'o', 'õ' => 'o',
-		'ö' => 'o', 'ø' => 'o',
-		'ù' => 'u', 'ú' => 'u',
-		'û' => 'u', 'ü' => 'u',
-		'ý' => 'y', 'þ' => 'th',
-		'ÿ' => 'y', 'Ø' => 'O',
+		'ª' => 'a',
+		'º' => 'o',
+		'À' => 'A',
+		'Á' => 'A',
+		'Â' => 'A',
+		'Ã' => 'A',
+		'Ä' => 'A',
+		'Å' => 'A',
+		'Æ' => 'AE',
+		'Ç' => 'C',
+		'È' => 'E',
+		'É' => 'E',
+		'Ê' => 'E',
+		'Ë' => 'E',
+		'Ì' => 'I',
+		'Í' => 'I',
+		'Î' => 'I',
+		'Ï' => 'I',
+		'Ð' => 'D',
+		'Ñ' => 'N',
+		'Ò' => 'O',
+		'Ó' => 'O',
+		'Ô' => 'O',
+		'Õ' => 'O',
+		'Ö' => 'O',
+		'Ù' => 'U',
+		'Ú' => 'U',
+		'Û' => 'U',
+		'Ü' => 'U',
+		'Ý' => 'Y',
+		'Þ' => 'TH',
+		'ß' => 's',
+		'à' => 'a',
+		'á' => 'a',
+		'â' => 'a',
+		'ã' => 'a',
+		'ä' => 'a',
+		'å' => 'a',
+		'æ' => 'ae',
+		'ç' => 'c',
+		'è' => 'e',
+		'é' => 'e',
+		'ê' => 'e',
+		'ë' => 'e',
+		'ì' => 'i',
+		'í' => 'i',
+		'î' => 'i',
+		'ï' => 'i',
+		'ð' => 'd',
+		'ñ' => 'n',
+		'ò' => 'o',
+		'ó' => 'o',
+		'ô' => 'o',
+		'õ' => 'o',
+		'ö' => 'o',
+		'ø' => 'o',
+		'ù' => 'u',
+		'ú' => 'u',
+		'û' => 'u',
+		'ü' => 'u',
+		'ý' => 'y',
+		'þ' => 'th',
+		'ÿ' => 'y',
+		'Ø' => 'O',
 		// Decompositions for Latin Extended-A
-		'Ā' => 'A', 'ā' => 'a',
-		'Ă' => 'A', 'ă' => 'a',
-		'Ą' => 'A', 'ą' => 'a',
-		'Ć' => 'C', 'ć' => 'c',
-		'Ĉ' => 'C', 'ĉ' => 'c',
-		'Ċ' => 'C', 'ċ' => 'c',
-		'Č' => 'C', 'č' => 'c',
-		'Ď' => 'D', 'ď' => 'd',
-		'Đ' => 'D', 'đ' => 'd',
-		'Ē' => 'E', 'ē' => 'e',
-		'Ĕ' => 'E', 'ĕ' => 'e',
-		'Ė' => 'E', 'ė' => 'e',
-		'Ę' => 'E', 'ę' => 'e',
-		'Ě' => 'E', 'ě' => 'e',
-		'Ĝ' => 'G', 'ĝ' => 'g',
-		'Ğ' => 'G', 'ğ' => 'g',
-		'Ġ' => 'G', 'ġ' => 'g',
-		'Ģ' => 'G', 'ģ' => 'g',
-		'Ĥ' => 'H', 'ĥ' => 'h',
-		'Ħ' => 'H', 'ħ' => 'h',
-		'Ĩ' => 'I', 'ĩ' => 'i',
-		'Ī' => 'I', 'ī' => 'i',
-		'Ĭ' => 'I', 'ĭ' => 'i',
-		'Į' => 'I', 'į' => 'i',
-		'İ' => 'I', 'ı' => 'i',
-		'Ĳ' => 'IJ','ĳ' => 'ij',
-		'Ĵ' => 'J', 'ĵ' => 'j',
-		'Ķ' => 'K', 'ķ' => 'k',
-		'ĸ' => 'k', 'Ĺ' => 'L',
-		'ĺ' => 'l', 'Ļ' => 'L',
-		'ļ' => 'l', 'Ľ' => 'L',
-		'ľ' => 'l', 'Ŀ' => 'L',
-		'ŀ' => 'l', 'Ł' => 'L',
-		'ł' => 'l', 'Ń' => 'N',
-		'ń' => 'n', 'Ņ' => 'N',
-		'ņ' => 'n', 'Ň' => 'N',
-		'ň' => 'n', 'ŉ' => 'n',
-		'Ŋ' => 'N', 'ŋ' => 'n',
-		'Ō' => 'O', 'ō' => 'o',
-		'Ŏ' => 'O', 'ŏ' => 'o',
-		'Ő' => 'O', 'ő' => 'o',
-		'Œ' => 'OE','œ' => 'oe',
-		'Ŕ' => 'R','ŕ' => 'r',
-		'Ŗ' => 'R','ŗ' => 'r',
-		'Ř' => 'R','ř' => 'r',
-		'Ś' => 'S','ś' => 's',
-		'Ŝ' => 'S','ŝ' => 's',
-		'Ş' => 'S','ş' => 's',
-		'Š' => 'S', 'š' => 's',
-		'Ţ' => 'T', 'ţ' => 't',
-		'Ť' => 'T', 'ť' => 't',
-		'Ŧ' => 'T', 'ŧ' => 't',
-		'Ũ' => 'U', 'ũ' => 'u',
-		'Ū' => 'U', 'ū' => 'u',
-		'Ŭ' => 'U', 'ŭ' => 'u',
-		'Ů' => 'U', 'ů' => 'u',
-		'Ű' => 'U', 'ű' => 'u',
-		'Ų' => 'U', 'ų' => 'u',
-		'Ŵ' => 'W', 'ŵ' => 'w',
-		'Ŷ' => 'Y', 'ŷ' => 'y',
-		'Ÿ' => 'Y', 'Ź' => 'Z',
-		'ź' => 'z', 'Ż' => 'Z',
-		'ż' => 'z', 'Ž' => 'Z',
-		'ž' => 'z', 'ſ' => 's',
+		'Ā' => 'A',
+		'ā' => 'a',
+		'Ă' => 'A',
+		'ă' => 'a',
+		'Ą' => 'A',
+		'ą' => 'a',
+		'Ć' => 'C',
+		'ć' => 'c',
+		'Ĉ' => 'C',
+		'ĉ' => 'c',
+		'Ċ' => 'C',
+		'ċ' => 'c',
+		'Č' => 'C',
+		'č' => 'c',
+		'Ď' => 'D',
+		'ď' => 'd',
+		'Đ' => 'D',
+		'đ' => 'd',
+		'Ē' => 'E',
+		'ē' => 'e',
+		'Ĕ' => 'E',
+		'ĕ' => 'e',
+		'Ė' => 'E',
+		'ė' => 'e',
+		'Ę' => 'E',
+		'ę' => 'e',
+		'Ě' => 'E',
+		'ě' => 'e',
+		'Ĝ' => 'G',
+		'ĝ' => 'g',
+		'Ğ' => 'G',
+		'ğ' => 'g',
+		'Ġ' => 'G',
+		'ġ' => 'g',
+		'Ģ' => 'G',
+		'ģ' => 'g',
+		'Ĥ' => 'H',
+		'ĥ' => 'h',
+		'Ħ' => 'H',
+		'ħ' => 'h',
+		'Ĩ' => 'I',
+		'ĩ' => 'i',
+		'Ī' => 'I',
+		'ī' => 'i',
+		'Ĭ' => 'I',
+		'ĭ' => 'i',
+		'Į' => 'I',
+		'į' => 'i',
+		'İ' => 'I',
+		'ı' => 'i',
+		'Ĳ' => 'IJ',
+		'ĳ' => 'ij',
+		'Ĵ' => 'J',
+		'ĵ' => 'j',
+		'Ķ' => 'K',
+		'ķ' => 'k',
+		'ĸ' => 'k',
+		'Ĺ' => 'L',
+		'ĺ' => 'l',
+		'Ļ' => 'L',
+		'ļ' => 'l',
+		'Ľ' => 'L',
+		'ľ' => 'l',
+		'Ŀ' => 'L',
+		'ŀ' => 'l',
+		'Ł' => 'L',
+		'ł' => 'l',
+		'Ń' => 'N',
+		'ń' => 'n',
+		'Ņ' => 'N',
+		'ņ' => 'n',
+		'Ň' => 'N',
+		'ň' => 'n',
+		'ŉ' => 'n',
+		'Ŋ' => 'N',
+		'ŋ' => 'n',
+		'Ō' => 'O',
+		'ō' => 'o',
+		'Ŏ' => 'O',
+		'ŏ' => 'o',
+		'Ő' => 'O',
+		'ő' => 'o',
+		'Œ' => 'OE',
+		'œ' => 'oe',
+		'Ŕ' => 'R',
+		'ŕ' => 'r',
+		'Ŗ' => 'R',
+		'ŗ' => 'r',
+		'Ř' => 'R',
+		'ř' => 'r',
+		'Ś' => 'S',
+		'ś' => 's',
+		'Ŝ' => 'S',
+		'ŝ' => 's',
+		'Ş' => 'S',
+		'ş' => 's',
+		'Š' => 'S',
+		'š' => 's',
+		'Ţ' => 'T',
+		'ţ' => 't',
+		'Ť' => 'T',
+		'ť' => 't',
+		'Ŧ' => 'T',
+		'ŧ' => 't',
+		'Ũ' => 'U',
+		'ũ' => 'u',
+		'Ū' => 'U',
+		'ū' => 'u',
+		'Ŭ' => 'U',
+		'ŭ' => 'u',
+		'Ů' => 'U',
+		'ů' => 'u',
+		'Ű' => 'U',
+		'ű' => 'u',
+		'Ų' => 'U',
+		'ų' => 'u',
+		'Ŵ' => 'W',
+		'ŵ' => 'w',
+		'Ŷ' => 'Y',
+		'ŷ' => 'y',
+		'Ÿ' => 'Y',
+		'Ź' => 'Z',
+		'ź' => 'z',
+		'Ż' => 'Z',
+		'ż' => 'z',
+		'Ž' => 'Z',
+		'ž' => 'z',
+		'ſ' => 's',
 		// Decompositions for Latin Extended-B
-		'Ș' => 'S', 'ș' => 's',
-		'Ț' => 'T', 'ț' => 't',
+		'Ș' => 'S',
+		'ș' => 's',
+		'Ț' => 'T',
+		'ț' => 't',
 		// Euro Sign
 		'€' => 'E',
 		// GBP (Pound) Sign
 		'£' => '',
 		// Vowels with diacritic (Vietnamese)
 		// unmarked
-		'Ơ' => 'O', 'ơ' => 'o',
-		'Ư' => 'U', 'ư' => 'u',
+		'Ơ' => 'O',
+		'ơ' => 'o',
+		'Ư' => 'U',
+		'ư' => 'u',
 		// grave accent
-		'Ầ' => 'A', 'ầ' => 'a',
-		'Ằ' => 'A', 'ằ' => 'a',
-		'Ề' => 'E', 'ề' => 'e',
-		'Ồ' => 'O', 'ồ' => 'o',
-		'Ờ' => 'O', 'ờ' => 'o',
-		'Ừ' => 'U', 'ừ' => 'u',
-		'Ỳ' => 'Y', 'ỳ' => 'y',
+		'Ầ' => 'A',
+		'ầ' => 'a',
+		'Ằ' => 'A',
+		'ằ' => 'a',
+		'Ề' => 'E',
+		'ề' => 'e',
+		'Ồ' => 'O',
+		'ồ' => 'o',
+		'Ờ' => 'O',
+		'ờ' => 'o',
+		'Ừ' => 'U',
+		'ừ' => 'u',
+		'Ỳ' => 'Y',
+		'ỳ' => 'y',
 		// hook
-		'Ả' => 'A', 'ả' => 'a',
-		'Ẩ' => 'A', 'ẩ' => 'a',
-		'Ẳ' => 'A', 'ẳ' => 'a',
-		'Ẻ' => 'E', 'ẻ' => 'e',
-		'Ể' => 'E', 'ể' => 'e',
-		'Ỉ' => 'I', 'ỉ' => 'i',
-		'Ỏ' => 'O', 'ỏ' => 'o',
-		'Ổ' => 'O', 'ổ' => 'o',
-		'Ở' => 'O', 'ở' => 'o',
-		'Ủ' => 'U', 'ủ' => 'u',
-		'Ử' => 'U', 'ử' => 'u',
-		'Ỷ' => 'Y', 'ỷ' => 'y',
+		'Ả' => 'A',
+		'ả' => 'a',
+		'Ẩ' => 'A',
+		'ẩ' => 'a',
+		'Ẳ' => 'A',
+		'ẳ' => 'a',
+		'Ẻ' => 'E',
+		'ẻ' => 'e',
+		'Ể' => 'E',
+		'ể' => 'e',
+		'Ỉ' => 'I',
+		'ỉ' => 'i',
+		'Ỏ' => 'O',
+		'ỏ' => 'o',
+		'Ổ' => 'O',
+		'ổ' => 'o',
+		'Ở' => 'O',
+		'ở' => 'o',
+		'Ủ' => 'U',
+		'ủ' => 'u',
+		'Ử' => 'U',
+		'ử' => 'u',
+		'Ỷ' => 'Y',
+		'ỷ' => 'y',
 		// tilde
-		'Ẫ' => 'A', 'ẫ' => 'a',
-		'Ẵ' => 'A', 'ẵ' => 'a',
-		'Ẽ' => 'E', 'ẽ' => 'e',
-		'Ễ' => 'E', 'ễ' => 'e',
-		'Ỗ' => 'O', 'ỗ' => 'o',
-		'Ỡ' => 'O', 'ỡ' => 'o',
-		'Ữ' => 'U', 'ữ' => 'u',
-		'Ỹ' => 'Y', 'ỹ' => 'y',
+		'Ẫ' => 'A',
+		'ẫ' => 'a',
+		'Ẵ' => 'A',
+		'ẵ' => 'a',
+		'Ẽ' => 'E',
+		'ẽ' => 'e',
+		'Ễ' => 'E',
+		'ễ' => 'e',
+		'Ỗ' => 'O',
+		'ỗ' => 'o',
+		'Ỡ' => 'O',
+		'ỡ' => 'o',
+		'Ữ' => 'U',
+		'ữ' => 'u',
+		'Ỹ' => 'Y',
+		'ỹ' => 'y',
 		// acute accent
-		'Ấ' => 'A', 'ấ' => 'a',
-		'Ắ' => 'A', 'ắ' => 'a',
-		'Ế' => 'E', 'ế' => 'e',
-		'Ố' => 'O', 'ố' => 'o',
-		'Ớ' => 'O', 'ớ' => 'o',
-		'Ứ' => 'U', 'ứ' => 'u',
+		'Ấ' => 'A',
+		'ấ' => 'a',
+		'Ắ' => 'A',
+		'ắ' => 'a',
+		'Ế' => 'E',
+		'ế' => 'e',
+		'Ố' => 'O',
+		'ố' => 'o',
+		'Ớ' => 'O',
+		'ớ' => 'o',
+		'Ứ' => 'U',
+		'ứ' => 'u',
 		// dot below
-		'Ạ' => 'A', 'ạ' => 'a',
-		'Ậ' => 'A', 'ậ' => 'a',
-		'Ặ' => 'A', 'ặ' => 'a',
-		'Ẹ' => 'E', 'ẹ' => 'e',
-		'Ệ' => 'E', 'ệ' => 'e',
-		'Ị' => 'I', 'ị' => 'i',
-		'Ọ' => 'O', 'ọ' => 'o',
-		'Ộ' => 'O', 'ộ' => 'o',
-		'Ợ' => 'O', 'ợ' => 'o',
-		'Ụ' => 'U', 'ụ' => 'u',
-		'Ự' => 'U', 'ự' => 'u',
-		'Ỵ' => 'Y', 'ỵ' => 'y',
+		'Ạ' => 'A',
+		'ạ' => 'a',
+		'Ậ' => 'A',
+		'ậ' => 'a',
+		'Ặ' => 'A',
+		'ặ' => 'a',
+		'Ẹ' => 'E',
+		'ẹ' => 'e',
+		'Ệ' => 'E',
+		'ệ' => 'e',
+		'Ị' => 'I',
+		'ị' => 'i',
+		'Ọ' => 'O',
+		'ọ' => 'o',
+		'Ộ' => 'O',
+		'ộ' => 'o',
+		'Ợ' => 'O',
+		'ợ' => 'o',
+		'Ụ' => 'U',
+		'ụ' => 'u',
+		'Ự' => 'U',
+		'ự' => 'u',
+		'Ỵ' => 'Y',
+		'ỵ' => 'y',
 		// Vowels with diacritic (Chinese, Hanyu Pinyin)
 		'ɑ' => 'a',
 		// macron
-		'Ǖ' => 'U', 'ǖ' => 'u',
+		'Ǖ' => 'U',
+		'ǖ' => 'u',
 		// acute accent
-		'Ǘ' => 'U', 'ǘ' => 'u',
+		'Ǘ' => 'U',
+		'ǘ' => 'u',
 		// caron
-		'Ǎ' => 'A', 'ǎ' => 'a',
-		'Ǐ' => 'I', 'ǐ' => 'i',
-		'Ǒ' => 'O', 'ǒ' => 'o',
-		'Ǔ' => 'U', 'ǔ' => 'u',
-		'Ǚ' => 'U', 'ǚ' => 'u',
+		'Ǎ' => 'A',
+		'ǎ' => 'a',
+		'Ǐ' => 'I',
+		'ǐ' => 'i',
+		'Ǒ' => 'O',
+		'ǒ' => 'o',
+		'Ǔ' => 'U',
+		'ǔ' => 'u',
+		'Ǚ' => 'U',
+		'ǚ' => 'u',
 		// grave accent
-		'Ǜ' => 'U', 'ǜ' => 'u',
+		'Ǜ' => 'U',
+		'ǜ' => 'u',
 		);
 
 		// Used for locale-specific rules
 		$locale = get_locale();
 
 		if ( 'de_DE' == $locale || 'de_DE_formal' == $locale || 'de_CH' == $locale || 'de_CH_informal' == $locale ) {
-			$chars[ 'Ä' ] = 'Ae';
-			$chars[ 'ä' ] = 'ae';
-			$chars[ 'Ö' ] = 'Oe';
-			$chars[ 'ö' ] = 'oe';
-			$chars[ 'Ü' ] = 'Ue';
-			$chars[ 'ü' ] = 'ue';
-			$chars[ 'ß' ] = 'ss';
+			$chars['Ä'] = 'Ae';
+			$chars['ä'] = 'ae';
+			$chars['Ö'] = 'Oe';
+			$chars['ö'] = 'oe';
+			$chars['Ü'] = 'Ue';
+			$chars['ü'] = 'ue';
+			$chars['ß'] = 'ss';
 		} elseif ( 'da_DK' === $locale ) {
-			$chars[ 'Æ' ] = 'Ae';
- 			$chars[ 'æ' ] = 'ae';
-			$chars[ 'Ø' ] = 'Oe';
-			$chars[ 'ø' ] = 'oe';
-			$chars[ 'Å' ] = 'Aa';
-			$chars[ 'å' ] = 'aa';
+			$chars['Æ'] = 'Ae';
+			 $chars['æ'] = 'ae';
+			$chars['Ø'] = 'Oe';
+			$chars['ø'] = 'oe';
+			$chars['Å'] = 'Aa';
+			$chars['å'] = 'aa';
 		} elseif ( 'ca' === $locale ) {
-			$chars[ 'l·l' ] = 'll';
+			$chars['l·l'] = 'll';
 		} elseif ( 'sr_RS' === $locale || 'bs_BA' === $locale ) {
-			$chars[ 'Đ' ] = 'DJ';
-			$chars[ 'đ' ] = 'dj';
+			$chars['Đ'] = 'DJ';
+			$chars['đ'] = 'dj';
 		}
 
-		$string = strtr($string, $chars);
+		$string = strtr( $string, $chars );
 	} else {
 		$chars = array();
 		// Assume ISO-8859-1 if not UTF-8
 		$chars['in'] = "\x80\x83\x8a\x8e\x9a\x9e"
-			."\x9f\xa2\xa5\xb5\xc0\xc1\xc2"
-			."\xc3\xc4\xc5\xc7\xc8\xc9\xca"
-			."\xcb\xcc\xcd\xce\xcf\xd1\xd2"
-			."\xd3\xd4\xd5\xd6\xd8\xd9\xda"
-			."\xdb\xdc\xdd\xe0\xe1\xe2\xe3"
-			."\xe4\xe5\xe7\xe8\xe9\xea\xeb"
-			."\xec\xed\xee\xef\xf1\xf2\xf3"
-			."\xf4\xf5\xf6\xf8\xf9\xfa\xfb"
-			."\xfc\xfd\xff";
+			. "\x9f\xa2\xa5\xb5\xc0\xc1\xc2"
+			. "\xc3\xc4\xc5\xc7\xc8\xc9\xca"
+			. "\xcb\xcc\xcd\xce\xcf\xd1\xd2"
+			. "\xd3\xd4\xd5\xd6\xd8\xd9\xda"
+			. "\xdb\xdc\xdd\xe0\xe1\xe2\xe3"
+			. "\xe4\xe5\xe7\xe8\xe9\xea\xeb"
+			. "\xec\xed\xee\xef\xf1\xf2\xf3"
+			. "\xf4\xf5\xf6\xf8\xf9\xfa\xfb"
+			. "\xfc\xfd\xff";
 
-		$chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy";
+		$chars['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy';
 
-		$string = strtr($string, $chars['in'], $chars['out']);
+		$string = strtr( $string, $chars['in'], $chars['out'] );
 		$double_chars = array();
-		$double_chars['in'] = array("\x8c", "\x9c", "\xc6", "\xd0", "\xde", "\xdf", "\xe6", "\xf0", "\xfe");
-		$double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');
-		$string = str_replace($double_chars['in'], $double_chars['out'], $string);
-	}
+		$double_chars['in'] = array( "\x8c", "\x9c", "\xc6", "\xd0", "\xde", "\xdf", "\xe6", "\xf0", "\xfe" );
+		$double_chars['out'] = array( 'OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th' );
+		$string = str_replace( $double_chars['in'], $double_chars['out'], $string );
+	}// End if().
 
 	return $string;
 }
@@ -1761,7 +1959,7 @@
  */
 function sanitize_file_name( $filename ) {
 	$filename_raw = $filename;
-	$special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", "%", "+", chr(0));
+	$special_chars = array( '?', '[', ']', '/', '\\', '=', '<', '>', ':', ';', ',', "'", '"', '&', '$', '#', '*', '(', ')', '|', '~', '`', '!', '{', '}', '%', '+', chr( 0 ) );
 	/**
 	 * Filters the list of characters to remove from a filename.
 	 *
@@ -1786,7 +1984,7 @@
 	}
 
 	// Split the filename into a base and extension[s]
-	$parts = explode('.', $filename);
+	$parts = explode( '.', $filename );
 
 	// Return if only one extension
 	if ( count( $parts ) <= 2 ) {
@@ -1802,18 +2000,18 @@
 	}
 
 	// Process multiple extensions
-	$filename = array_shift($parts);
-	$extension = array_pop($parts);
+	$filename = array_shift( $parts );
+	$extension = array_pop( $parts );
 	$mimes = get_allowed_mime_types();
 
 	/*
 	 * Loop over any intermediate extensions. Postfix them with a trailing underscore
 	 * if they are a 2 - 5 character long alpha string not in the extension whitelist.
 	 */
-	foreach ( (array) $parts as $part) {
+	foreach ( (array) $parts as $part ) {
 		$filename .= '.' . $part;
 
-		if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) {
+		if ( preg_match( '/^[a-zA-Z]{2,5}\d?$/', $part ) ) {
 			$allowed = false;
 			foreach ( $mimes as $ext_preg => $mime_match ) {
 				$ext_preg = '!^(' . $ext_preg . ')$!i';
@@ -1822,13 +2020,14 @@
 					break;
 				}
 			}
-			if ( !$allowed )
+			if ( ! $allowed ) {
 				$filename .= '_';
+			}
 		}
 	}
 	$filename .= '.' . $extension;
 	/** This filter is documented in wp-includes/formatting.php */
-	return apply_filters('sanitize_file_name', $filename, $filename_raw);
+	return apply_filters( 'sanitize_file_name', $filename, $filename_raw );
 }
 
 /**
@@ -1854,8 +2053,9 @@
 	$username = preg_replace( '/&.+?;/', '', $username ); // Kill entities
 
 	// If strict, reduce to ASCII for max portability.
-	if ( $strict )
+	if ( $strict ) {
 		$username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username );
+	}
 
 	$username = trim( $username );
 	// Consolidate contiguous whitespace
@@ -1916,8 +2116,9 @@
 function sanitize_title( $title, $fallback_title = '', $context = 'save' ) {
 	$raw_title = $title;
 
-	if ( 'save' == $context )
-		$title = remove_accents($title);
+	if ( 'save' == $context ) {
+		$title = remove_accents( $title );
+	}
 
 	/**
 	 * Filters a sanitized title string.
@@ -1930,8 +2131,9 @@
 	 */
 	$title = apply_filters( 'sanitize_title', $title, $raw_title, $context );
 
-	if ( '' === $title || false === $title )
+	if ( '' === $title || false === $title ) {
 		$title = $fallback_title;
+	}
 
 	return $title;
 }
@@ -1964,22 +2166,22 @@
  * @return string The sanitized title.
  */
 function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'display' ) {
-	$title = strip_tags($title);
+	$title = strip_tags( $title );
 	// Preserve escaped octets.
-	$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
+	$title = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title );
 	// Remove percent signs that are not part of an octet.
-	$title = str_replace('%', '', $title);
+	$title = str_replace( '%', '', $title );
 	// Restore octets.
-	$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);
+	$title = preg_replace( '|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title );
 
-	if (seems_utf8($title)) {
-		if (function_exists('mb_strtolower')) {
-			$title = mb_strtolower($title, 'UTF-8');
+	if ( seems_utf8( $title ) ) {
+		if ( function_exists( 'mb_strtolower' ) ) {
+			$title = mb_strtolower( $title, 'UTF-8' );
 		}
-		$title = utf8_uri_encode($title, 200);
+		$title = utf8_uri_encode( $title, 200 );
 	}
 
-	$title = strtolower($title);
+	$title = strtolower( $title );
 
 	if ( 'save' == $context ) {
 		// Convert nbsp, ndash and mdash to hyphens
@@ -1990,31 +2192,50 @@
 		// Strip these characters entirely
 		$title = str_replace( array(
 			// iexcl and iquest
-			'%c2%a1', '%c2%bf',
+			'%c2%a1',
+			'%c2%bf',
 			// angle quotes
-			'%c2%ab', '%c2%bb', '%e2%80%b9', '%e2%80%ba',
+			'%c2%ab',
+			'%c2%bb',
+			'%e2%80%b9',
+			'%e2%80%ba',
 			// curly quotes
-			'%e2%80%98', '%e2%80%99', '%e2%80%9c', '%e2%80%9d',
-			'%e2%80%9a', '%e2%80%9b', '%e2%80%9e', '%e2%80%9f',
+			'%e2%80%98',
+			'%e2%80%99',
+			'%e2%80%9c',
+			'%e2%80%9d',
+			'%e2%80%9a',
+			'%e2%80%9b',
+			'%e2%80%9e',
+			'%e2%80%9f',
 			// copy, reg, deg, hellip and trade
-			'%c2%a9', '%c2%ae', '%c2%b0', '%e2%80%a6', '%e2%84%a2',
+			'%c2%a9',
+			'%c2%ae',
+			'%c2%b0',
+			'%e2%80%a6',
+			'%e2%84%a2',
 			// acute accents
-			'%c2%b4', '%cb%8a', '%cc%81', '%cd%81',
+			'%c2%b4',
+			'%cb%8a',
+			'%cc%81',
+			'%cd%81',
 			// grave accent, macron, caron
-			'%cc%80', '%cc%84', '%cc%8c',
+			'%cc%80',
+			'%cc%84',
+			'%cc%8c',
 		), '', $title );
 
 		// Convert times to x
 		$title = str_replace( '%c3%97', 'x', $title );
-	}
+	}// End if().
 
-	$title = preg_replace('/&.+?;/', '', $title); // kill entities
-	$title = str_replace('.', '-', $title);
+	$title = preg_replace( '/&.+?;/', '', $title ); // kill entities
+	$title = str_replace( '.', '-', $title );
 
-	$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
-	$title = preg_replace('/\s+/', '-', $title);
-	$title = preg_replace('|-+|', '-', $title);
-	$title = trim($title, '-');
+	$title = preg_replace( '/[^%a-z0-9 _-]/', '', $title );
+	$title = preg_replace( '/\s+/', '-', $title );
+	$title = preg_replace( '|-+|', '-', $title );
+	$title = trim( $title, '-' );
 
 	return $title;
 }
@@ -2138,7 +2359,7 @@
 		'&#156;' => '&#339;',
 		'&#157;' => '',
 		'&#158;' => '&#382;',
-		'&#159;' => '&#376;'
+		'&#159;' => '&#376;',
 	);
 
 	if ( strpos( $content, '&#1' ) !== false ) {
@@ -2158,7 +2379,7 @@
  * @return string Balanced text
  */
 function balanceTags( $text, $force = false ) {
-	if ( $force || get_option('use_balanceTags') == 1 ) {
+	if ( $force || get_option( 'use_balanceTags' ) == 1 ) {
 		return force_balance_tags( $text );
 	} else {
 		return $text;
@@ -2194,37 +2415,36 @@
 	$nestable_tags = array( 'blockquote', 'div', 'object', 'q', 'span' );
 
 	// WP bug fix for comments - in case you REALLY meant to type '< !--'
-	$text = str_replace('< !--', '<    !--', $text);
+	$text = str_replace( '< !--', '<    !--', $text );
 	// WP bug fix for LOVE <3 (and other situations with '<' before a number)
-	$text = preg_replace('#<([0-9]{1})#', '&lt;$1', $text);
+	$text = preg_replace( '#<([0-9]{1})#', '&lt;$1', $text );
 
-	while ( preg_match("/<(\/?[\w:]*)\s*([^>]*)>/", $text, $regex) ) {
+	while ( preg_match( '/<(\/?[\w:]*)\s*([^>]*)>/', $text, $regex ) ) {
 		$newtext .= $tagqueue;
 
-		$i = strpos($text, $regex[0]);
-		$l = strlen($regex[0]);
+		$i = strpos( $text, $regex[0] );
+		$l = strlen( $regex[0] );
 
 		// clear the shifter
 		$tagqueue = '';
 		// Pop or Push
-		if ( isset($regex[1][0]) && '/' == $regex[1][0] ) { // End Tag
-			$tag = strtolower(substr($regex[1],1));
+		if ( isset( $regex[1][0] ) && '/' == $regex[1][0] ) { // End Tag
+			$tag = strtolower( substr( $regex[1],1 ) );
 			// if too many closing tags
 			if ( $stacksize <= 0 ) {
 				$tag = '';
 				// or close to be safe $tag = '/' . $tag;
-			}
-			// if stacktop value = tag close value then pop
-			elseif ( $tagstack[$stacksize - 1] == $tag ) { // found closing tag
+			} // End if().
+			elseif ( $tagstack[ $stacksize - 1 ] == $tag ) { // found closing tag
 				$tag = '</' . $tag . '>'; // Close Tag
 				// Pop
 				array_pop( $tagstack );
 				$stacksize--;
 			} else { // closing tag not at top, search for it
-				for ( $j = $stacksize-1; $j >= 0; $j-- ) {
-					if ( $tagstack[$j] == $tag ) {
-					// add tag to tagqueue
-						for ( $k = $stacksize-1; $k >= $j; $k--) {
+				for ( $j = $stacksize -1; $j >= 0; $j-- ) {
+					if ( $tagstack[ $j ] == $tag ) {
+						// add tag to tagqueue
+						for ( $k = $stacksize -1; $k >= $j; $k-- ) {
 							$tagqueue .= '</' . array_pop( $tagstack ) . '>';
 							$stacksize--;
 						}
@@ -2234,29 +2454,27 @@
 				$tag = '';
 			}
 		} else { // Begin Tag
-			$tag = strtolower($regex[1]);
+			$tag = strtolower( $regex[1] );
 
 			// Tag Cleaning
 
 			// If it's an empty tag "< >", do nothing
 			if ( '' == $tag ) {
 				// do nothing
-			}
-			// ElseIf it presents itself as a self-closing tag...
+			} // End if().
 			elseif ( substr( $regex[2], -1 ) == '/' ) {
 				// ...but it isn't a known single-entity self-closing tag, then don't let it be treated as such and
 				// immediately close it with a closing tag (the tag will encapsulate no text as a result)
-				if ( ! in_array( $tag, $single_tags ) )
+				if ( ! in_array( $tag, $single_tags ) ) {
 					$regex[2] = trim( substr( $regex[2], 0, -1 ) ) . "></$tag";
-			}
-			// ElseIf it's a known single-entity tag but it doesn't close itself, do so
-			elseif ( in_array($tag, $single_tags) ) {
+				}
+			} // ElseIf it's a known single-entity tag but it doesn't close itself, do so
+			elseif ( in_array( $tag, $single_tags ) ) {
 				$regex[2] .= '/';
-			}
-			// Else it's not a single-entity tag
+			} // Else it's not a single-entity tag
 			else {
 				// If the top of the stack is the same as the tag we want to push, close previous tag
-				if ( $stacksize > 0 && !in_array($tag, $nestable_tags) && $tagstack[$stacksize - 1] == $tag ) {
+				if ( $stacksize > 0 && ! in_array( $tag, $nestable_tags ) && $tagstack[ $stacksize - 1 ] == $tag ) {
 					$tagqueue = '</' . array_pop( $tagstack ) . '>';
 					$stacksize--;
 				}
@@ -2265,19 +2483,20 @@
 
 			// Attributes
 			$attributes = $regex[2];
-			if ( ! empty( $attributes ) && $attributes[0] != '>' )
+			if ( ! empty( $attributes ) && $attributes[0] != '>' ) {
 				$attributes = ' ' . $attributes;
+			}
 
 			$tag = '<' . $tag . $attributes . '>';
 			//If already queuing a close tag, then put this tag on, too
-			if ( !empty($tagqueue) ) {
+			if ( ! empty( $tagqueue ) ) {
 				$tagqueue .= $tag;
 				$tag = '';
 			}
-		}
-		$newtext .= substr($text, 0, $i) . $tag;
-		$text = substr($text, $i + $l);
-	}
+		}// End if().
+		$newtext .= substr( $text, 0, $i ) . $tag;
+		$text = substr( $text, $i + $l );
+	}// End while().
 
 	// Clear Tag Queue
 	$newtext .= $tagqueue;
@@ -2286,12 +2505,12 @@
 	$newtext .= $text;
 
 	// Empty Stack
-	while( $x = array_pop($tagstack) )
-		$newtext .= '</' . $x . '>'; // Add remaining tags to close
+	while ( $x = array_pop( $tagstack ) ) {		$newtext .= '</' . $x . '>'; // Add remaining tags to close
+	}
 
 	// WP fix for the bug with HTML comments
-	$newtext = str_replace("< !--","<!--",$newtext);
-	$newtext = str_replace("<    !--","< !--",$newtext);
+	$newtext = str_replace( '< !--','<!--',$newtext );
+	$newtext = str_replace( '<    !--','< !--',$newtext );
 
 	return $newtext;
 }
@@ -2321,8 +2540,9 @@
 	 * @param string $content The text, prior to formatting for editing.
 	 */
 	$content = apply_filters( 'format_to_edit', $content );
-	if ( ! $rich_text )
+	if ( ! $rich_text ) {
 		$content = esc_textarea( $content );
+	}
 	return $content;
 }
 
@@ -2356,8 +2576,9 @@
  * @return string String with backslashes inserted.
  */
 function backslashit( $string ) {
-	if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9' )
+	if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9' ) {
 		$string = '\\\\' . $string;
+	}
 	return addcslashes( $string, 'A..Za..z' );
 }
 
@@ -2405,11 +2626,12 @@
  * @param string $gpc The string returned from HTTP request data.
  * @return string Returns a string escaped with slashes.
  */
-function addslashes_gpc($gpc) {
-	if ( get_magic_quotes_gpc() )
-		$gpc = stripslashes($gpc);
+function addslashes_gpc( $gpc ) {
+	if ( get_magic_quotes_gpc() ) {
+		$gpc = stripslashes( $gpc );
+	}
 
-	return wp_slash($gpc);
+	return wp_slash( $gpc );
 }
 
 /**
@@ -2486,11 +2708,11 @@
 	for ( $i = 0, $len = strlen( $email_address ); $i < $len; $i++ ) {
 		$j = rand( 0, 1 + $hex_encoding );
 		if ( $j == 0 ) {
-			$email_no_spam_address .= '&#' . ord( $email_address[$i] ) . ';';
+			$email_no_spam_address .= '&#' . ord( $email_address[ $i ] ) . ';';
 		} elseif ( $j == 1 ) {
-			$email_no_spam_address .= $email_address[$i];
+			$email_no_spam_address .= $email_address[ $i ];
 		} elseif ( $j == 2 ) {
-			$email_no_spam_address .= '%' . zeroise( dechex( ord( $email_address[$i] ) ), 2 );
+			$email_no_spam_address .= '%' . zeroise( dechex( ord( $email_address[ $i ] ) ), 2 );
 		}
 	}
 
@@ -2526,9 +2748,10 @@
 		$url = substr( $url, 0, strrpos( $url, ')' ) );
 	}
 
-	$url = esc_url($url);
-	if ( empty($url) )
+	$url = esc_url( $url );
+	if ( empty( $url ) ) {
 		return $matches[0];
+	}
 
 	return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>" . $suffix;
 }
@@ -2550,14 +2773,15 @@
 	$dest = 'http://' . $dest;
 
 	// removed trailing [.,;:)] from URL
-	if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
-		$ret = substr($dest, -1);
-		$dest = substr($dest, 0, strlen($dest)-1);
+	if ( in_array( substr( $dest, -1 ), array( '.', ',', ';', ':', ')' ) ) === true ) {
+		$ret = substr( $dest, -1 );
+		$dest = substr( $dest, 0, strlen( $dest ) -1 );
 	}
 
-	$dest = esc_url($dest);
-	if ( empty($dest) )
+	$dest = esc_url( $dest );
+	if ( empty( $dest ) ) {
 		return $matches[0];
+	}
 
 	return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
 }
@@ -2595,10 +2819,11 @@
 	$nested_code_pre = 0; // Keep track of how many levels link is nested inside <pre> or <code>
 	foreach ( $textarr as $piece ) {
 
-		if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) || preg_match( '|^<script[\s>]|i', $piece ) || preg_match( '|^<style[\s>]|i', $piece ) )
+		if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) || preg_match( '|^<script[\s>]|i', $piece ) || preg_match( '|^<style[\s>]|i', $piece ) ) {
 			$nested_code_pre++;
-		elseif ( $nested_code_pre && ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) || '</script>' === strtolower( $piece ) || '</style>' === strtolower( $piece ) ) )
+		} elseif ( $nested_code_pre && ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) || '</script>' === strtolower( $piece ) || '</style>' === strtolower( $piece ) ) ) {
 			$nested_code_pre--;
+		}
 
 		if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {
 			$r .= $piece;
@@ -2631,7 +2856,7 @@
 				)
 				(\)?)                                                  # 3: Trailing closing parenthesis (for parethesis balancing post processing)
 			~xS'; // The regex is a non-anchored pattern and does not have a single fixed starting character.
-			      // Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
+				  // Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
 
 			$ret = preg_replace_callback( $url_clickable, '_make_url_clickable_cb', $ret );
 
@@ -2641,10 +2866,10 @@
 			$ret = substr( $ret, 1, -1 ); // Remove our whitespace padding.
 			$r .= $ret;
 		}
-	}
+	}// End foreach().
 
 	// Cleanup of accidental links within links
-	return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
+	return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', '$1$3</a>', $r );
 }
 
 /**
@@ -2713,8 +2938,8 @@
  */
 function wp_rel_nofollow( $text ) {
 	// This is a pre save filter, so text is already escaped.
-	$text = stripslashes($text);
-	$text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
+	$text = stripslashes( $text );
+	$text = preg_replace_callback( '|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text );
 	return wp_slash( $text );
 }
 
@@ -2735,7 +2960,7 @@
 	$rel  = 'nofollow';
 
 	if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) ||
-	     preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text )
+		 preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text )
 	) {
 		return "<a $text>";
 	}
@@ -2775,8 +3000,9 @@
 function translate_smiley( $matches ) {
 	global $wpsmiliestrans;
 
-	if ( count( $matches ) == 0 )
+	if ( count( $matches ) == 0 ) {
 		return '';
+	}
 
 	$smiley = trim( reset( $matches ) );
 	$img = $wpsmiliestrans[ $smiley ];
@@ -2830,20 +3056,20 @@
 		$ignore_block_element = '';
 
 		for ( $i = 0; $i < $stop; $i++ ) {
-			$content = $textarr[$i];
+			$content = $textarr[ $i ];
 
 			// If we're in an ignore block, wait until we find its closing tag
-			if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) )  {
+			if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {
 				$ignore_block_element = $matches[1];
 			}
 
 			// If it's not a tag and not in ignore block
-			if ( '' ==  $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) {
+			if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) {
 				$content = preg_replace_callback( $wp_smiliessearch, 'translate_smiley', $content );
 			}
 
 			// did we exit ignore block
-			if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content )  {
+			if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) {
 				$ignore_block_element = '';
 			}
 
@@ -2868,8 +3094,9 @@
  * @return string|bool Either false or the valid email address.
  */
 function is_email( $email, $deprecated = false ) {
-	if ( ! empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '3.0.0' );
+	}
 
 	// Test for the minimum length the email can be
 	if ( strlen( $email ) < 6 ) {
@@ -2900,7 +3127,7 @@
 
 	// LOCAL PART
 	// Test for invalid characters
-	if ( !preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) {
+	if ( ! preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) {
 		/** This filter is documented in wp-includes/formatting.php */
 		return apply_filters( 'is_email', false, $email, 'local_invalid_chars' );
 	}
@@ -2936,7 +3163,7 @@
 		}
 
 		// Test for invalid characters
-		if ( !preg_match('/^[a-z0-9-]+$/i', $sub ) ) {
+		if ( ! preg_match( '/^[a-z0-9-]+$/i', $sub ) ) {
 			/** This filter is documented in wp-includes/formatting.php */
 			return apply_filters( 'is_email', false, $email, 'sub_invalid_chars' );
 		}
@@ -2957,10 +3184,10 @@
  */
 function wp_iso_descrambler( $string ) {
 	/* this may only work with iso-8859-1, I'm afraid */
-	if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {
+	if ( ! preg_match( '#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches ) ) {
 		return $string;
 	} else {
-		$subject = str_replace('_', ' ', $matches[2]);
+		$subject = str_replace( '_', ' ', $matches[2] );
 		return preg_replace_callback( '#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject );
 	}
 }
@@ -3033,13 +3260,15 @@
 	$tz = get_option( 'timezone_string' );
 	if ( $tz ) {
 		$datetime = date_create( $string, new DateTimeZone( 'UTC' ) );
-		if ( ! $datetime )
+		if ( ! $datetime ) {
 			return date( $format, 0 );
+		}
 		$datetime->setTimezone( new DateTimeZone( $tz ) );
 		$string_localtime = $datetime->format( $format );
 	} else {
-		if ( ! preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches) )
+		if ( ! preg_match( '#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches ) ) {
 			return date( $format, 0 );
+		}
 		$string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] );
 		$string_localtime = gmdate( $format, $string_time + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
 	}
@@ -3056,12 +3285,12 @@
  */
 function iso8601_timezone_to_offset( $timezone ) {
 	// $timezone is either 'Z' or '[+|-]hhmm'
-	if ($timezone == 'Z') {
+	if ( $timezone == 'Z' ) {
 		$offset = 0;
 	} else {
-		$sign    = (substr($timezone, 0, 1) == '+') ? 1 : -1;
-		$hours   = intval(substr($timezone, 1, 2));
-		$minutes = intval(substr($timezone, 3, 4)) / 60;
+		$sign    = (substr( $timezone, 0, 1 ) == '+') ? 1 : -1;
+		$hours   = intval( substr( $timezone, 1, 2 ) );
+		$minutes = intval( substr( $timezone, 3, 4 ) ) / 60;
 		$offset  = $sign * HOUR_IN_SECONDS * ($hours + $minutes);
 	}
 	return $offset;
@@ -3077,25 +3306,25 @@
  * @return string The date and time in MySQL DateTime format - Y-m-d H:i:s.
  */
 function iso8601_to_datetime( $date_string, $timezone = 'user' ) {
-	$timezone = strtolower($timezone);
+	$timezone = strtolower( $timezone );
 
-	if ($timezone == 'gmt') {
+	if ( $timezone == 'gmt' ) {
 
-		preg_match('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits);
+		preg_match( '#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits );
 
-		if (!empty($date_bits[7])) { // we have a timezone, so let's compute an offset
-			$offset = iso8601_timezone_to_offset($date_bits[7]);
+		if ( ! empty( $date_bits[7] ) ) { // we have a timezone, so let's compute an offset
+			$offset = iso8601_timezone_to_offset( $date_bits[7] );
 		} else { // we don't have a timezone, so we assume user local timezone (not server's!)
-			$offset = HOUR_IN_SECONDS * get_option('gmt_offset');
+			$offset = HOUR_IN_SECONDS * get_option( 'gmt_offset' );
 		}
 
-		$timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]);
+		$timestamp = gmmktime( $date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1] );
 		$timestamp -= $offset;
 
-		return gmdate('Y-m-d H:i:s', $timestamp);
+		return gmdate( 'Y-m-d H:i:s', $timestamp );
 
-	} elseif ($timezone == 'user') {
-		return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string);
+	} elseif ( $timezone == 'user' ) {
+		return preg_replace( '#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string );
 	}
 }
 
@@ -3222,41 +3451,47 @@
 
 	if ( $diff < HOUR_IN_SECONDS ) {
 		$mins = round( $diff / MINUTE_IN_SECONDS );
-		if ( $mins <= 1 )
+		if ( $mins <= 1 ) {
 			$mins = 1;
+		}
 		/* translators: Time difference between two dates, in minutes (min=minute). 1: Number of minutes */
 		$since = sprintf( _n( '%s min', '%s mins', $mins ), $mins );
 	} elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) {
 		$hours = round( $diff / HOUR_IN_SECONDS );
-		if ( $hours <= 1 )
+		if ( $hours <= 1 ) {
 			$hours = 1;
+		}
 		/* translators: Time difference between two dates, in hours. 1: Number of hours */
 		$since = sprintf( _n( '%s hour', '%s hours', $hours ), $hours );
 	} elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) {
 		$days = round( $diff / DAY_IN_SECONDS );
-		if ( $days <= 1 )
+		if ( $days <= 1 ) {
 			$days = 1;
+		}
 		/* translators: Time difference between two dates, in days. 1: Number of days */
 		$since = sprintf( _n( '%s day', '%s days', $days ), $days );
 	} elseif ( $diff < MONTH_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
 		$weeks = round( $diff / WEEK_IN_SECONDS );
-		if ( $weeks <= 1 )
+		if ( $weeks <= 1 ) {
 			$weeks = 1;
+		}
 		/* translators: Time difference between two dates, in weeks. 1: Number of weeks */
 		$since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks );
 	} elseif ( $diff < YEAR_IN_SECONDS && $diff >= MONTH_IN_SECONDS ) {
 		$months = round( $diff / MONTH_IN_SECONDS );
-		if ( $months <= 1 )
+		if ( $months <= 1 ) {
 			$months = 1;
+		}
 		/* translators: Time difference between two dates, in months. 1: Number of months */
 		$since = sprintf( _n( '%s month', '%s months', $months ), $months );
 	} elseif ( $diff >= YEAR_IN_SECONDS ) {
 		$years = round( $diff / YEAR_IN_SECONDS );
-		if ( $years <= 1 )
+		if ( $years <= 1 ) {
 			$years = 1;
+		}
 		/* translators: Time difference between two dates, in years. 1: Number of years */
 		$since = sprintf( _n( '%s year', '%s years', $years ), $years );
-	}
+	}// End if().
 
 	/**
 	 * Filters the human readable difference between two timestamps.
@@ -3289,13 +3524,13 @@
 function wp_trim_excerpt( $text = '' ) {
 	$raw_excerpt = $text;
 	if ( '' == $text ) {
-		$text = get_the_content('');
+		$text = get_the_content( '' );
 
 		$text = strip_shortcodes( $text );
 
 		/** This filter is documented in wp-includes/post-template.php */
 		$text = apply_filters( 'the_content', $text );
-		$text = str_replace(']]>', ']]&gt;', $text);
+		$text = str_replace( ']]>', ']]&gt;', $text );
 
 		/**
 		 * Filters the number of words in an excerpt.
@@ -3405,8 +3640,9 @@
 	 * @param string $text           The text prior to entity conversion.
 	 */
 	$filtered = apply_filters( 'pre_ent2ncr', null, $text );
-	if ( null !== $filtered )
+	if ( null !== $filtered ) {
 		return $filtered;
+	}
 
 	$to_ncr = array(
 		'&quot;' => '&#34;',
@@ -3664,10 +3900,10 @@
 		'&spades;' => '&#9824;',
 		'&clubs;' => '&#9827;',
 		'&hearts;' => '&#9829;',
-		'&diams;' => '&#9830;'
+		'&diams;' => '&#9830;',
 	);
 
-	return str_replace( array_keys($to_ncr), array_values($to_ncr), $text );
+	return str_replace( array_keys( $to_ncr ), array_values( $to_ncr ), $text );
 }
 
 /**
@@ -3768,29 +4004,31 @@
 function esc_url( $url, $protocols = null, $_context = 'display' ) {
 	$original_url = $url;
 
-	if ( '' == $url )
+	if ( '' == $url ) {
 		return $url;
+	}
 
 	$url = str_replace( ' ', '%20', $url );
-	$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url);
+	$url = preg_replace( '|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url );
 
 	if ( '' === $url ) {
 		return $url;
 	}
 
 	if ( 0 !== stripos( $url, 'mailto:' ) ) {
-		$strip = array('%0d', '%0a', '%0D', '%0A');
-		$url = _deep_replace($strip, $url);
+		$strip = array( '%0d', '%0a', '%0D', '%0A' );
+		$url = _deep_replace( $strip, $url );
 	}
 
-	$url = str_replace(';//', '://', $url);
+	$url = str_replace( ';//', '://', $url );
 	/* If the URL doesn't appear to contain a scheme, we
 	 * presume it needs http:// prepended (unless a relative
 	 * link starting with /, # or ? or a php file).
 	 */
-	if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
-		! preg_match('/^[a-z0-9-]+?\.php/i', $url) )
+	if ( strpos( $url, ':' ) === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
+		! preg_match( '/^[a-z0-9-]+?\.php/i', $url ) ) {
 		$url = 'http://' . $url;
+	}
 
 	// Replace ampersands and single quotes only when displaying.
 	if ( 'display' == $_context ) {
@@ -3834,16 +4072,18 @@
 		$end_clean = str_replace( array( '[', ']' ), array( '%5B', '%5D' ), $end_dirty );
 		$url       = str_replace( $end_dirty, $end_clean, $url );
 
-	}
+	}// End if().
 
 	if ( '/' === $url[0] ) {
 		$good_protocol_url = $url;
 	} else {
-		if ( ! is_array( $protocols ) )
+		if ( ! is_array( $protocols ) ) {
 			$protocols = wp_allowed_protocols();
+		}
 		$good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
-		if ( strtolower( $good_protocol_url ) != strtolower( $url ) )
+		if ( strtolower( $good_protocol_url ) != strtolower( $url ) ) {
 			return '';
+		}
 	}
 
 	/**
@@ -3883,8 +4123,8 @@
  */
 function htmlentities2( $myHTML ) {
 	$translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES );
-	$translation_table[chr(38)] = '&';
-	return preg_replace( "/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/", "&amp;", strtr($myHTML, $translation_table) );
+	$translation_table[ chr( 38 ) ] = '&';
+	return preg_replace( '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/', '&amp;', strtr( $myHTML, $translation_table ) );
 }
 
 /**
@@ -3914,7 +4154,7 @@
 	 * @since 2.0.6
 	 *
 	 * @param string $safe_text The text after it has been escaped.
- 	 * @param string $text      The text prior to being escaped.
+	  * @param string $text      The text prior to being escaped.
 	 */
 	return apply_filters( 'js_escape', $safe_text, $text );
 }
@@ -3939,7 +4179,7 @@
 	 * @since 2.8.0
 	 *
 	 * @param string $safe_text The text after it has been escaped.
- 	 * @param string $text      The text prior to being escaped.
+	  * @param string $text      The text prior to being escaped.
 	 */
 	return apply_filters( 'esc_html', $safe_text, $text );
 }
@@ -3964,7 +4204,7 @@
 	 * @since 2.0.6
 	 *
 	 * @param string $safe_text The text after it has been escaped.
- 	 * @param string $text      The text prior to being escaped.
+	  * @param string $text      The text prior to being escaped.
 	 */
 	return apply_filters( 'attribute_escape', $safe_text, $text );
 }
@@ -3985,7 +4225,7 @@
 	 * @since 3.1.0
 	 *
 	 * @param string $safe_text The text after it has been escaped.
- 	 * @param string $text      The text prior to being escaped.
+	  * @param string $text      The text prior to being escaped.
 	 */
 	return apply_filters( 'esc_textarea', $safe_text, $text );
 }
@@ -3999,14 +4239,14 @@
  * @return string
  */
 function tag_escape( $tag_name ) {
-	$safe_tag = strtolower( preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name) );
+	$safe_tag = strtolower( preg_replace( '/[^a-zA-Z0-9_:]/', '', $tag_name ) );
 	/**
 	 * Filters a string cleaned and escaped for output as an HTML tag.
 	 *
 	 * @since 2.8.0
 	 *
 	 * @param string $safe_tag The tag name after it has been escaped.
- 	 * @param string $tag_name The text before it was escaped.
+	  * @param string $tag_name The text before it was escaped.
 	 */
 	return apply_filters( 'tag_escape', $safe_tag, $tag_name );
 }
@@ -4089,17 +4329,20 @@
 		case 'posts_per_page':
 		case 'posts_per_rss':
 			$value = (int) $value;
-			if ( empty($value) )
+			if ( empty( $value ) ) {
 				$value = 1;
-			if ( $value < -1 )
-				$value = abs($value);
+			}
+			if ( $value < -1 ) {
+				$value = abs( $value );
+			}
 			break;
 
 		case 'default_ping_status':
 		case 'default_comment_status':
 			// Options that if not there have 0 value but need to be something like "closed"
-			if ( $value == '0' || $value == '')
+			if ( $value == '0' || $value == '' ) {
 				$value = 'closed';
+			}
 			break;
 
 		case 'blogdescription':
@@ -4117,15 +4360,15 @@
 			break;
 
 		case 'blog_charset':
-			$value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); // strips slashes
+			$value = preg_replace( '/[^a-zA-Z0-9_-]/', '', $value ); // strips slashes
 			break;
 
 		case 'blog_public':
 			// This is the value if the settings checkbox is not checked on POST. Don't rely on this.
-			if ( null === $value )
+			if ( null === $value ) {
 				$value = 1;
-			else
-				$value = intval( $value );
+			} else { $value = intval( $value );
+			}
 			break;
 
 		case 'date_format':
@@ -4151,7 +4394,7 @@
 			break;
 
 		case 'gmt_offset':
-			$value = preg_replace('/[^0-9:.-]/', '', $value); // strips slashes
+			$value = preg_replace( '/[^0-9:.-]/', '', $value ); // strips slashes
 			break;
 
 		case 'siteurl':
@@ -4195,13 +4438,15 @@
 			if ( is_wp_error( $value ) ) {
 				$error = $value->get_error_message();
 			} else {
-				if ( ! is_array( $value ) )
+				if ( ! is_array( $value ) ) {
 					$value = explode( ' ', $value );
+				}
 
 				$value = array_values( array_filter( array_map( 'trim', $value ) ) );
 
-				if ( ! $value )
+				if ( ! $value ) {
 					$value = '';
+				}
 			}
 			break;
 
@@ -4211,8 +4456,9 @@
 			if ( is_wp_error( $value ) ) {
 				$error = $value->get_error_message();
 			} else {
-				if ( ! is_array( $value ) )
+				if ( ! is_array( $value ) ) {
 					$value = explode( "\n", $value );
+				}
 
 				$domains = array_values( array_filter( array_map( 'trim', $value ) ) );
 				$value = array();
@@ -4222,8 +4468,9 @@
 						$value[] = $domain;
 					}
 				}
-				if ( ! $value )
+				if ( ! $value ) {
 					$value = '';
+				}
 			}
 			break;
 
@@ -4255,8 +4502,9 @@
 			break;
 
 		case 'default_role' :
-			if ( ! get_role( $value ) && get_role( 'subscriber' ) )
+			if ( ! get_role( $value ) && get_role( 'subscriber' ) ) {
 				$value = 'subscriber';
+			}
 			break;
 
 		case 'moderation_keys':
@@ -4271,7 +4519,7 @@
 				$value = implode( "\n", $value );
 			}
 			break;
-	}
+	}// End switch().
 
 	if ( ! empty( $error ) ) {
 		$value = get_option( $option );
@@ -4334,8 +4582,9 @@
  */
 function wp_parse_str( $string, &$array ) {
 	parse_str( $string, $array );
-	if ( get_magic_quotes_gpc() )
+	if ( get_magic_quotes_gpc() ) {
 		$array = stripslashes_deep( $array );
+	}
 	/**
 	 * Filters the array of variables derived from a parsed string.
 	 *
@@ -4357,7 +4606,7 @@
  * @return string Converted text.
  */
 function wp_pre_kses_less_than( $text ) {
-	return preg_replace_callback('%<[^>]*?((?=<)|>|$)%', 'wp_pre_kses_less_than_callback', $text);
+	return preg_replace_callback( '%<[^>]*?((?=<)|>|$)%', 'wp_pre_kses_less_than_callback', $text );
 }
 
 /**
@@ -4369,8 +4618,9 @@
  * @return string The text returned after esc_html if needed.
  */
 function wp_pre_kses_less_than_callback( $matches ) {
-	if ( false === strpos($matches[0], '>') )
-		return esc_html($matches[0]);
+	if ( false === strpos( $matches[0], '>' ) ) {
+		return esc_html( $matches[0] );
+	}
 	return $matches[0];
 }
 
@@ -4386,39 +4636,40 @@
  */
 function wp_sprintf( $pattern ) {
 	$args = func_get_args();
-	$len = strlen($pattern);
+	$len = strlen( $pattern );
 	$start = 0;
 	$result = '';
 	$arg_index = 0;
 	while ( $len > $start ) {
 		// Last character: append and break
-		if ( strlen($pattern) - 1 == $start ) {
-			$result .= substr($pattern, -1);
+		if ( strlen( $pattern ) - 1 == $start ) {
+			$result .= substr( $pattern, -1 );
 			break;
 		}
 
 		// Literal %: append and continue
-		if ( substr($pattern, $start, 2) == '%%' ) {
+		if ( substr( $pattern, $start, 2 ) == '%%' ) {
 			$start += 2;
 			$result .= '%';
 			continue;
 		}
 
 		// Get fragment before next %
-		$end = strpos($pattern, '%', $start + 1);
-		if ( false === $end )
+		$end = strpos( $pattern, '%', $start + 1 );
+		if ( false === $end ) {
 			$end = $len;
-		$fragment = substr($pattern, $start, $end - $start);
+		}
+		$fragment = substr( $pattern, $start, $end - $start );
 
 		// Fragment has a specifier
-		if ( $pattern[$start] == '%' ) {
+		if ( $pattern[ $start ] == '%' ) {
 			// Find numbered arguments or take the next one in order
-			if ( preg_match('/^%(\d+)\$/', $fragment, $matches) ) {
-				$arg = isset($args[$matches[1]]) ? $args[$matches[1]] : '';
-				$fragment = str_replace("%{$matches[1]}$", '%', $fragment);
+			if ( preg_match( '/^%(\d+)\$/', $fragment, $matches ) ) {
+				$arg = isset( $args[ $matches[1] ] ) ? $args[ $matches[1] ] : '';
+				$fragment = str_replace( "%{$matches[1]}$", '%', $fragment );
 			} else {
 				++$arg_index;
-				$arg = isset($args[$arg_index]) ? $args[$arg_index] : '';
+				$arg = isset( $args[ $arg_index ] ) ? $args[ $arg_index ] : '';
 			}
 
 			/**
@@ -4432,16 +4683,16 @@
 			 * @param string $arg      The argument.
 			 */
 			$_fragment = apply_filters( 'wp_sprintf', $fragment, $arg );
-			if ( $_fragment != $fragment )
+			if ( $_fragment != $fragment ) {
 				$fragment = $_fragment;
-			else
-				$fragment = sprintf($fragment, strval($arg) );
+			} else { $fragment = sprintf( $fragment, strval( $arg ) );
+			}
 		}
 
 		// Append to result and move to next fragment
 		$result .= $fragment;
 		$start = $end;
-	}
+	}// End while().
 	return $result;
 }
 
@@ -4460,12 +4711,14 @@
  */
 function wp_sprintf_l( $pattern, $args ) {
 	// Not a match
-	if ( substr($pattern, 0, 2) != '%l' )
+	if ( substr( $pattern, 0, 2 ) != '%l' ) {
 		return $pattern;
+	}
 
 	// Nothing to work with
-	if ( empty($args) )
+	if ( empty( $args ) ) {
 		return '';
+	}
 
 	/**
 	 * Filters the translated delimiters used by wp_sprintf_l().
@@ -4480,28 +4733,29 @@
 	 */
 	$l = apply_filters( 'wp_sprintf_l', array(
 		/* translators: used to join items in a list with more than 2 items */
-		'between'          => sprintf( __('%s, %s'), '', '' ),
+		'between'          => sprintf( __( '%1$s, %2$s' ), '', '' ),
 		/* translators: used to join last two items in a list with more than 2 times */
-		'between_last_two' => sprintf( __('%s, and %s'), '', '' ),
+		'between_last_two' => sprintf( __( '%1$s, and %2$s' ), '', '' ),
 		/* translators: used to join items in a list with only 2 items */
-		'between_only_two' => sprintf( __('%s and %s'), '', '' ),
+		'between_only_two' => sprintf( __( '%1$s and %2$s' ), '', '' ),
 	) );
 
 	$args = (array) $args;
-	$result = array_shift($args);
-	if ( count($args) == 1 )
-		$result .= $l['between_only_two'] . array_shift($args);
+	$result = array_shift( $args );
+	if ( count( $args ) == 1 ) {
+		$result .= $l['between_only_two'] . array_shift( $args );
+	}
 	// Loop when more than two args
-	$i = count($args);
+	$i = count( $args );
 	while ( $i ) {
-		$arg = array_shift($args);
+		$arg = array_shift( $args );
 		$i--;
-		if ( 0 == $i )
+		if ( 0 == $i ) {
 			$result .= $l['between_last_two'] . $arg;
-		else
-			$result .= $l['between'] . $arg;
+		} else { $result .= $l['between'] . $arg;
+		}
 	}
-	return $result . substr($pattern, 2);
+	return $result . substr( $pattern, 2 );
 }
 
 /**
@@ -4519,14 +4773,16 @@
  * @return string The excerpt.
  */
 function wp_html_excerpt( $str, $count, $more = null ) {
-	if ( null === $more )
+	if ( null === $more ) {
 		$more = '';
+	}
 	$str = wp_strip_all_tags( $str, true );
 	$excerpt = mb_substr( $str, 0, $count );
 	// remove part of an entity at the end
 	$excerpt = preg_replace( '/&[^;\s]{0,6}$/', '', $excerpt );
-	if ( $str != $excerpt )
+	if ( $str != $excerpt ) {
 		$excerpt = trim( $excerpt ) . $more;
+	}
 	return $excerpt;
 }
 
@@ -4545,10 +4801,10 @@
  * @param array  $attrs   The attributes which should be processed.
  * @return string The processed content.
  */
-function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) {
+function links_add_base_url( $content, $base, $attrs = array( 'src', 'href' ) ) {
 	global $_links_add_base;
 	$_links_add_base = $base;
-	$attrs = implode('|', (array)$attrs);
+	$attrs = implode( '|', (array) $attrs );
 	return preg_replace_callback( "!($attrs)=(['\"])(.+?)\\2!i", '_links_add_base', $content );
 }
 
@@ -4591,10 +4847,10 @@
  * @param array  $tags    An array of tags to apply to.
  * @return string The processed content.
  */
-function links_add_target( $content, $target = '_blank', $tags = array('a') ) {
+function links_add_target( $content, $target = '_blank', $tags = array( 'a' ) ) {
 	global $_links_add_target;
 	$_links_add_target = $target;
-	$tags = implode('|', (array)$tags);
+	$tags = implode( '|', (array) $tags );
 	return preg_replace_callback( "!<($tags)([^>]*)>!i", '_links_add_target', $content );
 }
 
@@ -4612,7 +4868,7 @@
 function _links_add_target( $m ) {
 	global $_links_add_target;
 	$tag = $m[1];
-	$link = preg_replace('|( target=([\'"])(.*?)\2)|i', '', $m[2]);
+	$link = preg_replace( '|( target=([\'"])(.*?)\2)|i', '', $m[2] );
 	return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">';
 }
 
@@ -4644,12 +4900,13 @@
  * @param bool   $remove_breaks Optional. Whether to remove left over line breaks and white space chars
  * @return string The processed string.
  */
-function wp_strip_all_tags($string, $remove_breaks = false) {
+function wp_strip_all_tags( $string, $remove_breaks = false ) {
 	$string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
-	$string = strip_tags($string);
+	$string = strip_tags( $string );
 
-	if ( $remove_breaks )
-		$string = preg_replace('/[\r\n\t ]+/', ' ', $string);
+	if ( $remove_breaks ) {
+		$string = preg_replace( '/[\r\n\t ]+/', ' ', $string );
+	}
 
 	return trim( $string );
 }
@@ -4727,14 +4984,14 @@
 function _sanitize_text_fields( $str, $keep_newlines = false ) {
 	$filtered = wp_check_invalid_utf8( $str );
 
-	if ( strpos($filtered, '<') !== false ) {
+	if ( strpos( $filtered, '<' ) !== false ) {
 		$filtered = wp_pre_kses_less_than( $filtered );
 		// This will strip extra whitespace for us.
 		$filtered = wp_strip_all_tags( $filtered, false );
 
 		// Use html entities in a special case to make sure no later
 		// newline stripping stage could lead to a functional tag
-		$filtered = str_replace("<\n", "&lt;\n", $filtered);
+		$filtered = str_replace( "<\n", "&lt;\n", $filtered );
 	}
 
 	if ( ! $keep_newlines ) {
@@ -4743,14 +5000,14 @@
 	$filtered = trim( $filtered );
 
 	$found = false;
-	while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
-		$filtered = str_replace($match[0], '', $filtered);
+	while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
+		$filtered = str_replace( $match[0], '', $filtered );
 		$found = true;
 	}
 
 	if ( $found ) {
 		// Strip out the whitespace that may now exist after removing the octets.
-		$filtered = trim( preg_replace('/ +/', ' ', $filtered) );
+		$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
 	}
 
 	return $filtered;
@@ -4784,8 +5041,9 @@
 function capital_P_dangit( $text ) {
 	// Simple replacement for titles
 	$current_filter = current_filter();
-	if ( 'the_title' === $current_filter || 'wp_title' === $current_filter )
+	if ( 'the_title' === $current_filter || 'wp_title' === $current_filter ) {
 		return str_replace( 'Wordpress', 'WordPress', $text );
+	}
 	// Still here? Use the more judicious replacement
 	static $dblq = false;
 	if ( false === $dblq ) {
@@ -4829,8 +5087,9 @@
 function sanitize_trackback_urls( $to_ping ) {
 	$urls_to_ping = preg_split( '/[\r\n\t ]/', trim( $to_ping ), -1, PREG_SPLIT_NO_EMPTY );
 	foreach ( $urls_to_ping as $k => $url ) {
-		if ( !preg_match( '#^https?://.#i', $url ) )
-			unset( $urls_to_ping[$k] );
+		if ( ! preg_match( '#^https?://.#i', $url ) ) {
+			unset( $urls_to_ping[ $k ] );
+		}
 	}
 	$urls_to_ping = array_map( 'esc_url_raw', $urls_to_ping );
 	$urls_to_ping = implode( "\n", $urls_to_ping );
@@ -4863,9 +5122,9 @@
 	if ( is_array( $value ) ) {
 		foreach ( $value as $k => $v ) {
 			if ( is_array( $v ) ) {
-				$value[$k] = wp_slash( $v );
+				$value[ $k ] = wp_slash( $v );
 			} else {
-				$value[$k] = addslashes( $v );
+				$value[ $k ] = addslashes( $v );
 			}
 		}
 	} else {
@@ -5055,7 +5314,7 @@
 		?>
 		<script type="text/javascript">
 			window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
-			<?php readfile( ABSPATH . WPINC . "/js/wp-emoji-loader.js" ); ?>
+			<?php readfile( ABSPATH . WPINC . '/js/wp-emoji-loader.js' ); ?>
 		</script>
 		<?php
 	} else {
@@ -5080,7 +5339,7 @@
 			include "js/wp-emoji-loader.min.js"
 		</script>
 		<?php
-	}
+	}// End if().
 }
 
 /**
@@ -5162,20 +5421,20 @@
 	$ignore_block_element = '';
 
 	for ( $i = 0; $i < $stop; $i++ ) {
-		$content = $textarr[$i];
+		$content = $textarr[ $i ];
 
 		// If we're in an ignore block, wait until we find its closing tag.
-		if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) )  {
+		if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {
 			$ignore_block_element = $matches[1];
 		}
 
 		// If it's not a tag and not in ignore block.
-		if ( '' ==  $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) {
+		if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) {
 			$matches = array();
 			if ( preg_match_all( '/(&#x1f1(e[6-9a-f]|f[0-9a-f]);){2}/', $content, $matches ) ) {
 				if ( ! empty( $matches[0] ) ) {
 					foreach ( $matches[0] as $flag ) {
-						$chars = str_replace( array( '&#x', ';'), '', $flag );
+						$chars = str_replace( array( '&#x', ';' ), '', $flag );
 
 						list( $char1, $char2 ) = str_split( $chars, 5 );
 						$entity = sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', $cdn_url . $char1 . '-' . $char2 . $ext, html_entity_decode( $flag ) );
@@ -5192,7 +5451,7 @@
 			if ( preg_match_all( $regex, $content, $matches ) ) {
 				if ( ! empty( $matches[1] ) ) {
 					foreach ( $matches[1] as $emoji ) {
-						$char = str_replace( array( '&#x', ';'), '', $emoji );
+						$char = str_replace( array( '&#x', ';' ), '', $emoji );
 						$entity = sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', $cdn_url . $char . $ext, html_entity_decode( $emoji ) );
 
 						$content = str_replace( $emoji, $entity, $content );
@@ -5202,12 +5461,12 @@
 		}
 
 		// Did we exit ignore block.
-		if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content )  {
+		if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) {
 			$ignore_block_element = '';
 		}
 
 		$output .= $content;
-	}
+	}// End for().
 
 	return $output;
 }
@@ -5242,7 +5501,7 @@
 	}
 
 	foreach ( $headers as $header ) {
-		if ( strpos($header, ':') === false ) {
+		if ( strpos( $header, ':' ) === false ) {
 			continue;
 		}
 
@@ -5250,7 +5509,7 @@
 		list( $name, $content ) = explode( ':', trim( $header ), 2 );
 
 		// Cleanup crew.
-		$name    = trim( $name    );
+		$name    = trim( $name );
 		$content = trim( $content );
 
 		if ( 'content-type' === strtolower( $name ) ) {
@@ -5316,7 +5575,7 @@
 	}
 
 	// 3 or 6 hex digits, or the empty string.
-	if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) {
+	if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) {
 		return $color;
 	}
 }
Index: src/wp-includes/functions.php
===================================================================
--- src/wp-includes/functions.php	(revision 40901)
+++ src/wp-includes/functions.php	(working copy)
@@ -24,21 +24,24 @@
  * @return string|int|bool Formatted date string or Unix timestamp. False if $date is empty.
  */
 function mysql2date( $format, $date, $translate = true ) {
-	if ( empty( $date ) )
+	if ( empty( $date ) ) {
 		return false;
+	}
 
-	if ( 'G' == $format )
+	if ( 'G' == $format ) {
 		return strtotime( $date . ' +0000' );
+	}
 
 	$i = strtotime( $date );
 
-	if ( 'U' == $format )
+	if ( 'U' == $format ) {
 		return $i;
+	}
 
-	if ( $translate )
+	if ( $translate ) {
 		return date_i18n( $format, $i );
-	else
-		return date( $format, $i );
+	} else { return date( $format, $i );
+	}
 }
 
 /**
@@ -100,20 +103,20 @@
 	 */
 	$req_format = $dateformatstring;
 
-	if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {
+	if ( ( ! empty( $wp_locale->month ) ) && ( ! empty( $wp_locale->weekday ) ) ) {
 		$datemonth = $wp_locale->get_month( date( 'm', $i ) );
 		$datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth );
 		$dateweekday = $wp_locale->get_weekday( date( 'w', $i ) );
 		$dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday );
 		$datemeridiem = $wp_locale->get_meridiem( date( 'a', $i ) );
 		$datemeridiem_capital = $wp_locale->get_meridiem( date( 'A', $i ) );
-		$dateformatstring = ' '.$dateformatstring;
-		$dateformatstring = preg_replace( "/([^\\\])D/", "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring );
-		$dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring );
-		$dateformatstring = preg_replace( "/([^\\\])l/", "\\1" . backslashit( $dateweekday ), $dateformatstring );
-		$dateformatstring = preg_replace( "/([^\\\])M/", "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
-		$dateformatstring = preg_replace( "/([^\\\])a/", "\\1" . backslashit( $datemeridiem ), $dateformatstring );
-		$dateformatstring = preg_replace( "/([^\\\])A/", "\\1" . backslashit( $datemeridiem_capital ), $dateformatstring );
+		$dateformatstring = ' ' . $dateformatstring;
+		$dateformatstring = preg_replace( '/([^\\\])D/', "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring );
+		$dateformatstring = preg_replace( '/([^\\\])F/', "\\1" . backslashit( $datemonth ), $dateformatstring );
+		$dateformatstring = preg_replace( '/([^\\\])l/', "\\1" . backslashit( $dateweekday ), $dateformatstring );
+		$dateformatstring = preg_replace( '/([^\\\])M/', "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
+		$dateformatstring = preg_replace( '/([^\\\])a/', "\\1" . backslashit( $datemeridiem ), $dateformatstring );
+		$dateformatstring = preg_replace( '/([^\\\])A/', "\\1" . backslashit( $datemeridiem_capital ), $dateformatstring );
 
 		$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
 	}
@@ -127,7 +130,7 @@
 			foreach ( $timezone_formats as $timezone_format ) {
 				if ( false !== strpos( $dateformatstring, $timezone_format ) ) {
 					$formatted = date_format( $date_object, $timezone_format );
-					$dateformatstring = ' '.$dateformatstring;
+					$dateformatstring = ' ' . $dateformatstring;
 					$dateformatstring = preg_replace( "/([^\\\])$timezone_format/", "\\1" . backslashit( $formatted ), $dateformatstring );
 					$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
 				}
@@ -298,11 +301,13 @@
 	// The day of the week from the timestamp.
 	$weekday = date( 'w', $day );
 
-	if ( !is_numeric($start_of_week) )
+	if ( ! is_numeric( $start_of_week ) ) {
 		$start_of_week = get_option( 'start_of_week' );
+	}
 
-	if ( $weekday < $start_of_week )
+	if ( $weekday < $start_of_week ) {
 		$weekday += 7;
+	}
 
 	// The most recent week start day on or before $day.
 	$start = $day - DAY_IN_SECONDS * ( $weekday - $start_of_week );
@@ -321,8 +326,9 @@
  * @return mixed Unserialized data can be any type.
  */
 function maybe_unserialize( $original ) {
-	if ( is_serialized( $original ) ) // don't attempt to unserialize data that wasn't serialized going in
+	if ( is_serialized( $original ) ) { // don't attempt to unserialize data that wasn't serialized going in
 		return @unserialize( $original );
+	}
 	return $original;
 }
 
@@ -344,7 +350,7 @@
 		return false;
 	}
 	$data = trim( $data );
- 	if ( 'N;' == $data ) {
+	if ( 'N;' == $data ) {
 		return true;
 	}
 	if ( strlen( $data ) < 4 ) {
@@ -362,13 +368,16 @@
 		$semicolon = strpos( $data, ';' );
 		$brace     = strpos( $data, '}' );
 		// Either ; or } must exist.
-		if ( false === $semicolon && false === $brace )
+		if ( false === $semicolon && false === $brace ) {
 			return false;
+		}
 		// But neither must be in the first X characters.
-		if ( false !== $semicolon && $semicolon < 3 )
+		if ( false !== $semicolon && $semicolon < 3 ) {
 			return false;
-		if ( false !== $brace && $brace < 4 )
+		}
+		if ( false !== $brace && $brace < 4 ) {
 			return false;
+		}
 	}
 	$token = $data[0];
 	switch ( $token ) {
@@ -431,14 +440,16 @@
  * @return mixed A scalar data
  */
 function maybe_serialize( $data ) {
-	if ( is_array( $data ) || is_object( $data ) )
+	if ( is_array( $data ) || is_object( $data ) ) {
 		return serialize( $data );
+	}
 
 	// Double serialization is required for backward compatibility.
 	// See https://core.trac.wordpress.org/ticket/12930
 	// Also the world will end. See WP 3.6.1.
-	if ( is_serialized( $data, false ) )
+	if ( is_serialized( $data, false ) ) {
 		return serialize( $data );
+	}
 
 	return $data;
 }
@@ -517,16 +528,16 @@
 function wp_extract_urls( $content ) {
 	preg_match_all(
 		"#([\"']?)("
-			. "(?:([\w-]+:)?//?)"
-			. "[^\s()<>]+"
-			. "[.]"
-			. "(?:"
-				. "\([\w\d]+\)|"
-				. "(?:"
+			. '(?:([\w-]+:)?//?)'
+			. '[^\s()<>]+'
+			. '[.]'
+			. '(?:'
+				. '\([\w\d]+\)|'
+				. '(?:'
 					. "[^`!()\[\]{};:'\".,<>«»“”‘’\s]|"
-					. "(?:[:]\d+)?/?"
-				. ")+"
-			. ")"
+					. '(?:[:]\d+)?/?'
+				. ')+'
+			. ')'
 		. ")\\1#",
 		$content,
 		$post_links
@@ -565,21 +576,24 @@
 
 	foreach ( $pung as $link_test ) {
 		if ( ! in_array( $link_test, $post_links_temp ) ) { // link no longer in post
-			$mids = $wpdb->get_col( $wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $link_test ) . '%') );
-			foreach ( $mids as $mid )
+			$mids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $link_test ) . '%' ) );
+			foreach ( $mids as $mid ) {
 				delete_metadata_by_mid( 'post', $mid );
+			}
 		}
 	}
 
 	foreach ( (array) $post_links_temp as $link_test ) {
-		if ( !in_array( $link_test, $pung ) ) { // If we haven't pung it already
+		if ( ! in_array( $link_test, $pung ) ) { // If we haven't pung it already
 			$test = @parse_url( $link_test );
-			if ( false === $test )
+			if ( false === $test ) {
 				continue;
-			if ( isset( $test['query'] ) )
+			}
+			if ( isset( $test['query'] ) ) {
 				$post_links[] = $link_test;
-			elseif ( isset($test['path']) && ( $test['path'] != '/' ) &&  ($test['path'] != '' ) )
+			} elseif ( isset( $test['path'] ) && ( $test['path'] != '/' ) &&  ($test['path'] != '' ) ) {
 				$post_links[] = $link_test;
+			}
 		}
 	}
 
@@ -597,9 +611,9 @@
 	$post_links = apply_filters( 'enclosure_links', $post_links, $post_ID );
 
 	foreach ( (array) $post_links as $url ) {
-		if ( $url != '' && !$wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $url ) . '%' ) ) ) {
+		if ( $url != '' && ! $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $url ) . '%' ) ) ) {
 
-			if ( $headers = wp_get_http_headers( $url) ) {
+			if ( $headers = wp_get_http_headers( $url ) ) {
 				$len = isset( $headers['content-length'] ) ? (int) $headers['content-length'] : 0;
 				$type = isset( $headers['content-type'] ) ? $headers['content-type'] : '';
 				$allowed_types = array( 'video', 'audio' );
@@ -609,7 +623,7 @@
 				$url_parts = @parse_url( $url );
 				if ( false !== $url_parts ) {
 					$extension = pathinfo( $url_parts['path'], PATHINFO_EXTENSION );
-					if ( !empty( $extension ) ) {
+					if ( ! empty( $extension ) ) {
 						foreach ( wp_get_mime_types() as $exts => $mime ) {
 							if ( preg_match( '!^(' . $exts . ')$!i', $extension ) ) {
 								$type = $mime;
@@ -619,7 +633,7 @@
 					}
 				}
 
-				if ( in_array( substr( $type, 0, strpos( $type, "/" ) ), $allowed_types ) ) {
+				if ( in_array( substr( $type, 0, strpos( $type, '/' ) ), $allowed_types ) ) {
 					add_post_meta( $post_ID, 'enclosure', "$url\n$len\n$mime\n" );
 				}
 			}
@@ -637,13 +651,15 @@
  * @return bool|string False on failure, headers on success.
  */
 function wp_get_http_headers( $url, $deprecated = false ) {
-	if ( !empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '2.7.0' );
+	}
 
 	$response = wp_safe_remote_head( $url );
 
-	if ( is_wp_error( $response ) )
+	if ( is_wp_error( $response ) ) {
 		return false;
+	}
 
 	return wp_remote_retrieve_headers( $response );
 }
@@ -661,10 +677,10 @@
  */
 function is_new_day() {
 	global $currentday, $previousday;
-	if ( $currentday != $previousday )
+	if ( $currentday != $previousday ) {
 		return 1;
-	else
-		return 0;
+	} else { return 0;
+	}
 }
 
 /**
@@ -708,29 +724,34 @@
 	$ret = array();
 
 	foreach ( (array) $data as $k => $v ) {
-		if ( $urlencode)
-			$k = urlencode($k);
-		if ( is_int($k) && $prefix != null )
-			$k = $prefix.$k;
-		if ( !empty($key) )
+		if ( $urlencode ) {
+			$k = urlencode( $k );
+		}
+		if ( is_int( $k ) && $prefix != null ) {
+			$k = $prefix . $k;
+		}
+		if ( ! empty( $key ) ) {
 			$k = $key . '%5B' . $k . '%5D';
-		if ( $v === null )
+		}
+		if ( $v === null ) {
 			continue;
-		elseif ( $v === false )
+		} elseif ( $v === false ) {
 			$v = '0';
+		}
 
-		if ( is_array($v) || is_object($v) )
-			array_push($ret,_http_build_query($v, '', $sep, $k, $urlencode));
-		elseif ( $urlencode )
-			array_push($ret, $k.'='.urlencode($v));
-		else
-			array_push($ret, $k.'='.$v);
+		if ( is_array( $v ) || is_object( $v ) ) {
+			array_push( $ret,_http_build_query( $v, '', $sep, $k, $urlencode ) );
+		} elseif ( $urlencode ) {
+			array_push( $ret, $k . '=' . urlencode( $v ) );
+		} else { array_push( $ret, $k . '=' . $v );
+		}
 	}
 
-	if ( null === $sep )
-		$sep = ini_get('arg_separator.output');
+	if ( null === $sep ) {
+		$sep = ini_get( 'arg_separator.output' );
+	}
 
-	return implode($sep, $ret);
+	return implode( $sep, $ret );
 }
 
 /**
@@ -771,21 +792,21 @@
 function add_query_arg() {
 	$args = func_get_args();
 	if ( is_array( $args[0] ) ) {
-		if ( count( $args ) < 2 || false === $args[1] )
+		if ( count( $args ) < 2 || false === $args[1] ) {
 			$uri = $_SERVER['REQUEST_URI'];
-		else
-			$uri = $args[1];
+		} else { $uri = $args[1];
+		}
 	} else {
-		if ( count( $args ) < 3 || false === $args[2] )
+		if ( count( $args ) < 3 || false === $args[2] ) {
 			$uri = $_SERVER['REQUEST_URI'];
-		else
-			$uri = $args[2];
+		} else { $uri = $args[2];
+		}
 	}
 
-	if ( $frag = strstr( $uri, '#' ) )
+	if ( $frag = strstr( $uri, '#' ) ) {
 		$uri = substr( $uri, 0, -strlen( $frag ) );
-	else
-		$frag = '';
+	} else { $frag = '';
+	}
 
 	if ( 0 === stripos( $uri, 'http://' ) ) {
 		$protocol = 'http://';
@@ -819,8 +840,9 @@
 	}
 
 	foreach ( $qs as $k => $v ) {
-		if ( $v === false )
-			unset( $qs[$k] );
+		if ( $v === false ) {
+			unset( $qs[ $k ] );
+		}
 	}
 
 	$ret = build_query( $qs );
@@ -842,8 +864,9 @@
  */
 function remove_query_arg( $key, $query = false ) {
 	if ( is_array( $key ) ) { // removing multiple keys
-		foreach ( $key as $k )
+		foreach ( $key as $k ) {
 			$query = add_query_arg( $k, false, $query );
+		}
 		return $query;
 	}
 	return add_query_arg( $key, false, $query );
@@ -904,9 +927,9 @@
 function add_magic_quotes( $array ) {
 	foreach ( (array) $array as $k => $v ) {
 		if ( is_array( $v ) ) {
-			$array[$k] = add_magic_quotes( $v );
+			$array[ $k ] = add_magic_quotes( $v );
 		} else {
-			$array[$k] = addslashes( $v );
+			$array[ $k ] = addslashes( $v );
 		}
 	}
 	return $array;
@@ -925,16 +948,18 @@
 function wp_remote_fopen( $uri ) {
 	$parsed_url = @parse_url( $uri );
 
-	if ( !$parsed_url || !is_array( $parsed_url ) )
+	if ( ! $parsed_url || ! is_array( $parsed_url ) ) {
 		return false;
+	}
 
 	$options = array();
 	$options['timeout'] = 10;
 
 	$response = wp_safe_remote_get( $uri, $options );
 
-	if ( is_wp_error( $response ) )
+	if ( is_wp_error( $response ) ) {
 		return false;
+	}
 
 	return wp_remote_retrieve_body( $response );
 }
@@ -954,8 +979,9 @@
 	global $wp, $wp_query, $wp_the_query;
 	$wp->main( $query_vars );
 
-	if ( !isset($wp_the_query) )
+	if ( ! isset( $wp_the_query ) ) {
 		$wp_the_query = $wp_query;
+	}
 }
 
 /**
@@ -973,7 +999,7 @@
 
 	$code = absint( $code );
 
-	if ( !isset( $wp_header_to_desc ) ) {
+	if ( ! isset( $wp_header_to_desc ) ) {
 		$wp_header_to_desc = array(
 			100 => 'Continue',
 			101 => 'Switching Protocols',
@@ -1039,12 +1065,12 @@
 			510 => 'Not Extended',
 			511 => 'Network Authentication Required',
 		);
-	}
+	}// End if().
 
-	if ( isset( $wp_header_to_desc[$code] ) )
-		return $wp_header_to_desc[$code];
-	else
-		return '';
+	if ( isset( $wp_header_to_desc[ $code ] ) ) {
+		return $wp_header_to_desc[ $code ];
+	} else { return '';
+	}
 }
 
 /**
@@ -1069,7 +1095,7 @@
 
 	$protocol = wp_get_server_protocol();
 	$status_header = "$protocol $code $description";
-	if ( function_exists( 'apply_filters' ) )
+	if ( function_exists( 'apply_filters' ) ) {
 
 		/**
 		 * Filters an HTTP status header.
@@ -1082,6 +1108,7 @@
 		 * @param string $protocol      Server protocol.
 		 */
 		$status_header = apply_filters( 'status_header', $status_header, $code, $description, $protocol );
+	}
 
 	@header( $status_header, true, $code );
 }
@@ -1102,7 +1129,7 @@
 		'Cache-Control' => 'no-cache, must-revalidate, max-age=0',
 	);
 
-	if ( function_exists('apply_filters') ) {
+	if ( function_exists( 'apply_filters' ) ) {
 		/**
 		 * Filters the cache-controlling headers.
 		 *
@@ -1153,8 +1180,9 @@
 		}
 	}
 
-	foreach ( $headers as $name => $field_value )
-		@header("{$name}: {$field_value}");
+	foreach ( $headers as $name => $field_value ) {
+		@header( "{$name}: {$field_value}" );
+	}
 }
 
 /**
@@ -1165,9 +1193,9 @@
 function cache_javascript_headers() {
 	$expiresOffset = 10 * DAY_IN_SECONDS;
 
-	header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) );
-	header( "Vary: Accept-Encoding" ); // Handle proxies
-	header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $expiresOffset ) . " GMT" );
+	header( 'Content-Type: text/javascript; charset=' . get_bloginfo( 'charset' ) );
+	header( 'Vary: Accept-Encoding' ); // Handle proxies
+	header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expiresOffset ) . ' GMT' );
 }
 
 /**
@@ -1218,8 +1246,9 @@
 	// Remove the pad, if present.
 	$feed = preg_replace( '/^_+/', '', $feed );
 
-	if ( $feed == '' || $feed == 'feed' )
+	if ( $feed == '' || $feed == 'feed' ) {
 		$feed = get_default_feed();
+	}
 
 	if ( ! has_action( "do_feed_{$feed}" ) ) {
 		wp_die( __( 'ERROR: This is not a valid feed template.' ), '', array( 'response' => 404 ) );
@@ -1272,10 +1301,10 @@
  * @param bool $for_comments True for the comment feed, false for normal feed.
  */
 function do_feed_rss2( $for_comments ) {
-	if ( $for_comments )
+	if ( $for_comments ) {
 		load_template( ABSPATH . WPINC . '/feed-rss2-comments.php' );
-	else
-		load_template( ABSPATH . WPINC . '/feed-rss2.php' );
+	} else { load_template( ABSPATH . WPINC . '/feed-rss2.php' );
+	}
 }
 
 /**
@@ -1288,10 +1317,10 @@
  * @param bool $for_comments True for the comment feed, false for normal feed.
  */
 function do_feed_atom( $for_comments ) {
-	if ($for_comments)
-		load_template( ABSPATH . WPINC . '/feed-atom-comments.php');
-	else
-		load_template( ABSPATH . WPINC . '/feed-atom.php' );
+	if ( $for_comments ) {
+		load_template( ABSPATH . WPINC . '/feed-atom-comments.php' );
+	} else { load_template( ABSPATH . WPINC . '/feed-atom.php' );
+	}
 }
 
 /**
@@ -1318,7 +1347,7 @@
 		$output .= "Disallow: /\n";
 	} else {
 		$site_url = parse_url( site_url() );
-		$path = ( !empty( $site_url['path'] ) ) ? $site_url['path'] : '';
+		$path = ( ! empty( $site_url['path'] ) ) ? $site_url['path'] : '';
 		$output .= "Disallow: $path/wp-admin/\n";
 		$output .= "Allow: $path/wp-admin/admin-ajax.php\n";
 	}
@@ -1356,29 +1385,32 @@
 	 * Check cache first. If options table goes away and we have true
 	 * cached, oh well.
 	 */
-	if ( wp_cache_get( 'is_blog_installed' ) )
+	if ( wp_cache_get( 'is_blog_installed' ) ) {
 		return true;
+	}
 
 	$suppress = $wpdb->suppress_errors();
 	if ( ! wp_installing() ) {
 		$alloptions = wp_load_alloptions();
 	}
 	// If siteurl is not set to autoload, check it specifically
-	if ( !isset( $alloptions['siteurl'] ) )
+	if ( ! isset( $alloptions['siteurl'] ) ) {
 		$installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
-	else
-		$installed = $alloptions['siteurl'];
+	} else { $installed = $alloptions['siteurl'];
+	}
 	$wpdb->suppress_errors( $suppress );
 
-	$installed = !empty( $installed );
+	$installed = ! empty( $installed );
 	wp_cache_set( 'is_blog_installed', $installed );
 
-	if ( $installed )
+	if ( $installed ) {
 		return true;
+	}
 
 	// If visiting repair.php, return true and let it take over.
-	if ( defined( 'WP_REPAIRING' ) )
+	if ( defined( 'WP_REPAIRING' ) ) {
 		return true;
+	}
 
 	$suppress = $wpdb->suppress_errors();
 
@@ -1390,13 +1422,16 @@
 	$wp_tables = $wpdb->tables();
 	foreach ( $wp_tables as $table ) {
 		// The existence of custom user tables shouldn't suggest an insane state or prevent a clean install.
-		if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table )
+		if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table ) {
 			continue;
-		if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table )
+		}
+		if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table ) {
 			continue;
+		}
 
-		if ( ! $wpdb->get_results( "DESCRIBE $table;" ) )
+		if ( ! $wpdb->get_results( "DESCRIBE $table;" ) ) {
 			continue;
+		}
 
 		// One or more tables exist. We are insane.
 
@@ -1460,15 +1495,17 @@
  * @param bool       $echo    Optional. Whether to display or return hidden form field. Default true.
  * @return string Nonce field HTML markup.
  */
-function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true ) {
+function wp_nonce_field( $action = -1, $name = '_wpnonce', $referer = true, $echo = true ) {
 	$name = esc_attr( $name );
 	$nonce_field = '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />';
 
-	if ( $referer )
+	if ( $referer ) {
 		$nonce_field .= wp_referer_field( false );
+	}
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $nonce_field;
+	}
 
 	return $nonce_field;
 }
@@ -1485,10 +1522,11 @@
  * @return string Referer field HTML markup.
  */
 function wp_referer_field( $echo = true ) {
-	$referer_field = '<input type="hidden" name="_wp_http_referer" value="'. esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
+	$referer_field = '<input type="hidden" name="_wp_http_referer" value="' . esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $referer_field;
+	}
 	return $referer_field;
 }
 
@@ -1511,8 +1549,9 @@
 		$ref = 'previous' == $jump_back_to ? wp_get_referer() : wp_unslash( $_SERVER['REQUEST_URI'] );
 	}
 	$orig_referer_field = '<input type="hidden" name="_wp_original_http_referer" value="' . esc_attr( $ref ) . '" />';
-	if ( $echo )
+	if ( $echo ) {
 		echo $orig_referer_field;
+	}
 	return $orig_referer_field;
 }
 
@@ -1551,7 +1590,7 @@
 function wp_get_raw_referer() {
 	if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
 		return wp_unslash( $_REQUEST['_wp_http_referer'] );
-	} else if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
+	} elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
 		return wp_unslash( $_SERVER['HTTP_REFERER'] );
 	}
 
@@ -1566,8 +1605,9 @@
  * @return string|false False if no original referer or original referer if set.
  */
 function wp_get_original_referer() {
-	if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) )
+	if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) ) {
 		return wp_validate_redirect( wp_unslash( $_REQUEST['_wp_original_http_referer'] ), false );
+	}
 	return false;
 }
 
@@ -1601,12 +1641,14 @@
 	 * Safe mode fails with a trailing slash under certain PHP versions.
 	 * Use rtrim() instead of untrailingslashit to avoid formatting.php dependency.
 	 */
-	$target = rtrim($target, '/');
-	if ( empty($target) )
+	$target = rtrim( $target, '/' );
+	if ( empty( $target ) ) {
 		$target = '/';
+	}
 
-	if ( file_exists( $target ) )
+	if ( file_exists( $target ) ) {
 		return @is_dir( $target );
+	}
 
 	// We need to find the permissions of the parent folder that exists and inherit that.
 	$target_parent = dirname( $target );
@@ -1655,15 +1697,18 @@
 	 * This is definitive if true but fails if $path does not exist or contains
 	 * a symbolic link.
 	 */
-	if ( realpath($path) == $path )
+	if ( realpath( $path ) == $path ) {
 		return true;
+	}
 
-	if ( strlen($path) == 0 || $path[0] == '.' )
+	if ( strlen( $path ) == 0 || $path[0] == '.' ) {
 		return false;
+	}
 
 	// Windows allows absolute paths like this.
-	if ( preg_match('#^[a-zA-Z]:\\\\#', $path) )
+	if ( preg_match( '#^[a-zA-Z]:\\\\#', $path ) ) {
 		return true;
+	}
 
 	// A path starting with / or \ is absolute; anything else is relative.
 	return ( $path[0] == '/' || $path[0] == '\\' );
@@ -1682,10 +1727,11 @@
  * @return string The path with the base or absolute path.
  */
 function path_join( $base, $path ) {
-	if ( path_is_absolute($path) )
+	if ( path_is_absolute( $path ) ) {
 		return $path;
+	}
 
-	return rtrim($base, '/') . '/' . ltrim($path, '/');
+	return rtrim( $base, '/' ) . '/' . ltrim( $path, '/' );
 }
 
 /**
@@ -1730,25 +1776,30 @@
  */
 function get_temp_dir() {
 	static $temp = '';
-	if ( defined('WP_TEMP_DIR') )
-		return trailingslashit(WP_TEMP_DIR);
+	if ( defined( 'WP_TEMP_DIR' ) ) {
+		return trailingslashit( WP_TEMP_DIR );
+	}
 
-	if ( $temp )
+	if ( $temp ) {
 		return trailingslashit( $temp );
+	}
 
-	if ( function_exists('sys_get_temp_dir') ) {
+	if ( function_exists( 'sys_get_temp_dir' ) ) {
 		$temp = sys_get_temp_dir();
-		if ( @is_dir( $temp ) && wp_is_writable( $temp ) )
+		if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) {
 			return trailingslashit( $temp );
+		}
 	}
 
-	$temp = ini_get('upload_tmp_dir');
-	if ( @is_dir( $temp ) && wp_is_writable( $temp ) )
+	$temp = ini_get( 'upload_tmp_dir' );
+	if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) {
 		return trailingslashit( $temp );
+	}
 
 	$temp = WP_CONTENT_DIR . '/';
-	if ( is_dir( $temp ) && wp_is_writable( $temp ) )
+	if ( is_dir( $temp ) && wp_is_writable( $temp ) ) {
 		return $temp;
+	}
 
 	return '/tmp/';
 }
@@ -1767,10 +1818,10 @@
  * @return bool Whether the path is writable.
  */
 function wp_is_writable( $path ) {
-	if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) )
+	if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
 		return win_is_writable( $path );
-	else
-		return @is_writable( $path );
+	} else { return @is_writable( $path );
+	}
 }
 
 /**
@@ -1791,19 +1842,21 @@
  */
 function win_is_writable( $path ) {
 
-	if ( $path[strlen( $path ) - 1] == '/' ) { // if it looks like a directory, check a random file within the directory
-		return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp');
+	if ( $path[ strlen( $path ) - 1 ] == '/' ) { // if it looks like a directory, check a random file within the directory
+		return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp' );
 	} elseif ( is_dir( $path ) ) { // If it's a directory (and not a file) check a random file within the directory
 		return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' );
 	}
 	// check tmp file for read/write capabilities
-	$should_delete_tmp_file = !file_exists( $path );
+	$should_delete_tmp_file = ! file_exists( $path );
 	$f = @fopen( $path, 'a' );
-	if ( $f === false )
+	if ( $f === false ) {
 		return false;
+	}
 	fclose( $f );
-	if ( $should_delete_tmp_file )
+	if ( $should_delete_tmp_file ) {
 		unlink( $path );
+	}
 	return true;
 }
 
@@ -1928,11 +1981,11 @@
 		$dir = $upload_path;
 	}
 
-	if ( !$url = get_option( 'upload_url_path' ) ) {
-		if ( empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) )
+	if ( ! $url = get_option( 'upload_url_path' ) ) {
+		if ( empty( $upload_path ) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) ) {
 			$url = WP_CONTENT_URL . '/uploads';
-		else
-			$url = trailingslashit( $siteurl ) . $upload_path;
+		} else { $url = trailingslashit( $siteurl ) . $upload_path;
+		}
 	}
 
 	/*
@@ -1957,10 +2010,10 @@
 			 * had wp-content/uploads for the main site.)
 			 */
 
-			if ( defined( 'MULTISITE' ) )
+			if ( defined( 'MULTISITE' ) ) {
 				$ms_dir = '/sites/' . get_current_blog_id();
-			else
-				$ms_dir = '/' . get_current_blog_id();
+			} else { $ms_dir = '/' . get_current_blog_id();
+			}
 
 			$dir .= $ms_dir;
 			$url .= $ms_dir;
@@ -1980,13 +2033,13 @@
 			 * rewriting in multisite, the resulting URL is /files. (#WP22702 for background.)
 			 */
 
-			if ( defined( 'BLOGUPLOADDIR' ) )
+			if ( defined( 'BLOGUPLOADDIR' ) ) {
 				$dir = untrailingslashit( BLOGUPLOADDIR );
-			else
-				$dir = ABSPATH . UPLOADS;
+			} else { $dir = ABSPATH . UPLOADS;
+			}
 			$url = trailingslashit( $siteurl ) . 'files';
-		}
-	}
+		}// End if().
+	}// End if().
 
 	$basedir = $dir;
 	$baseurl = $url;
@@ -1994,8 +2047,9 @@
 	$subdir = '';
 	if ( get_option( 'uploads_use_yearmonth_folders' ) ) {
 		// Generate the yearly and monthly dirs
-		if ( !$time )
+		if ( ! $time ) {
 			$time = current_time( 'mysql' );
+		}
 		$y = substr( $time, 0, 4 );
 		$m = substr( $time, 5, 2 );
 		$subdir = "/$y/$m";
@@ -2033,7 +2087,7 @@
  */
 function wp_unique_filename( $dir, $filename, $unique_filename_callback = null ) {
 	// Sanitize the file name before we begin processing.
-	$filename = sanitize_file_name($filename);
+	$filename = sanitize_file_name( $filename );
 
 	// Separate the filename into a name and extension.
 	$ext = pathinfo( $filename, PATHINFO_EXTENSION );
@@ -2057,12 +2111,12 @@
 		$number = '';
 
 		// Change '.ext' to lower case.
-		if ( $ext && strtolower($ext) != $ext ) {
-			$ext2 = strtolower($ext);
-			$filename2 = preg_replace( '|' . preg_quote($ext) . '$|', $ext2, $filename );
+		if ( $ext && strtolower( $ext ) != $ext ) {
+			$ext2 = strtolower( $ext );
+			$filename2 = preg_replace( '|' . preg_quote( $ext ) . '$|', $ext2, $filename );
 
 			// Check for both lower and upper case extension or image sub-sizes may be overwritten.
-			while ( file_exists($dir . "/$filename") || file_exists($dir . "/$filename2") ) {
+			while ( file_exists( $dir . "/$filename" ) || file_exists( $dir . "/$filename2" ) ) {
 				$new_number = (int) $number + 1;
 				$filename = str_replace( array( "-$number$ext", "$number$ext" ), "-$new_number$ext", $filename );
 				$filename2 = str_replace( array( "-$number$ext2", "$number$ext2" ), "-$new_number$ext2", $filename2 );
@@ -2087,11 +2141,11 @@
 			if ( '' == "$number$ext" ) {
 				$filename = "$filename-" . $new_number;
 			} else {
-				$filename = str_replace( array( "-$number$ext", "$number$ext" ), "-" . $new_number . $ext, $filename );
+				$filename = str_replace( array( "-$number$ext", "$number$ext" ), '-' . $new_number . $ext, $filename );
 			}
 			$number = $new_number;
 		}
-	}
+	}// End if().
 
 	/** This filter is documented in wp-includes/functions.php */
 	return apply_filters( 'wp_unique_filename', $filename, $ext, $dir, $unique_filename_callback );
@@ -2121,20 +2175,24 @@
  * @return array
  */
 function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
-	if ( !empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '2.0.0' );
+	}
 
-	if ( empty( $name ) )
+	if ( empty( $name ) ) {
 		return array( 'error' => __( 'Empty filename' ) );
+	}
 
 	$wp_filetype = wp_check_filetype( $name );
-	if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) )
+	if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) ) {
 		return array( 'error' => __( 'Sorry, this file type is not permitted for security reasons.' ) );
+	}
 
 	$upload = wp_upload_dir( $time );
 
-	if ( $upload['error'] !== false )
+	if ( $upload['error'] !== false ) {
 		return $upload;
+	}
 
 	/**
 	 * Filters whether to treat the upload bits as an error.
@@ -2147,8 +2205,8 @@
 	 * @param mixed $upload_bits_error An array of upload bits data, or a non-array error to return.
 	 */
 	$upload_bits_error = apply_filters( 'wp_upload_bits', array( 'name' => $name, 'bits' => $bits, 'time' => $time ) );
-	if ( !is_array( $upload_bits_error ) ) {
-		$upload[ 'error' ] = $upload_bits_error;
+	if ( ! is_array( $upload_bits_error ) ) {
+		$upload['error'] = $upload_bits_error;
 		return $upload;
 	}
 
@@ -2156,10 +2214,10 @@
 
 	$new_file = $upload['path'] . "/$filename";
 	if ( ! wp_mkdir_p( dirname( $new_file ) ) ) {
-		if ( 0 === strpos( $upload['basedir'], ABSPATH ) )
+		if ( 0 === strpos( $upload['basedir'], ABSPATH ) ) {
 			$error_path = str_replace( ABSPATH, '', $upload['basedir'] ) . $upload['subdir'];
-		else
-			$error_path = basename( $upload['basedir'] ) . $upload['subdir'];
+		} else { $error_path = basename( $upload['basedir'] ) . $upload['subdir'];
+		}
 
 		$message = sprintf(
 			/* translators: %s: directory path */
@@ -2170,8 +2228,9 @@
 	}
 
 	$ifp = @ fopen( $new_file, 'wb' );
-	if ( ! $ifp )
+	if ( ! $ifp ) {
 		return array( 'error' => sprintf( __( 'Could not write file %s' ), $new_file ) );
+	}
 
 	@fwrite( $ifp, $bits );
 	fclose( $ifp );
@@ -2203,9 +2262,11 @@
 	$ext = strtolower( $ext );
 
 	$ext2type = wp_get_ext_types();
-	foreach ( $ext2type as $type => $exts )
-		if ( in_array( $ext, $exts ) )
+	foreach ( $ext2type as $type => $exts ) {
+		if ( in_array( $ext, $exts ) ) {
 			return $type;
+		}
+	}
 }
 
 /**
@@ -2220,8 +2281,9 @@
  * @return array Values with extension first and mime type.
  */
 function wp_check_filetype( $filename, $mimes = null ) {
-	if ( empty($mimes) )
+	if ( empty( $mimes ) ) {
 		$mimes = get_allowed_mime_types();
+	}
 	$type = false;
 	$ext = false;
 
@@ -2312,7 +2374,7 @@
 				$real_mime = false;
 			}
 		}
-	}
+	}// End if().
 
 	// Validate files that didn't get validated during previous checks.
 	if ( $type && ! $real_mime && extension_loaded( 'fileinfo' ) ) {
@@ -2403,105 +2465,105 @@
 	 *                                 corresponding to those types.
 	 */
 	return apply_filters( 'mime_types', array(
-	// Image formats.
-	'jpg|jpeg|jpe' => 'image/jpeg',
-	'gif' => 'image/gif',
-	'png' => 'image/png',
-	'bmp' => 'image/bmp',
-	'tiff|tif' => 'image/tiff',
-	'ico' => 'image/x-icon',
-	// Video formats.
-	'asf|asx' => 'video/x-ms-asf',
-	'wmv' => 'video/x-ms-wmv',
-	'wmx' => 'video/x-ms-wmx',
-	'wm' => 'video/x-ms-wm',
-	'avi' => 'video/avi',
-	'divx' => 'video/divx',
-	'flv' => 'video/x-flv',
-	'mov|qt' => 'video/quicktime',
-	'mpeg|mpg|mpe' => 'video/mpeg',
-	'mp4|m4v' => 'video/mp4',
-	'ogv' => 'video/ogg',
-	'webm' => 'video/webm',
-	'mkv' => 'video/x-matroska',
-	'3gp|3gpp' => 'video/3gpp', // Can also be audio
-	'3g2|3gp2' => 'video/3gpp2', // Can also be audio
-	// Text formats.
-	'txt|asc|c|cc|h|srt' => 'text/plain',
-	'csv' => 'text/csv',
-	'tsv' => 'text/tab-separated-values',
-	'ics' => 'text/calendar',
-	'rtx' => 'text/richtext',
-	'css' => 'text/css',
-	'htm|html' => 'text/html',
-	'vtt' => 'text/vtt',
-	'dfxp' => 'application/ttaf+xml',
-	// Audio formats.
-	'mp3|m4a|m4b' => 'audio/mpeg',
-	'ra|ram' => 'audio/x-realaudio',
-	'wav' => 'audio/wav',
-	'ogg|oga' => 'audio/ogg',
-	'mid|midi' => 'audio/midi',
-	'wma' => 'audio/x-ms-wma',
-	'wax' => 'audio/x-ms-wax',
-	'mka' => 'audio/x-matroska',
-	// Misc application formats.
-	'rtf' => 'application/rtf',
-	'js' => 'application/javascript',
-	'pdf' => 'application/pdf',
-	'swf' => 'application/x-shockwave-flash',
-	'class' => 'application/java',
-	'tar' => 'application/x-tar',
-	'zip' => 'application/zip',
-	'gz|gzip' => 'application/x-gzip',
-	'rar' => 'application/rar',
-	'7z' => 'application/x-7z-compressed',
-	'exe' => 'application/x-msdownload',
-	'psd' => 'application/octet-stream',
-	'xcf' => 'application/octet-stream',
-	// MS Office formats.
-	'doc' => 'application/msword',
-	'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
-	'wri' => 'application/vnd.ms-write',
-	'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
-	'mdb' => 'application/vnd.ms-access',
-	'mpp' => 'application/vnd.ms-project',
-	'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
-	'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
-	'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
-	'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
-	'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
-	'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
-	'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
-	'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
-	'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
-	'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
-	'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
-	'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
-	'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
-	'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
-	'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
-	'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
-	'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
-	'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
-	'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12',
-	'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote',
-	'oxps' => 'application/oxps',
-	'xps' => 'application/vnd.ms-xpsdocument',
-	// OpenOffice formats.
-	'odt' => 'application/vnd.oasis.opendocument.text',
-	'odp' => 'application/vnd.oasis.opendocument.presentation',
-	'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
-	'odg' => 'application/vnd.oasis.opendocument.graphics',
-	'odc' => 'application/vnd.oasis.opendocument.chart',
-	'odb' => 'application/vnd.oasis.opendocument.database',
-	'odf' => 'application/vnd.oasis.opendocument.formula',
-	// WordPerfect formats.
-	'wp|wpd' => 'application/wordperfect',
-	// iWork formats.
-	'key' => 'application/vnd.apple.keynote',
-	'numbers' => 'application/vnd.apple.numbers',
-	'pages' => 'application/vnd.apple.pages',
+		// Image formats.
+		'jpg|jpeg|jpe' => 'image/jpeg',
+		'gif' => 'image/gif',
+		'png' => 'image/png',
+		'bmp' => 'image/bmp',
+		'tiff|tif' => 'image/tiff',
+		'ico' => 'image/x-icon',
+		// Video formats.
+		'asf|asx' => 'video/x-ms-asf',
+		'wmv' => 'video/x-ms-wmv',
+		'wmx' => 'video/x-ms-wmx',
+		'wm' => 'video/x-ms-wm',
+		'avi' => 'video/avi',
+		'divx' => 'video/divx',
+		'flv' => 'video/x-flv',
+		'mov|qt' => 'video/quicktime',
+		'mpeg|mpg|mpe' => 'video/mpeg',
+		'mp4|m4v' => 'video/mp4',
+		'ogv' => 'video/ogg',
+		'webm' => 'video/webm',
+		'mkv' => 'video/x-matroska',
+		'3gp|3gpp' => 'video/3gpp', // Can also be audio
+		'3g2|3gp2' => 'video/3gpp2', // Can also be audio
+		// Text formats.
+		'txt|asc|c|cc|h|srt' => 'text/plain',
+		'csv' => 'text/csv',
+		'tsv' => 'text/tab-separated-values',
+		'ics' => 'text/calendar',
+		'rtx' => 'text/richtext',
+		'css' => 'text/css',
+		'htm|html' => 'text/html',
+		'vtt' => 'text/vtt',
+		'dfxp' => 'application/ttaf+xml',
+		// Audio formats.
+		'mp3|m4a|m4b' => 'audio/mpeg',
+		'ra|ram' => 'audio/x-realaudio',
+		'wav' => 'audio/wav',
+		'ogg|oga' => 'audio/ogg',
+		'mid|midi' => 'audio/midi',
+		'wma' => 'audio/x-ms-wma',
+		'wax' => 'audio/x-ms-wax',
+		'mka' => 'audio/x-matroska',
+		// Misc application formats.
+		'rtf' => 'application/rtf',
+		'js' => 'application/javascript',
+		'pdf' => 'application/pdf',
+		'swf' => 'application/x-shockwave-flash',
+		'class' => 'application/java',
+		'tar' => 'application/x-tar',
+		'zip' => 'application/zip',
+		'gz|gzip' => 'application/x-gzip',
+		'rar' => 'application/rar',
+		'7z' => 'application/x-7z-compressed',
+		'exe' => 'application/x-msdownload',
+		'psd' => 'application/octet-stream',
+		'xcf' => 'application/octet-stream',
+		// MS Office formats.
+		'doc' => 'application/msword',
+		'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
+		'wri' => 'application/vnd.ms-write',
+		'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
+		'mdb' => 'application/vnd.ms-access',
+		'mpp' => 'application/vnd.ms-project',
+		'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+		'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
+		'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+		'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
+		'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+		'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
+		'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
+		'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+		'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
+		'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
+		'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+		'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
+		'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+		'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
+		'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+		'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
+		'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
+		'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
+		'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12',
+		'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote',
+		'oxps' => 'application/oxps',
+		'xps' => 'application/vnd.ms-xpsdocument',
+		// OpenOffice formats.
+		'odt' => 'application/vnd.oasis.opendocument.text',
+		'odp' => 'application/vnd.oasis.opendocument.presentation',
+		'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+		'odg' => 'application/vnd.oasis.opendocument.graphics',
+		'odc' => 'application/vnd.oasis.opendocument.chart',
+		'odb' => 'application/vnd.oasis.opendocument.database',
+		'odf' => 'application/vnd.oasis.opendocument.formula',
+		// WordPerfect formats.
+		'wp|wpd' => 'application/wordperfect',
+		// iWork formats.
+		'key' => 'application/vnd.apple.keynote',
+		'numbers' => 'application/vnd.apple.numbers',
+		'pages' => 'application/vnd.apple.pages',
 	) );
 }
 
@@ -2550,11 +2612,13 @@
 	$t = wp_get_mime_types();
 
 	unset( $t['swf'], $t['exe'] );
-	if ( function_exists( 'current_user_can' ) )
+	if ( function_exists( 'current_user_can' ) ) {
 		$unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
+	}
 
-	if ( empty( $unfiltered ) )
+	if ( empty( $unfiltered ) ) {
 		unset( $t['htm|html'] );
+	}
 
 	/**
 	 * Filters list of allowed mime types and file extensions.
@@ -2697,26 +2761,27 @@
  */
 function _default_wp_die_handler( $message, $title = '', $args = array() ) {
 	$defaults = array( 'response' => 500 );
-	$r = wp_parse_args($args, $defaults);
+	$r = wp_parse_args( $args, $defaults );
 
-	$have_gettext = function_exists('__');
+	$have_gettext = function_exists( '__' );
 
 	if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) {
 		if ( empty( $title ) ) {
 			$error_data = $message->get_error_data();
-			if ( is_array( $error_data ) && isset( $error_data['title'] ) )
+			if ( is_array( $error_data ) && isset( $error_data['title'] ) ) {
 				$title = $error_data['title'];
+			}
 		}
 		$errors = $message->get_error_messages();
 		switch ( count( $errors ) ) {
-		case 0 :
-			$message = '';
+			case 0 :
+				$message = '';
 			break;
-		case 1 :
-			$message = "<p>{$errors[0]}</p>";
+			case 1 :
+				$message = "<p>{$errors[0]}</p>";
 			break;
-		default :
-			$message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>";
+			default :
+				$message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>";
 			break;
 		}
 	} elseif ( is_string( $message ) ) {
@@ -2724,30 +2789,34 @@
 	}
 
 	if ( isset( $r['back_link'] ) && $r['back_link'] ) {
-		$back_text = $have_gettext? __('&laquo; Back') : '&laquo; Back';
+		$back_text = $have_gettext? __( '&laquo; Back' ) : '&laquo; Back';
 		$message .= "\n<p><a href='javascript:history.back()'>$back_text</a></p>";
 	}
 
 	if ( ! did_action( 'admin_head' ) ) :
-		if ( !headers_sent() ) {
+		if ( ! headers_sent() ) {
 			status_header( $r['response'] );
 			nocache_headers();
 			header( 'Content-Type: text/html; charset=utf-8' );
 		}
 
-		if ( empty($title) )
-			$title = $have_gettext ? __('WordPress &rsaquo; Error') : 'WordPress &rsaquo; Error';
+		if ( empty( $title ) ) {
+			$title = $have_gettext ? __( 'WordPress &rsaquo; Error' ) : 'WordPress &rsaquo; Error';
+		}
 
 		$text_direction = 'ltr';
-		if ( isset($r['text_direction']) && 'rtl' == $r['text_direction'] )
+		if ( isset( $r['text_direction'] ) && 'rtl' == $r['text_direction'] ) {
 			$text_direction = 'rtl';
-		elseif ( function_exists( 'is_rtl' ) && is_rtl() )
+		} elseif ( function_exists( 'is_rtl' ) && is_rtl() ) {
 			$text_direction = 'rtl';
+		}
 ?>
 <!DOCTYPE html>
 <!-- Ticket #11289, IE bug fix: always pad the error page with enough characters such that it is greater than 512 bytes, even after gzip compression abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono
 -->
-<html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) language_attributes(); else echo "dir='$text_direction'"; ?>>
+<html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) { language_attributes();
+} else { echo "dir='$text_direction'";
+} ?>>
 <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<meta name="viewport" content="width=device-width">
@@ -2804,11 +2873,11 @@
 		}
 		a:focus {
 			color: #124964;
-		    -webkit-box-shadow:
-		    	0 0 0 1px #5b9dd9,
+			-webkit-box-shadow:
+				0 0 0 1px #5b9dd9,
 				0 0 2px 1px rgba(30, 140, 190, .8);
-		    box-shadow:
-		    	0 0 0 1px #5b9dd9,
+			box-shadow:
+				0 0 0 1px #5b9dd9,
 				0 0 2px 1px rgba(30, 140, 190, .8);
 			outline: none;
 		}
@@ -2834,7 +2903,7 @@
 
 			-webkit-box-shadow: 0 1px 0 #ccc;
 			box-shadow: 0 1px 0 #ccc;
-		 	vertical-align: top;
+			 vertical-align: top;
 		}
 
 		.button.button-large {
@@ -2860,11 +2929,11 @@
 		.button:active {
 			background: #eee;
 			border-color: #999;
-		 	-webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
-		 	box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
-		 	-webkit-transform: translateY(1px);
-		 	-ms-transform: translateY(1px);
-		 	transform: translateY(1px);
+			 -webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
+			 box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
+			 -webkit-transform: translateY(1px);
+			 -ms-transform: translateY(1px);
+			 transform: translateY(1px);
 		}
 
 		<?php
@@ -2901,10 +2970,10 @@
 	global $wp_xmlrpc_server;
 	$defaults = array( 'response' => 500 );
 
-	$r = wp_parse_args($args, $defaults);
+	$r = wp_parse_args( $args, $defaults );
 
 	if ( $wp_xmlrpc_server ) {
-		$error = new IXR_Error( $r['response'] , $message);
+		$error = new IXR_Error( $r['response'] , $message );
 		$wp_xmlrpc_server->output( $error->getXml() );
 	}
 	die();
@@ -2932,8 +3001,9 @@
 		status_header( $r['response'] );
 	}
 
-	if ( is_scalar( $message ) )
+	if ( is_scalar( $message ) ) {
 		die( (string) $message );
+	}
 	die( '0' );
 }
 
@@ -2948,8 +3018,9 @@
  * @param string $message Optional. Response to print. Default empty.
  */
 function _scalar_wp_die_handler( $message = '' ) {
-	if ( is_scalar( $message ) )
+	if ( is_scalar( $message ) ) {
 		die( (string) $message );
+	}
 	die();
 }
 
@@ -2986,7 +3057,7 @@
 	// If json_encode() was successful, no need to do more sanity checking.
 	// ... unless we're in an old version of PHP, and json_encode() returned
 	// a string containing 'null'. Then we need to do more sanity checking.
-	if ( false !== $json && ( version_compare( PHP_VERSION, '5.5', '>=' ) || false === strpos( $json, 'null' ) ) )  {
+	if ( false !== $json && ( version_compare( PHP_VERSION, '5.5', '>=' ) || false === strpos( $json, 'null' ) ) ) {
 		return $json;
 	}
 
@@ -3057,7 +3128,7 @@
 		return _wp_json_convert_string( $data );
 	} else {
 		return $data;
-	}
+	}// End if().
 
 	return $output;
 }
@@ -3182,8 +3253,9 @@
 function wp_send_json_success( $data = null, $status_code = null ) {
 	$response = array( 'success' => true );
 
-	if ( isset( $data ) )
+	if ( isset( $data ) ) {
 		$response['data'] = $data;
+	}
 
 	wp_send_json( $response, $status_code );
 }
@@ -3262,8 +3334,9 @@
  * @return string Homepage location.
  */
 function _config_wp_home( $url = '' ) {
-	if ( defined( 'WP_HOME' ) )
+	if ( defined( 'WP_HOME' ) ) {
 		return untrailingslashit( WP_HOME );
+	}
 	return $url;
 }
 
@@ -3283,8 +3356,9 @@
  * @return string The WordPress Site URL.
  */
 function _config_wp_siteurl( $url = '' ) {
-	if ( defined( 'WP_SITEURL' ) )
+	if ( defined( 'WP_SITEURL' ) ) {
 		return untrailingslashit( WP_SITEURL );
+	}
 	return $url;
 }
 
@@ -3359,10 +3433,11 @@
 	global $wpsmiliestrans, $wp_smiliessearch;
 
 	// don't bother setting up smilies if they are disabled
-	if ( !get_option( 'use_smilies' ) )
+	if ( ! get_option( 'use_smilies' ) ) {
 		return;
+	}
 
-	if ( !isset( $wpsmiliestrans ) ) {
+	if ( ! isset( $wpsmiliestrans ) ) {
 		$wpsmiliestrans = array(
 		':mrgreen:' => 'mrgreen.png',
 		':neutral:' => "\xf0\x9f\x98\x90",
@@ -3370,7 +3445,7 @@
 		  ':arrow:' => "\xe2\x9e\xa1",
 		  ':shock:' => "\xf0\x9f\x98\xaf",
 		  ':smile:' => "\xf0\x9f\x99\x82",
-		    ':???:' => "\xf0\x9f\x98\x95",
+			':???:' => "\xf0\x9f\x98\x95",
 		   ':cool:' => "\xf0\x9f\x98\x8e",
 		   ':evil:' => "\xf0\x9f\x91\xbf",
 		   ':grin:' => "\xf0\x9f\x98\x80",
@@ -3379,38 +3454,38 @@
 		   ':razz:' => "\xf0\x9f\x98\x9b",
 		   ':roll:' => "\xf0\x9f\x99\x84",
 		   ':wink:' => "\xf0\x9f\x98\x89",
-		    ':cry:' => "\xf0\x9f\x98\xa5",
-		    ':eek:' => "\xf0\x9f\x98\xae",
-		    ':lol:' => "\xf0\x9f\x98\x86",
-		    ':mad:' => "\xf0\x9f\x98\xa1",
-		    ':sad:' => "\xf0\x9f\x99\x81",
-		      '8-)' => "\xf0\x9f\x98\x8e",
-		      '8-O' => "\xf0\x9f\x98\xaf",
-		      ':-(' => "\xf0\x9f\x99\x81",
-		      ':-)' => "\xf0\x9f\x99\x82",
-		      ':-?' => "\xf0\x9f\x98\x95",
-		      ':-D' => "\xf0\x9f\x98\x80",
-		      ':-P' => "\xf0\x9f\x98\x9b",
-		      ':-o' => "\xf0\x9f\x98\xae",
-		      ':-x' => "\xf0\x9f\x98\xa1",
-		      ':-|' => "\xf0\x9f\x98\x90",
-		      ';-)' => "\xf0\x9f\x98\x89",
+			':cry:' => "\xf0\x9f\x98\xa5",
+			':eek:' => "\xf0\x9f\x98\xae",
+			':lol:' => "\xf0\x9f\x98\x86",
+			':mad:' => "\xf0\x9f\x98\xa1",
+			':sad:' => "\xf0\x9f\x99\x81",
+			  '8-)' => "\xf0\x9f\x98\x8e",
+			  '8-O' => "\xf0\x9f\x98\xaf",
+			  ':-(' => "\xf0\x9f\x99\x81",
+			  ':-)' => "\xf0\x9f\x99\x82",
+			  ':-?' => "\xf0\x9f\x98\x95",
+			  ':-D' => "\xf0\x9f\x98\x80",
+			  ':-P' => "\xf0\x9f\x98\x9b",
+			  ':-o' => "\xf0\x9f\x98\xae",
+			  ':-x' => "\xf0\x9f\x98\xa1",
+			  ':-|' => "\xf0\x9f\x98\x90",
+			  ';-)' => "\xf0\x9f\x98\x89",
 		// This one transformation breaks regular text with frequency.
 		//     '8)' => "\xf0\x9f\x98\x8e",
-		       '8O' => "\xf0\x9f\x98\xaf",
-		       ':(' => "\xf0\x9f\x99\x81",
-		       ':)' => "\xf0\x9f\x99\x82",
-		       ':?' => "\xf0\x9f\x98\x95",
-		       ':D' => "\xf0\x9f\x98\x80",
-		       ':P' => "\xf0\x9f\x98\x9b",
-		       ':o' => "\xf0\x9f\x98\xae",
-		       ':x' => "\xf0\x9f\x98\xa1",
-		       ':|' => "\xf0\x9f\x98\x90",
-		       ';)' => "\xf0\x9f\x98\x89",
-		      ':!:' => "\xe2\x9d\x97",
-		      ':?:' => "\xe2\x9d\x93",
+			   '8O' => "\xf0\x9f\x98\xaf",
+			   ':(' => "\xf0\x9f\x99\x81",
+			   ':)' => "\xf0\x9f\x99\x82",
+			   ':?' => "\xf0\x9f\x98\x95",
+			   ':D' => "\xf0\x9f\x98\x80",
+			   ':P' => "\xf0\x9f\x98\x9b",
+			   ':o' => "\xf0\x9f\x98\xae",
+			   ':x' => "\xf0\x9f\x98\xa1",
+			   ':|' => "\xf0\x9f\x98\x90",
+			   ';)' => "\xf0\x9f\x98\x89",
+			  ':!:' => "\xe2\x9d\x97",
+			  ':?:' => "\xe2\x9d\x93",
 		);
-	}
+	}// End if().
 
 	/**
 	 * Filters all the smilies.
@@ -3422,9 +3497,9 @@
 	 *
 	 * @param array $wpsmiliestrans List of the smilies.
 	 */
-	$wpsmiliestrans = apply_filters('smilies', $wpsmiliestrans);
+	$wpsmiliestrans = apply_filters( 'smilies', $wpsmiliestrans );
 
-	if (count($wpsmiliestrans) == 0) {
+	if ( count( $wpsmiliestrans ) == 0 ) {
 		return;
 	}
 
@@ -3433,7 +3508,7 @@
 	 * we match the longest possible smilie (:???: vs :?) as the regular
 	 * expression used below is first-match
 	 */
-	krsort($wpsmiliestrans);
+	krsort( $wpsmiliestrans );
 
 	$spaces = wp_spaces_regexp();
 
@@ -3442,21 +3517,21 @@
 
 	$subchar = '';
 	foreach ( (array) $wpsmiliestrans as $smiley => $img ) {
-		$firstchar = substr($smiley, 0, 1);
-		$rest = substr($smiley, 1);
+		$firstchar = substr( $smiley, 0, 1 );
+		$rest = substr( $smiley, 1 );
 
 		// new subpattern?
-		if ($firstchar != $subchar) {
-			if ($subchar != '') {
+		if ( $firstchar != $subchar ) {
+			if ( $subchar != '' ) {
 				$wp_smiliessearch .= ')(?=' . $spaces . '|$)';  // End previous "subpattern"
 				$wp_smiliessearch .= '|(?<=' . $spaces . '|^)'; // Begin another "subpattern"
 			}
 			$subchar = $firstchar;
-			$wp_smiliessearch .= preg_quote($firstchar, '/') . '(?:';
+			$wp_smiliessearch .= preg_quote( $firstchar, '/' ) . '(?:';
 		} else {
 			$wp_smiliessearch .= '|';
 		}
-		$wp_smiliessearch .= preg_quote($rest, '/');
+		$wp_smiliessearch .= preg_quote( $rest, '/' );
 	}
 
 	$wp_smiliessearch .= ')(?=' . $spaces . '|$)/m';
@@ -3477,15 +3552,16 @@
  * @return array Merged user defined values with defaults.
  */
 function wp_parse_args( $args, $defaults = '' ) {
-	if ( is_object( $args ) )
+	if ( is_object( $args ) ) {
 		$r = get_object_vars( $args );
-	elseif ( is_array( $args ) )
+	} elseif ( is_array( $args ) ) {
 		$r =& $args;
-	else
-		wp_parse_str( $args, $r );
+	} else { wp_parse_str( $args, $r );
+	}
 
-	if ( is_array( $defaults ) )
+	if ( is_array( $defaults ) ) {
 		return array_merge( $defaults, $r );
+	}
 	return $r;
 }
 
@@ -3498,10 +3574,11 @@
  * @return array Sanitized array of IDs.
  */
 function wp_parse_id_list( $list ) {
-	if ( !is_array($list) )
-		$list = preg_split('/[\s,]+/', $list);
+	if ( ! is_array( $list ) ) {
+		$list = preg_split( '/[\s,]+/', $list );
+	}
 
-	return array_unique(array_map('absint', $list));
+	return array_unique( array_map( 'absint', $list ) );
 }
 
 /**
@@ -3535,9 +3612,11 @@
  */
 function wp_array_slice_assoc( $array, $keys ) {
 	$slice = array();
-	foreach ( $keys as $key )
-		if ( isset( $array[ $key ] ) )
+	foreach ( $keys as $key ) {
+		if ( isset( $array[ $key ] ) ) {
 			$slice[ $key ] = $array[ $key ];
+		}
+	}
 
 	return $slice;
 }
@@ -3701,8 +3780,9 @@
 function wp_widgets_add_menu() {
 	global $submenu;
 
-	if ( ! current_theme_supports( 'widgets' ) )
+	if ( ! current_theme_supports( 'widgets' ) ) {
 		return;
+	}
 
 	$submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' );
 	ksort( $submenu['themes.php'], SORT_NUMERIC );
@@ -3717,8 +3797,9 @@
  */
 function wp_ob_end_flush_all() {
 	$levels = ob_get_level();
-	for ($i=0; $i<$levels; $i++)
+	for ( $i = 0; $i < $levels; $i++ ) {
 		ob_end_flush();
+	}
 }
 
 /**
@@ -3751,8 +3832,9 @@
 	}
 
 	// If installing or in the admin, provide the verbose message.
-	if ( wp_installing() || defined( 'WP_ADMIN' ) )
-		wp_die($wpdb->error);
+	if ( wp_installing() || defined( 'WP_ADMIN' ) ) {
+		wp_die( $wpdb->error );
+	}
 
 	// Otherwise, be terse.
 	status_header( 500 );
@@ -3760,7 +3842,7 @@
 	header( 'Content-Type: text/html; charset=utf-8' );
 ?>
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
+<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) { echo ' dir="rtl"';} ?>>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<title><?php _e( 'Database Error' ); ?></title>
@@ -3828,10 +3910,10 @@
 		if ( function_exists( '__' ) ) {
 			if ( ! is_null( $replacement ) ) {
 				/* translators: 1: PHP function name, 2: version number, 3: alternative function name */
-				trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
+				trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $function, $version, $replacement ) );
 			} else {
 				/* translators: 1: PHP function name, 2: version number */
-				trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
+				trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $function, $version ) );
 			}
 		} else {
 			if ( ! is_null( $replacement ) ) {
@@ -3891,19 +3973,19 @@
 			if ( ! empty( $parent_class ) ) {
 				/* translators: 1: PHP class name, 2: PHP parent class name, 3: version number, 4: __construct() method */
 				trigger_error( sprintf( __( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ),
-					$class, $parent_class, $version, '<pre>__construct()</pre>' ) );
+				$class, $parent_class, $version, '<pre>__construct()</pre>' ) );
 			} else {
 				/* translators: 1: PHP class name, 2: version number, 3: __construct() method */
 				trigger_error( sprintf( __( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
-					$class, $version, '<pre>__construct()</pre>' ) );
+				$class, $version, '<pre>__construct()</pre>' ) );
 			}
 		} else {
 			if ( ! empty( $parent_class ) ) {
 				trigger_error( sprintf( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.',
-					$class, $parent_class, $version, '<pre>__construct()</pre>' ) );
+				$class, $parent_class, $version, '<pre>__construct()</pre>' ) );
 			} else {
 				trigger_error( sprintf( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
-					$class, $version, '<pre>__construct()</pre>' ) );
+				$class, $version, '<pre>__construct()</pre>' ) );
 			}
 		}
 	}
@@ -3956,10 +4038,10 @@
 		if ( function_exists( '__' ) ) {
 			if ( ! is_null( $replacement ) ) {
 				/* translators: 1: PHP file name, 2: version number, 3: alternative file name */
-				trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );
+				trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $file, $version, $replacement ) . $message );
 			} else {
 				/* translators: 1: PHP file name, 2: version number */
-				trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message );
+				trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $file, $version ) . $message );
 			}
 		} else {
 			if ( ! is_null( $replacement ) ) {
@@ -4020,10 +4102,10 @@
 		if ( function_exists( '__' ) ) {
 			if ( ! is_null( $message ) ) {
 				/* translators: 1: PHP function name, 2: version number, 3: optional message regarding the change */
-				trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
+				trigger_error( sprintf( __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s' ), $function, $version, $message ) );
 			} else {
 				/* translators: 1: PHP function name, 2: version number */
-				trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
+				trigger_error( sprintf( __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $function, $version ) );
 			}
 		} else {
 			if ( ! is_null( $message ) ) {
@@ -4175,22 +4257,25 @@
  * @param bool   $default Optional. The default return value if the module is not found. Default false.
  * @return bool Whether the specified module is loaded.
  */
-function apache_mod_loaded($mod, $default = false) {
+function apache_mod_loaded( $mod, $default = false ) {
 	global $is_apache;
 
-	if ( !$is_apache )
+	if ( ! $is_apache ) {
 		return false;
+	}
 
 	if ( function_exists( 'apache_get_modules' ) ) {
 		$mods = apache_get_modules();
-		if ( in_array($mod, $mods) )
+		if ( in_array( $mod, $mods ) ) {
 			return true;
+		}
 	} elseif ( function_exists( 'phpinfo' ) && false === strpos( ini_get( 'disable_functions' ), 'phpinfo' ) ) {
 			ob_start();
-			phpinfo(8);
+			phpinfo( 8 );
 			$phpinfo = ob_get_clean();
-			if ( false !== strpos($phpinfo, $mod) )
-				return true;
+		if ( false !== strpos( $phpinfo, $mod ) ) {
+			return true;
+		}
 	}
 	return $default;
 }
@@ -4218,7 +4303,7 @@
 		 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs
 		 * via ISAPI then pretty permalinks will not work.
 		 */
-		$supports_permalinks = class_exists( 'DOMDocument', false ) && isset($_SERVER['IIS_UrlRewriteModule']) && ( PHP_SAPI == 'cgi-fcgi' );
+		$supports_permalinks = class_exists( 'DOMDocument', false ) && isset( $_SERVER['IIS_UrlRewriteModule'] ) && ( PHP_SAPI == 'cgi-fcgi' );
 	}
 
 	/**
@@ -4246,17 +4331,21 @@
  * @return int 0 means nothing is wrong, greater than 0 means something was wrong.
  */
 function validate_file( $file, $allowed_files = '' ) {
-	if ( false !== strpos( $file, '..' ) )
+	if ( false !== strpos( $file, '..' ) ) {
 		return 1;
+	}
 
-	if ( false !== strpos( $file, './' ) )
+	if ( false !== strpos( $file, './' ) ) {
 		return 1;
+	}
 
-	if ( ! empty( $allowed_files ) && ! in_array( $file, $allowed_files ) )
+	if ( ! empty( $allowed_files ) && ! in_array( $file, $allowed_files ) ) {
 		return 3;
+	}
 
-	if (':' == substr( $file, 1, 1 ) )
+	if ( ':' == substr( $file, 1, 1 ) ) {
 		return 2;
+	}
 
 	return 0;
 }
@@ -4274,7 +4363,7 @@
 function force_ssl_admin( $force = null ) {
 	static $forced = false;
 
-	if ( !is_null( $force ) ) {
+	if ( ! is_null( $force ) ) {
 		$old_forced = $forced;
 		$forced = $force;
 		return $old_forced;
@@ -4294,7 +4383,7 @@
  * @return string The guessed URL.
  */
 function wp_guess_url() {
-	if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
+	if ( defined( 'WP_SITEURL' ) && '' != WP_SITEURL ) {
 		$url = WP_SITEURL;
 	} else {
 		$abspath_fix = str_replace( '\\', '/', ABSPATH );
@@ -4304,7 +4393,7 @@
 		if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false || strpos( $_SERVER['REQUEST_URI'], 'wp-login.php' ) !== false ) {
 			$path = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', $_SERVER['REQUEST_URI'] );
 
-		// The request is for a file in ABSPATH
+			// The request is for a file in ABSPATH
 		} elseif ( $script_filename_dir . '/' == $abspath_fix ) {
 			// Strip off any file/query params in the path
 			$path = preg_replace( '#/[^/]*$#i', '', $_SERVER['PHP_SELF'] );
@@ -4329,7 +4418,7 @@
 		$url = $schema . $_SERVER['HTTP_HOST'] . $path;
 	}
 
-	return rtrim($url, '/');
+	return rtrim( $url, '/' );
 }
 
 /**
@@ -4352,8 +4441,9 @@
 function wp_suspend_cache_addition( $suspend = null ) {
 	static $_suspend = false;
 
-	if ( is_bool( $suspend ) )
+	if ( is_bool( $suspend ) ) {
 		$_suspend = $suspend;
+	}
 
 	return $_suspend;
 }
@@ -4390,11 +4480,13 @@
  *              running Multisite.
  */
 function is_main_site( $site_id = null ) {
-	if ( ! is_multisite() )
+	if ( ! is_multisite() ) {
 		return true;
+	}
 
-	if ( ! $site_id )
+	if ( ! $site_id ) {
 		$site_id = get_current_blog_id();
+	}
 
 	return (int) $site_id === (int) get_network()->site_id;
 }
@@ -4465,8 +4557,9 @@
  * @return bool True if multisite and global terms enabled.
  */
 function global_terms_enabled() {
-	if ( ! is_multisite() )
+	if ( ! is_multisite() ) {
 		return false;
+	}
 
 	static $global_terms = null;
 	if ( is_null( $global_terms ) ) {
@@ -4482,10 +4575,10 @@
 		 * @param null $enabled Whether global terms are enabled.
 		 */
 		$filter = apply_filters( 'global_terms_enabled', null );
-		if ( ! is_null( $filter ) )
+		if ( ! is_null( $filter ) ) {
 			$global_terms = (bool) $filter;
-		else
-			$global_terms = (bool) get_site_option( 'global_terms_enabled', false );
+		} else { $global_terms = (bool) get_site_option( 'global_terms_enabled', false );
+		}
 	}
 	return $global_terms;
 }
@@ -4500,7 +4593,7 @@
  * @return float|false Timezone GMT offset, false otherwise.
  */
 function wp_timezone_override_offset() {
-	if ( !$timezone_string = get_option( 'timezone_string' ) ) {
+	if ( ! $timezone_string = get_option( 'timezone_string' ) ) {
 		return false;
 	}
 
@@ -4576,7 +4669,7 @@
 function wp_timezone_choice( $selected_zone, $locale = null ) {
 	static $mo_loaded = false, $locale_loaded = null;
 
-	$continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific');
+	$continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific' );
 
 	// Load translations for continents and cities.
 	if ( ! $mo_loaded || $locale !== $locale_loaded ) {
@@ -4590,7 +4683,7 @@
 	$zonen = array();
 	foreach ( timezone_identifiers_list() as $zone ) {
 		$zone = explode( '/', $zone );
-		if ( !in_array( $zone[0], $continents ) ) {
+		if ( ! in_array( $zone[0], $continents ) ) {
 			continue;
 		}
 
@@ -4610,7 +4703,7 @@
 			'subcity'     => ( $exists[2] ? $zone[2] : '' ),
 			't_continent' => ( $exists[3] ? translate( str_replace( '_', ' ', $zone[0] ), 'continents-cities' ) : '' ),
 			't_city'      => ( $exists[4] ? translate( str_replace( '_', ' ', $zone[1] ), 'continents-cities' ) : '' ),
-			't_subcity'   => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' )
+			't_subcity'   => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' ),
 		);
 	}
 	usort( $zonen, '_wp_timezone_choice_usort_callback' );
@@ -4632,16 +4725,16 @@
 			// It's inside a continent group
 
 			// Continent optgroup
-			if ( !isset( $zonen[$key - 1] ) || $zonen[$key - 1]['continent'] !== $zone['continent'] ) {
+			if ( ! isset( $zonen[ $key - 1 ] ) || $zonen[ $key - 1 ]['continent'] !== $zone['continent'] ) {
 				$label = $zone['t_continent'];
-				$structure[] = '<optgroup label="'. esc_attr( $label ) .'">';
+				$structure[] = '<optgroup label="' . esc_attr( $label ) . '">';
 			}
 
 			// Add the city to the value
 			$value[] = $zone['city'];
 
 			$display = $zone['t_city'];
-			if ( !empty( $zone['subcity'] ) ) {
+			if ( ! empty( $zone['subcity'] ) ) {
 				// Add the subcity to the value
 				$value[] = $zone['subcity'];
 				$display .= ' - ' . $zone['t_subcity'];
@@ -4654,40 +4747,97 @@
 		if ( $value === $selected_zone ) {
 			$selected = 'selected="selected" ';
 		}
-		$structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . "</option>";
+		$structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . '</option>';
 
 		// Close continent optgroup
-		if ( !empty( $zone['city'] ) && ( !isset($zonen[$key + 1]) || (isset( $zonen[$key + 1] ) && $zonen[$key + 1]['continent'] !== $zone['continent']) ) ) {
+		if ( ! empty( $zone['city'] ) && ( ! isset( $zonen[ $key + 1 ] ) || (isset( $zonen[ $key + 1 ] ) && $zonen[ $key + 1 ]['continent'] !== $zone['continent']) ) ) {
 			$structure[] = '</optgroup>';
 		}
-	}
+	}// End foreach().
 
 	// Do UTC
-	$structure[] = '<optgroup label="'. esc_attr__( 'UTC' ) .'">';
+	$structure[] = '<optgroup label="' . esc_attr__( 'UTC' ) . '">';
 	$selected = '';
-	if ( 'UTC' === $selected_zone )
+	if ( 'UTC' === $selected_zone ) {
 		$selected = 'selected="selected" ';
-	$structure[] = '<option ' . $selected . 'value="' . esc_attr( 'UTC' ) . '">' . __('UTC') . '</option>';
+	}
+	$structure[] = '<option ' . $selected . 'value="' . esc_attr( 'UTC' ) . '">' . __( 'UTC' ) . '</option>';
 	$structure[] = '</optgroup>';
 
 	// Do manual UTC offsets
-	$structure[] = '<optgroup label="'. esc_attr__( 'Manual Offsets' ) .'">';
-	$offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,
-		0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75, 6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 13.75, 14);
+	$structure[] = '<optgroup label="' . esc_attr__( 'Manual Offsets' ) . '">';
+	$offset_range = array(
+	-12,
+	-11.5,
+	-11,
+	-10.5,
+	-10,
+	-9.5,
+	-9,
+	-8.5,
+	-8,
+	-7.5,
+	-7,
+	-6.5,
+	-6,
+	-5.5,
+	-5,
+	-4.5,
+	-4,
+	-3.5,
+	-3,
+	-2.5,
+	-2,
+	-1.5,
+	-1,
+	-0.5,
+		0,
+	0.5,
+	1,
+	1.5,
+	2,
+	2.5,
+	3,
+	3.5,
+	4,
+	4.5,
+	5,
+	5.5,
+	5.75,
+	6,
+	6.5,
+	7,
+	7.5,
+	8,
+	8.5,
+	8.75,
+	9,
+	9.5,
+	10,
+	10.5,
+	11,
+	11.5,
+	12,
+	12.75,
+	13,
+	13.75,
+	14,
+	);
 	foreach ( $offset_range as $offset ) {
-		if ( 0 <= $offset )
+		if ( 0 <= $offset ) {
 			$offset_name = '+' . $offset;
-		else
-			$offset_name = (string) $offset;
+		} else { $offset_name = (string) $offset;
+		}
 
 		$offset_value = $offset_name;
-		$offset_name = str_replace(array('.25','.5','.75'), array(':15',':30',':45'), $offset_name);
+		$offset_name = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $offset_name );
 		$offset_name = 'UTC' . $offset_name;
 		$offset_value = 'UTC' . $offset_value;
 		$selected = '';
-		if ( $offset_value === $selected_zone )
+		if ( $offset_value === $selected_zone ) {
 			$selected = 'selected="selected" ';
-		$structure[] = '<option ' . $selected . 'value="' . esc_attr( $offset_value ) . '">' . esc_html( $offset_name ) . "</option>";
+		}
+		$structure[] = '<option ' . $selected . 'value="' . esc_attr( $offset_value ) . '">' . esc_html( $offset_name ) . '</option>';
 
 	}
 	$structure[] = '</optgroup>';
@@ -4707,7 +4857,7 @@
  * @return string
  */
 function _cleanup_header_comment( $str ) {
-	return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str));
+	return trim( preg_replace( '/\s*(?:\*\/|\?>).*/', '', $str ) );
 }
 
 /**
@@ -4725,35 +4875,37 @@
 
 	$delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS );
 
-	$posts_to_delete = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp), ARRAY_A);
+	$posts_to_delete = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp ), ARRAY_A );
 
 	foreach ( (array) $posts_to_delete as $post ) {
 		$post_id = (int) $post['post_id'];
-		if ( !$post_id )
+		if ( ! $post_id ) {
 			continue;
+		}
 
-		$del_post = get_post($post_id);
+		$del_post = get_post( $post_id );
 
-		if ( !$del_post || 'trash' != $del_post->post_status ) {
-			delete_post_meta($post_id, '_wp_trash_meta_status');
-			delete_post_meta($post_id, '_wp_trash_meta_time');
+		if ( ! $del_post || 'trash' != $del_post->post_status ) {
+			delete_post_meta( $post_id, '_wp_trash_meta_status' );
+			delete_post_meta( $post_id, '_wp_trash_meta_time' );
 		} else {
-			wp_delete_post($post_id);
+			wp_delete_post( $post_id );
 		}
 	}
 
-	$comments_to_delete = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp), ARRAY_A);
+	$comments_to_delete = $wpdb->get_results( $wpdb->prepare( "SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp ), ARRAY_A );
 
 	foreach ( (array) $comments_to_delete as $comment ) {
 		$comment_id = (int) $comment['comment_id'];
-		if ( !$comment_id )
+		if ( ! $comment_id ) {
 			continue;
+		}
 
-		$del_comment = get_comment($comment_id);
+		$del_comment = get_comment( $comment_id );
 
-		if ( !$del_comment || 'trash' != $del_comment->comment_approved ) {
-			delete_comment_meta($comment_id, '_wp_trash_meta_time');
-			delete_comment_meta($comment_id, '_wp_trash_meta_status');
+		if ( ! $del_comment || 'trash' != $del_comment->comment_approved ) {
+			delete_comment_meta( $comment_id, '_wp_trash_meta_time' );
+			delete_comment_meta( $comment_id, '_wp_trash_meta_status' );
 		} else {
 			wp_delete_comment( $del_comment );
 		}
@@ -4811,10 +4963,10 @@
 	}
 
 	foreach ( $all_headers as $field => $regex ) {
-		if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] )
+		if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] ) {
 			$all_headers[ $field ] = _cleanup_header_comment( $match[1] );
-		else
-			$all_headers[ $field ] = '';
+		} else { $all_headers[ $field ] = '';
+		}
 	}
 
 	return $all_headers;
@@ -4927,16 +5079,16 @@
  */
 function _wp_mysql_week( $column ) {
 	switch ( $start_of_week = (int) get_option( 'start_of_week' ) ) {
-	case 1 :
+		case 1 :
 		return "WEEK( $column, 1 )";
-	case 2 :
-	case 3 :
-	case 4 :
-	case 5 :
-	case 6 :
+		case 2 :
+		case 3 :
+		case 4 :
+		case 5 :
+		case 6 :
 		return "WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )";
-	case 0 :
-	default :
+		case 0 :
+		default :
 		return "WEEK( $column, 0 )";
 	}
 }
@@ -4957,8 +5109,9 @@
 function wp_find_hierarchy_loop( $callback, $start, $start_parent, $callback_args = array() ) {
 	$override = is_null( $start_parent ) ? array() : array( $start => $start_parent );
 
-	if ( !$arbitrary_loop_member = wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override, $callback_args ) )
+	if ( ! $arbitrary_loop_member = wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override, $callback_args ) ) {
 		return array();
+	}
 
 	return wp_find_hierarchy_loop_tortoise_hare( $callback, $arbitrary_loop_member, $override, $callback_args, true );
 }
@@ -4992,19 +5145,21 @@
 	while (
 		$tortoise
 	&&
-		( $evanescent_hare = isset( $override[$hare] ) ? $override[$hare] : call_user_func_array( $callback, array_merge( array( $hare ), $callback_args ) ) )
+		( $evanescent_hare = isset( $override[ $hare ] ) ? $override[ $hare ] : call_user_func_array( $callback, array_merge( array( $hare ), $callback_args ) ) )
 	&&
-		( $hare = isset( $override[$evanescent_hare] ) ? $override[$evanescent_hare] : call_user_func_array( $callback, array_merge( array( $evanescent_hare ), $callback_args ) ) )
+		( $hare = isset( $override[ $evanescent_hare ] ) ? $override[ $evanescent_hare ] : call_user_func_array( $callback, array_merge( array( $evanescent_hare ), $callback_args ) ) )
 	) {
-		if ( $_return_loop )
-			$return[$tortoise] = $return[$evanescent_hare] = $return[$hare] = true;
+		if ( $_return_loop ) {
+			$return[ $tortoise ] = $return[ $evanescent_hare ] = $return[ $hare ] = true;
+		}
 
 		// tortoise got lapped - must be a loop
-		if ( $tortoise == $evanescent_hare || $tortoise == $hare )
+		if ( $tortoise == $evanescent_hare || $tortoise == $hare ) {
 			return $_return_loop ? $return : $tortoise;
+		}
 
 		// Increment tortoise by one step
-		$tortoise = isset( $override[$tortoise] ) ? $override[$tortoise] : call_user_func_array( $callback, array_merge( array( $tortoise ), $callback_args ) );
+		$tortoise = isset( $override[ $tortoise ] ) ? $override[ $tortoise ] : call_user_func_array( $callback, array_merge( array( $tortoise ), $callback_args ) );
 	}
 
 	return false;
@@ -5074,10 +5229,10 @@
  *                      of individual calls.
  */
 function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) {
-	if ( version_compare( PHP_VERSION, '5.2.5', '>=' ) )
+	if ( version_compare( PHP_VERSION, '5.2.5', '>=' ) ) {
 		$trace = debug_backtrace( false );
-	else
-		$trace = debug_backtrace();
+	} else { $trace = debug_backtrace();
+	}
 
 	$caller = array();
 	$check_class = ! is_null( $ignore_class );
@@ -5087,8 +5242,9 @@
 		if ( $skip_frames > 0 ) {
 			$skip_frames--;
 		} elseif ( isset( $call['class'] ) ) {
-			if ( $check_class && $ignore_class == $call['class'] )
+			if ( $check_class && $ignore_class == $call['class'] ) {
 				continue; // Filter out calls
+			}
 
 			$caller[] = "{$call['class']}{$call['type']}{$call['function']}";
 		} else {
@@ -5101,10 +5257,10 @@
 			}
 		}
 	}
-	if ( $pretty )
+	if ( $pretty ) {
 		return join( ', ', array_reverse( $caller ) );
-	else
-		return $caller;
+	} else { return $caller;
+	}
 }
 
 /**
@@ -5122,7 +5278,7 @@
 	$clean = array();
 	foreach ( $object_ids as $id ) {
 		$id = (int) $id;
-		if ( !wp_cache_get( $id, $cache_key ) ) {
+		if ( ! wp_cache_get( $id, $cache_key ) ) {
 			$clean[] = $id;
 		}
 	}
@@ -5139,14 +5295,15 @@
  * @return bool Whether the device is able to upload files.
  */
 function _device_can_upload() {
-	if ( ! wp_is_mobile() )
+	if ( ! wp_is_mobile() ) {
 		return true;
+	}
 
 	$ua = $_SERVER['HTTP_USER_AGENT'];
 
-	if ( strpos($ua, 'iPhone') !== false
-		|| strpos($ua, 'iPad') !== false
-		|| strpos($ua, 'iPod') !== false ) {
+	if ( strpos( $ua, 'iPhone' ) !== false
+		|| strpos( $ua, 'iPad' ) !== false
+		|| strpos( $ua, 'iPod' ) !== false ) {
 			return preg_match( '#OS ([\d_]+) like Mac OS X#', $ua, $version ) && version_compare( $version[1], '6', '>=' );
 	}
 
@@ -5163,7 +5320,7 @@
  */
 function wp_is_stream( $path ) {
 	$wrappers = stream_get_wrappers();
-	$wrappers_re = '(' . join('|', $wrappers) . ')';
+	$wrappers_re = '(' . join( '|', $wrappers ) . ')';
 
 	return preg_match( "!^$wrappers_re://!", $path ) === 1;
 }
@@ -5205,11 +5362,13 @@
  * @since 3.6.0
  */
 function wp_auth_check_load() {
-	if ( ! is_admin() && ! is_user_logged_in() )
+	if ( ! is_admin() && ! is_user_logged_in() ) {
 		return;
+	}
 
-	if ( defined( 'IFRAME_REQUEST' ) )
+	if ( defined( 'IFRAME_REQUEST' ) ) {
 		return;
+	}
 
 	$screen = get_current_screen();
 	$hidden = array( 'update', 'update-network', 'update-core', 'update-core-network', 'upgrade', 'upgrade-network', 'network' );
@@ -5270,9 +5429,9 @@
 
 	?>
 	<div class="wp-auth-fallback">
-		<p><b class="wp-auth-fallback-expired" tabindex="0"><?php _e('Session expired'); ?></b></p>
-		<p><a href="<?php echo esc_url( $login_url ); ?>" target="_blank"><?php _e('Please log in again.'); ?></a>
-		<?php _e('The login page will open in a new window. After logging in you can close it and return to this page.'); ?></p>
+		<p><b class="wp-auth-fallback-expired" tabindex="0"><?php _e( 'Session expired' ); ?></b></p>
+		<p><a href="<?php echo esc_url( $login_url ); ?>" target="_blank"><?php _e( 'Please log in again.' ); ?></a>
+		<?php _e( 'The login page will open in a new window. After logging in you can close it and return to this page.' ); ?></p>
 	</div>
 	</div>
 	</div>
@@ -5314,8 +5473,9 @@
  * @return string Tag RegEx.
  */
 function get_tag_regex( $tag ) {
-	if ( empty( $tag ) )
+	if ( empty( $tag ) ) {
 		return;
+	}
 	return sprintf( '<%1$s[^<]*(?:>[\s\S]*<\/%1$s>|\s*\/>)', tag_escape( $tag ) );
 }
 
@@ -5332,7 +5492,7 @@
  * @return string The canonical form of the charset.
  */
 function _canonical_charset( $charset ) {
-	if ( 'utf-8' === strtolower( $charset ) || 'utf8' === strtolower( $charset) ) {
+	if ( 'utf-8' === strtolower( $charset ) || 'utf8' === strtolower( $charset ) ) {
 
 		return 'UTF-8';
 	}
@@ -5375,11 +5535,13 @@
 	static $encodings = array();
 	static $overloaded = null;
 
-	if ( is_null( $overloaded ) )
+	if ( is_null( $overloaded ) ) {
 		$overloaded = function_exists( 'mb_internal_encoding' ) && ( ini_get( 'mbstring.func_overload' ) & 2 );
+	}
 
-	if ( false === $overloaded )
+	if ( false === $overloaded ) {
 		return;
+	}
 
 	if ( ! $reset ) {
 		$encoding = mb_internal_encoding();
@@ -5585,7 +5747,7 @@
 			 */
 			$filtered_limit = apply_filters( "{$context}_memory_limit", $filtered_limit );
 			break;
-	}
+	}// End switch().
 
 	$filtered_limit_int = wp_convert_hr_to_bytes( $filtered_limit );
 
Index: src/wp-includes/functions.wp-scripts.php
===================================================================
--- src/wp-includes/functions.wp-scripts.php	(revision 40901)
+++ src/wp-includes/functions.wp-scripts.php	(working copy)
@@ -216,12 +216,31 @@
 		( 'wp-login.php' === $GLOBALS['pagenow'] && 'login_enqueue_scripts' !== $current_filter )
 	) {
 		$no = array(
-			'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion',
-			'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog',
-			'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse',
-			'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable',
-			'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs',
-			'jquery-ui-tooltip', 'jquery-ui-widget', 'underscore', 'backbone',
+			'jquery',
+		'jquery-core',
+		'jquery-migrate',
+		'jquery-ui-core',
+		'jquery-ui-accordion',
+			'jquery-ui-autocomplete',
+		'jquery-ui-button',
+		'jquery-ui-datepicker',
+		'jquery-ui-dialog',
+			'jquery-ui-draggable',
+		'jquery-ui-droppable',
+		'jquery-ui-menu',
+		'jquery-ui-mouse',
+			'jquery-ui-position',
+		'jquery-ui-progressbar',
+		'jquery-ui-resizable',
+		'jquery-ui-selectable',
+			'jquery-ui-slider',
+		'jquery-ui-sortable',
+		'jquery-ui-spinner',
+		'jquery-ui-tabs',
+			'jquery-ui-tooltip',
+		'jquery-ui-widget',
+		'underscore',
+		'backbone',
 		);
 
 		if ( in_array( $handle, $no ) ) {
@@ -234,7 +253,7 @@
 			_doing_it_wrong( __FUNCTION__, $message, '3.6.0' );
 			return;
 		}
-	}
+	}// End if().
 
 	wp_scripts()->remove( $handle );
 }
@@ -266,7 +285,6 @@
 
 	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
 
-
 	if ( $src || $in_footer ) {
 		$_handle = explode( '?', $handle );
 
@@ -331,6 +349,6 @@
  * @param mixed  $value  String containing the data to be added.
  * @return bool True on success, false on failure.
  */
-function wp_script_add_data( $handle, $key, $value ){
+function wp_script_add_data( $handle, $key, $value ) {
 	return wp_scripts()->add_data( $handle, $key, $value );
 }
Index: src/wp-includes/functions.wp-styles.php
===================================================================
--- src/wp-includes/functions.wp-styles.php	(revision 40901)
+++ src/wp-includes/functions.wp-styles.php	(working copy)
@@ -167,7 +167,7 @@
 	$wp_styles = wp_styles();
 
 	if ( $src ) {
-		$_handle = explode('?', $handle);
+		$_handle = explode( '?', $handle );
 		$wp_styles->add( $_handle[0], $src, $deps, $ver, $media );
 	}
 	$wp_styles->enqueue( $handle );
Index: src/wp-includes/general-template.php
===================================================================
--- src/wp-includes/general-template.php	(revision 40901)
+++ src/wp-includes/general-template.php	(working copy)
@@ -114,8 +114,9 @@
 
 	$templates = array();
 	$name = (string) $name;
-	if ( '' !== $name )
+	if ( '' !== $name ) {
 		$templates[] = "sidebar-{$name}.php";
+	}
 
 	$templates[] = 'sidebar.php';
 
@@ -159,12 +160,13 @@
 
 	$templates = array();
 	$name = (string) $name;
-	if ( '' !== $name )
+	if ( '' !== $name ) {
 		$templates[] = "{$slug}-{$name}.php";
+	}
 
 	$templates[] = "{$slug}.php";
 
-	locate_template($templates, true, false);
+	locate_template( $templates, true, false );
 }
 
 /**
@@ -224,14 +226,14 @@
 					<span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span>
 					<input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" />
 				</label>
-				<input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
+				<input type="submit" class="search-submit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" />
 			</form>';
 		} else {
 			$form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
 				<div>
 					<label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label>
 					<input type="text" value="' . get_search_query() . '" name="s" id="s" />
-					<input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
+					<input type="submit" id="searchsubmit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" />
 				</div>
 			</form>';
 		}
@@ -246,13 +248,14 @@
 	 */
 	$result = apply_filters( 'get_search_form', $form );
 
-	if ( null === $result )
+	if ( null === $result ) {
 		$result = $form;
+	}
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $result;
-	else
-		return $result;
+	} else { return $result;
+	}
 }
 
 /**
@@ -267,11 +270,11 @@
  * @param bool   $echo     Default to echo and not return the link.
  * @return string|void String when retrieving.
  */
-function wp_loginout($redirect = '', $echo = true) {
-	if ( ! is_user_logged_in() )
-		$link = '<a href="' . esc_url( wp_login_url($redirect) ) . '">' . __('Log in') . '</a>';
-	else
-		$link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
+function wp_loginout( $redirect = '', $echo = true ) {
+	if ( ! is_user_logged_in() ) {
+		$link = '<a href="' . esc_url( wp_login_url( $redirect ) ) . '">' . __( 'Log in' ) . '</a>';
+	} else { $link = '<a href="' . esc_url( wp_logout_url( $redirect ) ) . '">' . __( 'Log out' ) . '</a>';
+	}
 
 	if ( $echo ) {
 		/**
@@ -298,13 +301,15 @@
  * @param string $redirect Path to redirect to on logout.
  * @return string The logout URL. Note: HTML-encoded via esc_html() in wp_nonce_url().
  */
-function wp_logout_url($redirect = '') {
-	$args = array( 'action' => 'logout' );
-	if ( !empty($redirect) ) {
+function wp_logout_url( $redirect = '' ) {
+	$args = array(
+		'action' => 'logout',
+	);
+	if ( ! empty( $redirect ) ) {
 		$args['redirect_to'] = urlencode( $redirect );
 	}
 
-	$logout_url = add_query_arg($args, site_url('wp-login.php', 'login'));
+	$logout_url = add_query_arg( $args, site_url( 'wp-login.php', 'login' ) );
 	$logout_url = wp_nonce_url( $logout_url, 'log-out' );
 
 	/**
@@ -328,14 +333,16 @@
  *                             Default false.
  * @return string The login URL. Not HTML-encoded.
  */
-function wp_login_url($redirect = '', $force_reauth = false) {
-	$login_url = site_url('wp-login.php', 'login');
+function wp_login_url( $redirect = '', $force_reauth = false ) {
+	$login_url = site_url( 'wp-login.php', 'login' );
 
-	if ( !empty($redirect) )
-		$login_url = add_query_arg('redirect_to', urlencode($redirect), $login_url);
+	if ( ! empty( $redirect ) ) {
+		$login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );
+	}
 
-	if ( $force_reauth )
-		$login_url = add_query_arg('reauth', '1', $login_url);
+	if ( $force_reauth ) {
+		$login_url = add_query_arg( 'reauth', '1', $login_url );
+	}
 
 	/**
 	 * Filters the login URL.
@@ -487,10 +494,10 @@
 			' . $login_form_bottom . '
 		</form>';
 
-	if ( $args['echo'] )
+	if ( $args['echo'] ) {
 		echo $form;
-	else
-		return $form;
+	} else { return $form;
+	}
 }
 
 /**
@@ -502,12 +509,14 @@
  * @return string Lost password URL.
  */
 function wp_lostpassword_url( $redirect = '' ) {
-	$args = array( 'action' => 'lostpassword' );
-	if ( !empty($redirect) ) {
+	$args = array(
+		'action' => 'lostpassword',
+	);
+	if ( ! empty( $redirect ) ) {
 		$args['redirect_to'] = $redirect;
 	}
 
-	$lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );
+	$lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php', 'login' ) );
 
 	/**
 	 * Filters the Lost Password URL.
@@ -535,12 +544,12 @@
  */
 function wp_register( $before = '<li>', $after = '</li>', $echo = true ) {
 	if ( ! is_user_logged_in() ) {
-		if ( get_option('users_can_register') )
-			$link = $before . '<a href="' . esc_url( wp_registration_url() ) . '">' . __('Register') . '</a>' . $after;
-		else
-			$link = '';
+		if ( get_option( 'users_can_register' ) ) {
+			$link = $before . '<a href="' . esc_url( wp_registration_url() ) . '">' . __( 'Register' ) . '</a>' . $after;
+		} else { $link = '';
+		}
 	} elseif ( current_user_can( 'read' ) ) {
-		$link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after;
+		$link = $before . '<a href="' . admin_url() . '">' . __( 'Site Admin' ) . '</a>' . $after;
 	} else {
 		$link = '';
 	}
@@ -644,7 +653,7 @@
  * @return string Mostly string values, might be empty.
  */
 function get_bloginfo( $show = '', $filter = 'raw' ) {
-	switch( $show ) {
+	switch ( $show ) {
 		case 'home' : // DEPRECATED
 		case 'siteurl' : // DEPRECATED
 			_deprecated_argument( __FUNCTION__, '2.2.0', sprintf(
@@ -661,25 +670,25 @@
 			$output = site_url();
 			break;
 		case 'description':
-			$output = get_option('blogdescription');
+			$output = get_option( 'blogdescription' );
 			break;
 		case 'rdf_url':
-			$output = get_feed_link('rdf');
+			$output = get_feed_link( 'rdf' );
 			break;
 		case 'rss_url':
-			$output = get_feed_link('rss');
+			$output = get_feed_link( 'rss' );
 			break;
 		case 'rss2_url':
-			$output = get_feed_link('rss2');
+			$output = get_feed_link( 'rss2' );
 			break;
 		case 'atom_url':
-			$output = get_feed_link('atom');
+			$output = get_feed_link( 'atom' );
 			break;
 		case 'comments_atom_url':
-			$output = get_feed_link('comments_atom');
+			$output = get_feed_link( 'comments_atom' );
 			break;
 		case 'comments_rss2_url':
-			$output = get_feed_link('comments_rss2');
+			$output = get_feed_link( 'comments_rss2' );
 			break;
 		case 'pingback_url':
 			$output = site_url( 'xmlrpc.php' );
@@ -695,14 +704,15 @@
 			$output = get_template_directory_uri();
 			break;
 		case 'admin_email':
-			$output = get_option('admin_email');
+			$output = get_option( 'admin_email' );
 			break;
 		case 'charset':
-			$output = get_option('blog_charset');
-			if ('' == $output) $output = 'UTF-8';
+			$output = get_option( 'blog_charset' );
+			if ( '' == $output ) { $output = 'UTF-8';
+			}
 			break;
 		case 'html_type' :
-			$output = get_option('html_type');
+			$output = get_option( 'html_type' );
 			break;
 		case 'version':
 			global $wp_version;
@@ -735,15 +745,16 @@
 			break;
 		case 'name':
 		default:
-			$output = get_option('blogname');
+			$output = get_option( 'blogname' );
 			break;
-	}
+	}// End switch().
 
 	$url = true;
-	if (strpos($show, 'url') === false &&
-		strpos($show, 'directory') === false &&
-		strpos($show, 'home') === false)
+	if ( strpos( $show, 'url' ) === false &&
+		strpos( $show, 'directory' ) === false &&
+		strpos( $show, 'home' ) === false ) {
 		$url = false;
+	}
 
 	if ( 'display' == $filter ) {
 		if ( $url ) {
@@ -910,9 +921,7 @@
 			esc_url( home_url( '/' ) ),
 			wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr )
 		);
-	}
-
-	// If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
+	} // End if().
 	elseif ( is_customize_preview() ) {
 		$html = sprintf( '<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo"/></a>',
 			esc_url( home_url( '/' ) )
@@ -983,39 +992,39 @@
 	if ( is_404() ) {
 		$title['title'] = __( 'Page not found' );
 
-	// If it's a search, use a dynamic search results title.
+		// If it's a search, use a dynamic search results title.
 	} elseif ( is_search() ) {
 		/* translators: %s: search phrase */
 		$title['title'] = sprintf( __( 'Search Results for &#8220;%s&#8221;' ), get_search_query() );
 
-	// If on the front page, use the site title.
+		// If on the front page, use the site title.
 	} elseif ( is_front_page() ) {
 		$title['title'] = get_bloginfo( 'name', 'display' );
 
-	// If on a post type archive, use the post type archive title.
+		// If on a post type archive, use the post type archive title.
 	} elseif ( is_post_type_archive() ) {
 		$title['title'] = post_type_archive_title( '', false );
 
-	// If on a taxonomy archive, use the term title.
+		// If on a taxonomy archive, use the term title.
 	} elseif ( is_tax() ) {
 		$title['title'] = single_term_title( '', false );
 
-	/*
-	 * If we're on the blog page that is not the homepage or
-	 * a single post of any post type, use the post title.
-	 */
+		/*
+		* If we're on the blog page that is not the homepage or
+		* a single post of any post type, use the post title.
+		*/
 	} elseif ( is_home() || is_singular() ) {
 		$title['title'] = single_post_title( '', false );
 
-	// If on a category or tag archive, use the term title.
+		// If on a category or tag archive, use the term title.
 	} elseif ( is_category() || is_tag() ) {
 		$title['title'] = single_term_title( '', false );
 
-	// If on an author archive, use the author's display name.
+		// If on an author archive, use the author's display name.
 	} elseif ( is_author() && $author = get_queried_object() ) {
 		$title['title'] = $author->display_name;
 
-	// If it's a date archive, use the date as the title.
+		// If it's a date archive, use the date as the title.
 	} elseif ( is_year() ) {
 		$title['title'] = get_the_date( _x( 'Y', 'yearly archives date format' ) );
 
@@ -1024,7 +1033,7 @@
 
 	} elseif ( is_day() ) {
 		$title['title'] = get_the_date();
-	}
+	}// End if().
 
 	// Add a page number if necessary.
 	if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
@@ -1259,8 +1268,9 @@
 function single_post_title( $prefix = '', $display = true ) {
 	$_post = get_queried_object();
 
-	if ( !isset($_post->post_title) )
+	if ( ! isset( $_post->post_title ) ) {
 		return;
+	}
 
 	/**
 	 * Filters the page title for a single post.
@@ -1271,10 +1281,10 @@
 	 * @param object $_post       The current queried object as returned by get_queried_object().
 	 */
 	$title = apply_filters( 'single_post_title', $_post->post_title, $_post );
-	if ( $display )
+	if ( $display ) {
 		echo $prefix . $title;
-	else
-		return $prefix . $title;
+	} else { return $prefix . $title;
+	}
 }
 
 /**
@@ -1290,12 +1300,14 @@
  * @return string|void Title when retrieving, null when displaying or failure.
  */
 function post_type_archive_title( $prefix = '', $display = true ) {
-	if ( ! is_post_type_archive() )
+	if ( ! is_post_type_archive() ) {
 		return;
+	}
 
 	$post_type = get_query_var( 'post_type' );
-	if ( is_array( $post_type ) )
+	if ( is_array( $post_type ) ) {
 		$post_type = reset( $post_type );
+	}
 
 	$post_type_obj = get_post_type_object( $post_type );
 
@@ -1309,10 +1321,10 @@
 	 */
 	$title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, $post_type );
 
-	if ( $display )
+	if ( $display ) {
 		echo $prefix . $title;
-	else
-		return $prefix . $title;
+	} else { return $prefix . $title;
+	}
 }
 
 /**
@@ -1365,8 +1377,9 @@
 function single_term_title( $prefix = '', $display = true ) {
 	$term = get_queried_object();
 
-	if ( !$term )
+	if ( ! $term ) {
 		return;
+	}
 
 	if ( is_category() ) {
 		/**
@@ -1399,13 +1412,14 @@
 		return;
 	}
 
-	if ( empty( $term_name ) )
+	if ( empty( $term_name ) ) {
 		return;
+	}
 
-	if ( $display )
+	if ( $display ) {
 		echo $prefix . $term_name;
-	else
-		return $prefix . $term_name;
+	} else { return $prefix . $term_name;
+	}
 }
 
 /**
@@ -1424,28 +1438,30 @@
  * @param bool   $display Optional, default is true. Whether to display or retrieve title.
  * @return string|void Title when retrieving.
  */
-function single_month_title($prefix = '', $display = true ) {
+function single_month_title( $prefix = '', $display = true ) {
 	global $wp_locale;
 
-	$m = get_query_var('m');
-	$year = get_query_var('year');
-	$monthnum = get_query_var('monthnum');
+	$m = get_query_var( 'm' );
+	$year = get_query_var( 'year' );
+	$monthnum = get_query_var( 'monthnum' );
 
-	if ( !empty($monthnum) && !empty($year) ) {
+	if ( ! empty( $monthnum ) && ! empty( $year ) ) {
 		$my_year = $year;
-		$my_month = $wp_locale->get_month($monthnum);
-	} elseif ( !empty($m) ) {
-		$my_year = substr($m, 0, 4);
-		$my_month = $wp_locale->get_month(substr($m, 4, 2));
+		$my_month = $wp_locale->get_month( $monthnum );
+	} elseif ( ! empty( $m ) ) {
+		$my_year = substr( $m, 0, 4 );
+		$my_month = $wp_locale->get_month( substr( $m, 4, 2 ) );
 	}
 
-	if ( empty($my_month) )
+	if ( empty( $my_month ) ) {
 		return false;
+	}
 
 	$result = $prefix . $my_month . $prefix . $my_year;
 
-	if ( !$display )
+	if ( ! $display ) {
 		return $result;
+	}
 	echo $result;
 }
 
@@ -1522,7 +1538,7 @@
 		$title = sprintf( __( '%1$s: %2$s' ), $tax->labels->singular_name, single_term_title( '', false ) );
 	} else {
 		$title = __( 'Archives' );
-	}
+	}// End if().
 
 	/**
 	 * Filters the archive title.
@@ -1611,18 +1627,19 @@
  * @param string $after  Optional. Content to append to the description. Default empty.
  * @return string HTML link content for archive.
  */
-function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
-	$text = wptexturize($text);
-	$url = esc_url($url);
+function get_archives_link( $url, $text, $format = 'html', $before = '', $after = '' ) {
+	$text = wptexturize( $text );
+	$url = esc_url( $url );
 
-	if ('link' == $format)
+	if ( 'link' == $format ) {
 		$link_html = "\t<link rel='archives' title='" . esc_attr( $text ) . "' href='$url' />\n";
-	elseif ('option' == $format)
+	} elseif ( 'option' == $format ) {
 		$link_html = "\t<option value='$url'>$before $text $after</option>\n";
-	elseif ('html' == $format)
+	} elseif ( 'html' == $format ) {
 		$link_html = "\t<li>$before<a href='$url'>$text</a>$after</li>\n";
-	else // custom
+	} else { // End if().
 		$link_html = "\t$before<a href='$url'>$text</a>$after\n";
+	}
 
 	/**
 	 * Filters the archive link content.
@@ -1679,11 +1696,15 @@
 	global $wpdb, $wp_locale;
 
 	$defaults = array(
-		'type' => 'monthly', 'limit' => '',
-		'format' => 'html', 'before' => '',
-		'after' => '', 'show_post_count' => false,
-		'echo' => 1, 'order' => 'DESC',
-		'post_type' => 'post'
+		'type' => 'monthly',
+	'limit' => '',
+		'format' => 'html',
+	'before' => '',
+		'after' => '',
+	'show_post_count' => false,
+		'echo' => 1,
+	'order' => 'DESC',
+		'post_type' => 'post',
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -1772,7 +1793,7 @@
 		}
 		if ( $results ) {
 			$after = $r['after'];
-			foreach ( (array) $results as $result) {
+			foreach ( (array) $results as $result ) {
 				$url = get_year_link( $result->year );
 				if ( 'post' !== $r['post_type'] ) {
 					$url = add_query_arg( 'post_type', $r['post_type'], $url );
@@ -1826,7 +1847,10 @@
 					$arc_week       = get_weekstartend( $result->yyyymmdd, get_option( 'start_of_week' ) );
 					$arc_week_start = date_i18n( get_option( 'date_format' ), $arc_week['start'] );
 					$arc_week_end   = date_i18n( get_option( 'date_format' ), $arc_week['end'] );
-					$url            = add_query_arg( array( 'm' => $arc_year, 'w' => $result->week, ), home_url( '/' ) );
+					$url            = add_query_arg( array(
+						'm' => $arc_year,
+						'w' => $result->week,
+					), home_url( '/' ) );
 					if ( 'post' !== $r['post_type'] ) {
 						$url = add_query_arg( 'post_type', $r['post_type'], $url );
 					}
@@ -1861,7 +1885,7 @@
 				}
 			}
 		}
-	}
+	}// End if().
 	if ( $r['echo'] ) {
 		echo $output;
 	} else {
@@ -1877,9 +1901,9 @@
  * @param int $num Number of day.
  * @return float Days since the start of the week.
  */
-function calendar_week_mod($num) {
+function calendar_week_mod( $num ) {
 	$base = 7;
-	return ($num - $base*floor($num/$base));
+	return ($num - $base * floor( $num / $base ));
 }
 
 /**
@@ -1925,7 +1949,7 @@
 
 	// Quick check. If we have no posts at all, abort!
 	if ( ! $posts ) {
-		$gotsome = $wpdb->get_var("SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");
+		$gotsome = $wpdb->get_var( "SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1" );
 		if ( ! $gotsome ) {
 			$cache[ $key ] = '';
 			wp_cache_set( 'get_calendar', $cache, 'calendar' );
@@ -1949,7 +1973,7 @@
 		$thisyear = (int) substr( $m, 0, 4 );
 		//it seems MySQL's weeks disagree with PHP's
 		$d = ( ( $w - 1 ) * 7 ) + 6;
-		$thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')");
+		$thismonth = $wpdb->get_var( "SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')" );
 	} elseif ( ! empty( $m ) ) {
 		$thisyear = (int) substr( $m, 0, 4 );
 		if ( strlen( $m ) < 6 ) {
@@ -1980,7 +2004,7 @@
 			LIMIT 1");
 
 	/* translators: Calendar caption: 1: month name, 2: 4-digit year */
-	$calendar_caption = _x('%1$s %2$s', 'calendar caption');
+	$calendar_caption = _x( '%1$s %2$s', 'calendar caption' );
 	$calendar_output = '<table id="wp-calendar">
 	<caption>' . sprintf(
 		$calendar_caption,
@@ -2010,21 +2034,21 @@
 	<tr>';
 
 	if ( $previous ) {
-		$calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link( $previous->year, $previous->month ) . '">&laquo; ' .
+		$calendar_output .= "\n\t\t" . '<td colspan="3" id="prev"><a href="' . get_month_link( $previous->year, $previous->month ) . '">&laquo; ' .
 			$wp_locale->get_month_abbrev( $wp_locale->get_month( $previous->month ) ) .
 		'</a></td>';
 	} else {
-		$calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad">&nbsp;</td>';
+		$calendar_output .= "\n\t\t" . '<td colspan="3" id="prev" class="pad">&nbsp;</td>';
 	}
 
-	$calendar_output .= "\n\t\t".'<td class="pad">&nbsp;</td>';
+	$calendar_output .= "\n\t\t" . '<td class="pad">&nbsp;</td>';
 
 	if ( $next ) {
-		$calendar_output .= "\n\t\t".'<td colspan="3" id="next"><a href="' . get_month_link( $next->year, $next->month ) . '">' .
+		$calendar_output .= "\n\t\t" . '<td colspan="3" id="next"><a href="' . get_month_link( $next->year, $next->month ) . '">' .
 			$wp_locale->get_month_abbrev( $wp_locale->get_month( $next->month ) ) .
 		' &raquo;</a></td>';
 	} else {
-		$calendar_output .= "\n\t\t".'<td colspan="3" id="next" class="pad">&nbsp;</td>';
+		$calendar_output .= "\n\t\t" . '<td colspan="3" id="next" class="pad">&nbsp;</td>';
 	}
 
 	$calendar_output .= '
@@ -2050,14 +2074,14 @@
 	// See how much we should pad in the beginning
 	$pad = calendar_week_mod( date( 'w', $unixmonth ) - $week_begins );
 	if ( 0 != $pad ) {
-		$calendar_output .= "\n\t\t".'<td colspan="'. esc_attr( $pad ) .'" class="pad">&nbsp;</td>';
+		$calendar_output .= "\n\t\t" . '<td colspan="' . esc_attr( $pad ) . '" class="pad">&nbsp;</td>';
 	}
 
 	$newrow = false;
 	$daysinmonth = (int) date( 't', $unixmonth );
 
 	for ( $day = 1; $day <= $daysinmonth; ++$day ) {
-		if ( isset($newrow) && $newrow ) {
+		if ( isset( $newrow ) && $newrow ) {
 			$calendar_output .= "\n\t</tr>\n\t<tr>\n\t\t";
 		}
 		$newrow = false;
@@ -2086,14 +2110,14 @@
 		}
 		$calendar_output .= '</td>';
 
-		if ( 6 == calendar_week_mod( date( 'w', mktime(0, 0 , 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) {
+		if ( 6 == calendar_week_mod( date( 'w', mktime( 0, 0 , 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) {
 			$newrow = true;
 		}
 	}
 
 	$pad = 7 - calendar_week_mod( date( 'w', mktime( 0, 0 , 0, $thismonth, $day, $thisyear ) ) - $week_begins );
 	if ( $pad != 0 && $pad != 7 ) {
-		$calendar_output .= "\n\t\t".'<td class="pad" colspan="'. esc_attr( $pad ) .'">&nbsp;</td>';
+		$calendar_output .= "\n\t\t" . '<td class="pad" colspan="' . esc_attr( $pad ) . '">&nbsp;</td>';
 	}
 	$calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>";
 
@@ -2141,10 +2165,10 @@
 	global $allowedtags;
 	$allowed = '';
 	foreach ( (array) $allowedtags as $tag => $attributes ) {
-		$allowed .= '<'.$tag;
-		if ( 0 < count($attributes) ) {
+		$allowed .= '<' . $tag;
+		if ( 0 < count( $attributes ) ) {
 			foreach ( $attributes as $attribute => $limits ) {
-				$allowed .= ' '.$attribute.'=""';
+				$allowed .= ' ' . $attribute . '=""';
 			}
 		}
 		$allowed .= '> ';
@@ -2206,10 +2230,10 @@
 		 */
 		$the_date = apply_filters( 'the_date', $the_date, $d, $before, $after );
 
-		if ( $echo )
+		if ( $echo ) {
 			echo $the_date;
-		else
-			return $the_date;
+		} else { return $the_date;
+		}
 	}
 }
 
@@ -2263,7 +2287,7 @@
  * @return string|void String if retrieving.
  */
 function the_modified_date( $d = '', $before = '', $after = '', $echo = true ) {
-	$the_modified_date = $before . get_the_modified_date($d) . $after;
+	$the_modified_date = $before . get_the_modified_date( $d ) . $after;
 
 	/**
 	 * Filters the date a post was last modified for display.
@@ -2278,10 +2302,10 @@
 	 */
 	$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $d, $before, $after );
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $the_modified_date;
-	else
-		return $the_modified_date;
+	} else { return $the_modified_date;
+	}
 
 }
 
@@ -2353,16 +2377,16 @@
  * @return string|int|false Formatted date string or Unix timestamp if `$id` is 'U' or 'G'. False on failure.
  */
 function get_the_time( $d = '', $post = null ) {
-	$post = get_post($post);
+	$post = get_post( $post );
 
 	if ( ! $post ) {
 		return false;
 	}
 
-	if ( '' == $d )
-		$the_time = get_post_time(get_option('time_format'), false, $post, true);
-	else
-		$the_time = get_post_time($d, false, $post, true);
+	if ( '' == $d ) {
+		$the_time = get_post_time( get_option( 'time_format' ), false, $post, true );
+	} else { $the_time = get_post_time( $d, false, $post, true );
+	}
 
 	/**
 	 * Filters the time a post was written.
@@ -2391,18 +2415,18 @@
  * @return string|int|false Formatted date string or Unix timestamp if `$id` is 'U' or 'G'. False on failure.
  */
 function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
-	$post = get_post($post);
+	$post = get_post( $post );
 
 	if ( ! $post ) {
 		return false;
 	}
 
-	if ( $gmt )
+	if ( $gmt ) {
 		$time = $post->post_date_gmt;
-	else
-		$time = $post->post_date;
+	} else { $time = $post->post_date;
+	}
 
-	$time = mysql2date($d, $time, $translate);
+	$time = mysql2date( $d, $time, $translate );
 
 	/**
 	 * Filters the localized time a post was written.
@@ -2424,7 +2448,7 @@
  *
  * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option.
  */
-function the_modified_time($d = '') {
+function the_modified_time( $d = '' ) {
 	/**
 	 * Filters the localized time a post was last modified, for display.
 	 *
@@ -2435,7 +2459,7 @@
 	 *                                      or php date format. Defaults to value
 	 *                                      specified in 'time_format' option.
 	 */
-	echo apply_filters( 'the_modified_time', get_the_modified_time($d), $d );
+	echo apply_filters( 'the_modified_time', get_the_modified_time( $d ), $d );
 }
 
 /**
@@ -2490,17 +2514,17 @@
  * @return string|int|false Formatted date string or Unix timestamp if `$id` is 'U' or 'G'. False on failure.
  */
 function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
-	$post = get_post($post);
+	$post = get_post( $post );
 
 	if ( ! $post ) {
 		return false;
 	}
 
-	if ( $gmt )
+	if ( $gmt ) {
 		$time = $post->post_modified_gmt;
-	else
-		$time = $post->post_modified;
-	$time = mysql2date($d, $time, $translate);
+	} else { $time = $post->post_modified;
+	}
+	$time = mysql2date( $d, $time, $translate );
 
 	/**
 	 * Filters the localized time a post was last modified.
@@ -2550,7 +2574,7 @@
  * @param string $before Optional Output before the date.
  * @param string $after Optional Output after the date.
  */
-function the_weekday_date($before='',$after='') {
+function the_weekday_date( $before = '', $after = '' ) {
 	global $wp_locale, $currentday, $previousweekday;
 	$the_weekday_date = '';
 	if ( $currentday != $previousweekday ) {
@@ -2613,16 +2637,17 @@
  * @param array $args Optional arguments.
  */
 function feed_links( $args = array() ) {
-	if ( !current_theme_supports('automatic-feed-links') )
+	if ( ! current_theme_supports( 'automatic-feed-links' ) ) {
 		return;
+	}
 
 	$defaults = array(
 		/* translators: Separator between blog name and feed type in feed links */
-		'separator'	=> _x('&raquo;', 'feed link'),
+		'separator'	=> _x( '&raquo;', 'feed link' ),
 		/* translators: 1: blog title, 2: separator (raquo) */
-		'feedtitle'	=> __('%1$s %2$s Feed'),
+		'feedtitle'	=> __( '%1$s %2$s Feed' ),
 		/* translators: 1: blog title, 2: separator (raquo) */
-		'comstitle'	=> __('%1$s %2$s Comments Feed'),
+		'comstitle'	=> __( '%1$s %2$s Comments Feed' ),
 	);
 
 	$args = wp_parse_args( $args, $defaults );
@@ -2660,21 +2685,21 @@
 function feed_links_extra( $args = array() ) {
 	$defaults = array(
 		/* translators: Separator between blog name and feed type in feed links */
-		'separator'   => _x('&raquo;', 'feed link'),
+		'separator'   => _x( '&raquo;', 'feed link' ),
 		/* translators: 1: blog name, 2: separator(raquo), 3: post title */
-		'singletitle' => __('%1$s %2$s %3$s Comments Feed'),
+		'singletitle' => __( '%1$s %2$s %3$s Comments Feed' ),
 		/* translators: 1: blog name, 2: separator(raquo), 3: category name */
-		'cattitle'    => __('%1$s %2$s %3$s Category Feed'),
+		'cattitle'    => __( '%1$s %2$s %3$s Category Feed' ),
 		/* translators: 1: blog name, 2: separator(raquo), 3: tag name */
-		'tagtitle'    => __('%1$s %2$s %3$s Tag Feed'),
+		'tagtitle'    => __( '%1$s %2$s %3$s Tag Feed' ),
 		/* translators: 1: blog name, 2: separator(raquo), 3: term name, 4: taxonomy singular name */
-		'taxtitle'    => __('%1$s %2$s %3$s %4$s Feed'),
+		'taxtitle'    => __( '%1$s %2$s %3$s %4$s Feed' ),
 		/* translators: 1: blog name, 2: separator(raquo), 3: author name  */
-		'authortitle' => __('%1$s %2$s Posts by %3$s Feed'),
+		'authortitle' => __( '%1$s %2$s Posts by %3$s Feed' ),
 		/* translators: 1: blog name, 2: separator(raquo), 3: search phrase */
-		'searchtitle' => __('%1$s %2$s Search Results for &#8220;%3$s&#8221; Feed'),
+		'searchtitle' => __( '%1$s %2$s Search Results for &#8220;%3$s&#8221; Feed' ),
 		/* translators: 1: blog name, 2: separator(raquo), 3: post type name */
-		'posttypetitle' => __('%1$s %2$s %3$s Feed'),
+		'posttypetitle' => __( '%1$s %2$s %3$s Feed' ),
 	);
 
 	$args = wp_parse_args( $args, $defaults );
@@ -2684,13 +2709,16 @@
 		$post = get_post( $id );
 
 		if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
-			$title = sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], the_title_attribute( array( 'echo' => false ) ) );
+			$title = sprintf( $args['singletitle'], get_bloginfo( 'name' ), $args['separator'], the_title_attribute( array(
+				'echo' => false,
+			) ) );
 			$href = get_post_comments_feed_link( $post->ID );
 		}
 	} elseif ( is_post_type_archive() ) {
 		$post_type = get_query_var( 'post_type' );
-		if ( is_array( $post_type ) )
+		if ( is_array( $post_type ) ) {
 			$post_type = reset( $post_type );
+		}
 
 		$post_type_obj = get_post_type_object( $post_type );
 		$title = sprintf( $args['posttypetitle'], get_bloginfo( 'name' ), $args['separator'], $post_type_obj->labels->name );
@@ -2699,38 +2727,40 @@
 		$term = get_queried_object();
 
 		if ( $term ) {
-			$title = sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name );
+			$title = sprintf( $args['cattitle'], get_bloginfo( 'name' ), $args['separator'], $term->name );
 			$href = get_category_feed_link( $term->term_id );
 		}
 	} elseif ( is_tag() ) {
 		$term = get_queried_object();
 
 		if ( $term ) {
-			$title = sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name );
+			$title = sprintf( $args['tagtitle'], get_bloginfo( 'name' ), $args['separator'], $term->name );
 			$href = get_tag_feed_link( $term->term_id );
 		}
 	} elseif ( is_tax() ) {
- 		$term = get_queried_object();
- 		$tax = get_taxonomy( $term->taxonomy );
- 		$title = sprintf( $args['taxtitle'], get_bloginfo('name'), $args['separator'], $term->name, $tax->labels->singular_name );
- 		$href = get_term_feed_link( $term->term_id, $term->taxonomy );
+		 $term = get_queried_object();
+		 $tax = get_taxonomy( $term->taxonomy );
+		 $title = sprintf( $args['taxtitle'], get_bloginfo( 'name' ), $args['separator'], $term->name, $tax->labels->singular_name );
+		 $href = get_term_feed_link( $term->term_id, $term->taxonomy );
 	} elseif ( is_author() ) {
-		$author_id = intval( get_query_var('author') );
+		$author_id = intval( get_query_var( 'author' ) );
 
-		$title = sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_the_author_meta( 'display_name', $author_id ) );
+		$title = sprintf( $args['authortitle'], get_bloginfo( 'name' ), $args['separator'], get_the_author_meta( 'display_name', $author_id ) );
 		$href = get_author_feed_link( $author_id );
 	} elseif ( is_search() ) {
-		$title = sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query( false ) );
+		$title = sprintf( $args['searchtitle'], get_bloginfo( 'name' ), $args['separator'], get_search_query( false ) );
 		$href = get_search_feed_link();
 	} elseif ( is_post_type_archive() ) {
-		$title = sprintf( $args['posttypetitle'], get_bloginfo('name'), $args['separator'], post_type_archive_title( '', false ) );
+		$title = sprintf( $args['posttypetitle'], get_bloginfo( 'name' ), $args['separator'], post_type_archive_title( '', false ) );
 		$post_type_obj = get_queried_object();
-		if ( $post_type_obj )
+		if ( $post_type_obj ) {
 			$href = get_post_type_archive_feed_link( $post_type_obj->name );
-	}
+		}
+	}// End if().
 
-	if ( isset($title) && isset($href) )
+	if ( isset( $title ) && isset( $href ) ) {
 		echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( $title ) . '" href="' . esc_url( $href ) . '" />' . "\n";
+	}
 }
 
 /**
@@ -2771,8 +2801,9 @@
  */
 function noindex() {
 	// If the blog is not public, tell robots to go away.
-	if ( '0' == get_option('blog_public') )
+	if ( '0' == get_option( 'blog_public' ) ) {
 		wp_no_robots();
+	}
 }
 
 /**
@@ -2916,14 +2947,14 @@
 			$atts['href'] = $url;
 
 			$unique_urls[ $url ] = $atts;
-		}
+		}// End foreach().
 
 		foreach ( $unique_urls as $atts ) {
 			$html = '';
 
 			foreach ( $atts as $attr => $value ) {
 				if ( ! is_scalar( $value ) ||
-				     ( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr', 'rel', 'type' ), true ) && ! is_numeric( $attr ))
+					 ( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr', 'rel', 'type' ), true ) && ! is_numeric( $attr ))
 				) {
 					continue;
 				}
@@ -2941,7 +2972,7 @@
 
 			echo "<link $html />\n";
 		}
-	}
+	}// End foreach().
 }
 
 /**
@@ -2997,7 +3028,7 @@
 function user_can_richedit() {
 	global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_IE, $is_edge;
 
-	if ( !isset($wp_rich_edit) ) {
+	if ( ! isset( $wp_rich_edit ) ) {
 		$wp_rich_edit = false;
 
 		if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users
@@ -3005,7 +3036,7 @@
 				$wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 );
 			} elseif ( $is_IE ) {
 				$wp_rich_edit = ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE ' ) === false );
-			} elseif ( $is_gecko || $is_chrome || $is_edge || ( $is_opera && !wp_is_mobile() ) ) {
+			} elseif ( $is_gecko || $is_chrome || $is_edge || ( $is_opera && ! wp_is_mobile() ) ) {
 				$wp_rich_edit = true;
 			}
 		}
@@ -3034,8 +3065,8 @@
 function wp_default_editor() {
 	$r = user_can_richedit() ? 'tinymce' : 'html'; // defaults
 	if ( wp_get_current_user() ) { // look for cookie
-		$ed = get_user_setting('editor', 'tinymce');
-		$r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r;
+		$ed = get_user_setting( 'editor', 'tinymce' );
+		$r = ( in_array( $ed, array( 'tinymce', 'html', 'test' ) ) ) ? $ed : $r;
 	}
 
 	/**
@@ -3068,9 +3099,10 @@
  * @param array  $settings  See _WP_Editors::editor().
  */
 function wp_editor( $content, $editor_id, $settings = array() ) {
-	if ( ! class_exists( '_WP_Editors', false ) )
+	if ( ! class_exists( '_WP_Editors', false ) ) {
 		require( ABSPATH . WPINC . '/class-wp-editor.php' );
-	_WP_Editors::editor($content, $editor_id, $settings);
+	}
+	_WP_Editors::editor( $content, $editor_id, $settings );
 }
 
 /**
@@ -3112,8 +3144,9 @@
 	 */
 	$query = apply_filters( 'get_search_query', get_query_var( 's' ) );
 
-	if ( $escaped )
+	if ( $escaped ) {
 		$query = esc_attr( $query );
+	}
 	return $query;
 }
 
@@ -3149,18 +3182,21 @@
 function get_language_attributes( $doctype = 'html' ) {
 	$attributes = array();
 
-	if ( function_exists( 'is_rtl' ) && is_rtl() )
+	if ( function_exists( 'is_rtl' ) && is_rtl() ) {
 		$attributes[] = 'dir="rtl"';
+	}
 
-	if ( $lang = get_bloginfo('language') ) {
-		if ( get_option('html_type') == 'text/html' || $doctype == 'html' )
+	if ( $lang = get_bloginfo( 'language' ) ) {
+		if ( get_option( 'html_type' ) == 'text/html' || $doctype == 'html' ) {
 			$attributes[] = "lang=\"$lang\"";
+		}
 
-		if ( get_option('html_type') != 'text/html' || $doctype == 'xhtml' )
+		if ( get_option( 'html_type' ) != 'text/html' || $doctype == 'xhtml' ) {
 			$attributes[] = "xml:lang=\"$lang\"";
+		}
 	}
 
-	$output = implode(' ', $attributes);
+	$output = implode( ' ', $attributes );
 
 	/**
 	 * Filters the language attributes for display in the html tag.
@@ -3289,15 +3325,15 @@
 		'current' => $current,
 		'show_all' => false,
 		'prev_next' => true,
-		'prev_text' => __('&laquo; Previous'),
-		'next_text' => __('Next &raquo;'),
+		'prev_text' => __( '&laquo; Previous' ),
+		'next_text' => __( 'Next &raquo;' ),
 		'end_size' => 1,
 		'mid_size' => 2,
 		'type' => 'plain',
 		'add_args' => array(), // array of query args to add
 		'add_fragment' => '',
 		'before_page_number' => '',
-		'after_page_number' => ''
+		'after_page_number' => '',
 	);
 
 	$args = wp_parse_args( $args, $defaults );
@@ -3346,8 +3382,9 @@
 	if ( $args['prev_next'] && $current && 1 < $current ) :
 		$link = str_replace( '%_%', 2 == $current ? '' : $args['format'], $args['base'] );
 		$link = str_replace( '%#%', $current - 1, $link );
-		if ( $add_args )
+		if ( $add_args ) {
 			$link = add_query_arg( $add_args, $link );
+		}
 		$link .= $args['add_fragment'];
 
 		/**
@@ -3361,18 +3398,19 @@
 	endif;
 	for ( $n = 1; $n <= $total; $n++ ) :
 		if ( $n == $current ) :
-			$page_links[] = "<span class='page-numbers current'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . "</span>";
+			$page_links[] = "<span class='page-numbers current'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '</span>';
 			$dots = true;
 		else :
 			if ( $args['show_all'] || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) :
 				$link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] );
 				$link = str_replace( '%#%', $n, $link );
-				if ( $add_args )
+				if ( $add_args ) {
 					$link = add_query_arg( $add_args, $link );
+				}
 				$link .= $args['add_fragment'];
 
 				/** This filter is documented in wp-includes/general-template.php */
-				$page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . "</a>";
+				$page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '</a>';
 				$dots = true;
 			elseif ( $dots && ! $args['show_all'] ) :
 				$page_links[] = '<span class="page-numbers dots">' . __( '&hellip;' ) . '</span>';
@@ -3383,8 +3421,9 @@
 	if ( $args['prev_next'] && $current && $current < $total ) :
 		$link = str_replace( '%_%', $args['format'], $args['base'] );
 		$link = str_replace( '%#%', $current + 1, $link );
-		if ( $add_args )
+		if ( $add_args ) {
 			$link = add_query_arg( $add_args, $link );
+		}
 		$link .= $args['add_fragment'];
 
 		/** This filter is documented in wp-includes/general-template.php */
@@ -3396,12 +3435,12 @@
 
 		case 'list' :
 			$r .= "<ul class='page-numbers'>\n\t<li>";
-			$r .= join("</li>\n\t<li>", $page_links);
+			$r .= join( "</li>\n\t<li>", $page_links );
 			$r .= "</li>\n</ul>\n";
 			break;
 
 		default :
-			$r = join("\n", $page_links);
+			$r = join( "\n", $page_links );
 			break;
 	}
 	return $r;
@@ -3436,10 +3475,11 @@
 function wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = array() ) {
 	global $_wp_admin_css_colors;
 
-	if ( !isset($_wp_admin_css_colors) )
+	if ( ! isset( $_wp_admin_css_colors ) ) {
 		$_wp_admin_css_colors = array();
+	}
 
-	$_wp_admin_css_colors[$key] = (object) array(
+	$_wp_admin_css_colors[ $key ] = (object) array(
 		'name' => $name,
 		'url' => $url,
 		'colors' => $colors,
@@ -3459,7 +3499,11 @@
 	wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ),
 		false,
 		array( '#222', '#333', '#0073aa', '#00a0d2' ),
-		array( 'base' => '#82878c', 'focus' => '#00a0d2', 'current' => '#fff' )
+		array(
+			'base' => '#82878c',
+			'focus' => '#00a0d2',
+			'current' => '#fff',
+		)
 	);
 
 	// Other color schemes are not available when running out of src
@@ -3470,43 +3514,71 @@
 	wp_admin_css_color( 'light', _x( 'Light', 'admin color scheme' ),
 		admin_url( "css/colors/light/colors$suffix.css" ),
 		array( '#e5e5e5', '#999', '#d64e07', '#04a4cc' ),
-		array( 'base' => '#999', 'focus' => '#ccc', 'current' => '#ccc' )
+		array(
+			'base' => '#999',
+			'focus' => '#ccc',
+			'current' => '#ccc',
+		)
 	);
 
 	wp_admin_css_color( 'blue', _x( 'Blue', 'admin color scheme' ),
 		admin_url( "css/colors/blue/colors$suffix.css" ),
 		array( '#096484', '#4796b3', '#52accc', '#74B6CE' ),
-		array( 'base' => '#e5f8ff', 'focus' => '#fff', 'current' => '#fff' )
+		array(
+			'base' => '#e5f8ff',
+			'focus' => '#fff',
+			'current' => '#fff',
+		)
 	);
 
 	wp_admin_css_color( 'midnight', _x( 'Midnight', 'admin color scheme' ),
 		admin_url( "css/colors/midnight/colors$suffix.css" ),
 		array( '#25282b', '#363b3f', '#69a8bb', '#e14d43' ),
-		array( 'base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff' )
+		array(
+			'base' => '#f1f2f3',
+			'focus' => '#fff',
+			'current' => '#fff',
+		)
 	);
 
 	wp_admin_css_color( 'sunrise', _x( 'Sunrise', 'admin color scheme' ),
 		admin_url( "css/colors/sunrise/colors$suffix.css" ),
 		array( '#b43c38', '#cf4944', '#dd823b', '#ccaf0b' ),
-		array( 'base' => '#f3f1f1', 'focus' => '#fff', 'current' => '#fff' )
+		array(
+			'base' => '#f3f1f1',
+			'focus' => '#fff',
+			'current' => '#fff',
+		)
 	);
 
 	wp_admin_css_color( 'ectoplasm', _x( 'Ectoplasm', 'admin color scheme' ),
 		admin_url( "css/colors/ectoplasm/colors$suffix.css" ),
 		array( '#413256', '#523f6d', '#a3b745', '#d46f15' ),
-		array( 'base' => '#ece6f6', 'focus' => '#fff', 'current' => '#fff' )
+		array(
+			'base' => '#ece6f6',
+			'focus' => '#fff',
+			'current' => '#fff',
+		)
 	);
 
 	wp_admin_css_color( 'ocean', _x( 'Ocean', 'admin color scheme' ),
 		admin_url( "css/colors/ocean/colors$suffix.css" ),
 		array( '#627c83', '#738e96', '#9ebaa0', '#aa9d88' ),
-		array( 'base' => '#f2fcff', 'focus' => '#fff', 'current' => '#fff' )
+		array(
+			'base' => '#f2fcff',
+			'focus' => '#fff',
+			'current' => '#fff',
+		)
 	);
 
 	wp_admin_css_color( 'coffee', _x( 'Coffee', 'admin color scheme' ),
 		admin_url( "css/colors/coffee/colors$suffix.css" ),
 		array( '#46403c', '#59524c', '#c7a589', '#9ea476' ),
-		array( 'base' => '#f3f2f1', 'focus' => '#fff', 'current' => '#fff' )
+		array(
+			'base' => '#f3f2f1',
+			'focus' => '#fff',
+			'current' => '#fff',
+		)
 	);
 
 }
@@ -3522,10 +3594,10 @@
  * @return string
  */
 function wp_admin_css_uri( $file = 'wp-admin' ) {
-	if ( defined('WP_INSTALLING') ) {
+	if ( defined( 'WP_INSTALLING' ) ) {
 		$_file = "./$file.css";
 	} else {
-		$_file = admin_url("$file.css");
+		$_file = admin_url( "$file.css" );
 	}
 	$_file = add_query_arg( 'version', get_bloginfo( 'version' ),  $_file );
 
@@ -3565,10 +3637,11 @@
 	$handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file;
 
 	if ( wp_styles()->query( $handle ) ) {
-		if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue. Print this one immediately
+		if ( $force_echo || did_action( 'wp_print_styles' ) ) { // we already printed the style queue. Print this one immediately
 			wp_print_styles( $handle );
-		else // Add to style queue
+		} else { // End if().
 			wp_enqueue_style( $handle );
+		}
 		return;
 	}
 
@@ -3604,8 +3677,9 @@
 	wp_enqueue_script( 'thickbox' );
 	wp_enqueue_style( 'thickbox' );
 
-	if ( is_network_admin() )
+	if ( is_network_admin() ) {
 		add_action( 'admin_head', '_thickbox_path_admin_subfolder' );
+	}
 }
 
 /**
@@ -3646,7 +3720,7 @@
 	 * @param string $type           The type of generator to output. Accepts 'html',
 	 *                               'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'.
 	 */
-	echo apply_filters( 'the_generator', get_the_generator($type), $type ) . "\n";
+	echo apply_filters( 'the_generator', get_the_generator( $type ), $type ) . "\n";
 }
 
 /**
@@ -3665,8 +3739,9 @@
 	if ( empty( $type ) ) {
 
 		$current_filter = current_filter();
-		if ( empty( $current_filter ) )
+		if ( empty( $current_filter ) ) {
 			return;
+		}
 
 		switch ( $current_filter ) {
 			case 'rss2_head' :
@@ -3708,7 +3783,7 @@
 			$gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->';
 			break;
 		case 'export':
-			$gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '" -->';
+			$gen = '<!-- generator="WordPress/' . get_bloginfo_rss( 'version' ) . '" created="' . date( 'Y-m-d H:i' ) . '" -->';
 			break;
 	}
 
@@ -3789,13 +3864,14 @@
  * @return string html attribute or empty string
  */
 function __checked_selected_helper( $helper, $current, $echo, $type ) {
-	if ( (string) $helper === (string) $current )
+	if ( (string) $helper === (string) $current ) {
 		$result = " $type='$type'";
-	else
-		$result = '';
+	} else { $result = '';
+	}
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $result;
+	}
 
 	return $result;
 }
@@ -3811,11 +3887,13 @@
  * @return array $settings
  */
 function wp_heartbeat_settings( $settings ) {
-	if ( ! is_admin() )
+	if ( ! is_admin() ) {
 		$settings['ajaxurl'] = admin_url( 'admin-ajax.php', 'relative' );
+	}
 
-	if ( is_user_logged_in() )
+	if ( is_user_logged_in() ) {
 		$settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' );
+	}
 
 	return $settings;
 }
Index: src/wp-includes/http.php
===================================================================
--- src/wp-includes/http.php	(revision 40901)
+++ src/wp-includes/http.php	(working copy)
@@ -148,7 +148,7 @@
  * @param array  $args Optional. Request arguments. Default empty array.
  * @return WP_Error|array The response or WP_Error on failure.
  */
-function wp_remote_request($url, $args = array()) {
+function wp_remote_request( $url, $args = array() ) {
 	$http = _wp_http_get_object();
 	return $http->request( $url, $args );
 }
@@ -165,7 +165,7 @@
  * @param array  $args Optional. Request arguments. Default empty array.
  * @return WP_Error|array The response or WP_Error on failure.
  */
-function wp_remote_get($url, $args = array()) {
+function wp_remote_get( $url, $args = array() ) {
 	$http = _wp_http_get_object();
 	return $http->get( $url, $args );
 }
@@ -182,7 +182,7 @@
  * @param array  $args Optional. Request arguments. Default empty array.
  * @return WP_Error|array The response or WP_Error on failure.
  */
-function wp_remote_post($url, $args = array()) {
+function wp_remote_post( $url, $args = array() ) {
 	$http = _wp_http_get_object();
 	return $http->post( $url, $args );
 }
@@ -199,7 +199,7 @@
  * @param array  $args Optional. Request arguments. Default empty array.
  * @return WP_Error|array The response or WP_Error on failure.
  */
-function wp_remote_head($url, $args = array()) {
+function wp_remote_head( $url, $args = array() ) {
 	$http = _wp_http_get_object();
 	return $http->head( $url, $args );
 }
@@ -238,7 +238,7 @@
 	}
 
 	if ( isset( $response['headers'][ $header ] ) ) {
-		return $response['headers'][$header];
+		return $response['headers'][ $header ];
 	}
 
 	return '';
@@ -255,8 +255,9 @@
  * @return int|string The response code as an integer. Empty string on incorrect parameter given.
  */
 function wp_remote_retrieve_response_code( $response ) {
-	if ( is_wp_error($response) || ! isset($response['response']) || ! is_array($response['response']))
+	if ( is_wp_error( $response ) || ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) {
 		return '';
+	}
 
 	return $response['response']['code'];
 }
@@ -272,8 +273,9 @@
  * @return string The response message. Empty string on incorrect parameter given.
  */
 function wp_remote_retrieve_response_message( $response ) {
-	if ( is_wp_error($response) || ! isset($response['response']) || ! is_array($response['response']))
+	if ( is_wp_error( $response ) || ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) {
 		return '';
+	}
 
 	return $response['response']['message'];
 }
@@ -287,8 +289,9 @@
  * @return string The body of the response. Empty string if no body or incorrect parameter given.
  */
 function wp_remote_retrieve_body( $response ) {
-	if ( is_wp_error($response) || ! isset($response['body']) )
+	if ( is_wp_error( $response ) || ! isset( $response['body'] ) ) {
 		return '';
+	}
 
 	return $response['body'];
 }
@@ -376,7 +379,7 @@
 		$capabilities = array_combine( array_values( $capabilities ), array_fill( 0, $count, true ) );
 	}
 
-	if ( $url && !isset( $capabilities['ssl'] ) ) {
+	if ( $url && ! isset( $capabilities['ssl'] ) ) {
 		$scheme = parse_url( $url, PHP_URL_SCHEME );
 		if ( 'https' == $scheme || 'ssl' == $scheme ) {
 			$capabilities['ssl'] = true;
@@ -395,8 +398,9 @@
  */
 function get_http_origin() {
 	$origin = '';
-	if ( ! empty ( $_SERVER[ 'HTTP_ORIGIN' ] ) )
-		$origin = $_SERVER[ 'HTTP_ORIGIN' ];
+	if ( ! empty( $_SERVER['HTTP_ORIGIN'] ) ) {
+		$origin = $_SERVER['HTTP_ORIGIN'];
+	}
 
 	/**
 	 * Change the origin of an HTTP request.
@@ -421,10 +425,10 @@
 
 	// @todo preserve port?
 	$allowed_origins = array_unique( array(
-		'http://' . $admin_origin[ 'host' ],
-		'https://' . $admin_origin[ 'host' ],
-		'http://' . $home_origin[ 'host' ],
-		'https://' . $home_origin[ 'host' ],
+		'http://' . $admin_origin['host'],
+		'https://' . $admin_origin['host'],
+		'http://' . $home_origin['host'],
+		'https://' . $home_origin['host'],
 	) );
 
 	/**
@@ -454,11 +458,13 @@
 function is_allowed_http_origin( $origin = null ) {
 	$origin_arg = $origin;
 
-	if ( null === $origin )
+	if ( null === $origin ) {
 		$origin = get_http_origin();
+	}
 
-	if ( $origin && ! in_array( $origin, get_allowed_http_origins() ) )
+	if ( $origin && ! in_array( $origin, get_allowed_http_origins() ) ) {
 		$origin = '';
+	}
 
 	/**
 	 * Change the allowed HTTP origin result.
@@ -488,10 +494,11 @@
 	$origin = get_http_origin();
 
 	if ( is_allowed_http_origin( $origin ) ) {
-		@header( 'Access-Control-Allow-Origin: ' .  $origin );
+		@header( 'Access-Control-Allow-Origin: ' . $origin );
 		@header( 'Access-Control-Allow-Credentials: true' );
-		if ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] )
+		if ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) {
 			exit;
+		}
 		return $origin;
 	}
 
@@ -514,18 +521,22 @@
 function wp_http_validate_url( $url ) {
 	$original_url = $url;
 	$url = wp_kses_bad_protocol( $url, array( 'http', 'https' ) );
-	if ( ! $url || strtolower( $url ) !== strtolower( $original_url ) )
+	if ( ! $url || strtolower( $url ) !== strtolower( $original_url ) ) {
 		return false;
+	}
 
 	$parsed_url = @parse_url( $url );
-	if ( ! $parsed_url || empty( $parsed_url['host'] ) )
+	if ( ! $parsed_url || empty( $parsed_url['host'] ) ) {
 		return false;
+	}
 
-	if ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) )
+	if ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) ) {
 		return false;
+	}
 
-	if ( false !== strpbrk( $parsed_url['host'], ':#?[]' ) )
+	if ( false !== strpbrk( $parsed_url['host'], ':#?[]' ) ) {
 		return false;
+	}
 
 	$parsed_home = @parse_url( get_option( 'home' ) );
 
@@ -541,8 +552,9 @@
 			$ip = $host;
 		} else {
 			$ip = gethostbyname( $host );
-			if ( $ip === $host ) // Error condition for gethostbyname()
+			if ( $ip === $host ) { // Error condition for gethostbyname()
 				$ip = false;
+			}
 		}
 		if ( $ip ) {
 			$parts = array_map( 'intval', explode( '.', $ip ) );
@@ -562,21 +574,25 @@
 				 * @param string $host IP of the requested host.
 				 * @param string $url  URL of the requested host.
 				 */
-				if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) )
+				if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) {
 					return false;
+				}
 			}
 		}
 	}
 
-	if ( empty( $parsed_url['port'] ) )
+	if ( empty( $parsed_url['port'] ) ) {
 		return $url;
+	}
 
 	$port = $parsed_url['port'];
-	if ( 80 === $port || 443 === $port || 8080 === $port )
+	if ( 80 === $port || 443 === $port || 8080 === $port ) {
 		return $url;
+	}
 
-	if ( $parsed_home && $same_host && isset( $parsed_home['port'] ) && $parsed_home['port'] === $port )
+	if ( $parsed_home && $same_host && isset( $parsed_home['port'] ) && $parsed_home['port'] === $port ) {
 		return $url;
+	}
 
 	return false;
 }
@@ -593,8 +609,9 @@
  * @return bool
  */
 function allowed_http_request_hosts( $is_external, $host ) {
-	if ( ! $is_external && wp_validate_redirect( 'http://' . $host ) )
+	if ( ! $is_external && wp_validate_redirect( 'http://' . $host ) ) {
 		$is_external = true;
+	}
 	return $is_external;
 }
 
@@ -615,12 +632,15 @@
 function ms_allowed_http_request_hosts( $is_external, $host ) {
 	global $wpdb;
 	static $queried = array();
-	if ( $is_external )
+	if ( $is_external ) {
 		return $is_external;
-	if ( $host === get_network()->domain )
+	}
+	if ( $host === get_network()->domain ) {
 		return true;
-	if ( isset( $queried[ $host ] ) )
+	}
+	if ( isset( $queried[ $host ] ) ) {
 		return $queried[ $host ];
+	}
 	$queried[ $host ] = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT domain FROM $wpdb->blogs WHERE domain = %s LIMIT 1", $host ) );
 	return $queried[ $host ];
 }
Index: src/wp-includes/kses.php
===================================================================
--- src/wp-includes/kses.php	(revision 40901)
+++ src/wp-includes/kses.php	(working copy)
@@ -42,8 +42,9 @@
  *
  * @since 1.2.0
  */
-if ( ! defined( 'CUSTOM_TAGS' ) )
+if ( ! defined( 'CUSTOM_TAGS' ) ) {
 	define( 'CUSTOM_TAGS', false );
+}
 
 // Ensure that these variables are added to the global namespace
 // (e.g. if using namespaces / autoload in the current PHP environment).
@@ -452,48 +453,258 @@
 	);
 
 	$allowedentitynames = array(
-		'nbsp',    'iexcl',  'cent',    'pound',  'curren', 'yen',
-		'brvbar',  'sect',   'uml',     'copy',   'ordf',   'laquo',
-		'not',     'shy',    'reg',     'macr',   'deg',    'plusmn',
-		'acute',   'micro',  'para',    'middot', 'cedil',  'ordm',
-		'raquo',   'iquest', 'Agrave',  'Aacute', 'Acirc',  'Atilde',
-		'Auml',    'Aring',  'AElig',   'Ccedil', 'Egrave', 'Eacute',
-		'Ecirc',   'Euml',   'Igrave',  'Iacute', 'Icirc',  'Iuml',
-		'ETH',     'Ntilde', 'Ograve',  'Oacute', 'Ocirc',  'Otilde',
-		'Ouml',    'times',  'Oslash',  'Ugrave', 'Uacute', 'Ucirc',
-		'Uuml',    'Yacute', 'THORN',   'szlig',  'agrave', 'aacute',
-		'acirc',   'atilde', 'auml',    'aring',  'aelig',  'ccedil',
-		'egrave',  'eacute', 'ecirc',   'euml',   'igrave', 'iacute',
-		'icirc',   'iuml',   'eth',     'ntilde', 'ograve', 'oacute',
-		'ocirc',   'otilde', 'ouml',    'divide', 'oslash', 'ugrave',
-		'uacute',  'ucirc',  'uuml',    'yacute', 'thorn',  'yuml',
-		'quot',    'amp',    'lt',      'gt',     'apos',   'OElig',
-		'oelig',   'Scaron', 'scaron',  'Yuml',   'circ',   'tilde',
-		'ensp',    'emsp',   'thinsp',  'zwnj',   'zwj',    'lrm',
-		'rlm',     'ndash',  'mdash',   'lsquo',  'rsquo',  'sbquo',
-		'ldquo',   'rdquo',  'bdquo',   'dagger', 'Dagger', 'permil',
-		'lsaquo',  'rsaquo', 'euro',    'fnof',   'Alpha',  'Beta',
-		'Gamma',   'Delta',  'Epsilon', 'Zeta',   'Eta',    'Theta',
-		'Iota',    'Kappa',  'Lambda',  'Mu',     'Nu',     'Xi',
-		'Omicron', 'Pi',     'Rho',     'Sigma',  'Tau',    'Upsilon',
-		'Phi',     'Chi',    'Psi',     'Omega',  'alpha',  'beta',
-		'gamma',   'delta',  'epsilon', 'zeta',   'eta',    'theta',
-		'iota',    'kappa',  'lambda',  'mu',     'nu',     'xi',
-		'omicron', 'pi',     'rho',     'sigmaf', 'sigma',  'tau',
-		'upsilon', 'phi',    'chi',     'psi',    'omega',  'thetasym',
-		'upsih',   'piv',    'bull',    'hellip', 'prime',  'Prime',
-		'oline',   'frasl',  'weierp',  'image',  'real',   'trade',
-		'alefsym', 'larr',   'uarr',    'rarr',   'darr',   'harr',
-		'crarr',   'lArr',   'uArr',    'rArr',   'dArr',   'hArr',
-		'forall',  'part',   'exist',   'empty',  'nabla',  'isin',
-		'notin',   'ni',     'prod',    'sum',    'minus',  'lowast',
-		'radic',   'prop',   'infin',   'ang',    'and',    'or',
-		'cap',     'cup',    'int',     'sim',    'cong',   'asymp',
-		'ne',      'equiv',  'le',      'ge',     'sub',    'sup',
-		'nsub',    'sube',   'supe',    'oplus',  'otimes', 'perp',
-		'sdot',    'lceil',  'rceil',   'lfloor', 'rfloor', 'lang',
-		'rang',    'loz',    'spades',  'clubs',  'hearts', 'diams',
-		'sup1',    'sup2',   'sup3',    'frac14', 'frac12', 'frac34',
+		'nbsp',
+	'iexcl',
+	'cent',
+	'pound',
+	'curren',
+	'yen',
+		'brvbar',
+	'sect',
+	'uml',
+	'copy',
+	'ordf',
+	'laquo',
+		'not',
+	'shy',
+	'reg',
+	'macr',
+	'deg',
+	'plusmn',
+		'acute',
+	'micro',
+	'para',
+	'middot',
+	'cedil',
+	'ordm',
+		'raquo',
+	'iquest',
+	'Agrave',
+	'Aacute',
+	'Acirc',
+	'Atilde',
+		'Auml',
+	'Aring',
+	'AElig',
+	'Ccedil',
+	'Egrave',
+	'Eacute',
+		'Ecirc',
+	'Euml',
+	'Igrave',
+	'Iacute',
+	'Icirc',
+	'Iuml',
+		'ETH',
+	'Ntilde',
+	'Ograve',
+	'Oacute',
+	'Ocirc',
+	'Otilde',
+		'Ouml',
+	'times',
+	'Oslash',
+	'Ugrave',
+	'Uacute',
+	'Ucirc',
+		'Uuml',
+	'Yacute',
+	'THORN',
+	'szlig',
+	'agrave',
+	'aacute',
+		'acirc',
+	'atilde',
+	'auml',
+	'aring',
+	'aelig',
+	'ccedil',
+		'egrave',
+	'eacute',
+	'ecirc',
+	'euml',
+	'igrave',
+	'iacute',
+		'icirc',
+	'iuml',
+	'eth',
+	'ntilde',
+	'ograve',
+	'oacute',
+		'ocirc',
+	'otilde',
+	'ouml',
+	'divide',
+	'oslash',
+	'ugrave',
+		'uacute',
+	'ucirc',
+	'uuml',
+	'yacute',
+	'thorn',
+	'yuml',
+		'quot',
+	'amp',
+	'lt',
+	'gt',
+	'apos',
+	'OElig',
+		'oelig',
+	'Scaron',
+	'scaron',
+	'Yuml',
+	'circ',
+	'tilde',
+		'ensp',
+	'emsp',
+	'thinsp',
+	'zwnj',
+	'zwj',
+	'lrm',
+		'rlm',
+	'ndash',
+	'mdash',
+	'lsquo',
+	'rsquo',
+	'sbquo',
+		'ldquo',
+	'rdquo',
+	'bdquo',
+	'dagger',
+	'Dagger',
+	'permil',
+		'lsaquo',
+	'rsaquo',
+	'euro',
+	'fnof',
+	'Alpha',
+	'Beta',
+		'Gamma',
+	'Delta',
+	'Epsilon',
+	'Zeta',
+	'Eta',
+	'Theta',
+		'Iota',
+	'Kappa',
+	'Lambda',
+	'Mu',
+	'Nu',
+	'Xi',
+		'Omicron',
+	'Pi',
+	'Rho',
+	'Sigma',
+	'Tau',
+	'Upsilon',
+		'Phi',
+	'Chi',
+	'Psi',
+	'Omega',
+	'alpha',
+	'beta',
+		'gamma',
+	'delta',
+	'epsilon',
+	'zeta',
+	'eta',
+	'theta',
+		'iota',
+	'kappa',
+	'lambda',
+	'mu',
+	'nu',
+	'xi',
+		'omicron',
+	'pi',
+	'rho',
+	'sigmaf',
+	'sigma',
+	'tau',
+		'upsilon',
+	'phi',
+	'chi',
+	'psi',
+	'omega',
+	'thetasym',
+		'upsih',
+	'piv',
+	'bull',
+	'hellip',
+	'prime',
+	'Prime',
+		'oline',
+	'frasl',
+	'weierp',
+	'image',
+	'real',
+	'trade',
+		'alefsym',
+	'larr',
+	'uarr',
+	'rarr',
+	'darr',
+	'harr',
+		'crarr',
+	'lArr',
+	'uArr',
+	'rArr',
+	'dArr',
+	'hArr',
+		'forall',
+	'part',
+	'exist',
+	'empty',
+	'nabla',
+	'isin',
+		'notin',
+	'ni',
+	'prod',
+	'sum',
+	'minus',
+	'lowast',
+		'radic',
+	'prop',
+	'infin',
+	'ang',
+	'and',
+	'or',
+		'cap',
+	'cup',
+	'int',
+	'sim',
+	'cong',
+	'asymp',
+		'ne',
+	'equiv',
+	'le',
+	'ge',
+	'sub',
+	'sup',
+		'nsub',
+	'sube',
+	'supe',
+	'oplus',
+	'otimes',
+	'perp',
+		'sdot',
+	'lceil',
+	'rceil',
+	'lfloor',
+	'rfloor',
+	'lang',
+		'rang',
+	'loz',
+	'spades',
+	'clubs',
+	'hearts',
+	'diams',
+		'sup1',
+	'sup2',
+	'sup3',
+	'frac14',
+	'frac12',
+	'frac34',
 		'there4',
 	);
 
@@ -501,7 +712,7 @@
 } else {
 	$allowedtags = wp_kses_array_lc( $allowedtags );
 	$allowedposttags = wp_kses_array_lc( $allowedposttags );
-}
+}// End if().
 
 /**
  * Filters content and keeps only allowable HTML elements.
@@ -524,12 +735,15 @@
  * @return string Filtered content with only allowed HTML elements
  */
 function wp_kses( $string, $allowed_html, $allowed_protocols = array() ) {
-	if ( empty( $allowed_protocols ) )
+	if ( empty( $allowed_protocols ) ) {
 		$allowed_protocols = wp_allowed_protocols();
-	$string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );
-	$string = wp_kses_normalize_entities($string);
-	$string = wp_kses_hook($string, $allowed_html, $allowed_protocols); // WP changed the order of these funcs and added args to wp_kses_hook
-	return wp_kses_split($string, $allowed_html, $allowed_protocols);
+	}
+	$string = wp_kses_no_null( $string, array(
+		'slash_zero' => 'keep',
+	) );
+	$string = wp_kses_normalize_entities( $string );
+	$string = wp_kses_hook( $string, $allowed_html, $allowed_protocols ); // WP changed the order of these funcs and added args to wp_kses_hook
+	return wp_kses_split( $string, $allowed_html, $allowed_protocols );
 }
 
 /**
@@ -545,23 +759,25 @@
  * @return string Filtered attribute.
  */
 function wp_kses_one_attr( $string, $element ) {
-	$uris = array('xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');
+	$uris = array( 'xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action' );
 	$allowed_html = wp_kses_allowed_html( 'post' );
 	$allowed_protocols = wp_allowed_protocols();
-	$string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );
-	
+	$string = wp_kses_no_null( $string, array(
+		'slash_zero' => 'keep',
+	) );
+
 	// Preserve leading and trailing whitespace.
 	$matches = array();
-	preg_match('/^\s*/', $string, $matches);
+	preg_match( '/^\s*/', $string, $matches );
 	$lead = $matches[0];
-	preg_match('/\s*$/', $string, $matches);
+	preg_match( '/\s*$/', $string, $matches );
 	$trail = $matches[0];
 	if ( empty( $trail ) ) {
 		$string = substr( $string, strlen( $lead ) );
 	} else {
 		$string = substr( $string, strlen( $lead ), -strlen( $trail ) );
 	}
-	
+
 	// Parse attribute name and value from input.
 	$split = preg_split( '/\s*=\s*/', $string, 2 );
 	$name = $split[0];
@@ -598,7 +814,7 @@
 		$value = '';
 		$vless = 'y';
 	}
-	
+
 	// Sanitize attribute by name.
 	wp_kses_attr_check( $name, $value, $string, $vless, $element, $allowed_html );
 
@@ -654,7 +870,7 @@
 
 		case 'entities':
 			/** This filter is documented in wp-includes/kses.php */
-			return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context);
+			return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context );
 
 		case 'data':
 		default:
@@ -758,44 +974,50 @@
  * @param array  $allowed_protocols Allowed protocols to keep
  * @return string Fixed HTML element
  */
-function wp_kses_split2($string, $allowed_html, $allowed_protocols) {
-	$string = wp_kses_stripslashes($string);
+function wp_kses_split2( $string, $allowed_html, $allowed_protocols ) {
+	$string = wp_kses_stripslashes( $string );
 
-	if (substr($string, 0, 1) != '<')
+	if ( substr( $string, 0, 1 ) != '<' ) {
 		return '&gt;';
+	}
 	// It matched a ">" character
 
 	if ( '<!--' == substr( $string, 0, 4 ) ) {
-		$string = str_replace( array('<!--', '-->'), '', $string );
-		while ( $string != ($newstring = wp_kses($string, $allowed_html, $allowed_protocols)) )
-			$string = $newstring;
-		if ( $string == '' )
+		$string = str_replace( array( '<!--', '-->' ), '', $string );
+		while ( $string != ($newstring = wp_kses( $string, $allowed_html, $allowed_protocols )) ) {			$string = $newstring;
+		}
+		if ( $string == '' ) {
 			return '';
+		}
 		// prevent multiple dashes in comments
-		$string = preg_replace('/--+/', '-', $string);
+		$string = preg_replace( '/--+/', '-', $string );
 		// prevent three dashes closing a comment
-		$string = preg_replace('/-$/', '', $string);
+		$string = preg_replace( '/-$/', '', $string );
 		return "<!--{$string}-->";
 	}
 	// Allow HTML comments
 
-	if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9-]+)([^>]*)>?$%', $string, $matches))
+	if ( ! preg_match( '%^<\s*(/\s*)?([a-zA-Z0-9-]+)([^>]*)>?$%', $string, $matches ) ) {
 		return '';
+	}
 	// It's seriously malformed
 
-	$slash = trim($matches[1]);
+	$slash = trim( $matches[1] );
 	$elem = $matches[2];
 	$attrlist = $matches[3];
 
-	if ( ! is_array( $allowed_html ) )
+	if ( ! is_array( $allowed_html ) ) {
 		$allowed_html = wp_kses_allowed_html( $allowed_html );
+	}
 
-	if ( ! isset($allowed_html[strtolower($elem)]) )
+	if ( ! isset( $allowed_html[ strtolower( $elem ) ] ) ) {
 		return '';
+	}
 	// They are using a not allowed HTML element
 
-	if ($slash != '')
+	if ( $slash != '' ) {
 		return "</$elem>";
+	}
 	// No attributes are allowed for closing elements
 
 	return wp_kses_attr( $elem, $attrlist, $allowed_html, $allowed_protocols );
@@ -818,14 +1040,16 @@
  * @param array  $allowed_protocols Allowed protocols to keep
  * @return string Sanitized HTML element
  */
-function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) {
-	if ( ! is_array( $allowed_html ) )
+function wp_kses_attr( $element, $attr, $allowed_html, $allowed_protocols ) {
+	if ( ! is_array( $allowed_html ) ) {
 		$allowed_html = wp_kses_allowed_html( $allowed_html );
+	}
 
 	// Is there a closing XHTML slash at the end of the attributes?
 	$xhtml_slash = '';
-	if (preg_match('%\s*/\s*$%', $attr))
+	if ( preg_match( '%\s*/\s*$%', $attr ) ) {
 		$xhtml_slash = ' /';
+	}
 
 	// Are any attributes allowed at all for this element?
 	if ( ! isset( $allowed_html[ strtolower( $element ) ] ) || true === $allowed_html[ strtolower( $element ) ] || count( $allowed_html[ strtolower( $element ) ] ) == 0 ) {
@@ -833,19 +1057,19 @@
 	}
 
 	// Split it
-	$attrarr = wp_kses_hair($attr, $allowed_protocols);
+	$attrarr = wp_kses_hair( $attr, $allowed_protocols );
 
 	// Go through $attrarr, and save the allowed attributes for this element
 	// in $attr2
 	$attr2 = '';
 	foreach ( $attrarr as $arreach ) {
 		if ( wp_kses_attr_check( $arreach['name'], $arreach['value'], $arreach['whole'], $arreach['vless'], $element, $allowed_html ) ) {
-			$attr2 .= ' '.$arreach['whole'];
+			$attr2 .= ' ' . $arreach['whole'];
 		}
 	}
 
 	// Remove any "<" or ">" characters
-	$attr2 = preg_replace('/[<>]/', '', $attr2);
+	$attr2 = preg_replace( '/[<>]/', '', $attr2 );
 
 	return "<$element$attr2$xhtml_slash>";
 }
@@ -864,10 +1088,10 @@
  * @return bool Is the attribute allowed?
  */
 function wp_kses_attr_check( &$name, &$value, &$whole, $vless, $element, $allowed_html ) {
-	$allowed_attr = $allowed_html[strtolower( $element )];
+	$allowed_attr = $allowed_html[ strtolower( $element ) ];
 
 	$name_low = strtolower( $name );
-	if ( ! isset( $allowed_attr[$name_low] ) || '' == $allowed_attr[$name_low] ) {
+	if ( ! isset( $allowed_attr[ $name_low ] ) || '' == $allowed_attr[ $name_low ] ) {
 		$name = $value = $whole = '';
 		return false;
 	}
@@ -884,9 +1108,9 @@
 		$value = $new_value;
 	}
 
-	if ( is_array( $allowed_attr[$name_low] ) ) {
+	if ( is_array( $allowed_attr[ $name_low ] ) ) {
 		// there are some checks
-		foreach ( $allowed_attr[$name_low] as $currkey => $currval ) {
+		foreach ( $allowed_attr[ $name_low ] as $currkey => $currval ) {
 			if ( ! wp_kses_check_attr_val( $value, $vless, $currkey, $currval ) ) {
 				$name = $value = $whole = '';
 				return false;
@@ -914,21 +1138,21 @@
  * @param array  $allowed_protocols Allowed protocols to keep
  * @return array List of attributes after parsing
  */
-function wp_kses_hair($attr, $allowed_protocols) {
+function wp_kses_hair( $attr, $allowed_protocols ) {
 	$attrarr = array();
 	$mode = 0;
 	$attrname = '';
-	$uris = array('xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');
+	$uris = array( 'xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action' );
 
 	// Loop through the whole attribute list
 
-	while (strlen($attr) != 0) {
+	while ( strlen( $attr ) != 0 ) {
 		$working = 0; // Was the last operation successful?
 
-		switch ($mode) {
+		switch ( $mode ) {
 			case 0 : // attribute name, href for instance
 
-				if ( preg_match('/^([-a-zA-Z:]+)/', $attr, $match ) ) {
+				if ( preg_match( '/^([-a-zA-Z:]+)/', $attr, $match ) ) {
 					$attrname = $match[1];
 					$working = $mode = 1;
 					$attr = preg_replace( '/^[-a-zA-Z:]+/', '', $attr );
@@ -938,90 +1162,98 @@
 
 			case 1 : // equals sign or valueless ("selected")
 
-				if (preg_match('/^\s*=\s*/', $attr)) // equals sign
-					{
+				if ( preg_match( '/^\s*=\s*/', $attr ) ) { // equals sign
 					$working = 1;
 					$mode = 2;
-					$attr = preg_replace('/^\s*=\s*/', '', $attr);
+					$attr = preg_replace( '/^\s*=\s*/', '', $attr );
 					break;
 				}
 
-				if (preg_match('/^\s+/', $attr)) // valueless
-					{
+				if ( preg_match( '/^\s+/', $attr ) ) { // valueless
 					$working = 1;
 					$mode = 0;
-					if(false === array_key_exists($attrname, $attrarr)) {
-						$attrarr[$attrname] = array ('name' => $attrname, 'value' => '', 'whole' => $attrname, 'vless' => 'y');
+					if ( false === array_key_exists( $attrname, $attrarr ) ) {
+						$attrarr[ $attrname ] = array(
+							'name' => $attrname,
+							'value' => '',
+							'whole' => $attrname,
+							'vless' => 'y',
+						);
 					}
-					$attr = preg_replace('/^\s+/', '', $attr);
+					$attr = preg_replace( '/^\s+/', '', $attr );
 				}
 
 				break;
 
 			case 2 : // attribute value, a URL after href= for instance
 
-				if (preg_match('%^"([^"]*)"(\s+|/?$)%', $attr, $match))
+				if ( preg_match( '%^"([^"]*)"(\s+|/?$)%', $attr, $match ) ) {
 					// "value"
-					{
 					$thisval = $match[1];
-					if ( in_array(strtolower($attrname), $uris) )
-						$thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
+					if ( in_array( strtolower( $attrname ), $uris ) ) {
+						$thisval = wp_kses_bad_protocol( $thisval, $allowed_protocols );
+					}
 
-					if(false === array_key_exists($attrname, $attrarr)) {
-						$attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n');
+					if ( false === array_key_exists( $attrname, $attrarr ) ) {
+						$attrarr[ $attrname ] = array(
+							'name' => $attrname,
+							'value' => $thisval,
+							'whole' => "$attrname=\"$thisval\"",
+							'vless' => 'n',
+						);
 					}
 					$working = 1;
 					$mode = 0;
-					$attr = preg_replace('/^"[^"]*"(\s+|$)/', '', $attr);
+					$attr = preg_replace( '/^"[^"]*"(\s+|$)/', '', $attr );
 					break;
 				}
 
-				if (preg_match("%^'([^']*)'(\s+|/?$)%", $attr, $match))
+				if ( preg_match( "%^'([^']*)'(\s+|/?$)%", $attr, $match ) ) {
 					// 'value'
-					{
 					$thisval = $match[1];
-					if ( in_array(strtolower($attrname), $uris) )
-						$thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
+					if ( in_array( strtolower( $attrname ), $uris ) ) {
+						$thisval = wp_kses_bad_protocol( $thisval, $allowed_protocols );
+					}
 
-					if(false === array_key_exists($attrname, $attrarr)) {
-						$attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname='$thisval'", 'vless' => 'n');
+					if ( false === array_key_exists( $attrname, $attrarr ) ) {
+						$attrarr[ $attrname ] = array( 'name' => $attrname, 'value' => $thisval, 'whole' => "$attrname='$thisval'", 'vless' => 'n' );
 					}
 					$working = 1;
 					$mode = 0;
-					$attr = preg_replace("/^'[^']*'(\s+|$)/", '', $attr);
+					$attr = preg_replace( "/^'[^']*'(\s+|$)/", '', $attr );
 					break;
 				}
 
-				if (preg_match("%^([^\s\"']+)(\s+|/?$)%", $attr, $match))
+				if ( preg_match( "%^([^\s\"']+)(\s+|/?$)%", $attr, $match ) ) {
 					// value
-					{
 					$thisval = $match[1];
-					if ( in_array(strtolower($attrname), $uris) )
-						$thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
+					if ( in_array( strtolower( $attrname ), $uris ) ) {
+						$thisval = wp_kses_bad_protocol( $thisval, $allowed_protocols );
+					}
 
-					if(false === array_key_exists($attrname, $attrarr)) {
-						$attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n');
+					if ( false === array_key_exists( $attrname, $attrarr ) ) {
+						$attrarr[ $attrname ] = array( 'name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n' );
 					}
 					// We add quotes to conform to W3C's HTML spec.
 					$working = 1;
 					$mode = 0;
-					$attr = preg_replace("%^[^\s\"']+(\s+|$)%", '', $attr);
+					$attr = preg_replace( "%^[^\s\"']+(\s+|$)%", '', $attr );
 				}
 
 				break;
-		} // switch
+		} // End switch().
 
-		if ($working == 0) // not well formed, remove and try again
-		{
-			$attr = wp_kses_html_error($attr);
+		if ( $working == 0 ) { // not well formed, remove and try again
+			$attr = wp_kses_html_error( $attr );
 			$mode = 0;
 		}
-	} // while
+	} // End while().
 
-	if ($mode == 1 && false === array_key_exists($attrname, $attrarr))
+	if ( $mode == 1 && false === array_key_exists( $attrname, $attrarr ) ) {
 		// special case, for when the attribute list ends with a valueless
 		// attribute like "selected"
-		$attrarr[$attrname] = array ('name' => $attrname, 'value' => '', 'whole' => $attrname, 'vless' => 'y');
+		$attrarr[ $attrname ] = array( 'name' => $attrname, 'value' => '', 'whole' => $attrname, 'vless' => 'y' );
+	}
 
 	return $attrarr;
 }
@@ -1039,16 +1271,16 @@
  * @return array|bool List of attributes found in $element. Returns false on failure.
  */
 function wp_kses_attr_parse( $element ) {
-	$valid = preg_match('%^(<\s*)(/\s*)?([a-zA-Z0-9]+\s*)([^>]*)(>?)$%', $element, $matches);
+	$valid = preg_match( '%^(<\s*)(/\s*)?([a-zA-Z0-9]+\s*)([^>]*)(>?)$%', $element, $matches );
 	if ( 1 !== $valid ) {
 		return false;
 	}
 
-	$begin =  $matches[1];
-	$slash =  $matches[2];
+	$begin = $matches[1];
+	$slash = $matches[2];
 	$elname = $matches[3];
-	$attr =   $matches[4];
-	$end =    $matches[5];
+	$attr = $matches[4];
+	$end = $matches[5];
 
 	if ( '' !== $slash ) {
 		// Closing elements do not get parsed.
@@ -1062,7 +1294,7 @@
 	} else {
 		$xhtml_slash = '';
 	}
-	
+
 	// Split it
 	$attrarr = wp_kses_hair_parse( $attr );
 	if ( false === $attrarr ) {
@@ -1072,7 +1304,7 @@
 	// Make sure all input is returned by adding front and back matter.
 	array_unshift( $attrarr, $begin . $slash . $elname );
 	array_push( $attrarr, $xhtml_slash . $end );
-	
+
 	return $attrarr;
 }
 
@@ -1096,22 +1328,22 @@
 
 	$regex =
 	  '(?:'
-	.     '[-a-zA-Z:]+'   // Attribute name.
+	. '[-a-zA-Z:]+'   // Attribute name.
 	. '|'
-	.     '\[\[?[^\[\]]+\]\]?' // Shortcode in the name position implies unfiltered_html.
+	. '\[\[?[^\[\]]+\]\]?' // Shortcode in the name position implies unfiltered_html.
 	. ')'
 	. '(?:'               // Attribute value.
-	.     '\s*=\s*'       // All values begin with '='
-	.     '(?:'
-	.         '"[^"]*"'   // Double-quoted
-	.     '|'
-	.         "'[^']*'"   // Single-quoted
-	.     '|'
-	.         '[^\s"\']+' // Non-quoted
-	.         '(?:\s|$)'  // Must have a space
-	.     ')'
+	. '\s*=\s*'       // All values begin with '='
+	. '(?:'
+	. '"[^"]*"'   // Double-quoted
+	. '|'
+	. "'[^']*'"   // Single-quoted
+	. '|'
+	. '[^\s"\']+' // Non-quoted
+	. '(?:\s|$)'  // Must have a space
+	. ')'
 	. '|'
-	.     '(?:\s|$)'      // If attribute has no value, space is required.
+	. '(?:\s|$)'      // If attribute has no value, space is required.
 	. ')'
 	. '\s*';              // Trailing space is optional except as mentioned above.
 
@@ -1143,25 +1375,27 @@
  * @param mixed  $checkvalue What constraint the value should pass
  * @return bool Whether check passes
  */
-function wp_kses_check_attr_val($value, $vless, $checkname, $checkvalue) {
+function wp_kses_check_attr_val( $value, $vless, $checkname, $checkvalue ) {
 	$ok = true;
 
-	switch (strtolower($checkname)) {
+	switch ( strtolower( $checkname ) ) {
 		case 'maxlen' :
 			// The maxlen check makes sure that the attribute value has a length not
 			// greater than the given value. This can be used to avoid Buffer Overflows
 			// in WWW clients and various Internet servers.
 
-			if (strlen($value) > $checkvalue)
+			if ( strlen( $value ) > $checkvalue ) {
 				$ok = false;
+			}
 			break;
 
 		case 'minlen' :
 			// The minlen check makes sure that the attribute value has a length not
 			// smaller than the given value.
 
-			if (strlen($value) < $checkvalue)
+			if ( strlen( $value ) < $checkvalue ) {
 				$ok = false;
+			}
 			break;
 
 		case 'maxval' :
@@ -1171,20 +1405,24 @@
 			// value is not greater than the given value.
 			// This check can be used to avoid Denial of Service attacks.
 
-			if (!preg_match('/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value))
+			if ( ! preg_match( '/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value ) ) {
 				$ok = false;
-			if ($value > $checkvalue)
+			}
+			if ( $value > $checkvalue ) {
 				$ok = false;
+			}
 			break;
 
 		case 'minval' :
 			// The minval check makes sure that the attribute value is a positive integer,
 			// and that it is not smaller than the given value.
 
-			if (!preg_match('/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value))
+			if ( ! preg_match( '/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value ) ) {
 				$ok = false;
-			if ($value < $checkvalue)
+			}
+			if ( $value < $checkvalue ) {
 				$ok = false;
+			}
 			break;
 
 		case 'valueless' :
@@ -1193,10 +1431,11 @@
 			// is a "y" or a "Y", the attribute must not have a value.
 			// If the given value is an "n" or an "N", the attribute must have one.
 
-			if (strtolower($checkvalue) != $vless)
+			if ( strtolower( $checkvalue ) != $vless ) {
 				$ok = false;
+			}
 			break;
-	} // switch
+	} // End switch().
 
 	return $ok;
 }
@@ -1215,17 +1454,18 @@
  * @param array  $allowed_protocols Allowed protocols to keep
  * @return string Filtered content
  */
-function wp_kses_bad_protocol($string, $allowed_protocols) {
-	$string = wp_kses_no_null($string);
+function wp_kses_bad_protocol( $string, $allowed_protocols ) {
+	$string = wp_kses_no_null( $string );
 	$iterations = 0;
 
 	do {
 		$original_string = $string;
-		$string = wp_kses_bad_protocol_once($string, $allowed_protocols);
+		$string = wp_kses_bad_protocol_once( $string, $allowed_protocols );
 	} while ( $original_string != $string && ++$iterations < 6 );
 
-	if ( $original_string != $string )
+	if ( $original_string != $string ) {
 		return '';
+	}
 
 	return $string;
 }
@@ -1266,8 +1506,8 @@
  * @param string $string String to strip slashes
  * @return string Fixed string with quoted slashes
  */
-function wp_kses_stripslashes($string) {
-	return preg_replace('%\\\\"%', '"', $string);
+function wp_kses_stripslashes( $string ) {
+	return preg_replace( '%\\\\"%', '"', $string );
 }
 
 /**
@@ -1278,18 +1518,18 @@
  * @param array $inarray Unfiltered array
  * @return array Fixed array with all lowercase keys
  */
-function wp_kses_array_lc($inarray) {
-	$outarray = array ();
+function wp_kses_array_lc( $inarray ) {
+	$outarray = array();
 
-	foreach ( (array) $inarray as $inkey => $inval) {
-		$outkey = strtolower($inkey);
-		$outarray[$outkey] = array ();
-
-		foreach ( (array) $inval as $inkey2 => $inval2) {
-			$outkey2 = strtolower($inkey2);
-			$outarray[$outkey][$outkey2] = $inval2;
-		} // foreach $inval
-	} // foreach $inarray
+	foreach ( (array) $inarray as $inkey => $inval ) {
+		$outkey = strtolower( $inkey );
+		$outarray[ $outkey ] = array();
+
+		foreach ( (array) $inval as $inkey2 => $inval2 ) {
+			$outkey2 = strtolower( $inkey2 );
+			$outarray[ $outkey ][ $outkey2 ] = $inval2;
+		} // End foreach().
+	} // End foreach().
 
 	return $outarray;
 }
@@ -1305,8 +1545,8 @@
  * @param string $string
  * @return string
  */
-function wp_kses_html_error($string) {
-	return preg_replace('/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $string);
+function wp_kses_html_error( $string ) {
+	return preg_replace( '/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $string );
 }
 
 /**
@@ -1321,17 +1561,19 @@
  * @param string $allowed_protocols Allowed protocols
  * @return string Sanitized content
  */
-function wp_kses_bad_protocol_once($string, $allowed_protocols, $count = 1 ) {
+function wp_kses_bad_protocol_once( $string, $allowed_protocols, $count = 1 ) {
 	$string2 = preg_split( '/:|&#0*58;|&#x0*3a;/i', $string, 2 );
-	if ( isset($string2[1]) && ! preg_match('%/\?%', $string2[0]) ) {
+	if ( isset( $string2[1] ) && ! preg_match( '%/\?%', $string2[0] ) ) {
 		$string = trim( $string2[1] );
 		$protocol = wp_kses_bad_protocol_once2( $string2[0], $allowed_protocols );
 		if ( 'feed:' == $protocol ) {
-			if ( $count > 2 )
+			if ( $count > 2 ) {
 				return '';
+			}
 			$string = wp_kses_bad_protocol_once( $string, $allowed_protocols, ++$count );
-			if ( empty( $string ) )
+			if ( empty( $string ) ) {
 				return $string;
+			}
 		}
 		$string = $protocol . $string;
 	}
@@ -1353,22 +1595,23 @@
  * @return string Sanitized content
  */
 function wp_kses_bad_protocol_once2( $string, $allowed_protocols ) {
-	$string2 = wp_kses_decode_entities($string);
-	$string2 = preg_replace('/\s/', '', $string2);
-	$string2 = wp_kses_no_null($string2);
-	$string2 = strtolower($string2);
+	$string2 = wp_kses_decode_entities( $string );
+	$string2 = preg_replace( '/\s/', '', $string2 );
+	$string2 = wp_kses_no_null( $string2 );
+	$string2 = strtolower( $string2 );
 
 	$allowed = false;
-	foreach ( (array) $allowed_protocols as $one_protocol )
-		if ( strtolower($one_protocol) == $string2 ) {
+	foreach ( (array) $allowed_protocols as $one_protocol ) {
+		if ( strtolower( $one_protocol ) == $string2 ) {
 			$allowed = true;
 			break;
 		}
+	}
 
-	if ($allowed)
+	if ( $allowed ) {
 		return "$string2:";
-	else
-		return '';
+	} else { return '';
+	}
 }
 
 /**
@@ -1382,14 +1625,14 @@
  * @param string $string Content to normalize entities
  * @return string Content with normalized entities
  */
-function wp_kses_normalize_entities($string) {
+function wp_kses_normalize_entities( $string ) {
 	// Disarm all entities by converting & to &amp;
-	$string = str_replace('&', '&amp;', $string);
+	$string = str_replace( '&', '&amp;', $string );
 
 	// Change back the allowed entities in our entity whitelist
-	$string = preg_replace_callback('/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string);
-	$string = preg_replace_callback('/&amp;#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string);
-	$string = preg_replace_callback('/&amp;#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string);
+	$string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string );
+	$string = preg_replace_callback( '/&amp;#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string );
+	$string = preg_replace_callback( '/&amp;#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string );
 
 	return $string;
 }
@@ -1407,11 +1650,12 @@
  * @param array $matches preg_replace_callback() matches array
  * @return string Correctly encoded entity
  */
-function wp_kses_named_entities($matches) {
+function wp_kses_named_entities( $matches ) {
 	global $allowedentitynames;
 
-	if ( empty($matches[1]) )
+	if ( empty( $matches[1] ) ) {
 		return '';
+	}
 
 	$i = $matches[1];
 	return ( ! in_array( $i, $allowedentitynames ) ) ? "&amp;$i;" : "&$i;";
@@ -1429,13 +1673,14 @@
  * @param array $matches preg_replace_callback() matches array
  * @return string Correctly encoded entity
  */
-function wp_kses_normalize_entities2($matches) {
-	if ( empty($matches[1]) )
+function wp_kses_normalize_entities2( $matches ) {
+	if ( empty( $matches[1] ) ) {
 		return '';
+	}
 
 	$i = $matches[1];
-	if (valid_unicode($i)) {
-		$i = str_pad(ltrim($i,'0'), 3, '0', STR_PAD_LEFT);
+	if ( valid_unicode( $i ) ) {
+		$i = str_pad( ltrim( $i,'0' ), 3, '0', STR_PAD_LEFT );
 		$i = "&#$i;";
 	} else {
 		$i = "&amp;#$i;";
@@ -1456,12 +1701,13 @@
  * @param array $matches preg_replace_callback() matches array
  * @return string Correctly encoded entity
  */
-function wp_kses_normalize_entities3($matches) {
-	if ( empty($matches[1]) )
+function wp_kses_normalize_entities3( $matches ) {
+	if ( empty( $matches[1] ) ) {
 		return '';
+	}
 
 	$hexchars = $matches[1];
-	return ( ! valid_unicode( hexdec( $hexchars ) ) ) ? "&amp;#x$hexchars;" : '&#x'.ltrim($hexchars,'0').';';
+	return ( ! valid_unicode( hexdec( $hexchars ) ) ) ? "&amp;#x$hexchars;" : '&#x' . ltrim( $hexchars,'0' ) . ';';
 }
 
 /**
@@ -1472,7 +1718,7 @@
  * @param int $i Unicode value
  * @return bool True if the value was a valid Unicode number
  */
-function valid_unicode($i) {
+function valid_unicode( $i ) {
 	return ( $i == 0x9 || $i == 0xa || $i == 0xd ||
 			($i >= 0x20 && $i <= 0xd7ff) ||
 			($i >= 0xe000 && $i <= 0xfffd) ||
@@ -1491,9 +1737,9 @@
  * @param string $string Content to change entities
  * @return string Content after decoded entities
  */
-function wp_kses_decode_entities($string) {
-	$string = preg_replace_callback('/&#([0-9]+);/', '_wp_kses_decode_entities_chr', $string);
-	$string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', '_wp_kses_decode_entities_chr_hexdec', $string);
+function wp_kses_decode_entities( $string ) {
+	$string = preg_replace_callback( '/&#([0-9]+);/', '_wp_kses_decode_entities_chr', $string );
+	$string = preg_replace_callback( '/&#[Xx]([0-9A-Fa-f]+);/', '_wp_kses_decode_entities_chr_hexdec', $string );
 
 	return $string;
 }
@@ -1616,18 +1862,18 @@
  */
 function kses_init_filters() {
 	// Normal filtering
-	add_filter('title_save_pre', 'wp_filter_kses');
+	add_filter( 'title_save_pre', 'wp_filter_kses' );
 
 	// Comment filtering
-	if ( current_user_can( 'unfiltered_html' ) )
+	if ( current_user_can( 'unfiltered_html' ) ) {
 		add_filter( 'pre_comment_content', 'wp_filter_post_kses' );
-	else
-		add_filter( 'pre_comment_content', 'wp_filter_kses' );
+	} else { add_filter( 'pre_comment_content', 'wp_filter_kses' );
+	}
 
 	// Post filtering
-	add_filter('content_save_pre', 'wp_filter_post_kses');
-	add_filter('excerpt_save_pre', 'wp_filter_post_kses');
-	add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
+	add_filter( 'content_save_pre', 'wp_filter_post_kses' );
+	add_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
+	add_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
 }
 
 /**
@@ -1644,16 +1890,16 @@
  */
 function kses_remove_filters() {
 	// Normal filtering
-	remove_filter('title_save_pre', 'wp_filter_kses');
+	remove_filter( 'title_save_pre', 'wp_filter_kses' );
 
 	// Comment filtering
 	remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
 	remove_filter( 'pre_comment_content', 'wp_filter_kses' );
 
 	// Post filtering
-	remove_filter('content_save_pre', 'wp_filter_post_kses');
-	remove_filter('excerpt_save_pre', 'wp_filter_post_kses');
-	remove_filter('content_filtered_save_pre', 'wp_filter_post_kses');
+	remove_filter( 'content_save_pre', 'wp_filter_post_kses' );
+	remove_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
+	remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
 }
 
 /**
@@ -1687,14 +1933,16 @@
  * @return string            Filtered string of CSS rules.
  */
 function safecss_filter_attr( $css, $deprecated = '' ) {
-	if ( !empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '2.8.1' ); // Never implemented
+	}
 
-	$css = wp_kses_no_null($css);
-	$css = str_replace(array("\n","\r","\t"), '', $css);
+	$css = wp_kses_no_null( $css );
+	$css = str_replace( array( "\n", "\r", "\t" ), '', $css );
 
-	if ( preg_match( '%[\\\\(&=}]|/\*%', $css ) ) // remove any inline css containing \ ( & } = or comments
+	if ( preg_match( '%[\\\\(&=}]|/\*%', $css ) ) { // remove any inline css containing \ ( & } = or comments
 		return '';
+	}
 
 	$css_array = explode( ';', trim( $css ) );
 
@@ -1778,25 +2026,29 @@
 		'list-style-type',
 	) );
 
-	if ( empty($allowed_attr) )
+	if ( empty( $allowed_attr ) ) {
 		return $css;
+	}
 
 	$css = '';
 	foreach ( $css_array as $css_item ) {
-		if ( $css_item == '' )
+		if ( $css_item == '' ) {
 			continue;
+		}
 		$css_item = trim( $css_item );
 		$found = false;
 		if ( strpos( $css_item, ':' ) === false ) {
 			$found = true;
 		} else {
 			$parts = explode( ':', $css_item );
-			if ( in_array( trim( $parts[0] ), $allowed_attr ) )
+			if ( in_array( trim( $parts[0] ), $allowed_attr ) ) {
 				$found = true;
+			}
 		}
 		if ( $found ) {
-			if( $css != '' )
+			if ( $css != '' ) {
 				$css .= ';';
+			}
 			$css .= $css_item;
 		}
 	}
@@ -1822,11 +2074,13 @@
 		'role' => true,
 	);
 
-	if ( true === $value )
+	if ( true === $value ) {
 		$value = array();
+	}
 
-	if ( is_array( $value ) )
+	if ( is_array( $value ) ) {
 		return array_merge( $value, $global_attributes );
+	}
 
 	return $value;
 }
Index: src/wp-includes/l10n.php
===================================================================
--- src/wp-includes/l10n.php	(revision 40901)
+++ src/wp-includes/l10n.php	(working copy)
@@ -399,7 +399,7 @@
  *                        Default 'default'.
  * @return string The translated singular or plural form.
  */
-function _nx($single, $plural, $number, $context, $domain = 'default') {
+function _nx( $single, $plural, $number, $context, $domain = 'default' ) {
 	$translations = get_translations_for_domain( $domain );
 	$translation  = $translations->translate_plural( $single, $plural, $number, $context );
 
@@ -448,7 +448,14 @@
  * }
  */
 function _n_noop( $singular, $plural, $domain = null ) {
-	return array( 0 => $singular, 1 => $plural, 'singular' => $singular, 'plural' => $plural, 'context' => null, 'domain' => $domain );
+	return array(
+		0 => $singular,
+		1 => $plural,
+		'singular' => $singular,
+		'plural' => $plural,
+		'context' => null,
+		'domain' => $domain,
+	);
 }
 
 /**
@@ -487,7 +494,15 @@
  * }
  */
 function _nx_noop( $singular, $plural, $context, $domain = null ) {
-	return array( 0 => $singular, 1 => $plural, 2 => $context, 'singular' => $singular, 'plural' => $plural, 'context' => $context, 'domain' => $domain );
+	return array(
+		0 => $singular,
+		1 => $plural,
+		2 => $context,
+		'singular' => $singular,
+		'plural' => $plural,
+		'context' => $context,
+		'domain' => $domain,
+	);
 }
 
 /**
@@ -511,13 +526,14 @@
  * @return string Either $single or $plural translated text.
  */
 function translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) {
-	if ( $nooped_plural['domain'] )
+	if ( $nooped_plural['domain'] ) {
 		$domain = $nooped_plural['domain'];
+	}
 
-	if ( $nooped_plural['context'] )
+	if ( $nooped_plural['context'] ) {
 		return _nx( $nooped_plural['singular'], $nooped_plural['plural'], $count, $nooped_plural['context'], $domain );
-	else
-		return _n( $nooped_plural['singular'], $nooped_plural['plural'], $count, $domain );
+	} else { return _n( $nooped_plural['singular'], $nooped_plural['plural'], $count, $domain );
+	}
 }
 
 /**
@@ -580,17 +596,20 @@
 	 */
 	$mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );
 
-	if ( !is_readable( $mofile ) ) return false;
+	if ( ! is_readable( $mofile ) ) { return false;
+	}
 
 	$mo = new MO();
-	if ( !$mo->import_from_file( $mofile ) ) return false;
+	if ( ! $mo->import_from_file( $mofile ) ) { return false;
+	}
 
-	if ( isset( $l10n[$domain] ) )
-		$mo->merge_with( $l10n[$domain] );
+	if ( isset( $l10n[ $domain ] ) ) {
+		$mo->merge_with( $l10n[ $domain ] );
+	}
 
 	unset( $l10n_unloaded[ $domain ] );
 
-	$l10n[$domain] = &$mo;
+	$l10n[ $domain ] = &$mo;
 
 	return true;
 }
@@ -636,8 +655,8 @@
 	 */
 	do_action( 'unload_textdomain', $domain );
 
-	if ( isset( $l10n[$domain] ) ) {
-		unset( $l10n[$domain] );
+	if ( isset( $l10n[ $domain ] ) ) {
+		unset( $l10n[ $domain ] );
 
 		$l10n_unloaded[ $domain ] = true;
 
@@ -670,7 +689,7 @@
 
 	$return = load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" );
 
-	if ( ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) && ! file_exists(  WP_LANG_DIR . "/admin-$locale.mo" ) ) {
+	if ( ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) && ! file_exists( WP_LANG_DIR . "/admin-$locale.mo" ) ) {
 		load_textdomain( 'default', WP_LANG_DIR . "/ms-$locale.mo" );
 		return $return;
 	}
@@ -679,8 +698,9 @@
 		load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" );
 	}
 
-	if ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) )
+	if ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) {
 		load_textdomain( 'default', WP_LANG_DIR . "/admin-network-$locale.mo" );
+	}
 
 	return $return;
 }
@@ -815,8 +835,9 @@
  * @return bool True when the theme textdomain is successfully loaded, false otherwise.
  */
 function load_child_theme_textdomain( $domain, $path = false ) {
-	if ( ! $path )
+	if ( ! $path ) {
 		$path = get_stylesheet_directory();
+	}
 	return load_theme_textdomain( $domain, $path );
 }
 
@@ -989,7 +1010,7 @@
  * @return string Translated role name on success, original name on failure.
  */
 function translate_user_role( $name ) {
-	return translate_with_gettext_context( before_last_bar($name), 'User role' );
+	return translate_with_gettext_context( before_last_bar( $name ), 'User role' );
 }
 
 /**
@@ -1041,20 +1062,24 @@
  * @return array Array of language data.
  */
 function wp_get_installed_translations( $type ) {
-	if ( $type !== 'themes' && $type !== 'plugins' && $type !== 'core' )
+	if ( $type !== 'themes' && $type !== 'plugins' && $type !== 'core' ) {
 		return array();
+	}
 
 	$dir = 'core' === $type ? '' : "/$type";
 
-	if ( ! is_dir( WP_LANG_DIR ) )
+	if ( ! is_dir( WP_LANG_DIR ) ) {
 		return array();
+	}
 
-	if ( $dir && ! is_dir( WP_LANG_DIR . $dir ) )
+	if ( $dir && ! is_dir( WP_LANG_DIR . $dir ) ) {
 		return array();
+	}
 
 	$files = scandir( WP_LANG_DIR . $dir );
-	if ( ! $files )
+	if ( ! $files ) {
 		return array();
+	}
 
 	$language_data = array();
 
@@ -1068,7 +1093,7 @@
 		if ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?).po/', $file, $match ) ) {
 			continue;
 		}
-		if ( ! in_array( substr( $file, 0, -3 ) . '.mo', $files ) )  {
+		if ( ! in_array( substr( $file, 0, -3 ) . '.mo', $files ) ) {
 			continue;
 		}
 
Index: src/wp-includes/link-template.php
===================================================================
--- src/wp-includes/link-template.php	(revision 40901)
+++ src/wp-includes/link-template.php	(working copy)
@@ -44,12 +44,12 @@
  *                            for use in the filter. Default empty string.
  * @return string The URL with the trailing slash appended or stripped.
  */
-function user_trailingslashit($string, $type_of_url = '') {
+function user_trailingslashit( $string, $type_of_url = '' ) {
 	global $wp_rewrite;
-	if ( $wp_rewrite->use_trailing_slashes )
-		$string = trailingslashit($string);
-	else
-		$string = untrailingslashit($string);
+	if ( $wp_rewrite->use_trailing_slashes ) {
+		$string = trailingslashit( $string );
+	} else { $string = untrailingslashit( $string );
+	}
 
 	/**
 	 * Filters the trailing-slashed string, depending on whether the site is set to use trailing slashes.
@@ -79,7 +79,7 @@
 	switch ( strtolower( $mode ) ) {
 		case 'title':
 			$title = sanitize_title( $post->post_title ) . '-' . $post->ID;
-			echo '<a id="'.$title.'"></a>';
+			echo '<a id="' . $title . '"></a>';
 			break;
 		case 'id':
 		default:
@@ -137,17 +137,21 @@
 		$sample = false;
 	}
 
-	if ( empty($post->ID) )
+	if ( empty( $post->ID ) ) {
 		return false;
+	}
 
-	if ( $post->post_type == 'page' )
-		return get_page_link($post, $leavename, $sample);
-	elseif ( $post->post_type == 'attachment' )
+	if ( $post->post_type == 'page' ) {
+		return get_page_link( $post, $leavename, $sample );
+	} elseif ( $post->post_type == 'attachment' ) {
 		return get_attachment_link( $post, $leavename );
-	elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) )
-		return get_post_permalink($post, $leavename, $sample);
+	} elseif ( in_array( $post->post_type, get_post_types( array(
+		'_builtin' => false,
+	) ) ) ) {
+		return get_post_permalink( $post, $leavename, $sample );
+	}
 
-	$permalink = get_option('permalink_structure');
+	$permalink = get_option( 'permalink_structure' );
 
 	/**
 	 * Filters the permalink structure for a post before token replacement occurs.
@@ -162,12 +166,12 @@
 	 */
 	$permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename );
 
-	if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) {
-		$unixtime = strtotime($post->post_date);
+	if ( '' != $permalink && ! in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) {
+		$unixtime = strtotime( $post->post_date );
 
 		$category = '';
-		if ( strpos($permalink, '%category%') !== false ) {
-			$cats = get_the_category($post->ID);
+		if ( strpos( $permalink, '%category%' ) !== false ) {
+			$cats = get_the_category( $post->ID );
 			if ( $cats ) {
 				$cats = wp_list_sort( $cats, array(
 					'term_id' => 'ASC',
@@ -186,12 +190,13 @@
 
 				$category_object = get_term( $category_object, 'category' );
 				$category = $category_object->slug;
-				if ( $parent = $category_object->parent )
-					$category = get_category_parents($parent, false, '/', true) . $category;
+				if ( $parent = $category_object->parent ) {
+					$category = get_category_parents( $parent, false, '/', true ) . $category;
+				}
 			}
 			// show default category in permalinks, without
 			// having to assign it explicitly
-			if ( empty($category) ) {
+			if ( empty( $category ) ) {
 				$default_category = get_term( get_option( 'default_category' ), 'category' );
 				if ( $default_category && ! is_wp_error( $default_category ) ) {
 					$category = $default_category->slug;
@@ -200,12 +205,12 @@
 		}
 
 		$author = '';
-		if ( strpos($permalink, '%author%') !== false ) {
-			$authordata = get_userdata($post->post_author);
+		if ( strpos( $permalink, '%author%' ) !== false ) {
+			$authordata = get_userdata( $post->post_author );
 			$author = $authordata->user_nicename;
 		}
 
-		$date = explode(" ",date('Y m d H i s', $unixtime));
+		$date = explode( ' ',date( 'Y m d H i s', $unixtime ) );
 		$rewritereplace =
 		array(
 			$date[0],
@@ -220,11 +225,11 @@
 			$author,
 			$post->post_name,
 		);
-		$permalink = home_url( str_replace($rewritecode, $rewritereplace, $permalink) );
-		$permalink = user_trailingslashit($permalink, 'single');
+		$permalink = home_url( str_replace( $rewritecode, $rewritereplace, $permalink ) );
+		$permalink = user_trailingslashit( $permalink, 'single' );
 	} else { // if they're not using the fancy permalink option
-		$permalink = home_url('?p=' . $post->ID);
-	}
+		$permalink = home_url( '?p=' . $post->ID );
+	}// End if().
 
 	/**
 	 * Filters the permalink for a post.
@@ -255,34 +260,38 @@
 function get_post_permalink( $id = 0, $leavename = false, $sample = false ) {
 	global $wp_rewrite;
 
-	$post = get_post($id);
+	$post = get_post( $id );
 
-	if ( is_wp_error( $post ) )
+	if ( is_wp_error( $post ) ) {
 		return $post;
+	}
 
-	$post_link = $wp_rewrite->get_extra_permastruct($post->post_type);
+	$post_link = $wp_rewrite->get_extra_permastruct( $post->post_type );
 
 	$slug = $post->post_name;
 
 	$draft_or_pending = get_post_status( $id ) && in_array( get_post_status( $id ), array( 'draft', 'pending', 'auto-draft', 'future' ) );
 
-	$post_type = get_post_type_object($post->post_type);
+	$post_type = get_post_type_object( $post->post_type );
 
 	if ( $post_type->hierarchical ) {
 		$slug = get_page_uri( $id );
 	}
 
-	if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) {
+	if ( ! empty( $post_link ) && ( ! $draft_or_pending || $sample ) ) {
 		if ( ! $leavename ) {
-			$post_link = str_replace("%$post->post_type%", $slug, $post_link);
+			$post_link = str_replace( "%$post->post_type%", $slug, $post_link );
 		}
-		$post_link = home_url( user_trailingslashit($post_link) );
+		$post_link = home_url( user_trailingslashit( $post_link ) );
 	} else {
-		if ( $post_type->query_var && ( isset($post->post_status) && !$draft_or_pending ) )
-			$post_link = add_query_arg($post_type->query_var, $slug, '');
-		else
-			$post_link = add_query_arg(array('post_type' => $post->post_type, 'p' => $post->ID), '');
-		$post_link = home_url($post_link);
+		if ( $post_type->query_var && ( isset( $post->post_status ) && ! $draft_or_pending ) ) {
+			$post_link = add_query_arg( $post_type->query_var, $slug, '' );
+		} else { $post_link = add_query_arg( array(
+			'post_type' => $post->post_type,
+			'p' => $post->ID,
+		), '' );
+		}
+		$post_link = home_url( $post_link );
 	}
 
 	/**
@@ -314,10 +323,10 @@
 function get_page_link( $post = false, $leavename = false, $sample = false ) {
 	$post = get_post( $post );
 
-	if ( 'page' == get_option( 'show_on_front' ) && $post->ID == get_option( 'page_on_front' ) )
-		$link = home_url('/');
-	else
-		$link = _get_page_link( $post, $leavename, $sample );
+	if ( 'page' == get_option( 'show_on_front' ) && $post->ID == get_option( 'page_on_front' ) ) {
+		$link = home_url( '/' );
+	} else { $link = _get_page_link( $post, $leavename, $sample );
+	}
 
 	/**
 	 * Filters the permalink for a page.
@@ -356,13 +365,13 @@
 
 	$link = $wp_rewrite->get_page_permastruct();
 
-	if ( !empty($link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) {
+	if ( ! empty( $link ) && ( ( isset( $post->post_status ) && ! $draft_or_pending ) || $sample ) ) {
 		if ( ! $leavename ) {
-			$link = str_replace('%pagename%', get_page_uri( $post ), $link);
+			$link = str_replace( '%pagename%', get_page_uri( $post ), $link );
 		}
 
-		$link = home_url($link);
-		$link = user_trailingslashit($link, 'page');
+		$link = home_url( $link );
+		$link = user_trailingslashit( $link, 'page' );
 	} else {
 		$link = home_url( '?page_id=' . $post->ID );
 	}
@@ -403,27 +412,30 @@
 	}
 
 	if ( $wp_rewrite->using_permalinks() && $parent ) {
-		if ( 'page' == $parent->post_type )
+		if ( 'page' == $parent->post_type ) {
 			$parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front
-		else
-			$parentlink = get_permalink( $post->post_parent );
+		} else { $parentlink = get_permalink( $post->post_parent );
+		}
 
-		if ( is_numeric($post->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') )
+		if ( is_numeric( $post->post_name ) || false !== strpos( get_option( 'permalink_structure' ), '%category%' ) ) {
 			$name = 'attachment/' . $post->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker
-		else
-			$name = $post->post_name;
+		} else { $name = $post->post_name;
+		}
 
-		if ( strpos($parentlink, '?') === false )
-			$link = user_trailingslashit( trailingslashit($parentlink) . '%postname%' );
+		if ( strpos( $parentlink, '?' ) === false ) {
+			$link = user_trailingslashit( trailingslashit( $parentlink ) . '%postname%' );
+		}
 
-		if ( ! $leavename )
+		if ( ! $leavename ) {
 			$link = str_replace( '%postname%', $name, $link );
+		}
 	} elseif ( $wp_rewrite->using_permalinks() && ! $leavename ) {
 		$link = home_url( user_trailingslashit( $post->post_name ) );
 	}
 
-	if ( ! $link )
+	if ( ! $link ) {
 		$link = home_url( '/?attachment_id=' . $post->ID );
+	}
 
 	/**
 	 * Filters the permalink for an attachment.
@@ -448,11 +460,12 @@
  */
 function get_year_link( $year ) {
 	global $wp_rewrite;
-	if ( !$year )
-		$year = gmdate('Y', current_time('timestamp'));
+	if ( ! $year ) {
+		$year = gmdate( 'Y', current_time( 'timestamp' ) );
+	}
 	$yearlink = $wp_rewrite->get_year_permastruct();
-	if ( !empty($yearlink) ) {
-		$yearlink = str_replace('%year%', $year, $yearlink);
+	if ( ! empty( $yearlink ) ) {
+		$yearlink = str_replace( '%year%', $year, $yearlink );
 		$yearlink = home_url( user_trailingslashit( $yearlink, 'year' ) );
 	} else {
 		$yearlink = home_url( '?m=' . $year );
@@ -480,16 +493,18 @@
  * @param bool|int $month False for current month. Integer of month.
  * @return string The permalink for the specified month and year archive.
  */
-function get_month_link($year, $month) {
+function get_month_link( $year, $month ) {
 	global $wp_rewrite;
-	if ( !$year )
-		$year = gmdate('Y', current_time('timestamp'));
-	if ( !$month )
-		$month = gmdate('m', current_time('timestamp'));
+	if ( ! $year ) {
+		$year = gmdate( 'Y', current_time( 'timestamp' ) );
+	}
+	if ( ! $month ) {
+		$month = gmdate( 'm', current_time( 'timestamp' ) );
+	}
 	$monthlink = $wp_rewrite->get_month_permastruct();
-	if ( !empty($monthlink) ) {
-		$monthlink = str_replace('%year%', $year, $monthlink);
-		$monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
+	if ( ! empty( $monthlink ) ) {
+		$monthlink = str_replace( '%year%', $year, $monthlink );
+		$monthlink = str_replace( '%monthnum%', zeroise( intval( $month ), 2 ), $monthlink );
 		$monthlink = home_url( user_trailingslashit( $monthlink, 'month' ) );
 	} else {
 		$monthlink = home_url( '?m=' . $year . zeroise( $month, 2 ) );
@@ -519,20 +534,23 @@
  * @param bool|int $day   False for current day. Integer of day.
  * @return string The permalink for the specified day, month, and year archive.
  */
-function get_day_link($year, $month, $day) {
+function get_day_link( $year, $month, $day ) {
 	global $wp_rewrite;
-	if ( !$year )
-		$year = gmdate('Y', current_time('timestamp'));
-	if ( !$month )
-		$month = gmdate('m', current_time('timestamp'));
-	if ( !$day )
-		$day = gmdate('j', current_time('timestamp'));
+	if ( ! $year ) {
+		$year = gmdate( 'Y', current_time( 'timestamp' ) );
+	}
+	if ( ! $month ) {
+		$month = gmdate( 'm', current_time( 'timestamp' ) );
+	}
+	if ( ! $day ) {
+		$day = gmdate( 'j', current_time( 'timestamp' ) );
+	}
 
 	$daylink = $wp_rewrite->get_day_permastruct();
-	if ( !empty($daylink) ) {
-		$daylink = str_replace('%year%', $year, $daylink);
-		$daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink);
-		$daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
+	if ( ! empty( $daylink ) ) {
+		$daylink = str_replace( '%year%', $year, $daylink );
+		$daylink = str_replace( '%monthnum%', zeroise( intval( $month ), 2 ), $daylink );
+		$daylink = str_replace( '%day%', zeroise( intval( $day ), 2 ), $daylink );
 		$daylink = home_url( user_trailingslashit( $daylink, 'day' ) );
 	} else {
 		$daylink = home_url( '?m=' . $year . zeroise( $month, 2 ) . zeroise( $day, 2 ) );
@@ -589,25 +607,28 @@
 
 	$permalink = $wp_rewrite->get_feed_permastruct();
 	if ( '' != $permalink ) {
-		if ( false !== strpos($feed, 'comments_') ) {
-			$feed = str_replace('comments_', '', $feed);
+		if ( false !== strpos( $feed, 'comments_' ) ) {
+			$feed = str_replace( 'comments_', '', $feed );
 			$permalink = $wp_rewrite->get_comment_feed_permastruct();
 		}
 
-		if ( get_default_feed() == $feed )
+		if ( get_default_feed() == $feed ) {
 			$feed = '';
+		}
 
-		$permalink = str_replace('%feed%', $feed, $permalink);
-		$permalink = preg_replace('#/+#', '/', "/$permalink");
-		$output =  home_url( user_trailingslashit($permalink, 'feed') );
+		$permalink = str_replace( '%feed%', $feed, $permalink );
+		$permalink = preg_replace( '#/+#', '/', "/$permalink" );
+		$output = home_url( user_trailingslashit( $permalink, 'feed' ) );
 	} else {
-		if ( empty($feed) )
+		if ( empty( $feed ) ) {
 			$feed = get_default_feed();
+		}
 
-		if ( false !== strpos($feed, 'comments_') )
-			$feed = str_replace('comments_', 'comments-', $feed);
+		if ( false !== strpos( $feed, 'comments_' ) ) {
+			$feed = str_replace( 'comments_', 'comments-', $feed );
+		}
 
-		$output = home_url("?feed={$feed}");
+		$output = home_url( "?feed={$feed}" );
 	}
 
 	/**
@@ -633,42 +654,54 @@
 function get_post_comments_feed_link( $post_id = 0, $feed = '' ) {
 	$post_id = absint( $post_id );
 
-	if ( ! $post_id )
+	if ( ! $post_id ) {
 		$post_id = get_the_ID();
+	}
 
-	if ( empty( $feed ) )
+	if ( empty( $feed ) ) {
 		$feed = get_default_feed();
+	}
 
 	$post = get_post( $post_id );
 	$unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent;
 
-	if ( '' != get_option('permalink_structure') ) {
-		if ( 'page' == get_option('show_on_front') && $post_id == get_option('page_on_front') )
+	if ( '' != get_option( 'permalink_structure' ) ) {
+		if ( 'page' == get_option( 'show_on_front' ) && $post_id == get_option( 'page_on_front' ) ) {
 			$url = _get_page_link( $post_id );
-		else
-			$url = get_permalink($post_id);
+		} else { $url = get_permalink( $post_id );
+		}
 
 		if ( $unattached ) {
-			$url =  home_url( '/feed/' );
+			$url = home_url( '/feed/' );
 			if ( $feed !== get_default_feed() ) {
 				$url .= "$feed/";
 			}
 			$url = add_query_arg( 'attachment_id', $post_id, $url );
 		} else {
-			$url = trailingslashit($url) . 'feed';
-			if ( $feed != get_default_feed() )
+			$url = trailingslashit( $url ) . 'feed';
+			if ( $feed != get_default_feed() ) {
 				$url .= "/$feed";
-			$url = user_trailingslashit($url, 'single_feed');
+			}
+			$url = user_trailingslashit( $url, 'single_feed' );
 		}
 	} else {
 		if ( $unattached ) {
-			$url = add_query_arg( array( 'feed' => $feed, 'attachment_id' => $post_id ), home_url( '/' ) );
+			$url = add_query_arg( array(
+				'feed' => $feed,
+				'attachment_id' => $post_id,
+			), home_url( '/' ) );
 		} elseif ( 'page' == $post->post_type ) {
-			$url = add_query_arg( array( 'feed' => $feed, 'page_id' => $post_id ), home_url( '/' ) );
+			$url = add_query_arg( array(
+				'feed' => $feed,
+				'page_id' => $post_id,
+			), home_url( '/' ) );
 		} else {
-			$url = add_query_arg( array( 'feed' => $feed, 'p' => $post_id ), home_url( '/' ) );
+			$url = add_query_arg( array(
+				'feed' => $feed,
+				'p' => $post_id,
+			), home_url( '/' ) );
 		}
-	}
+	}// End if().
 
 	/**
 	 * Filters the post comments feed permalink.
@@ -696,7 +729,7 @@
 function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) {
 	$url = get_post_comments_feed_link( $post_id, $feed );
 	if ( empty( $link_text ) ) {
-		$link_text = __('Comments Feed');
+		$link_text = __( 'Comments Feed' );
 	}
 
 	$link = '<a href="' . esc_url( $url ) . '">' . $link_text . '</a>';
@@ -726,21 +759,22 @@
  */
 function get_author_feed_link( $author_id, $feed = '' ) {
 	$author_id = (int) $author_id;
-	$permalink_structure = get_option('permalink_structure');
+	$permalink_structure = get_option( 'permalink_structure' );
 
-	if ( empty($feed) )
+	if ( empty( $feed ) ) {
 		$feed = get_default_feed();
+	}
 
 	if ( '' == $permalink_structure ) {
-		$link = home_url("?feed=$feed&amp;author=" . $author_id);
+		$link = home_url( "?feed=$feed&amp;author=" . $author_id );
 	} else {
-		$link = get_author_posts_url($author_id);
-		if ( $feed == get_default_feed() )
+		$link = get_author_posts_url( $author_id );
+		if ( $feed == get_default_feed() ) {
 			$feed_link = 'feed';
-		else
-			$feed_link = "feed/$feed";
+		} else { $feed_link = "feed/$feed";
+		}
 
-		$link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');
+		$link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
 	}
 
 	/**
@@ -786,34 +820,35 @@
  * @return string|false Link to the feed for the term specified by $term_id and $taxonomy.
  */
 function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
-	$term_id = ( int ) $term_id;
+	$term_id = (int) $term_id;
 
-	$term = get_term( $term_id, $taxonomy  );
+	$term = get_term( $term_id, $taxonomy );
 
-	if ( empty( $term ) || is_wp_error( $term ) )
+	if ( empty( $term ) || is_wp_error( $term ) ) {
 		return false;
+	}
 
-	if ( empty( $feed ) )
+	if ( empty( $feed ) ) {
 		$feed = get_default_feed();
+	}
 
 	$permalink_structure = get_option( 'permalink_structure' );
 
 	if ( '' == $permalink_structure ) {
 		if ( 'category' == $taxonomy ) {
-			$link = home_url("?feed=$feed&amp;cat=$term_id");
-		}
-		elseif ( 'post_tag' == $taxonomy ) {
-			$link = home_url("?feed=$feed&amp;tag=$term->slug");
+			$link = home_url( "?feed=$feed&amp;cat=$term_id" );
+		} elseif ( 'post_tag' == $taxonomy ) {
+			$link = home_url( "?feed=$feed&amp;tag=$term->slug" );
 		} else {
 			$t = get_taxonomy( $taxonomy );
-			$link = home_url("?feed=$feed&amp;$t->query_var=$term->slug");
+			$link = home_url( "?feed=$feed&amp;$t->query_var=$term->slug" );
 		}
 	} else {
 		$link = get_term_link( $term_id, $term->taxonomy );
-		if ( $feed == get_default_feed() )
+		if ( $feed == get_default_feed() ) {
 			$feed_link = 'feed';
-		else
-			$feed_link = "feed/$feed";
+		} else { $feed_link = "feed/$feed";
+		}
 
 		$link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
 	}
@@ -979,19 +1014,22 @@
  * @return string|void HTML content.
  */
 function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) {
-	if ( is_null( $term ) )
+	if ( is_null( $term ) ) {
 		$term = get_queried_object();
+	}
 
-	if ( ! $term )
+	if ( ! $term ) {
 		return;
+	}
 
 	$tax = get_taxonomy( $term->taxonomy );
 	if ( ! current_user_can( 'edit_term', $term->term_id ) ) {
 		return;
 	}
 
-	if ( empty( $link ) )
-		$link = __('Edit This');
+	if ( empty( $link ) ) {
+		$link = __( 'Edit This' );
+	}
 
 	$link = '<a href="' . get_edit_term_link( $term->term_id, $term->taxonomy ) . '">' . $link . '</a>';
 
@@ -1005,10 +1043,10 @@
 	 */
 	$link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after;
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $link;
-	else
-		return $link;
+	} else { return $link;
+	}
 }
 
 /**
@@ -1024,18 +1062,18 @@
 function get_search_link( $query = '' ) {
 	global $wp_rewrite;
 
-	if ( empty($query) )
+	if ( empty( $query ) ) {
 		$search = get_search_query( false );
-	else
-		$search = stripslashes($query);
+	} else { $search = stripslashes( $query );
+	}
 
 	$permastruct = $wp_rewrite->get_search_permastruct();
 
 	if ( empty( $permastruct ) ) {
-		$link = home_url('?s=' . urlencode($search) );
+		$link = home_url( '?s=' . urlencode( $search ) );
 	} else {
-		$search = urlencode($search);
-		$search = str_replace('%2F', '/', $search); // %2F(/) is not valid within a URL, send it un-encoded.
+		$search = urlencode( $search );
+		$search = str_replace( '%2F', '/', $search ); // %2F(/) is not valid within a URL, send it un-encoded.
 		$link = str_replace( '%search%', $search, $permastruct );
 		$link = home_url( user_trailingslashit( $link, 'search' ) );
 	}
@@ -1062,19 +1100,20 @@
  * @param string $feed         Optional. Feed type. Default empty.
  * @return string The search results feed permalink.
  */
-function get_search_feed_link($search_query = '', $feed = '') {
+function get_search_feed_link( $search_query = '', $feed = '' ) {
 	global $wp_rewrite;
-	$link = get_search_link($search_query);
+	$link = get_search_link( $search_query );
 
-	if ( empty($feed) )
+	if ( empty( $feed ) ) {
 		$feed = get_default_feed();
+	}
 
 	$permastruct = $wp_rewrite->get_search_permastruct();
 
-	if ( empty($permastruct) ) {
-		$link = add_query_arg('feed', $feed, $link);
+	if ( empty( $permastruct ) ) {
+		$link = add_query_arg( 'feed', $feed, $link );
 	} else {
-		$link = trailingslashit($link);
+		$link = trailingslashit( $link );
 		$link .= "feed/$feed/";
 	}
 
@@ -1101,20 +1140,21 @@
  * @param string $feed         Optional. Feed type. Default empty.
  * @return string The comments feed search results permalink.
  */
-function get_search_comments_feed_link($search_query = '', $feed = '') {
+function get_search_comments_feed_link( $search_query = '', $feed = '' ) {
 	global $wp_rewrite;
 
-	if ( empty($feed) )
+	if ( empty( $feed ) ) {
 		$feed = get_default_feed();
+	}
 
-	$link = get_search_feed_link($search_query, $feed);
+	$link = get_search_feed_link( $search_query, $feed );
 
 	$permastruct = $wp_rewrite->get_search_permastruct();
 
-	if ( empty($permastruct) )
-		$link = add_query_arg('feed', 'comments-' . $feed, $link);
-	else
-		$link = add_query_arg('withcomments', 1, $link);
+	if ( empty( $permastruct ) ) {
+		$link = add_query_arg( 'feed', 'comments-' . $feed, $link );
+	} else { $link = add_query_arg( 'withcomments', 1, $link );
+	}
 
 	/** This filter is documented in wp-includes/link-template.php */
 	return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
@@ -1133,8 +1173,9 @@
  */
 function get_post_type_archive_link( $post_type ) {
 	global $wp_rewrite;
-	if ( ! $post_type_obj = get_post_type_object( $post_type ) )
+	if ( ! $post_type_obj = get_post_type_object( $post_type ) ) {
 		return false;
+	}
 
 	if ( 'post' === $post_type ) {
 		$show_on_front = get_option( 'show_on_front' );
@@ -1149,15 +1190,16 @@
 		return apply_filters( 'post_type_archive_link', $link, $post_type );
 	}
 
-	if ( ! $post_type_obj->has_archive )
+	if ( ! $post_type_obj->has_archive ) {
 		return false;
+	}
 
 	if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) {
 		$struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive;
-		if ( $post_type_obj->rewrite['with_front'] )
+		if ( $post_type_obj->rewrite['with_front'] ) {
 			$struct = $wp_rewrite->front . $struct;
-		else
-			$struct = $wp_rewrite->root . $struct;
+		} else { $struct = $wp_rewrite->root . $struct;
+		}
 		$link = home_url( user_trailingslashit( $struct, 'post_type_archive' ) );
 	} else {
 		$link = home_url( '?post_type=' . $post_type );
@@ -1185,18 +1227,21 @@
  */
 function get_post_type_archive_feed_link( $post_type, $feed = '' ) {
 	$default_feed = get_default_feed();
-	if ( empty( $feed ) )
+	if ( empty( $feed ) ) {
 		$feed = $default_feed;
+	}
 
-	if ( ! $link = get_post_type_archive_link( $post_type ) )
+	if ( ! $link = get_post_type_archive_link( $post_type ) ) {
 		return false;
+	}
 
 	$post_type_obj = get_post_type_object( $post_type );
 	if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) {
 		$link = trailingslashit( $link );
 		$link .= 'feed/';
-		if ( $feed != $default_feed )
+		if ( $feed != $default_feed ) {
 			$link .= "$feed/";
+		}
 	} else {
 		$link = add_query_arg( 'feed', $feed, $link );
 	}
@@ -1268,22 +1313,25 @@
  *                     not allow an editing UI.
  */
 function get_edit_post_link( $id = 0, $context = 'display' ) {
-	if ( ! $post = get_post( $id ) )
+	if ( ! $post = get_post( $id ) ) {
 		return;
+	}
 
-	if ( 'revision' === $post->post_type )
+	if ( 'revision' === $post->post_type ) {
 		$action = '';
-	elseif ( 'display' == $context )
+	} elseif ( 'display' == $context ) {
 		$action = '&amp;action=edit';
-	else
-		$action = '&action=edit';
+	} else { $action = '&action=edit';
+	}
 
 	$post_type_object = get_post_type_object( $post->post_type );
-	if ( !$post_type_object )
+	if ( ! $post_type_object ) {
 		return;
+	}
 
-	if ( !current_user_can( 'edit_post', $post->ID ) )
+	if ( ! current_user_can( 'edit_post', $post->ID ) ) {
 		return;
+	}
 
 	if ( $post_type_object->_edit_link ) {
 		$link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
@@ -1356,20 +1404,24 @@
  * @return string|void The delete post link URL for the given post.
  */
 function get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false ) {
-	if ( ! empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '3.0.0' );
+	}
 
-	if ( !$post = get_post( $id ) )
+	if ( ! $post = get_post( $id ) ) {
 		return;
+	}
 
 	$post_type_object = get_post_type_object( $post->post_type );
-	if ( !$post_type_object )
+	if ( ! $post_type_object ) {
 		return;
+	}
 
-	if ( !current_user_can( 'delete_post', $post->ID ) )
+	if ( ! current_user_can( 'delete_post', $post->ID ) ) {
 		return;
+	}
 
-	$action = ( $force_delete || !EMPTY_TRASH_DAYS ) ? 'delete' : 'trash';
+	$action = ( $force_delete || ! EMPTY_TRASH_DAYS ) ? 'delete' : 'trash';
 
 	$delete_link = add_query_arg( 'action', $action, admin_url( sprintf( $post_type_object->_edit_link, $post->ID ) ) );
 
@@ -1396,10 +1448,11 @@
 function get_edit_comment_link( $comment_id = 0 ) {
 	$comment = get_comment( $comment_id );
 
-	if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
+	if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
 		return;
+	}
 
-	$location = admin_url('comment.php?action=editcomment&amp;c=') . $comment->comment_ID;
+	$location = admin_url( 'comment.php?action=editcomment&amp;c=' ) . $comment->comment_ID;
 
 	/**
 	 * Filters the comment edit link.
@@ -1456,10 +1509,11 @@
 function get_edit_bookmark_link( $link = 0 ) {
 	$link = get_bookmark( $link );
 
-	if ( !current_user_can('manage_links') )
+	if ( ! current_user_can( 'manage_links' ) ) {
 		return;
+	}
 
-	$location = admin_url('link.php?action=edit&amp;link_id=') . $link->link_id;
+	$location = admin_url( 'link.php?action=edit&amp;link_id=' ) . $link->link_id;
 
 	/**
 	 * Filters the bookmark edit link.
@@ -1483,13 +1537,15 @@
  * @param int    $bookmark Optional. Bookmark ID. Default is the current bookmark.
  */
 function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {
-	$bookmark = get_bookmark($bookmark);
+	$bookmark = get_bookmark( $bookmark );
 
-	if ( !current_user_can('manage_links') )
+	if ( ! current_user_can( 'manage_links' ) ) {
 		return;
+	}
 
-	if ( empty($link) )
-		$link = __('Edit This');
+	if ( empty( $link ) ) {
+		$link = __( 'Edit This' );
+	}
 
 	$link = '<a href="' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '">' . $link . '</a>';
 
@@ -1513,21 +1569,24 @@
  * @return string URL to edit user page or empty string.
  */
 function get_edit_user_link( $user_id = null ) {
-	if ( ! $user_id )
+	if ( ! $user_id ) {
 		$user_id = get_current_user_id();
+	}
 
-	if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) )
+	if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) ) {
 		return '';
+	}
 
 	$user = get_userdata( $user_id );
 
-	if ( ! $user )
+	if ( ! $user ) {
 		return '';
+	}
 
-	if ( get_current_user_id() == $user->ID )
+	if ( get_current_user_id() == $user->ID ) {
 		$link = get_edit_profile_url( $user->ID );
-	else
-		$link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
+	} else { $link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
+	}
 
 	/**
 	 * Filters the user edit link.
@@ -1591,8 +1650,9 @@
 function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
 	global $wpdb;
 
-	if ( ( ! $post = get_post() ) || ! taxonomy_exists( $taxonomy ) )
+	if ( ( ! $post = get_post() ) || ! taxonomy_exists( $taxonomy ) ) {
 		return null;
+	}
 
 	$current_post_date = $post->post_date;
 
@@ -1615,20 +1675,22 @@
 
 		if ( $in_same_term ) {
 			$join .= " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";
-			$where .= $wpdb->prepare( "AND tt.taxonomy = %s", $taxonomy );
+			$where .= $wpdb->prepare( 'AND tt.taxonomy = %s', $taxonomy );
 
-			if ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) )
+			if ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {
 				return '';
+			}
 			$term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
 
 			// Remove any exclusions from the term array to include.
 			$term_array = array_diff( $term_array, (array) $excluded_terms );
 			$term_array = array_map( 'intval', $term_array );
 
-			if ( ! $term_array || is_wp_error( $term_array ) )
+			if ( ! $term_array || is_wp_error( $term_array ) ) {
 				return '';
+			}
 
-			$where .= " AND tt.term_id IN (" . implode( ',', $term_array ) . ")";
+			$where .= ' AND tt.term_id IN (' . implode( ',', $term_array ) . ')';
 		}
 
 		/**
@@ -1646,7 +1708,7 @@
 		if ( ! empty( $excluded_terms ) ) {
 			$where .= " AND p.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships tr LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.term_id IN (" . implode( ',', array_map( 'intval', $excluded_terms ) ) . ') )';
 		}
-	}
+	}// End if().
 
 	// 'post_status' clause depends on the current user.
 	if ( is_user_logged_in() ) {
@@ -1668,12 +1730,12 @@
 		$where .= " AND ( p.post_status = 'publish'";
 		foreach ( (array) $private_states as $state ) {
 			if ( current_user_can( $read_private_cap ) ) {
-				$where .= $wpdb->prepare( " OR p.post_status = %s", $state );
+				$where .= $wpdb->prepare( ' OR p.post_status = %s', $state );
 			} else {
-				$where .= $wpdb->prepare( " OR (p.post_author = %d AND p.post_status = %s)", $user_id, $state );
+				$where .= $wpdb->prepare( ' OR (p.post_author = %d AND p.post_status = %s)', $user_id, $state );
 			}
 		}
-		$where .= " )";
+		$where .= ' )';
 	} else {
 		$where .= " AND p.post_status = 'publish'";
 	}
@@ -1733,19 +1795,22 @@
 	$query_key = 'adjacent_post_' . md5( $query );
 	$result = wp_cache_get( $query_key, 'counts' );
 	if ( false !== $result ) {
-		if ( $result )
+		if ( $result ) {
 			$result = get_post( $result );
+		}
 		return $result;
 	}
 
 	$result = $wpdb->get_var( $query );
-	if ( null === $result )
+	if ( null === $result ) {
 		$result = '';
+	}
 
 	wp_cache_set( $query_key, $result, 'counts' );
 
-	if ( $result )
+	if ( $result ) {
 		$result = get_post( $result );
+	}
 
 	return $result;
 }
@@ -1765,18 +1830,20 @@
  * @return string|void The adjacent post relational link URL.
  */
 function get_adjacent_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
-	if ( $previous && is_attachment() && $post = get_post() )
+	if ( $previous && is_attachment() && $post = get_post() ) {
 		$post = get_post( $post->post_parent );
-	else
-		$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
+	} else { $post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
+	}
 
-	if ( empty( $post ) )
+	if ( empty( $post ) ) {
 		return;
+	}
 
 	$post_title = the_title_attribute( array( 'echo' => false, 'post' => $post ) );
 
-	if ( empty( $post_title ) )
+	if ( empty( $post_title ) ) {
 		$post_title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );
+	}
 
 	$date = mysql2date( get_option( 'date_format' ), $post->post_date );
 
@@ -1884,43 +1951,47 @@
  */
 function get_boundary_post( $in_same_term = false, $excluded_terms = '', $start = true, $taxonomy = 'category' ) {
 	$post = get_post();
-	if ( ! $post || ! is_single() || is_attachment() || ! taxonomy_exists( $taxonomy ) )
+	if ( ! $post || ! is_single() || is_attachment() || ! taxonomy_exists( $taxonomy ) ) {
 		return null;
+	}
 
 	$query_args = array(
 		'posts_per_page' => 1,
 		'order' => $start ? 'ASC' : 'DESC',
 		'update_post_term_cache' => false,
-		'update_post_meta_cache' => false
+		'update_post_meta_cache' => false,
 	);
 
 	$term_array = array();
 
 	if ( ! is_array( $excluded_terms ) ) {
-		if ( ! empty( $excluded_terms ) )
+		if ( ! empty( $excluded_terms ) ) {
 			$excluded_terms = explode( ',', $excluded_terms );
-		else
-			$excluded_terms = array();
+		} else { $excluded_terms = array();
+		}
 	}
 
 	if ( $in_same_term || ! empty( $excluded_terms ) ) {
-		if ( $in_same_term )
+		if ( $in_same_term ) {
 			$term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
+		}
 
 		if ( ! empty( $excluded_terms ) ) {
 			$excluded_terms = array_map( 'intval', $excluded_terms );
 			$excluded_terms = array_diff( $excluded_terms, $term_array );
 
 			$inverse_terms = array();
-			foreach ( $excluded_terms as $excluded_term )
+			foreach ( $excluded_terms as $excluded_term ) {
 				$inverse_terms[] = $excluded_term * -1;
+			}
 			$excluded_terms = $inverse_terms;
 		}
 
-		$query_args[ 'tax_query' ] = array( array(
+		$query_args['tax_query'] = array( array(
 			'taxonomy' => $taxonomy,
-			'terms' => array_merge( $term_array, $excluded_terms )
-		) );
+			'terms' => array_merge( $term_array, $excluded_terms ),
+		),
+		);
 	}
 
 	return get_posts( $query_args );
@@ -2007,18 +2078,19 @@
  * @return string The link URL of the previous or next post in relation to the current post.
  */
 function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
-	if ( $previous && is_attachment() )
+	if ( $previous && is_attachment() ) {
 		$post = get_post( get_post()->post_parent );
-	else
-		$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
+	} else { $post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
+	}
 
 	if ( ! $post ) {
 		$output = '';
 	} else {
 		$title = $post->post_title;
 
-		if ( empty( $post->post_title ) )
+		if ( empty( $post->post_title ) ) {
 			$title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );
+		}
 
 		/** This filter is documented in wp-includes/post-template.php */
 		$title = apply_filters( 'the_title', $title, $post->ID );
@@ -2026,7 +2098,7 @@
 		$date = mysql2date( get_option( 'date_format' ), $post->post_date );
 		$rel = $previous ? 'prev' : 'next';
 
-		$string = '<a href="' . get_permalink( $post ) . '" rel="'.$rel.'">';
+		$string = '<a href="' . get_permalink( $post ) . '" rel="' . $rel . '">';
 		$inlink = str_replace( '%title', $title, $link );
 		$inlink = str_replace( '%date', $date, $inlink );
 		$inlink = $string . $inlink . '</a>';
@@ -2084,21 +2156,21 @@
  * 	                    Otherwise, prepares the URL with esc_url_raw().
  * @return string The link URL for the given page number.
  */
-function get_pagenum_link($pagenum = 1, $escape = true ) {
+function get_pagenum_link( $pagenum = 1, $escape = true ) {
 	global $wp_rewrite;
 
 	$pagenum = (int) $pagenum;
 
 	$request = remove_query_arg( 'paged' );
 
-	$home_root = parse_url(home_url());
-	$home_root = ( isset($home_root['path']) ) ? $home_root['path'] : '';
+	$home_root = parse_url( home_url() );
+	$home_root = ( isset( $home_root['path'] ) ) ? $home_root['path'] : '';
 	$home_root = preg_quote( $home_root, '|' );
 
-	$request = preg_replace('|^'. $home_root . '|i', '', $request);
-	$request = preg_replace('|^/+|', '', $request);
+	$request = preg_replace( '|^' . $home_root . '|i', '', $request );
+	$request = preg_replace( '|^/+|', '', $request );
 
-	if ( !$wp_rewrite->using_permalinks() || is_admin() ) {
+	if ( ! $wp_rewrite->using_permalinks() || is_admin() ) {
 		$base = trailingslashit( get_bloginfo( 'url' ) );
 
 		if ( $pagenum > 1 ) {
@@ -2110,24 +2182,25 @@
 		$qs_regex = '|\?.*?$|';
 		preg_match( $qs_regex, $request, $qs_match );
 
-		if ( !empty( $qs_match[0] ) ) {
+		if ( ! empty( $qs_match[0] ) ) {
 			$query_string = $qs_match[0];
 			$request = preg_replace( $qs_regex, '', $request );
 		} else {
 			$query_string = '';
 		}
 
-		$request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request);
-		$request = preg_replace( '|^' . preg_quote( $wp_rewrite->index, '|' ) . '|i', '', $request);
-		$request = ltrim($request, '/');
+		$request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request );
+		$request = preg_replace( '|^' . preg_quote( $wp_rewrite->index, '|' ) . '|i', '', $request );
+		$request = ltrim( $request, '/' );
 
 		$base = trailingslashit( get_bloginfo( 'url' ) );
 
-		if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )
+		if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) ) {
 			$base .= $wp_rewrite->index . '/';
+		}
 
 		if ( $pagenum > 1 ) {
-			$request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' );
+			$request = ( ( ! empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . '/' . $pagenum, 'paged' );
 		}
 
 		$result = $base . $request . $query_string;
@@ -2142,10 +2215,10 @@
 	 */
 	$result = apply_filters( 'get_pagenum_link', $result );
 
-	if ( $escape )
+	if ( $escape ) {
 		return esc_url( $result );
-	else
-		return esc_url_raw( $result );
+	} else { return esc_url_raw( $result );
+	}
 }
 
 /**
@@ -2160,15 +2233,17 @@
  * @param int $max_page Optional. Max pages. Default 0.
  * @return string|void The link URL for next posts page.
  */
-function get_next_posts_page_link($max_page = 0) {
+function get_next_posts_page_link( $max_page = 0 ) {
 	global $paged;
 
-	if ( !is_single() ) {
-		if ( !$paged )
+	if ( ! is_single() ) {
+		if ( ! $paged ) {
 			$paged = 1;
-		$nextpage = intval($paged) + 1;
-		if ( !$max_page || $max_page >= $nextpage )
-			return get_pagenum_link($nextpage);
+		}
+		$nextpage = intval( $paged ) + 1;
+		if ( ! $max_page || $max_page >= $nextpage ) {
+			return get_pagenum_link( $nextpage );
+		}
 	}
 }
 
@@ -2184,10 +2259,10 @@
 function next_posts( $max_page = 0, $echo = true ) {
 	$output = esc_url( get_next_posts_page_link( $max_page ) );
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $output;
-	else
-		return $output;
+	} else { return $output;
+	}
 }
 
 /**
@@ -2205,18 +2280,21 @@
 function get_next_posts_link( $label = null, $max_page = 0 ) {
 	global $paged, $wp_query;
 
-	if ( !$max_page )
+	if ( ! $max_page ) {
 		$max_page = $wp_query->max_num_pages;
+	}
 
-	if ( !$paged )
+	if ( ! $paged ) {
 		$paged = 1;
+	}
 
-	$nextpage = intval($paged) + 1;
+	$nextpage = intval( $paged ) + 1;
 
-	if ( null === $label )
+	if ( null === $label ) {
 		$label = __( 'Next Page &raquo;' );
+	}
 
-	if ( !is_single() && ( $nextpage <= $max_page ) ) {
+	if ( ! is_single() && ( $nextpage <= $max_page ) ) {
 		/**
 		 * Filters the anchor tag attributes for the next posts page link.
 		 *
@@ -2226,7 +2304,7 @@
 		 */
 		$attr = apply_filters( 'next_posts_link_attributes', '' );
 
-		return '<a href="' . next_posts( $max_page, false ) . "\" $attr>" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) . '</a>';
+		return '<a href="' . next_posts( $max_page, false ) . "\" $attr>" . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) . '</a>';
 	}
 }
 
@@ -2258,11 +2336,12 @@
 function get_previous_posts_page_link() {
 	global $paged;
 
-	if ( !is_single() ) {
-		$nextpage = intval($paged) - 1;
-		if ( $nextpage < 1 )
+	if ( ! is_single() ) {
+		$nextpage = intval( $paged ) - 1;
+		if ( $nextpage < 1 ) {
 			$nextpage = 1;
-		return get_pagenum_link($nextpage);
+		}
+		return get_pagenum_link( $nextpage );
 	}
 }
 
@@ -2277,10 +2356,10 @@
 function previous_posts( $echo = true ) {
 	$output = esc_url( get_previous_posts_page_link() );
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $output;
-	else
-		return $output;
+	} else { return $output;
+	}
 }
 
 /**
@@ -2296,10 +2375,11 @@
 function get_previous_posts_link( $label = null ) {
 	global $paged;
 
-	if ( null === $label )
+	if ( null === $label ) {
 		$label = __( '&laquo; Previous Page' );
+	}
 
-	if ( !is_single() && $paged > 1 ) {
+	if ( ! is_single() && $paged > 1 ) {
 		/**
 		 * Filters the anchor tag attributes for the previous posts page link.
 		 *
@@ -2308,7 +2388,7 @@
 		 * @param string $attributes Attributes for the anchor tag.
 		 */
 		$attr = apply_filters( 'previous_posts_link_attributes', '' );
-		return '<a href="' . previous_posts( false ) . "\" $attr>". preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) .'</a>';
+		return '<a href="' . previous_posts( false ) . "\" $attr>" . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) . '</a>';
 	}
 }
 
@@ -2346,26 +2426,26 @@
 
 	$return = '';
 
-	if ( !is_singular() ) {
+	if ( ! is_singular() ) {
 		$defaults = array(
 			'sep' => ' &#8212; ',
-			'prelabel' => __('&laquo; Previous Page'),
-			'nxtlabel' => __('Next Page &raquo;'),
+			'prelabel' => __( '&laquo; Previous Page' ),
+			'nxtlabel' => __( 'Next Page &raquo;' ),
 		);
 		$args = wp_parse_args( $args, $defaults );
 
 		$max_num_pages = $wp_query->max_num_pages;
-		$paged = get_query_var('paged');
+		$paged = get_query_var( 'paged' );
 
 		//only have sep if there's both prev and next results
-		if ($paged < 2 || $paged >= $max_num_pages) {
+		if ( $paged < 2 || $paged >= $max_num_pages ) {
 			$args['sep'] = '';
 		}
 
 		if ( $max_num_pages > 1 ) {
-			$return = get_previous_posts_link($args['prelabel']);
-			$return .= preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $args['sep']);
-			$return .= get_next_posts_link($args['nxtlabel']);
+			$return = get_previous_posts_link( $args['prelabel'] );
+			$return .= preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $args['sep'] );
+			$return .= get_next_posts_link( $args['nxtlabel'] );
 		}
 	}
 	return $return;
@@ -2382,8 +2462,8 @@
  * @param string $nxtlabel Optional Label for next pages. Default empty.
  */
 function posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) {
-	$args = array_filter( compact('sep', 'prelabel', 'nxtlabel') );
-	echo get_posts_nav_link($args);
+	$args = array_filter( compact( 'sep', 'prelabel', 'nxtlabel' ) );
+	echo get_posts_nav_link( $args );
 }
 
 /**
@@ -2627,18 +2707,18 @@
 
 	$result = get_permalink();
 
-	if ( 'newest' == get_option('default_comments_page') ) {
+	if ( 'newest' == get_option( 'default_comments_page' ) ) {
 		if ( $pagenum != $max_page ) {
-			if ( $wp_rewrite->using_permalinks() )
-				$result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged');
-			else
-				$result = add_query_arg( 'cpage', $pagenum, $result );
+			if ( $wp_rewrite->using_permalinks() ) {
+				$result = user_trailingslashit( trailingslashit( $result ) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged' );
+			} else { $result = add_query_arg( 'cpage', $pagenum, $result );
+			}
 		}
 	} elseif ( $pagenum > 1 ) {
-		if ( $wp_rewrite->using_permalinks() )
-			$result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged');
-		else
-			$result = add_query_arg( 'cpage', $pagenum, $result );
+		if ( $wp_rewrite->using_permalinks() ) {
+			$result = user_trailingslashit( trailingslashit( $result ) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged' );
+		} else { $result = add_query_arg( 'cpage', $pagenum, $result );
+		}
 	}
 
 	$result .= '#comments';
@@ -2667,28 +2747,33 @@
 function get_next_comments_link( $label = '', $max_page = 0 ) {
 	global $wp_query;
 
-	if ( ! is_singular() )
+	if ( ! is_singular() ) {
 		return;
+	}
 
-	$page = get_query_var('cpage');
+	$page = get_query_var( 'cpage' );
 
 	if ( ! $page ) {
 		$page = 1;
 	}
 
-	$nextpage = intval($page) + 1;
+	$nextpage = intval( $page ) + 1;
 
-	if ( empty($max_page) )
+	if ( empty( $max_page ) ) {
 		$max_page = $wp_query->max_num_comment_pages;
+	}
 
-	if ( empty($max_page) )
+	if ( empty( $max_page ) ) {
 		$max_page = get_comment_pages_count();
+	}
 
-	if ( $nextpage > $max_page )
+	if ( $nextpage > $max_page ) {
 		return;
+	}
 
-	if ( empty($label) )
-		$label = __('Newer Comments &raquo;');
+	if ( empty( $label ) ) {
+		$label = __( 'Newer Comments &raquo;' );
+	}
 
 	/**
 	 * Filters the anchor tag attributes for the next comments page link.
@@ -2697,7 +2782,7 @@
 	 *
 	 * @param string $attributes Attributes for the anchor tag.
 	 */
-	return '<a href="' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) .'</a>';
+	return '<a href="' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) . '</a>';
 }
 
 /**
@@ -2721,18 +2806,21 @@
  * @return string|void HTML-formatted link for the previous page of comments.
  */
 function get_previous_comments_link( $label = '' ) {
-	if ( ! is_singular() )
+	if ( ! is_singular() ) {
 		return;
+	}
 
-	$page = get_query_var('cpage');
+	$page = get_query_var( 'cpage' );
 
-	if ( intval($page) <= 1 )
+	if ( intval( $page ) <= 1 ) {
 		return;
+	}
 
-	$prevpage = intval($page) - 1;
+	$prevpage = intval( $page ) - 1;
 
-	if ( empty($label) )
-		$label = __('&laquo; Older Comments');
+	if ( empty( $label ) ) {
+		$label = __( '&laquo; Older Comments' );
+	}
 
 	/**
 	 * Filters the anchor tag attributes for the previous comments page link.
@@ -2741,7 +2829,7 @@
 	 *
 	 * @param string $attributes Attributes for the anchor tag.
 	 */
-	return '<a href="' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) .'</a>';
+	return '<a href="' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) . '</a>';
 }
 
 /**
@@ -2769,12 +2857,14 @@
 function paginate_comments_links( $args = array() ) {
 	global $wp_rewrite;
 
-	if ( ! is_singular() )
+	if ( ! is_singular() ) {
 		return;
+	}
 
-	$page = get_query_var('cpage');
-	if ( !$page )
+	$page = get_query_var( 'cpage' );
+	if ( ! $page ) {
 		$page = 1;
+	}
 	$max_page = get_comment_pages_count();
 	$defaults = array(
 		'base' => add_query_arg( 'cpage', '%#%' ),
@@ -2782,18 +2872,19 @@
 		'total' => $max_page,
 		'current' => $page,
 		'echo' => true,
-		'add_fragment' => '#comments'
+		'add_fragment' => '#comments',
 	);
-	if ( $wp_rewrite->using_permalinks() )
-		$defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged');
+	if ( $wp_rewrite->using_permalinks() ) {
+		$defaults['base'] = user_trailingslashit( trailingslashit( get_permalink() ) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged' );
+	}
 
 	$args = wp_parse_args( $args, $defaults );
 	$page_links = paginate_links( $args );
 
-	if ( $args['echo'] )
+	if ( $args['echo'] ) {
 		echo $page_links;
-	else
-		return $page_links;
+	} else { return $page_links;
+	}
 }
 
 /**
@@ -2991,7 +3082,7 @@
 
 	$orig_scheme = $scheme;
 
-	if ( empty( $blog_id ) || !is_multisite() ) {
+	if ( empty( $blog_id ) || ! is_multisite() ) {
 		$url = get_option( 'home' );
 	} else {
 		switch_to_blog( $blog_id );
@@ -3000,16 +3091,17 @@
 	}
 
 	if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) {
-		if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow )
+		if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow ) {
 			$scheme = 'https';
-		else
-			$scheme = parse_url( $url, PHP_URL_SCHEME );
+		} else { $scheme = parse_url( $url, PHP_URL_SCHEME );
+		}
 	}
 
 	$url = set_url_scheme( $url, $scheme );
 
-	if ( $path && is_string( $path ) )
+	if ( $path && is_string( $path ) ) {
 		$url .= '/' . ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the home URL.
@@ -3061,7 +3153,7 @@
  * @return string Site URL link with optional path appended.
  */
 function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
-	if ( empty( $blog_id ) || !is_multisite() ) {
+	if ( empty( $blog_id ) || ! is_multisite() ) {
 		$url = get_option( 'siteurl' );
 	} else {
 		switch_to_blog( $blog_id );
@@ -3071,8 +3163,9 @@
 
 	$url = set_url_scheme( $url, $scheme );
 
-	if ( $path && is_string( $path ) )
+	if ( $path && is_string( $path ) ) {
 		$url .= '/' . ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the site URL.
@@ -3115,10 +3208,11 @@
  * @return string Admin URL link with optional path appended.
  */
 function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
-	$url = get_site_url($blog_id, 'wp-admin/', $scheme);
+	$url = get_site_url( $blog_id, 'wp-admin/', $scheme );
 
-	if ( $path && is_string( $path ) )
+	if ( $path && is_string( $path ) ) {
 		$url .= ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the admin area URL.
@@ -3145,8 +3239,9 @@
 function includes_url( $path = '', $scheme = null ) {
 	$url = site_url( '/' . WPINC . '/', $scheme );
 
-	if ( $path && is_string( $path ) )
-		$url .= ltrim($path, '/');
+	if ( $path && is_string( $path ) ) {
+		$url .= ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the URL to the includes directory.
@@ -3171,8 +3266,9 @@
 function content_url( $path = '' ) {
 	$url = set_url_scheme( WP_CONTENT_URL );
 
-	if ( $path && is_string( $path ) )
-		$url .= '/' . ltrim($path, '/');
+	if ( $path && is_string( $path ) ) {
+		$url .= '/' . ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the URL to the content directory.
@@ -3183,7 +3279,7 @@
 	 * @param string $path Path relative to the URL to the content directory. Blank string
 	 *                     if no path is specified.
 	 */
-	return apply_filters( 'content_url', $url, $path);
+	return apply_filters( 'content_url', $url, $path );
 }
 
 /**
@@ -3206,22 +3302,23 @@
 	$plugin = wp_normalize_path( $plugin );
 	$mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );
 
-	if ( !empty($plugin) && 0 === strpos($plugin, $mu_plugin_dir) )
+	if ( ! empty( $plugin ) && 0 === strpos( $plugin, $mu_plugin_dir ) ) {
 		$url = WPMU_PLUGIN_URL;
-	else
-		$url = WP_PLUGIN_URL;
-
+	} else { $url = WP_PLUGIN_URL;
+	}
 
 	$url = set_url_scheme( $url );
 
-	if ( !empty($plugin) && is_string($plugin) ) {
-		$folder = dirname(plugin_basename($plugin));
-		if ( '.' != $folder )
-			$url .= '/' . ltrim($folder, '/');
+	if ( ! empty( $plugin ) && is_string( $plugin ) ) {
+		$folder = dirname( plugin_basename( $plugin ) );
+		if ( '.' != $folder ) {
+			$url .= '/' . ltrim( $folder, '/' );
+		}
 	}
 
-	if ( $path && is_string( $path ) )
-		$url .= '/' . ltrim($path, '/');
+	if ( $path && is_string( $path ) ) {
+		$url .= '/' . ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the URL to the plugins directory.
@@ -3254,18 +3351,20 @@
  * @return string Site URL link with optional path appended.
  */
 function network_site_url( $path = '', $scheme = null ) {
-	if ( ! is_multisite() )
-		return site_url($path, $scheme);
+	if ( ! is_multisite() ) {
+		return site_url( $path, $scheme );
+	}
 
 	$current_network = get_network();
 
-	if ( 'relative' == $scheme )
+	if ( 'relative' == $scheme ) {
 		$url = $current_network->path;
-	else
-		$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
+	} else { $url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
+	}
 
-	if ( $path && is_string( $path ) )
+	if ( $path && is_string( $path ) ) {
 		$url .= ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the network site URL.
@@ -3296,22 +3395,25 @@
  * @return string Home URL link with optional path appended.
  */
 function network_home_url( $path = '', $scheme = null ) {
-	if ( ! is_multisite() )
-		return home_url($path, $scheme);
+	if ( ! is_multisite() ) {
+		return home_url( $path, $scheme );
+	}
 
 	$current_network = get_network();
 	$orig_scheme = $scheme;
 
-	if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) )
+	if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) {
 		$scheme = is_ssl() && ! is_admin() ? 'https' : 'http';
+	}
 
-	if ( 'relative' == $scheme )
+	if ( 'relative' == $scheme ) {
 		$url = $current_network->path;
-	else
-		$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
+	} else { $url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
+	}
 
-	if ( $path && is_string( $path ) )
+	if ( $path && is_string( $path ) ) {
 		$url .= ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the network home URL.
@@ -3324,7 +3426,7 @@
 	 * @param string|null $orig_scheme Scheme to give the URL context. Accepts 'http', 'https',
 	 *                                 'relative' or null.
 	 */
-	return apply_filters( 'network_home_url', $url, $path, $orig_scheme);
+	return apply_filters( 'network_home_url', $url, $path, $orig_scheme );
 }
 
 /**
@@ -3338,13 +3440,15 @@
  * @return string Admin URL link with optional path appended.
  */
 function network_admin_url( $path = '', $scheme = 'admin' ) {
-	if ( ! is_multisite() )
+	if ( ! is_multisite() ) {
 		return admin_url( $path, $scheme );
+	}
 
-	$url = network_site_url('wp-admin/network/', $scheme);
+	$url = network_site_url( 'wp-admin/network/', $scheme );
 
-	if ( $path && is_string( $path ) )
-		$url .= ltrim($path, '/');
+	if ( $path && is_string( $path ) ) {
+		$url .= ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the network admin URL.
@@ -3369,10 +3473,11 @@
  * @return string Admin URL link with optional path appended.
  */
 function user_admin_url( $path = '', $scheme = 'admin' ) {
-	$url = network_site_url('wp-admin/user/', $scheme);
+	$url = network_site_url( 'wp-admin/user/', $scheme );
 
-	if ( $path && is_string( $path ) )
-		$url .= ltrim($path, '/');
+	if ( $path && is_string( $path ) ) {
+		$url .= ltrim( $path, '/' );
+	}
 
 	/**
 	 * Filters the user admin URL for the current user.
@@ -3397,12 +3502,12 @@
  * @return string Admin URL link with optional path appended.
  */
 function self_admin_url( $path = '', $scheme = 'admin' ) {
-	if ( is_network_admin() )
-		return network_admin_url($path, $scheme);
-	elseif ( is_user_admin() )
-		return user_admin_url($path, $scheme);
-	else
-		return admin_url($path, $scheme);
+	if ( is_network_admin() ) {
+		return network_admin_url( $path, $scheme );
+	} elseif ( is_user_admin() ) {
+		return user_admin_url( $path, $scheme );
+	} else { return admin_url( $path, $scheme );
+	}
 }
 
 /**
@@ -3428,13 +3533,15 @@
 	}
 
 	$url = trim( $url );
-	if ( substr( $url, 0, 2 ) === '//' )
+	if ( substr( $url, 0, 2 ) === '//' ) {
 		$url = 'http:' . $url;
+	}
 
 	if ( 'relative' == $scheme ) {
 		$url = ltrim( preg_replace( '#^\w+://[^/]*#', '', $url ) );
-		if ( $url !== '' && $url[0] === '/' )
-			$url = '/' . ltrim($url , "/ \t\n\r\0\x0B" );
+		if ( $url !== '' && $url[0] === '/' ) {
+			$url = '/' . ltrim( $url , "/ \t\n\r\0\x0B" );
+		}
 	} else {
 		$url = preg_replace( '#^\w+://#', $scheme . '://', $url );
 	}
@@ -3472,7 +3579,7 @@
 	$user_id = $user_id ? (int) $user_id : get_current_user_id();
 
 	$blogs = get_blogs_of_user( $user_id );
-	if ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty($blogs) ) {
+	if ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty( $blogs ) ) {
 		$url = user_admin_url( $path, $scheme );
 	} elseif ( ! is_multisite() ) {
 		$url = admin_url( $path, $scheme );
@@ -3482,10 +3589,10 @@
 			$url = admin_url( $path, $scheme );
 		} else {
 			$active = get_active_blog_for_user( $user_id );
-			if ( $active )
+			if ( $active ) {
 				$url = get_admin_url( $active->blog_id, $path, $scheme );
-			else
-				$url = user_admin_url( $path, $scheme );
+			} else { $url = user_admin_url( $path, $scheme );
+			}
 		}
 	}
 
@@ -3500,7 +3607,7 @@
 	 * @param string $scheme  Scheme to give the URL context. Accepts 'http', 'https', 'login',
 	 *                        'login_post', 'admin', 'relative' or null.
 	 */
-	return apply_filters( 'user_dashboard_url', $url, $user_id, $path, $scheme);
+	return apply_filters( 'user_dashboard_url', $url, $user_id, $path, $scheme );
 }
 
 /**
@@ -3516,12 +3623,12 @@
 function get_edit_profile_url( $user_id = 0, $scheme = 'admin' ) {
 	$user_id = $user_id ? (int) $user_id : get_current_user_id();
 
-	if ( is_user_admin() )
+	if ( is_user_admin() ) {
 		$url = user_admin_url( 'profile.php', $scheme );
-	elseif ( is_network_admin() )
+	} elseif ( is_network_admin() ) {
 		$url = network_admin_url( 'profile.php', $scheme );
-	else
-		$url = get_dashboard_url( $user_id, 'profile.php', $scheme );
+	} else { $url = get_dashboard_url( $user_id, 'profile.php', $scheme );
+	}
 
 	/**
 	 * Filters the URL for a user's profile editor.
@@ -3533,7 +3640,7 @@
 	 * @param string $scheme  Scheme to give the URL context. Accepts 'http', 'https', 'login',
 	 *                        'login_post', 'admin', 'relative' or null.
 	 */
-	return apply_filters( 'edit_profile_url', $url, $user_id, $scheme);
+	return apply_filters( 'edit_profile_url', $url, $user_id, $scheme );
 }
 
 /**
@@ -3659,8 +3766,9 @@
 		$post = get_post( $post_id );
 	} elseif ( 'post' == $context ) {
 		$post = get_post( $id );
-		if ( ! empty( $post->ID ) )
+		if ( ! empty( $post->ID ) ) {
 			$post_id = $post->ID;
+		}
 	}
 
 	$shortlink = '';
@@ -3699,8 +3807,9 @@
 function wp_shortlink_wp_head() {
 	$shortlink = wp_get_shortlink( 0, 'query' );
 
-	if ( empty( $shortlink ) )
+	if ( empty( $shortlink ) ) {
 		return;
+	}
 
 	echo "<link rel='shortlink' href='" . esc_url( $shortlink ) . "' />\n";
 }
@@ -3713,15 +3822,17 @@
  * @since 3.0.0
  */
 function wp_shortlink_header() {
-	if ( headers_sent() )
+	if ( headers_sent() ) {
 		return;
+	}
 
-	$shortlink = wp_get_shortlink(0, 'query');
+	$shortlink = wp_get_shortlink( 0, 'query' );
 
-	if ( empty($shortlink) )
+	if ( empty( $shortlink ) ) {
 		return;
+	}
 
-	header('Link: <' . $shortlink . '>; rel=shortlink', false);
+	header( 'Link: <' . $shortlink . '>; rel=shortlink', false );
 }
 
 /**
@@ -3741,15 +3852,17 @@
 function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) {
 	$post = get_post();
 
-	if ( empty( $text ) )
-		$text = __('This is the short link.');
+	if ( empty( $text ) ) {
+		$text = __( 'This is the short link.' );
+	}
 
-	if ( empty( $title ) )
+	if ( empty( $title ) ) {
 		$title = the_title_attribute( array( 'echo' => false ) );
+	}
 
 	$shortlink = wp_get_shortlink( $post->ID );
 
-	if ( !empty( $shortlink ) ) {
+	if ( ! empty( $shortlink ) ) {
 		$link = '<a rel="shortlink" href="' . esc_url( $shortlink ) . '" title="' . $title . '">' . $text . '</a>';
 
 		/**
@@ -3962,7 +4075,7 @@
 		if ( ( ! $user || is_wp_error( $user ) ) && ! empty( $id_or_email->comment_author_email ) ) {
 			$email = $id_or_email->comment_author_email;
 		}
-	}
+	}// End if().
 
 	if ( ! $email_hash ) {
 		if ( $user ) {
Index: src/wp-includes/load.php
===================================================================
--- src/wp-includes/load.php	(revision 40901)
+++ src/wp-includes/load.php	(working copy)
@@ -27,20 +27,23 @@
  * @access private
  */
 function wp_unregister_GLOBALS() {
-	if ( !ini_get( 'register_globals' ) )
+	if ( ! ini_get( 'register_globals' ) ) {
 		return;
+	}
 
-	if ( isset( $_REQUEST['GLOBALS'] ) )
+	if ( isset( $_REQUEST['GLOBALS'] ) ) {
 		die( 'GLOBALS overwrite attempt detected' );
+	}
 
 	// Variables that shouldn't be unset
 	$no_unset = array( 'GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix' );
 
 	$input = array_merge( $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset( $_SESSION ) && is_array( $_SESSION ) ? $_SESSION : array() );
-	foreach ( $input as $k => $v )
-		if ( !in_array( $k, $no_unset ) && isset( $GLOBALS[$k] ) ) {
-			unset( $GLOBALS[$k] );
+	foreach ( $input as $k => $v ) {
+		if ( ! in_array( $k, $no_unset ) && isset( $GLOBALS[ $k ] ) ) {
+			unset( $GLOBALS[ $k ] );
 		}
+	}
 }
 
 /**
@@ -68,21 +71,21 @@
 		// IIS Mod-Rewrite
 		if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {
 			$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
-		}
-		// IIS Isapi_Rewrite
+		} // End if().
 		elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) {
 			$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
 		} else {
 			// Use ORIG_PATH_INFO if there is no PATH_INFO
-			if ( !isset( $_SERVER['PATH_INFO'] ) && isset( $_SERVER['ORIG_PATH_INFO'] ) )
+			if ( ! isset( $_SERVER['PATH_INFO'] ) && isset( $_SERVER['ORIG_PATH_INFO'] ) ) {
 				$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
+			}
 
 			// Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
 			if ( isset( $_SERVER['PATH_INFO'] ) ) {
-				if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
+				if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) {
 					$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
-				else
-					$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
+				} else { $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
+				}
 			}
 
 			// Append the query string if it exists and isn't null
@@ -93,17 +96,20 @@
 	}
 
 	// Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
-	if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) )
+	if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) ) {
 		$_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
+	}
 
 	// Fix for Dreamhost and other PHP as CGI hosts
-	if ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false )
+	if ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false ) {
 		unset( $_SERVER['PATH_INFO'] );
+	}
 
 	// Fix empty PHP_SELF
 	$PHP_SELF = $_SERVER['PHP_SELF'];
-	if ( empty( $PHP_SELF ) )
-		$_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER["REQUEST_URI"] );
+	if ( empty( $PHP_SELF ) ) {
+		$_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER['REQUEST_URI'] );
+	}
 }
 
 /**
@@ -151,7 +157,7 @@
  */
 function wp_favicon_request() {
 	if ( '/favicon.ico' == $_SERVER['REQUEST_URI'] ) {
-		header('Content-Type: image/vnd.microsoft.icon');
+		header( 'Content-Type: image/vnd.microsoft.icon' );
 		exit;
 	}
 }
@@ -173,15 +179,17 @@
  * @global int $upgrading the unix timestamp marking when upgrading WordPress began.
  */
 function wp_maintenance() {
-	if ( ! file_exists( ABSPATH . '.maintenance' ) || wp_installing() )
+	if ( ! file_exists( ABSPATH . '.maintenance' ) || wp_installing() ) {
 		return;
+	}
 
 	global $upgrading;
 
 	include( ABSPATH . '.maintenance' );
 	// If the $upgrading timestamp is older than 10 minutes, don't die.
-	if ( ( time() - $upgrading ) >= 600 )
+	if ( ( time() - $upgrading ) >= 600 ) {
 		return;
+	}
 
 	/**
 	 * Filters whether to enable maintenance mode.
@@ -213,7 +221,7 @@
 	header( 'Retry-After: 600' );
 ?>
 	<!DOCTYPE html>
-	<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
+	<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) { echo ' dir="rtl"';} ?>>
 	<head>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 		<title><?php _e( 'Maintenance' ); ?></title>
@@ -264,8 +272,9 @@
 	$timeend = microtime( true );
 	$timetotal = $timeend - $timestart;
 	$r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision );
-	if ( $display )
+	if ( $display ) {
 		echo $r;
+	}
 	return $r;
 }
 
@@ -313,17 +322,18 @@
 	 *
 	 * @param bool $enable_debug_mode Whether to enable debug mode checks to occur. Default true.
 	 */
-	if ( ! apply_filters( 'enable_wp_debug_mode_checks', true ) ){
+	if ( ! apply_filters( 'enable_wp_debug_mode_checks', true ) ) {
 		return;
 	}
 
 	if ( WP_DEBUG ) {
 		error_reporting( E_ALL );
 
-		if ( WP_DEBUG_DISPLAY )
+		if ( WP_DEBUG_DISPLAY ) {
 			ini_set( 'display_errors', 1 );
-		elseif ( null !== WP_DEBUG_DISPLAY )
+		} elseif ( null !== WP_DEBUG_DISPLAY ) {
 			ini_set( 'display_errors', 0 );
+		}
 
 		if ( WP_DEBUG_LOG ) {
 			ini_set( 'log_errors', 1 );
@@ -352,8 +362,8 @@
  * @access private
  */
 function wp_set_lang_dir() {
-	if ( !defined( 'WP_LANG_DIR' ) ) {
-		if ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) || !@is_dir(ABSPATH . WPINC . '/languages') ) {
+	if ( ! defined( 'WP_LANG_DIR' ) ) {
+		if ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) || ! @is_dir( ABSPATH . WPINC . '/languages' ) ) {
 			/**
 			 * Server path of the language directory.
 			 *
@@ -362,7 +372,7 @@
 			 * @since 2.1.0
 			 */
 			define( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' );
-			if ( !defined( 'LANGDIR' ) ) {
+			if ( ! defined( 'LANGDIR' ) ) {
 				// Old static relative path maintained for limited backward compatibility - won't work in some cases.
 				define( 'LANGDIR', 'wp-content/languages' );
 			}
@@ -375,7 +385,7 @@
 			 * @since 2.1.0
 			 */
 			define( 'WP_LANG_DIR', ABSPATH . WPINC . '/languages' );
-			if ( !defined( 'LANGDIR' ) ) {
+			if ( ! defined( 'LANGDIR' ) ) {
 				// Old relative path maintained for backward compatibility.
 				define( 'LANGDIR', WPINC . '/languages' );
 			}
@@ -394,8 +404,9 @@
 	global $wpdb;
 
 	require_once( ABSPATH . WPINC . '/wp-db.php' );
-	if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
+	if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
 		require_once( WP_CONTENT_DIR . '/db.php' );
+	}
 
 	if ( isset( $wpdb ) ) {
 		return;
@@ -418,15 +429,46 @@
  */
 function wp_set_wpdb_vars() {
 	global $wpdb, $table_prefix;
-	if ( !empty( $wpdb->error ) )
+	if ( ! empty( $wpdb->error ) ) {
 		dead_db();
+	}
 
-	$wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d',
-		'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'comment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d',
-		'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d',
-		'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d',
+	$wpdb->field_types = array(
+	'post_author' => '%d',
+	'post_parent' => '%d',
+	'menu_order' => '%d',
+	'term_id' => '%d',
+	'term_group' => '%d',
+	'term_taxonomy_id' => '%d',
+		'parent' => '%d',
+	'count' => '%d',
+	'object_id' => '%d',
+	'term_order' => '%d',
+	'ID' => '%d',
+	'comment_ID' => '%d',
+	'comment_post_ID' => '%d',
+	'comment_parent' => '%d',
+		'user_id' => '%d',
+	'link_id' => '%d',
+	'link_owner' => '%d',
+	'link_rating' => '%d',
+	'option_id' => '%d',
+	'blog_id' => '%d',
+	'meta_id' => '%d',
+	'post_id' => '%d',
+		'user_status' => '%d',
+	'umeta_id' => '%d',
+	'comment_karma' => '%d',
+	'comment_count' => '%d',
 		// multisite:
-		'active' => '%d', 'cat_id' => '%d', 'deleted' => '%d', 'lang_id' => '%d', 'mature' => '%d', 'public' => '%d', 'site_id' => '%d', 'spam' => '%d',
+		'active' => '%d',
+	'cat_id' => '%d',
+	'deleted' => '%d',
+	'lang_id' => '%d',
+	'mature' => '%d',
+	'public' => '%d',
+	'site_id' => '%d',
+	'spam' => '%d',
 	);
 
 	$prefix = $wpdb->set_prefix( $table_prefix );
@@ -457,8 +499,9 @@
 function wp_using_ext_object_cache( $using = null ) {
 	global $_wp_using_ext_object_cache;
 	$current_using = $_wp_using_ext_object_cache;
-	if ( null !== $using )
+	if ( null !== $using ) {
 		$_wp_using_ext_object_cache = $using;
+	}
 	return $current_using;
 }
 
@@ -475,9 +518,9 @@
 	global $wp_filter;
 
 	$first_init = false;
- 	if ( ! function_exists( 'wp_cache_init' ) ) {
+	if ( ! function_exists( 'wp_cache_init' ) ) {
 		if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {
-			require_once ( WP_CONTENT_DIR . '/object-cache.php' );
+			require_once( WP_CONTENT_DIR . '/object-cache.php' );
 			if ( function_exists( 'wp_cache_init' ) ) {
 				wp_using_ext_object_cache( true );
 			}
@@ -500,7 +543,7 @@
 	}
 
 	if ( ! wp_using_ext_object_cache() ) {
-		require_once ( ABSPATH . WPINC . '/cache.php' );
+		require_once( ABSPATH . WPINC . '/cache.php' );
 	}
 
 	/*
@@ -563,13 +606,16 @@
  */
 function wp_get_mu_plugins() {
 	$mu_plugins = array();
-	if ( !is_dir( WPMU_PLUGIN_DIR ) )
+	if ( ! is_dir( WPMU_PLUGIN_DIR ) ) {
 		return $mu_plugins;
-	if ( ! $dh = opendir( WPMU_PLUGIN_DIR ) )
+	}
+	if ( ! $dh = opendir( WPMU_PLUGIN_DIR ) ) {
 		return $mu_plugins;
+	}
 	while ( ( $plugin = readdir( $dh ) ) !== false ) {
-		if ( substr( $plugin, -4 ) == '.php' )
+		if ( substr( $plugin, -4 ) == '.php' ) {
 			$mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin;
+		}
 	}
 	closedir( $dh );
 	sort( $mu_plugins );
@@ -601,8 +647,9 @@
 		array_unshift( $plugins, ABSPATH . 'my-hacks.php' );
 	}
 
-	if ( empty( $active_plugins ) || wp_installing() )
+	if ( empty( $active_plugins ) || wp_installing() ) {
 		return $plugins;
+	}
 
 	$network_plugins = is_multisite() ? wp_get_active_network_plugins() : false;
 
@@ -612,8 +659,9 @@
 			&& file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist
 			// not already included as a network plugin
 			&& ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) )
-			)
-		$plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
+			) {
+			$plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
+		}
 	}
 	return $plugins;
 }
@@ -630,8 +678,9 @@
 function wp_set_internal_encoding() {
 	if ( function_exists( 'mb_internal_encoding' ) ) {
 		$charset = get_option( 'blog_charset' );
-		if ( ! $charset || ! @mb_internal_encoding( $charset ) )
+		if ( ! $charset || ! @mb_internal_encoding( $charset ) ) {
 			mb_internal_encoding( 'UTF-8' );
+		}
 	}
 }
 
@@ -647,14 +696,14 @@
 function wp_magic_quotes() {
 	// If already slashed, strip.
 	if ( get_magic_quotes_gpc() ) {
-		$_GET    = stripslashes_deep( $_GET    );
-		$_POST   = stripslashes_deep( $_POST   );
+		$_GET    = stripslashes_deep( $_GET );
+		$_POST   = stripslashes_deep( $_POST );
 		$_COOKIE = stripslashes_deep( $_COOKIE );
 	}
 
 	// Escape with wpdb.
-	$_GET    = add_magic_quotes( $_GET    );
-	$_POST   = add_magic_quotes( $_POST   );
+	$_GET    = add_magic_quotes( $_GET );
+	$_POST   = add_magic_quotes( $_POST );
 	$_COOKIE = add_magic_quotes( $_COOKIE );
 	$_SERVER = add_magic_quotes( $_SERVER );
 
@@ -706,10 +755,11 @@
  * @return bool True if inside WordPress administration interface, false otherwise.
  */
 function is_admin() {
-	if ( isset( $GLOBALS['current_screen'] ) )
+	if ( isset( $GLOBALS['current_screen'] ) ) {
 		return $GLOBALS['current_screen']->in_admin();
-	elseif ( defined( 'WP_ADMIN' ) )
+	} elseif ( defined( 'WP_ADMIN' ) ) {
 		return WP_ADMIN;
+	}
 
 	return false;
 }
@@ -729,10 +779,11 @@
  * @return bool True if inside WordPress blog administration pages.
  */
 function is_blog_admin() {
-	if ( isset( $GLOBALS['current_screen'] ) )
+	if ( isset( $GLOBALS['current_screen'] ) ) {
 		return $GLOBALS['current_screen']->in_admin( 'site' );
-	elseif ( defined( 'WP_BLOG_ADMIN' ) )
+	} elseif ( defined( 'WP_BLOG_ADMIN' ) ) {
 		return WP_BLOG_ADMIN;
+	}
 
 	return false;
 }
@@ -752,10 +803,11 @@
  * @return bool True if inside WordPress network administration pages.
  */
 function is_network_admin() {
-	if ( isset( $GLOBALS['current_screen'] ) )
+	if ( isset( $GLOBALS['current_screen'] ) ) {
 		return $GLOBALS['current_screen']->in_admin( 'network' );
-	elseif ( defined( 'WP_NETWORK_ADMIN' ) )
+	} elseif ( defined( 'WP_NETWORK_ADMIN' ) ) {
 		return WP_NETWORK_ADMIN;
+	}
 
 	return false;
 }
@@ -776,10 +828,11 @@
  * @return bool True if inside WordPress user administration pages.
  */
 function is_user_admin() {
-	if ( isset( $GLOBALS['current_screen'] ) )
+	if ( isset( $GLOBALS['current_screen'] ) ) {
 		return $GLOBALS['current_screen']->in_admin( 'user' );
-	elseif ( defined( 'WP_USER_ADMIN' ) )
+	} elseif ( defined( 'WP_USER_ADMIN' ) ) {
 		return WP_USER_ADMIN;
+	}
 
 	return false;
 }
@@ -792,11 +845,13 @@
  * @return bool True if Multisite is enabled, false otherwise.
  */
 function is_multisite() {
-	if ( defined( 'MULTISITE' ) )
+	if ( defined( 'MULTISITE' ) ) {
 		return MULTISITE;
+	}
 
-	if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) )
+	if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) ) {
 		return true;
+	}
 
 	return false;
 }
@@ -812,7 +867,7 @@
  */
 function get_current_blog_id() {
 	global $blog_id;
-	return absint($blog_id);
+	return absint( $blog_id );
 }
 
 /**
@@ -857,12 +912,14 @@
 	global $wp_locale;
 
 	static $loaded = false;
-	if ( $loaded )
+	if ( $loaded ) {
 		return;
+	}
 	$loaded = true;
 
-	if ( function_exists( 'did_action' ) && did_action( 'init' ) )
+	if ( function_exists( 'did_action' ) && did_action( 'init' ) ) {
 		return;
+	}
 
 	// We need $wp_local_package
 	require ABSPATH . WPINC . '/version.php';
@@ -880,31 +937,39 @@
 
 	while ( true ) {
 		if ( defined( 'WPLANG' ) ) {
-			if ( '' == WPLANG )
+			if ( '' == WPLANG ) {
 				break;
+			}
 			$locales[] = WPLANG;
 		}
 
-		if ( isset( $wp_local_package ) )
+		if ( isset( $wp_local_package ) ) {
 			$locales[] = $wp_local_package;
+		}
 
-		if ( ! $locales )
+		if ( ! $locales ) {
 			break;
+		}
 
-		if ( defined( 'WP_LANG_DIR' ) && @is_dir( WP_LANG_DIR ) )
+		if ( defined( 'WP_LANG_DIR' ) && @is_dir( WP_LANG_DIR ) ) {
 			$locations[] = WP_LANG_DIR;
+		}
 
-		if ( defined( 'WP_CONTENT_DIR' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) )
+		if ( defined( 'WP_CONTENT_DIR' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) ) {
 			$locations[] = WP_CONTENT_DIR . '/languages';
+		}
 
-		if ( @is_dir( ABSPATH . 'wp-content/languages' ) )
+		if ( @is_dir( ABSPATH . 'wp-content/languages' ) ) {
 			$locations[] = ABSPATH . 'wp-content/languages';
+		}
 
-		if ( @is_dir( ABSPATH . WPINC . '/languages' ) )
+		if ( @is_dir( ABSPATH . WPINC . '/languages' ) ) {
 			$locations[] = ABSPATH . WPINC . '/languages';
+		}
 
-		if ( ! $locations )
+		if ( ! $locations ) {
 			break;
+		}
 
 		$locations = array_unique( $locations );
 
@@ -912,15 +977,16 @@
 			foreach ( $locations as $location ) {
 				if ( file_exists( $location . '/' . $locale . '.mo' ) ) {
 					load_textdomain( 'default', $location . '/' . $locale . '.mo' );
-					if ( defined( 'WP_SETUP_CONFIG' ) && file_exists( $location . '/admin-' . $locale . '.mo' ) )
+					if ( defined( 'WP_SETUP_CONFIG' ) && file_exists( $location . '/admin-' . $locale . '.mo' ) ) {
 						load_textdomain( 'default', $location . '/admin-' . $locale . '.mo' );
+					}
 					break 2;
 				}
 			}
 		}
 
 		break;
-	}
+	}// End while().
 
 	$wp_locale = new WP_Locale();
 }
@@ -973,7 +1039,7 @@
 		if ( '1' == $_SERVER['HTTPS'] ) {
 			return true;
 		}
-	} elseif ( isset($_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
+	} elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
 		return true;
 	}
 	return false;
@@ -1026,7 +1092,7 @@
 		if ( function_exists( 'ini_get_all' ) ) {
 			$ini_all = ini_get_all();
 		}
- 	}
+	}
 
 	// Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
 	if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) {
Index: src/wp-includes/media-template.php
===================================================================
--- src/wp-includes/media-template.php	(revision 40901)
+++ src/wp-includes/media-template.php	(working copy)
@@ -22,7 +22,7 @@
 	width="{{ _.isUndefined( data.model.width ) ? 400 : data.model.width }}"
 	preload="{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}"
 	<#
-	<?php foreach ( array( 'autoplay', 'loop' ) as $attr ):
+	<?php foreach ( array( 'autoplay', 'loop' ) as $attr ) :
 	?>if ( ! _.isUndefined( data.model.<?php echo $attr ?> ) && data.model.<?php echo $attr ?> ) {
 		#> <?php echo $attr ?><#
 	}
@@ -32,7 +32,7 @@
 	<source src="{{ data.model.src }}" type="{{ wp.media.view.settings.embedMimes[ data.model.src.split('.').pop() ] }}" />
 	<# } #>
 
-	<?php foreach ( $audio_types as $type ):
+	<?php foreach ( $audio_types as $type ) :
 	?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) { #>
 	<source src="{{ data.model.<?php echo $type ?> }}" type="{{ wp.media.view.settings.embedMimes[ '<?php echo $type ?>' ] }}" />
 	<# } #>
@@ -69,7 +69,7 @@
 		h = Math.ceil( ( data.model.height * w ) / data.model.width );
 	} else {
 		h = data.model.height;
- 	}
+	 }
 
 	if ( w ) {
 		w_rule = 'width: ' + w + 'px; ';
@@ -90,8 +90,11 @@
 	<# if ( w ) { #>width="{{ w }}"<# } #>
 	<# if ( h ) { #>height="{{ h }}"<# } #>
 	<?php
-	$props = array( 'poster' => '', 'preload' => 'metadata' );
-	foreach ( $props as $key => $value ):
+	$props = array(
+		'poster' => '',
+		'preload' => 'metadata',
+	);
+	foreach ( $props as $key => $value ) :
 		if ( empty( $value ) ) {
 		?><#
 		if ( ! _.isUndefined( data.model.<?php echo $key ?> ) && data.model.<?php echo $key ?> ) {
@@ -99,10 +102,10 @@
 		} #>
 		<?php } else {
 			echo $key ?>="{{ _.isUndefined( data.model.<?php echo $key ?> ) ? '<?php echo $value ?>' : data.model.<?php echo $key ?> }}"<?php
-		}
+}
 	endforeach;
 	?><#
-	<?php foreach ( array( 'autoplay', 'loop' ) as $attr ):
+	<?php foreach ( array( 'autoplay', 'loop' ) as $attr ) :
 	?> if ( ! _.isUndefined( data.model.<?php echo $attr ?> ) && data.model.<?php echo $attr ?> ) {
 		#> <?php echo $attr ?><#
 	}
@@ -118,7 +121,7 @@
 		<# }
 	} #>
 
-	<?php foreach ( $video_types as $type ):
+	<?php foreach ( $video_types as $type ) :
 	?><# if ( data.model.<?php echo $type ?> ) { #>
 	<source src="{{ data.model.<?php echo $type ?> }}" type="{{ settings.embedMimes[ '<?php echo $type ?>' ] }}" />
 	<# } #>
@@ -139,8 +142,9 @@
 function wp_print_media_templates() {
 	global $is_IE;
 	$class = 'media-modal wp-core-ui';
-	if ( $is_IE && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false )
+	if ( $is_IE && strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 7' ) !== false ) {
 		$class .= ' ie7';
+	}
 	?>
 	<!--[if lte IE 8]>
 	<style>
@@ -337,7 +341,7 @@
 		<div class="attachment-info">
 			<span class="settings-save-status">
 				<span class="spinner"></span>
-				<span class="saved"><?php esc_html_e('Saved.'); ?></span>
+				<span class="saved"><?php esc_html_e( 'Saved.' ); ?></span>
 			</span>
 			<div class="details">
 				<div class="filename"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div>
@@ -373,13 +377,13 @@
 
 			<div class="settings">
 				<label class="setting" data-setting="url">
-					<span class="name"><?php _e('URL'); ?></span>
+					<span class="name"><?php _e( 'URL' ); ?></span>
 					<input type="text" value="{{ data.url }}" readonly />
 				</label>
 				<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #>
 				<?php if ( post_type_supports( 'attachment', 'title' ) ) : ?>
 				<label class="setting" data-setting="title">
-					<span class="name"><?php _e('Title'); ?></span>
+					<span class="name"><?php _e( 'Title' ); ?></span>
 					<input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
 				</label>
 				<?php endif; ?>
@@ -405,7 +409,7 @@
 					</label>
 				<# } #>
 				<label class="setting" data-setting="description">
-					<span class="name"><?php _e('Description'); ?></span>
+					<span class="name"><?php _e( 'Description' ); ?></span>
 					<textarea {{ maybeReadOnly }}>{{ data.description }}</textarea>
 				</label>
 				<label class="setting">
@@ -431,13 +435,13 @@
 					<a href="post.php?post={{ data.id }}&action=edit"><?php _e( 'Edit more details' ); ?></a>
 				<# } #>
 				<# if ( ! data.uploading && data.can.remove ) { #> |
-					<?php if ( MEDIA_TRASH ): ?>
+					<?php if ( MEDIA_TRASH ) : ?>
 						<# if ( 'trash' === data.status ) { #>
 							<button type="button" class="button-link untrash-attachment"><?php _e( 'Untrash' ); ?></button>
 						<# } else { #>
 							<button type="button" class="button-link trash-attachment"><?php _ex( 'Trash', 'verb' ); ?></button>
 						<# } #>
-					<?php else: ?>
+					<?php else : ?>
 						<button type="button" class="button-link delete-attachment"><?php _e( 'Delete Permanently' ); ?></button>
 					<?php endif; ?>
 				<# } #>
@@ -482,15 +486,15 @@
 		if ( data.describe ) {
 			if ( 'image' === data.type ) { #>
 				<input type="text" value="{{ data.caption }}" class="describe" data-setting="caption"
-					placeholder="<?php esc_attr_e('Caption this image&hellip;'); ?>" {{ maybeReadOnly }} />
+					placeholder="<?php esc_attr_e( 'Caption this image&hellip;' ); ?>" {{ maybeReadOnly }} />
 			<# } else { #>
 				<input type="text" value="{{ data.title }}" class="describe" data-setting="title"
 					<# if ( 'video' === data.type ) { #>
-						placeholder="<?php esc_attr_e('Describe this video&hellip;'); ?>"
+						placeholder="<?php esc_attr_e( 'Describe this video&hellip;' ); ?>"
 					<# } else if ( 'audio' === data.type ) { #>
-						placeholder="<?php esc_attr_e('Describe this audio file&hellip;'); ?>"
+						placeholder="<?php esc_attr_e( 'Describe this audio file&hellip;' ); ?>"
 					<# } else { #>
-						placeholder="<?php esc_attr_e('Describe this media file&hellip;'); ?>"
+						placeholder="<?php esc_attr_e( 'Describe this media file&hellip;' ); ?>"
 					<# } #> {{ maybeReadOnly }} />
 			<# }
 		} #>
@@ -501,7 +505,7 @@
 			<?php _e( 'Attachment Details' ); ?>
 			<span class="settings-save-status">
 				<span class="spinner"></span>
-				<span class="saved"><?php esc_html_e('Saved.'); ?></span>
+				<span class="saved"><?php esc_html_e( 'Saved.' ); ?></span>
 			</span>
 		</h2>
 		<div class="attachment-info">
@@ -534,13 +538,13 @@
 				<# } #>
 
 				<# if ( ! data.uploading && data.can.remove ) { #>
-					<?php if ( MEDIA_TRASH ): ?>
+					<?php if ( MEDIA_TRASH ) : ?>
 					<# if ( 'trash' === data.status ) { #>
 						<button type="button" class="button-link untrash-attachment"><?php _e( 'Untrash' ); ?></button>
 					<# } else { #>
 						<button type="button" class="button-link trash-attachment"><?php _ex( 'Trash', 'verb' ); ?></button>
 					<# } #>
-					<?php else: ?>
+					<?php else : ?>
 						<button type="button" class="button-link delete-attachment"><?php _e( 'Delete Permanently' ); ?></button>
 					<?php endif; ?>
 				<# } #>
@@ -554,13 +558,13 @@
 		</div>
 
 		<label class="setting" data-setting="url">
-			<span class="name"><?php _e('URL'); ?></span>
+			<span class="name"><?php _e( 'URL' ); ?></span>
 			<input type="text" value="{{ data.url }}" readonly />
 		</label>
 		<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #>
 		<?php if ( post_type_supports( 'attachment', 'title' ) ) : ?>
 		<label class="setting" data-setting="title">
-			<span class="name"><?php _e('Title'); ?></span>
+			<span class="name"><?php _e( 'Title' ); ?></span>
 			<input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
 		</label>
 		<?php endif; ?>
@@ -576,17 +580,17 @@
 		<?php endforeach; ?>
 		<# } #>
 		<label class="setting" data-setting="caption">
-			<span class="name"><?php _e('Caption'); ?></span>
+			<span class="name"><?php _e( 'Caption' ); ?></span>
 			<textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea>
 		</label>
 		<# if ( 'image' === data.type ) { #>
 			<label class="setting" data-setting="alt">
-				<span class="name"><?php _e('Alt Text'); ?></span>
+				<span class="name"><?php _e( 'Alt Text' ); ?></span>
 				<input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} />
 			</label>
 		<# } #>
 		<label class="setting" data-setting="description">
-			<span class="name"><?php _e('Description'); ?></span>
+			<span class="name"><?php _e( 'Description' ); ?></span>
 			<textarea {{ maybeReadOnly }}>{{ data.description }}</textarea>
 		</label>
 	</script>
@@ -609,7 +613,7 @@
 
 		<# if ( 'image' === data.type ) { #>
 			<label class="setting align">
-				<span><?php _e('Alignment'); ?></span>
+				<span><?php _e( 'Alignment' ); ?></span>
 				<select class="alignment"
 					data-setting="align"
 					<# if ( data.userSettings ) { #>
@@ -635,9 +639,9 @@
 		<div class="setting">
 			<label>
 				<# if ( data.model.canEmbed ) { #>
-					<span><?php _e('Embed or Link'); ?></span>
+					<span><?php _e( 'Embed or Link' ); ?></span>
 				<# } else { #>
-					<span><?php _e('Link To'); ?></span>
+					<span><?php _e( 'Link To' ); ?></span>
 				<# } #>
 
 				<select class="link-to"
@@ -682,7 +686,7 @@
 
 		<# if ( 'undefined' !== typeof data.sizes ) { #>
 			<label class="setting">
-				<span><?php _e('Size'); ?></span>
+				<span><?php _e( 'Size' ); ?></span>
 				<select class="size" name="size"
 					data-setting="size"
 					<# if ( data.userSettings ) { #>
@@ -691,10 +695,10 @@
 					<?php
 					/** This filter is documented in wp-admin/includes/media.php */
 					$sizes = apply_filters( 'image_size_names_choose', array(
-						'thumbnail' => __('Thumbnail'),
-						'medium'    => __('Medium'),
-						'large'     => __('Large'),
-						'full'      => __('Full Size'),
+						'thumbnail' => __( 'Thumbnail' ),
+						'medium'    => __( 'Medium' ),
+						'large'     => __( 'Large' ),
+						'full'      => __( 'Full Size' ),
 					) );
 
 					foreach ( $sizes as $value => $name ) : ?>
@@ -715,7 +719,7 @@
 		<h2><?php _e( 'Gallery Settings' ); ?></h2>
 
 		<label class="setting">
-			<span><?php _e('Link To'); ?></span>
+			<span><?php _e( 'Link To' ); ?></span>
 			<select class="link-to"
 				data-setting="link"
 				<# if ( data.userSettings ) { #>
@@ -737,7 +741,7 @@
 		</label>
 
 		<label class="setting">
-			<span><?php _e('Columns'); ?></span>
+			<span><?php _e( 'Columns' ); ?></span>
 			<select class="columns" name="columns"
 				data-setting="columns">
 				<?php for ( $i = 1; $i <= 9; $i++ ) : ?>
@@ -834,18 +838,18 @@
 		/** This filter is documented in wp-admin/includes/media.php */
 		if ( ! apply_filters( 'disable_captions', '' ) ) : ?>
 			<label class="setting caption">
-				<span><?php _e('Caption'); ?></span>
+				<span><?php _e( 'Caption' ); ?></span>
 				<textarea data-setting="caption" />
 			</label>
 		<?php endif; ?>
 
 		<label class="setting alt-text">
-			<span><?php _e('Alt Text'); ?></span>
+			<span><?php _e( 'Alt Text' ); ?></span>
 			<input type="text" data-setting="alt" />
 		</label>
 
 		<div class="setting align">
-			<span><?php _e('Align'); ?></span>
+			<span><?php _e( 'Align' ); ?></span>
 			<div class="button-group button-large" data-setting="align">
 				<button class="button" value="left">
 					<?php esc_html_e( 'Left' ); ?>
@@ -863,7 +867,7 @@
 		</div>
 
 		<div class="setting link-to">
-			<span><?php _e('Link To'); ?></span>
+			<span><?php _e( 'Link To' ); ?></span>
 			<div class="button-group button-large" data-setting="link">
 				<button class="button" value="file">
 					<?php esc_html_e( 'Image URL' ); ?>
@@ -899,19 +903,19 @@
 					/** This filter is documented in wp-admin/includes/media.php */
 					if ( ! apply_filters( 'disable_captions', '' ) ) : ?>
 						<label class="setting caption">
-							<span><?php _e('Caption'); ?></span>
+							<span><?php _e( 'Caption' ); ?></span>
 							<textarea data-setting="caption">{{ data.model.caption }}</textarea>
 						</label>
 					<?php endif; ?>
 
 					<label class="setting alt-text">
-						<span><?php _e('Alternative Text'); ?></span>
+						<span><?php _e( 'Alternative Text' ); ?></span>
 						<input type="text" data-setting="alt" value="{{ data.model.alt }}" />
 					</label>
 
 					<h2><?php _e( 'Display Settings' ); ?></h2>
 					<div class="setting align">
-						<span><?php _e('Align'); ?></span>
+						<span><?php _e( 'Align' ); ?></span>
 						<div class="button-group button-large" data-setting="align">
 							<button class="button" value="left">
 								<?php esc_html_e( 'Left' ); ?>
@@ -931,7 +935,7 @@
 					<# if ( data.attachment ) { #>
 						<# if ( 'undefined' !== typeof data.attachment.sizes ) { #>
 							<label class="setting size">
-								<span><?php _e('Size'); ?></span>
+								<span><?php _e( 'Size' ); ?></span>
 								<select class="size" name="size"
 									data-setting="size"
 									<# if ( data.userSettings ) { #>
@@ -940,10 +944,10 @@
 									<?php
 									/** This filter is documented in wp-admin/includes/media.php */
 									$sizes = apply_filters( 'image_size_names_choose', array(
-										'thumbnail' => __('Thumbnail'),
-										'medium'    => __('Medium'),
-										'large'     => __('Large'),
-										'full'      => __('Full Size'),
+										'thumbnail' => __( 'Thumbnail' ),
+										'medium'    => __( 'Medium' ),
+										'large'     => __( 'Large' ),
+										'full'      => __( 'Full Size' ),
 									) );
 
 									foreach ( $sizes as $value => $name ) : ?>
@@ -967,7 +971,7 @@
 					<# } #>
 
 					<div class="setting link-to">
-						<span><?php _e('Link To'); ?></span>
+						<span><?php _e( 'Link To' ); ?></span>
 						<select data-setting="link">
 						<# if ( data.attachment ) { #>
 							<option value="file">
@@ -995,11 +999,11 @@
 						<div class="advanced-settings hidden">
 							<div class="advanced-image">
 								<label class="setting title-text">
-									<span><?php _e('Image Title Attribute'); ?></span>
+									<span><?php _e( 'Image Title Attribute' ); ?></span>
 									<input type="text" data-setting="title" value="{{ data.model.title }}" />
 								</label>
 								<label class="setting extra-classes">
-									<span><?php _e('Image CSS Class'); ?></span>
+									<span><?php _e( 'Image CSS Class' ); ?></span>
 									<input type="text" data-setting="extraClasses" value="{{ data.model.extraClasses }}" />
 								</label>
 							</div>
@@ -1008,11 +1012,11 @@
 									<label><input type="checkbox" data-setting="linkTargetBlank" value="_blank" <# if ( data.model.linkTargetBlank ) { #>checked="checked"<# } #>><?php _e( 'Open link in a new tab' ); ?></label>
 								</div>
 								<label class="setting link-rel">
-									<span><?php _e('Link Rel'); ?></span>
+									<span><?php _e( 'Link Rel' ); ?></span>
 									<input type="text" data-setting="linkRel" value="{{ data.model.linkClassName }}" />
 								</label>
 								<label class="setting link-class-name">
-									<span><?php _e('Link CSS Class'); ?></span>
+									<span><?php _e( 'Link CSS Class' ); ?></span>
 									<input type="text" data-setting="linkClassName" value="{{ data.model.linkClassName }}" />
 								</label>
 							</div>
@@ -1053,7 +1057,7 @@
 				<# } #>
 				<?php
 
-				foreach ( $audio_types as $type ):
+				foreach ( $audio_types as $type ) :
 				?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) {
 					if ( ! _.isUndefined( html5types.<?php echo $type ?> ) ) {
 						delete html5types.<?php echo $type ?>;
@@ -1134,7 +1138,7 @@
 					<button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button>
 				</label>
 				<# } #>
-				<?php foreach ( $video_types as $type ):
+				<?php foreach ( $video_types as $type ) :
 				?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) {
 					if ( ! _.isUndefined( html5types.<?php echo $type ?> ) ) {
 						delete html5types.<?php echo $type ?>;
Index: src/wp-includes/media.php
===================================================================
--- src/wp-includes/media.php	(revision 40901)
+++ src/wp-includes/media.php	(working copy)
@@ -59,56 +59,52 @@
 
 	$_wp_additional_image_sizes = wp_get_additional_image_sizes();
 
-	if ( ! $context )
+	if ( ! $context ) {
 		$context = is_admin() ? 'edit' : 'display';
+	}
 
-	if ( is_array($size) ) {
+	if ( is_array( $size ) ) {
 		$max_width = $size[0];
 		$max_height = $size[1];
-	}
-	elseif ( $size == 'thumb' || $size == 'thumbnail' ) {
-		$max_width = intval(get_option('thumbnail_size_w'));
-		$max_height = intval(get_option('thumbnail_size_h'));
+	} elseif ( $size == 'thumb' || $size == 'thumbnail' ) {
+		$max_width = intval( get_option( 'thumbnail_size_w' ) );
+		$max_height = intval( get_option( 'thumbnail_size_h' ) );
 		// last chance thumbnail size defaults
-		if ( !$max_width && !$max_height ) {
+		if ( ! $max_width && ! $max_height ) {
 			$max_width = 128;
 			$max_height = 96;
 		}
-	}
-	elseif ( $size == 'medium' ) {
-		$max_width = intval(get_option('medium_size_w'));
-		$max_height = intval(get_option('medium_size_h'));
+	} elseif ( $size == 'medium' ) {
+		$max_width = intval( get_option( 'medium_size_w' ) );
+		$max_height = intval( get_option( 'medium_size_h' ) );
 
-	}
-	elseif ( $size == 'medium_large' ) {
+	} elseif ( $size == 'medium_large' ) {
 		$max_width = intval( get_option( 'medium_large_size_w' ) );
 		$max_height = intval( get_option( 'medium_large_size_h' ) );
 
 		if ( intval( $content_width ) > 0 ) {
 			$max_width = min( intval( $content_width ), $max_width );
 		}
-	}
-	elseif ( $size == 'large' ) {
+	} elseif ( $size == 'large' ) {
 		/*
 		 * We're inserting a large size image into the editor. If it's a really
 		 * big image we'll scale it down to fit reasonably within the editor
 		 * itself, and within the theme's content width if it's known. The user
 		 * can resize it in the editor if they wish.
 		 */
-		$max_width = intval(get_option('large_size_w'));
-		$max_height = intval(get_option('large_size_h'));
-		if ( intval($content_width) > 0 ) {
-			$max_width = min( intval($content_width), $max_width );
+		$max_width = intval( get_option( 'large_size_w' ) );
+		$max_height = intval( get_option( 'large_size_h' ) );
+		if ( intval( $content_width ) > 0 ) {
+			$max_width = min( intval( $content_width ), $max_width );
 		}
 	} elseif ( ! empty( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ) ) ) {
-		$max_width = intval( $_wp_additional_image_sizes[$size]['width'] );
-		$max_height = intval( $_wp_additional_image_sizes[$size]['height'] );
+		$max_width = intval( $_wp_additional_image_sizes[ $size ]['width'] );
+		$max_height = intval( $_wp_additional_image_sizes[ $size ]['height'] );
 		// Only in admin. Assume that theme authors know what they're doing.
 		if ( intval( $content_width ) > 0 && 'edit' === $context ) {
 			$max_width = min( intval( $content_width ), $max_width );
 		}
-	}
-	// $size == 'full' has no constraint
+	} // End if().
 	else {
 		$max_width = $width;
 		$max_height = $height;
@@ -150,10 +146,12 @@
  */
 function image_hwstring( $width, $height ) {
 	$out = '';
-	if ($width)
-		$out .= 'width="'.intval($width).'" ';
-	if ($height)
-		$out .= 'height="'.intval($height).'" ';
+	if ( $width ) {
+		$out .= 'width="' . intval( $width ) . '" ';
+	}
+	if ( $height ) {
+		$out .= 'height="' . intval( $height ) . '" ';
+	}
 	return $out;
 }
 
@@ -202,11 +200,11 @@
 		return $out;
 	}
 
-	$img_url = wp_get_attachment_url($id);
-	$meta = wp_get_attachment_metadata($id);
+	$img_url = wp_get_attachment_url( $id );
+	$meta = wp_get_attachment_metadata( $id );
 	$width = $height = 0;
 	$is_intermediate = false;
-	$img_url_basename = wp_basename($img_url);
+	$img_url_basename = wp_basename( $img_url );
 
 	// If the file isn't an image, attempt to replace its URL with a rendered image from its meta.
 	// Otherwise, a non-image type could be returned.
@@ -222,28 +220,27 @@
 	}
 
 	// try for a new style intermediate size
-	if ( $intermediate = image_get_intermediate_size($id, $size) ) {
-		$img_url = str_replace($img_url_basename, $intermediate['file'], $img_url);
+	if ( $intermediate = image_get_intermediate_size( $id, $size ) ) {
+		$img_url = str_replace( $img_url_basename, $intermediate['file'], $img_url );
 		$width = $intermediate['width'];
 		$height = $intermediate['height'];
 		$is_intermediate = true;
-	}
-	elseif ( $size == 'thumbnail' ) {
+	} elseif ( $size == 'thumbnail' ) {
 		// fall back to the old thumbnail
-		if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) {
-			$img_url = str_replace($img_url_basename, wp_basename($thumb_file), $img_url);
+		if ( ($thumb_file = wp_get_attachment_thumb_file( $id )) && $info = getimagesize( $thumb_file ) ) {
+			$img_url = str_replace( $img_url_basename, wp_basename( $thumb_file ), $img_url );
 			$width = $info[0];
 			$height = $info[1];
 			$is_intermediate = true;
 		}
 	}
-	if ( !$width && !$height && isset( $meta['width'], $meta['height'] ) ) {
+	if ( ! $width && ! $height && isset( $meta['width'], $meta['height'] ) ) {
 		// any other type: use the real image
 		$width = $meta['width'];
 		$height = $meta['height'];
 	}
 
-	if ( $img_url) {
+	if ( $img_url ) {
 		// we have the actual image size, but might need to further constrain it if content_width is narrower
 		list( $width, $height ) = image_constrain_size_for_editor( $width, $height, $size );
 
@@ -359,12 +356,12 @@
  */
 function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) {
 
-	list( $img_src, $width, $height ) = image_downsize($id, $size);
-	$hwstring = image_hwstring($width, $height);
+	list( $img_src, $width, $height ) = image_downsize( $id, $size );
+	$hwstring = image_hwstring( $width, $height );
 
 	$title = $title ? 'title="' . esc_attr( $title ) . '" ' : '';
 
-	$class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
+	$class = 'align' . esc_attr( $align ) . ' size-' . esc_attr( $size ) . ' wp-image-' . $id;
 
 	/**
 	 * Filters the value of the attachment's image tag class attribute.
@@ -379,7 +376,7 @@
 	 */
 	$class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size );
 
-	$html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" ' . $title . $hwstring . 'class="' . $class . '" />';
+	$html = '<img src="' . esc_attr( $img_src ) . '" alt="' . esc_attr( $alt ) . '" ' . $title . $hwstring . 'class="' . $class . '" />';
 
 	/**
 	 * Filters the HTML content for the image tag.
@@ -412,8 +409,9 @@
  * @return array First item is the width, the second item is the height.
  */
 function wp_constrain_dimensions( $current_width, $current_height, $max_width = 0, $max_height = 0 ) {
-	if ( !$max_width && !$max_height )
+	if ( ! $max_width && ! $max_height ) {
 		return array( $current_width, $current_height );
+	}
 
 	$width_ratio = $height_ratio = 1.0;
 	$did_width = $did_height = false;
@@ -433,7 +431,7 @@
 	$larger_ratio  = max( $width_ratio, $height_ratio );
 
 	if ( (int) round( $current_width * $larger_ratio ) > $max_width || (int) round( $current_height * $larger_ratio ) > $max_height ) {
- 		// The larger ratio is too big. It would result in an overflow.
+		 // The larger ratio is too big. It would result in an overflow.
 		$ratio = $smaller_ratio;
 	} else {
 		// The larger ratio fits, and is likely to be a more "snug" fit.
@@ -441,8 +439,8 @@
 	}
 
 	// Very small dimensions may result in 0, 1 should be the minimum.
-	$w = max ( 1, (int) round( $current_width  * $ratio ) );
-	$h = max ( 1, (int) round( $current_height * $ratio ) );
+	$w = max( 1, (int) round( $current_width * $ratio ) );
+	$h = max( 1, (int) round( $current_height * $ratio ) );
 
 	// Sometimes, due to rounding, we'll end up with a result like this: 465x700 in a 177x177 box is 117x176... a pixel short
 	// We also have issues with recursive calls resulting in an ever-changing result. Constraining to the result of a constraint should yield the original result.
@@ -498,11 +496,13 @@
  */
 function image_resize_dimensions( $orig_w, $orig_h, $dest_w, $dest_h, $crop = false ) {
 
-	if ($orig_w <= 0 || $orig_h <= 0)
+	if ( $orig_w <= 0 || $orig_h <= 0 ) {
 		return false;
+	}
 	// at least one of dest_w or dest_h must be specific
-	if ($dest_w <= 0 && $dest_h <= 0)
+	if ( $dest_w <= 0 && $dest_h <= 0 ) {
 		return false;
+	}
 
 	/**
 	 * Filters whether to preempt calculating the image resize dimensions.
@@ -521,14 +521,15 @@
 	 *                           An array can specify positioning of the crop area. Default false.
 	 */
 	$output = apply_filters( 'image_resize_dimensions', null, $orig_w, $orig_h, $dest_w, $dest_h, $crop );
-	if ( null !== $output )
+	if ( null !== $output ) {
 		return $output;
+	}
 
 	if ( $crop ) {
 		// crop the largest possible portion of the original image that we can size to $dest_w x $dest_h
 		$aspect_ratio = $orig_w / $orig_h;
-		$new_w = min($dest_w, $orig_w);
-		$new_h = min($dest_h, $orig_h);
+		$new_w = min( $dest_w, $orig_w );
+		$new_h = min( $dest_h, $orig_h );
 
 		if ( ! $new_w ) {
 			$new_w = (int) round( $new_h * $aspect_ratio );
@@ -538,10 +539,10 @@
 			$new_h = (int) round( $new_w / $aspect_ratio );
 		}
 
-		$size_ratio = max($new_w / $orig_w, $new_h / $orig_h);
+		$size_ratio = max( $new_w / $orig_w, $new_h / $orig_h );
 
-		$crop_w = round($new_w / $size_ratio);
-		$crop_h = round($new_h / $size_ratio);
+		$crop_w = round( $new_w / $size_ratio );
+		$crop_h = round( $new_h / $size_ratio );
 
 		if ( ! is_array( $crop ) || count( $crop ) !== 2 ) {
 			$crop = array( 'center', 'center' );
@@ -573,7 +574,7 @@
 		$s_y = 0;
 
 		list( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );
-	}
+	}// End if().
 
 	// if the resulting image would be the same size or larger we don't want to resize it
 	if ( $new_w >= $orig_w && $new_h >= $orig_h && $dest_w != $orig_w && $dest_h != $orig_h ) {
@@ -606,8 +607,9 @@
 	if ( $width || $height ) {
 		$editor = wp_get_image_editor( $file );
 
-		if ( is_wp_error( $editor ) || is_wp_error( $editor->resize( $width, $height, $crop ) ) )
+		if ( is_wp_error( $editor ) || is_wp_error( $editor->resize( $width, $height, $crop ) ) ) {
 			return false;
+		}
 
 		$resized_file = $editor->save();
 
@@ -686,7 +688,7 @@
  * }
  */
 function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) {
-	if ( ! $size || ! is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) || empty( $imagedata['sizes'] )  ) {
+	if ( ! $size || ! is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) || empty( $imagedata['sizes'] ) ) {
 		return false;
 	}
 
@@ -730,11 +732,11 @@
 			}
 
 			$data = array_shift( $candidates );
-		/*
-		 * When the size requested is smaller than the thumbnail dimensions, we
-		 * fall back to the thumbnail size to maintain backwards compatibility with
-		 * pre 4.6 versions of WordPress.
-		 */
+			/*
+			* When the size requested is smaller than the thumbnail dimensions, we
+			* fall back to the thumbnail size to maintain backwards compatibility with
+			* pre 4.6 versions of WordPress.
+			*/
 		} elseif ( ! empty( $imagedata['sizes']['thumbnail'] ) && $imagedata['sizes']['thumbnail']['width'] >= $size[0] && $imagedata['sizes']['thumbnail']['width'] >= $size[1] ) {
 			$data = $imagedata['sizes']['thumbnail'];
 		} else {
@@ -746,7 +748,7 @@
 
 	} elseif ( ! empty( $imagedata['sizes'][ $size ] ) ) {
 		$data = $imagedata['sizes'][ $size ];
-	}
+	}// End if().
 
 	// If we still don't have a match at this point, return false.
 	if ( empty( $data ) ) {
@@ -755,9 +757,9 @@
 
 	// include the full filesystem path of the intermediate file
 	if ( empty( $data['path'] ) && ! empty( $data['file'] ) && ! empty( $imagedata['file'] ) ) {
-		$file_url = wp_get_attachment_url($post_id);
-		$data['path'] = path_join( dirname($imagedata['file']), $data['file'] );
-		$data['url'] = path_join( dirname($file_url), $data['file'] );
+		$file_url = wp_get_attachment_url( $post_id );
+		$data['path'] = path_join( dirname( $imagedata['file'] ), $data['file'] );
+		$data['url'] = path_join( dirname( $file_url ), $data['file'] );
 	}
 
 	/**
@@ -785,7 +787,7 @@
  */
 function get_intermediate_image_sizes() {
 	$_wp_additional_image_sizes = wp_get_additional_image_sizes();
-	$image_sizes = array('thumbnail', 'medium', 'medium_large', 'large'); // Standard sizes
+	$image_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' ); // Standard sizes
 	if ( ! empty( $_wp_additional_image_sizes ) ) {
 		$image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) );
 	}
@@ -868,17 +870,17 @@
  * @param string|array $attr          Optional. Attributes for the image markup. Default empty.
  * @return string HTML img element or empty string on failure.
  */
-function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $attr = '') {
+function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = false, $attr = '' ) {
 	$html = '';
-	$image = wp_get_attachment_image_src($attachment_id, $size, $icon);
+	$image = wp_get_attachment_image_src( $attachment_id, $size, $icon );
 	if ( $image ) {
 		list($src, $width, $height) = $image;
-		$hwstring = image_hwstring($width, $height);
+		$hwstring = image_hwstring( $width, $height );
 		$size_class = $size;
 		if ( is_array( $size_class ) ) {
 			$size_class = join( 'x', $size_class );
 		}
-		$attachment = get_post($attachment_id);
+		$attachment = get_post( $attachment_id );
 		$default_attr = array(
 			'src'	=> $src,
 			'class'	=> "attachment-$size_class size-$size_class",
@@ -918,12 +920,12 @@
 		 */
 		$attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size );
 		$attr = array_map( 'esc_attr', $attr );
-		$html = rtrim("<img $hwstring");
+		$html = rtrim( "<img $hwstring" );
 		foreach ( $attr as $name => $value ) {
 			$html .= " $name=" . '"' . $value . '"';
 		}
 		$html .= ' />';
-	}
+	}// End if().
 
 	return $html;
 }
@@ -988,10 +990,10 @@
 			absint( $image_meta['width'] ),
 			absint( $image_meta['height'] ),
 		);
-	} elseif ( ! empty( $image_meta['sizes'][$size_name] ) ) {
+	} elseif ( ! empty( $image_meta['sizes'][ $size_name ] ) ) {
 		return array(
-			absint( $image_meta['sizes'][$size_name]['width'] ),
-			absint( $image_meta['sizes'][$size_name]['height'] ),
+			absint( $image_meta['sizes'][ $size_name ]['width'] ),
+			absint( $image_meta['sizes'][ $size_name ]['height'] ),
 		);
 	}
 
@@ -1024,7 +1026,7 @@
 	$image_src = $image[0];
 	$size_array = array(
 		absint( $image[1] ),
-		absint( $image[2] )
+		absint( $image[2] ),
 	);
 
 	return wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attachment_id );
@@ -1172,12 +1174,14 @@
 
 			// The 'src' image has to be the first in the 'srcset', because of a bug in iOS8. See #35030.
 			if ( $is_src ) {
-				$sources = array( $image['width'] => $source ) + $sources;
+				$sources = array(
+					$image['width'] => $source,
+				) + $sources;
 			} else {
 				$sources[ $image['width'] ] = $source;
 			}
 		}
-	}
+	}// End foreach().
 
 	/**
 	 * Filters an image's 'srcset' sources.
@@ -1242,7 +1246,7 @@
 	$image_src = $image[0];
 	$size_array = array(
 		absint( $image[1] ),
-		absint( $image[2] )
+		absint( $image[2] ),
 	);
 
 	return wp_calculate_image_sizes( $size_array, $image_src, $image_meta, $attachment_id );
@@ -1319,7 +1323,7 @@
 
 	$selected_images = $attachment_ids = array();
 
-	foreach( $matches[0] as $image ) {
+	foreach ( $matches[0] as $image ) {
 		if ( false === strpos( $image, ' srcset=' ) && preg_match( '/wp-image-([0-9]+)/i', $image, $class_id ) &&
 			( $attachment_id = absint( $class_id[1] ) ) ) {
 
@@ -1385,7 +1389,7 @@
 		return $image;
 	}
 
-	$width  = preg_match( '/ width="([0-9]+)"/',  $image, $match_width  ) ? (int) $match_width[1]  : 0;
+	$width  = preg_match( '/ width="([0-9]+)"/',  $image, $match_width ) ? (int) $match_width[1]  : 0;
 	$height = preg_match( '/ height="([0-9]+)"/', $image, $match_height ) ? (int) $match_height[1] : 0;
 
 	if ( ! $width || ! $height ) {
@@ -1399,7 +1403,7 @@
 			$width = (int) $image_meta['width'];
 			$height = (int) $image_meta['height'];
 		} else {
-			foreach( $image_meta['sizes'] as $image_size_data ) {
+			foreach ( $image_meta['sizes'] as $image_size_data ) {
 				if ( $image_filename === $image_size_data['file'] ) {
 					$width = (int) $image_size_data['width'];
 					$height = (int) $image_size_data['height'];
@@ -1483,8 +1487,8 @@
 	remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );
 }
 
-add_shortcode('wp_caption', 'img_caption_shortcode');
-add_shortcode('caption', 'img_caption_shortcode');
+add_shortcode( 'wp_caption', 'img_caption_shortcode' );
+add_shortcode( 'caption', 'img_caption_shortcode' );
 
 /**
  * Builds the Caption shortcode output.
@@ -1537,8 +1541,9 @@
 	 * @param string $content The image element, possibly wrapped in a hyperlink.
 	 */
 	$output = apply_filters( 'img_caption_shortcode', '', $attr, $content );
-	if ( $output != '' )
+	if ( $output != '' ) {
 		return $output;
+	}
 
 	$atts = shortcode_atts( array(
 		'id'	  => '',
@@ -1549,11 +1554,13 @@
 	), $attr, 'caption' );
 
 	$atts['width'] = (int) $atts['width'];
-	if ( $atts['width'] < 1 || empty( $atts['caption'] ) )
+	if ( $atts['width'] < 1 || empty( $atts['caption'] ) ) {
 		return $content;
+	}
 
-	if ( ! empty( $atts['id'] ) )
+	if ( ! empty( $atts['id'] ) ) {
 		$atts['id'] = 'id="' . esc_attr( sanitize_html_class( $atts['id'] ) ) . '" ';
+	}
 
 	$class = trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] );
 
@@ -1594,7 +1601,7 @@
 	return $html;
 }
 
-add_shortcode('gallery', 'gallery_shortcode');
+add_shortcode( 'gallery', 'gallery_shortcode' );
 
 /**
  * Builds the Gallery shortcode output.
@@ -1676,22 +1683,44 @@
 		'size'       => 'thumbnail',
 		'include'    => '',
 		'exclude'    => '',
-		'link'       => ''
+		'link'       => '',
 	), $attr, 'gallery' );
 
 	$id = intval( $atts['id'] );
 
 	if ( ! empty( $atts['include'] ) ) {
-		$_attachments = get_posts( array( 'include' => $atts['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
+		$_attachments = get_posts( array(
+			'include' => $atts['include'],
+			'post_status' => 'inherit',
+			'post_type' => 'attachment',
+			'post_mime_type' => 'image',
+			'order' => $atts['order'],
+			'orderby' => $atts['orderby'],
+		) );
 
 		$attachments = array();
 		foreach ( $_attachments as $key => $val ) {
-			$attachments[$val->ID] = $_attachments[$key];
+			$attachments[ $val->ID ] = $_attachments[ $key ];
 		}
 	} elseif ( ! empty( $atts['exclude'] ) ) {
-		$attachments = get_children( array( 'post_parent' => $id, 'exclude' => $atts['exclude'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
+		$attachments = get_children( array(
+			'post_parent' => $id,
+			'exclude' => $atts['exclude'],
+			'post_status' => 'inherit',
+			'post_type' => 'attachment',
+			'post_mime_type' => 'image',
+			'order' => $atts['order'],
+			'orderby' => $atts['orderby'],
+		) );
 	} else {
-		$attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
+		$attachments = get_children( array(
+			'post_parent' => $id,
+			'post_status' => 'inherit',
+			'post_type' => 'attachment',
+			'post_mime_type' => 'image',
+			'order' => $atts['order'],
+			'orderby' => $atts['orderby'],
+		) );
 	}
 
 	if ( empty( $attachments ) ) {
@@ -1721,7 +1750,7 @@
 	}
 
 	$columns = intval( $atts['columns'] );
-	$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
+	$itemwidth = $columns > 0 ? floor( 100 / $columns ) : 100;
 	$float = is_rtl() ? 'right' : 'left';
 
 	$selector = "gallery-{$instance}";
@@ -1775,7 +1804,9 @@
 	$i = 0;
 	foreach ( $attachments as $id => $attachment ) {
 
-		$attr = ( trim( $attachment->post_excerpt ) ) ? array( 'aria-describedby' => "$selector-$id" ) : '';
+		$attr = ( trim( $attachment->post_excerpt ) ) ? array(
+			'aria-describedby' => "$selector-$id",
+		) : '';
 		if ( ! empty( $atts['link'] ) && 'file' === $atts['link'] ) {
 			$image_output = wp_get_attachment_link( $id, $atts['size'], false, false, false, $attr );
 		} elseif ( ! empty( $atts['link'] ) && 'none' === $atts['link'] ) {
@@ -1794,10 +1825,10 @@
 			<{$icontag} class='gallery-icon {$orientation}'>
 				$image_output
 			</{$icontag}>";
-		if ( $captiontag && trim($attachment->post_excerpt) ) {
+		if ( $captiontag && trim( $attachment->post_excerpt ) ) {
 			$output .= "
 				<{$captiontag} class='wp-caption-text gallery-caption' id='$selector-$id'>
-				" . wptexturize($attachment->post_excerpt) . "
+				" . wptexturize( $attachment->post_excerpt ) . "
 				</{$captiontag}>";
 		}
 		$output .= "</{$itemtag}>";
@@ -1959,7 +1990,7 @@
 		'tracklist' => true,
 		'tracknumbers' => true,
 		'images'	=> true,
-		'artists'	=> true
+		'artists'	=> true,
 	), $attr, 'playlist' );
 
 	$id = intval( $atts['id'] );
@@ -1973,7 +2004,7 @@
 		'post_type' => 'attachment',
 		'post_mime_type' => $atts['type'],
 		'order' => $atts['order'],
-		'orderby' => $atts['orderby']
+		'orderby' => $atts['orderby'],
 	);
 
 	if ( ! empty( $atts['include'] ) ) {
@@ -1982,7 +2013,7 @@
 
 		$attachments = array();
 		foreach ( $_attachments as $key => $val ) {
-			$attachments[$val->ID] = $_attachments[$key];
+			$attachments[ $val->ID ] = $_attachments[ $key ];
 		}
 	} elseif ( ! empty( $atts['exclude'] ) ) {
 		$args['post_parent'] = $id;
@@ -2031,7 +2062,7 @@
 			'type' => $ftype['type'],
 			'title' => $attachment->post_title,
 			'caption' => $attachment->post_excerpt,
-			'description' => $attachment->post_content
+			'description' => $attachment->post_content,
 		);
 
 		$track['meta'] = array();
@@ -2058,8 +2089,8 @@
 					'original' => compact( 'width', 'height' ),
 					'resized' => array(
 						'width' => $theme_width,
-						'height' => $theme_height
-					)
+						'height' => $theme_height,
+					),
 				);
 			}
 		}
@@ -2081,7 +2112,7 @@
 		}
 
 		$tracks[] = $track;
-	}
+	}// End foreach().
 	$data['tracks'] = $tracks;
 
 	$safe_type = esc_attr( $atts['type'] );
@@ -2101,12 +2132,12 @@
 		do_action( 'wp_playlist_scripts', $atts['type'], $atts['style'] );
 	} ?>
 <div class="wp-playlist wp-<?php echo $safe_type ?>-playlist wp-playlist-<?php echo $safe_style ?>">
-	<?php if ( 'audio' === $atts['type'] ): ?>
+	<?php if ( 'audio' === $atts['type'] ) : ?>
 	<div class="wp-playlist-current-item"></div>
 	<?php endif ?>
 	<<?php echo $safe_type ?> controls="controls" preload="none" width="<?php
 		echo (int) $theme_width;
-	?>"<?php if ( 'video' === $safe_type ):
+	?>"<?php if ( 'video' === $safe_type ) :
 		echo ' height="', (int) $theme_height, '"';
 	endif; ?>></<?php echo $safe_type ?>>
 	<div class="wp-playlist-next"></div>
@@ -2254,10 +2285,10 @@
 		'autoplay' => '',
 		'preload'  => 'none',
 		'class'    => 'wp-audio-shortcode',
-		'style'    => 'width: 100%;'
+		'style'    => 'width: 100%;',
 	);
 	foreach ( $default_types as $type ) {
-		$defaults_atts[$type] = '';
+		$defaults_atts[ $type ] = '';
 	}
 
 	$atts = shortcode_atts( $defaults_atts, $attr, 'audio' );
@@ -2329,8 +2360,8 @@
 
 	// These ones should just be omitted altogether if they are blank
 	foreach ( array( 'loop', 'autoplay', 'preload' ) as $a ) {
-		if ( empty( $html_atts[$a] ) ) {
-			unset( $html_atts[$a] );
+		if ( empty( $html_atts[ $a ] ) ) {
+			unset( $html_atts[ $a ] );
 		}
 	}
 
@@ -2467,7 +2498,7 @@
 	);
 
 	foreach ( $default_types as $type ) {
-		$defaults_atts[$type] = '';
+		$defaults_atts[ $type ] = '';
 	}
 
 	$atts = shortcode_atts( $defaults_atts, $attr, 'video' );
@@ -2586,8 +2617,8 @@
 
 	// These ones should just be omitted altogether if they are blank
 	foreach ( array( 'poster', 'loop', 'autoplay', 'preload' ) as $a ) {
-		if ( empty( $html_atts[$a] ) ) {
-			unset( $html_atts[$a] );
+		if ( empty( $html_atts[ $a ] ) ) {
+			unset( $html_atts[ $a ] );
 		}
 	}
 
@@ -2610,9 +2641,13 @@
 				$fileurl = $atts[ $fallback ];
 			}
 			if ( 'src' === $fallback && $is_youtube ) {
-				$type = array( 'type' => 'video/youtube' );
+				$type = array(
+					'type' => 'video/youtube',
+				);
 			} elseif ( 'src' === $fallback && $is_vimeo ) {
-				$type = array( 'type' => 'video/vimeo' );
+				$type = array(
+					'type' => 'video/vimeo',
+				);
 			} else {
 				$type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() );
 			}
@@ -2667,7 +2702,7 @@
  * @param string       $text Optional. Link text. Default false.
  */
 function previous_image_link( $size = 'thumbnail', $text = false ) {
-	adjacent_image_link(true, $size, $text);
+	adjacent_image_link( true, $size, $text );
 }
 
 /**
@@ -2683,7 +2718,7 @@
  * @param string       $text Optional. Link text. Default false.
  */
 function next_image_link( $size = 'thumbnail', $text = false ) {
-	adjacent_image_link(false, $size, $text);
+	adjacent_image_link( false, $size, $text );
 }
 
 /**
@@ -2700,7 +2735,14 @@
  */
 function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {
 	$post = get_post();
-	$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
+	$attachments = array_values( get_children( array(
+		'post_parent' => $post->post_parent,
+		'post_status' => 'inherit',
+		'post_type' => 'attachment',
+		'post_mime_type' => 'image',
+		'order' => 'ASC',
+		'orderby' => 'menu_order ID',
+	) ) );
 
 	foreach ( $attachments as $k => $attachment ) {
 		if ( $attachment->ID == $post->ID ) {
@@ -2756,22 +2798,27 @@
 	} elseif ( is_array( $attachment ) ) {
 		$attachment = (object) $attachment;
 	}
-	if ( ! is_object($attachment) )
+	if ( ! is_object( $attachment ) ) {
 		return array();
+	}
 
 	$file = get_attached_file( $attachment->ID );
 	$filename = basename( $file );
 
-	$objects = array('attachment');
+	$objects = array( 'attachment' );
 
-	if ( false !== strpos($filename, '.') )
-		$objects[] = 'attachment:' . substr($filename, strrpos($filename, '.') + 1);
-	if ( !empty($attachment->post_mime_type) ) {
+	if ( false !== strpos( $filename, '.' ) ) {
+		$objects[] = 'attachment:' . substr( $filename, strrpos( $filename, '.' ) + 1 );
+	}
+	if ( ! empty( $attachment->post_mime_type ) ) {
 		$objects[] = 'attachment:' . $attachment->post_mime_type;
-		if ( false !== strpos($attachment->post_mime_type, '/') )
-			foreach ( explode('/', $attachment->post_mime_type) as $token )
-				if ( !empty($token) )
+		if ( false !== strpos( $attachment->post_mime_type, '/' ) ) {
+			foreach ( explode( '/', $attachment->post_mime_type ) as $token ) {
+				if ( ! empty( $token ) ) {
 					$objects[] = "attachment:$token";
+				}
+			}
+		}
 	}
 
 	$taxonomies = array();
@@ -2806,10 +2853,10 @@
 	foreach ( get_taxonomies( array(), 'objects' ) as $taxonomy ) {
 		foreach ( $taxonomy->object_type as $object_type ) {
 			if ( 'attachment' == $object_type || 0 === strpos( $object_type, 'attachment:' ) ) {
-				if ( 'names' == $output )
+				if ( 'names' == $output ) {
 					$taxonomies[] = $taxonomy->name;
-				else
-					$taxonomies[ $taxonomy->name ] = $taxonomy;
+				} else { $taxonomies[ $taxonomy->name ] = $taxonomy;
+				}
 				break;
 			}
 		}
@@ -2829,11 +2876,11 @@
  * @param int $height Image height in pixels..
  * @return resource The GD image resource.
  */
-function wp_imagecreatetruecolor($width, $height) {
-	$img = imagecreatetruecolor($width, $height);
-	if ( is_resource($img) && function_exists('imagealphablending') && function_exists('imagesavealpha') ) {
-		imagealphablending($img, false);
-		imagesavealpha($img, true);
+function wp_imagecreatetruecolor( $width, $height ) {
+	$img = imagecreatetruecolor( $width, $height );
+	if ( is_resource( $img ) && function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {
+		imagealphablending( $img, false );
+		imagesavealpha( $img, true );
 	}
 	return $img;
 }
@@ -2902,8 +2949,9 @@
 
 		// If $file_info['type'] is false, then we let the editor attempt to
 		// figure out the file type, rather than forcing a failure based on extension.
-		if ( isset( $file_info ) && $file_info['type'] )
+		if ( isset( $file_info ) && $file_info['type'] ) {
 			$args['mime_type'] = $file_info['type'];
+		}
 	}
 
 	$implementation = _wp_image_editor_choose( $args );
@@ -2912,13 +2960,14 @@
 		$editor = new $implementation( $path );
 		$loaded = $editor->load();
 
-		if ( is_wp_error( $loaded ) )
+		if ( is_wp_error( $loaded ) ) {
 			return $loaded;
+		}
 
 		return $editor;
 	}
 
-	return new WP_Error( 'image_no_editor', __('No editor could be selected.') );
+	return new WP_Error( 'image_no_editor', __( 'No editor could be selected.' ) );
 }
 
 /**
@@ -2959,13 +3008,14 @@
 	$implementations = apply_filters( 'wp_image_editors', array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' ) );
 
 	foreach ( $implementations as $implementation ) {
-		if ( ! call_user_func( array( $implementation, 'test' ), $args ) )
+		if ( ! call_user_func( array( $implementation, 'test' ), $args ) ) {
 			continue;
+		}
 
 		if ( isset( $args['mime_type'] ) &&
 			! call_user_func(
 				array( $implementation, 'supports_mime_type' ),
-				$args['mime_type'] ) ) {
+			$args['mime_type'] ) ) {
 			continue;
 		}
 
@@ -2989,8 +3039,9 @@
 	$wp_scripts = wp_scripts();
 
 	$data = $wp_scripts->get_data( 'wp-plupload', 'data' );
-	if ( $data && false !== strpos( $data, '_wpPluploadSettings' ) )
+	if ( $data && false !== strpos( $data, '_wpPluploadSettings' ) ) {
 		return;
+	}
 
 	$max_upload_size = wp_max_upload_size();
 	$allowed_extensions = array_keys( get_allowed_mime_types() );
@@ -3007,7 +3058,11 @@
 		'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
 		'filters' => array(
 			'max_file_size'   => $max_upload_size . 'b',
-			'mime_types'      => array( array( 'extensions' => implode( ',', $extensions ) ) ),
+			'mime_types'      => array(
+				array(
+					'extensions' => implode( ',', $extensions ),
+				),
+			),
 		),
 	);
 
@@ -3049,13 +3104,14 @@
 			'mobile'    => wp_is_mobile(),
 			'supported' => _device_can_upload(),
 		),
-		'limitExceeded' => is_multisite() && ! is_upload_space_available()
+		'limitExceeded' => is_multisite() && ! is_upload_space_available(),
 	);
 
 	$script = 'var _wpPluploadSettings = ' . wp_json_encode( $settings ) . ';';
 
-	if ( $data )
+	if ( $data ) {
 		$script = "$data\n$script";
+	}
 
 	$wp_scripts->add_data( 'wp-plupload', 'data', $script );
 }
@@ -3070,17 +3126,19 @@
  * @return array|void Array of attachment details.
  */
 function wp_prepare_attachment_for_js( $attachment ) {
-	if ( ! $attachment = get_post( $attachment ) )
+	if ( ! $attachment = get_post( $attachment ) ) {
 		return;
+	}
 
-	if ( 'attachment' != $attachment->post_type )
+	if ( 'attachment' != $attachment->post_type ) {
 		return;
+	}
 
 	$meta = wp_get_attachment_metadata( $attachment->ID );
-	if ( false !== strpos( $attachment->post_mime_type, '/' ) )
+	if ( false !== strpos( $attachment->post_mime_type, '/' ) ) {
 		list( $type, $subtype ) = explode( '/', $attachment->post_mime_type );
-	else
-		list( $type, $subtype ) = array( $attachment->post_mime_type, '' );
+	} else { list( $type, $subtype ) = array( $attachment->post_mime_type, '' );
+	}
 
 	$attachment_url = wp_get_attachment_url( $attachment->ID );
 	$base_url = str_replace( wp_basename( $attachment_url ), '', $attachment_url );
@@ -3109,7 +3167,7 @@
 		'nonces'      => array(
 			'update' => false,
 			'delete' => false,
-			'edit'   => false
+			'edit'   => false,
 		),
 		'editLink'   => false,
 		'meta'       => false,
@@ -3161,18 +3219,19 @@
 		$response['editLink'] = get_edit_post_link( $attachment->ID, 'raw' );
 	}
 
-	if ( current_user_can( 'delete_post', $attachment->ID ) )
+	if ( current_user_can( 'delete_post', $attachment->ID ) ) {
 		$response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID );
+	}
 
 	if ( $meta && ( 'image' === $type || ! empty( $meta['sizes'] ) ) ) {
 		$sizes = array();
 
 		/** This filter is documented in wp-admin/includes/media.php */
 		$possible_sizes = apply_filters( 'image_size_names_choose', array(
-			'thumbnail' => __('Thumbnail'),
-			'medium'    => __('Medium'),
-			'large'     => __('Large'),
-			'full'      => __('Full Size'),
+			'thumbnail' => __( 'Thumbnail' ),
+			'medium'    => __( 'Medium' ),
+			'large'     => __( 'Large' ),
+			'full'      => __( 'Full Size' ),
 		) );
 		unset( $possible_sizes['full'] );
 
@@ -3212,7 +3271,9 @@
 		}
 
 		if ( 'image' === $type ) {
-			$sizes['full'] = array( 'url' => $attachment_url );
+			$sizes['full'] = array(
+				'url' => $attachment_url,
+			);
 
 			if ( isset( $meta['height'], $meta['width'] ) ) {
 				$sizes['full']['height'] = $meta['height'];
@@ -3226,23 +3287,28 @@
 				'url'         => $base_url . $meta['sizes']['full']['file'],
 				'height'      => $meta['sizes']['full']['height'],
 				'width'       => $meta['sizes']['full']['width'],
-				'orientation' => $meta['sizes']['full']['height'] > $meta['sizes']['full']['width'] ? 'portrait' : 'landscape'
+				'orientation' => $meta['sizes']['full']['height'] > $meta['sizes']['full']['width'] ? 'portrait' : 'landscape',
 			);
 		}
 
-		$response = array_merge( $response, array( 'sizes' => $sizes ) );
-	}
+		$response = array_merge( $response, array(
+			'sizes' => $sizes,
+		) );
+	}// End if().
 
 	if ( $meta && 'video' === $type ) {
-		if ( isset( $meta['width'] ) )
+		if ( isset( $meta['width'] ) ) {
 			$response['width'] = (int) $meta['width'];
-		if ( isset( $meta['height'] ) )
+		}
+		if ( isset( $meta['height'] ) ) {
 			$response['height'] = (int) $meta['height'];
+		}
 	}
 
 	if ( $meta && ( 'audio' === $type || 'video' === $type ) ) {
-		if ( isset( $meta['length_formatted'] ) )
+		if ( isset( $meta['length_formatted'] ) ) {
 			$response['fileLength'] = $meta['length_formatted'];
+		}
 
 		$response['meta'] = array();
 		foreach ( wp_get_attachment_id3_keys( $attachment, 'js' ) as $key => $label ) {
@@ -3268,8 +3334,11 @@
 		}
 	}
 
-	if ( function_exists('get_compat_media_markup') )
-		$response['compat'] = get_compat_media_markup( $attachment->ID, array( 'in_modal' => true ) );
+	if ( function_exists( 'get_compat_media_markup' ) ) {
+		$response['compat'] = get_compat_media_markup( $attachment->ID, array(
+			'in_modal' => true,
+		) );
+	}
 
 	/**
 	 * Filters the attachment data prepared for JavaScript.
@@ -3301,8 +3370,9 @@
  */
 function wp_enqueue_media( $args = array() ) {
 	// Enqueue me just once per page, please.
-	if ( did_action( 'wp_enqueue_media' ) )
+	if ( did_action( 'wp_enqueue_media' ) ) {
 		return;
+	}
 
 	global $content_width, $wpdb, $wp_locale;
 
@@ -3430,7 +3500,9 @@
 
 	$settings = array(
 		'tabs'      => $tabs,
-		'tabUrl'    => add_query_arg( array( 'chromeless' => true ), admin_url('media-upload.php') ),
+		'tabUrl'    => add_query_arg( array(
+			'chromeless' => true,
+		), admin_url( 'media-upload.php' ) ),
 		'mimeTypes' => wp_list_pluck( get_post_mime_types(), 0 ),
 		/** This filter is documented in wp-admin/includes/media.php */
 		'captions'  => ! apply_filters( 'disable_captions', '' ),
@@ -3586,25 +3658,25 @@
 		'videoSelectPosterImageTitle' => __( 'Select Poster Image' ),
 		'videoAddTrackTitle'	=> __( 'Add Subtitles' ),
 
- 		// Playlist
- 		'playlistDragInfo'    => __( 'Drag and drop to reorder tracks.' ),
- 		'createPlaylistTitle' => __( 'Create Audio Playlist' ),
- 		'editPlaylistTitle'   => __( 'Edit Audio Playlist' ),
- 		'cancelPlaylistTitle' => __( '&#8592; Cancel Audio Playlist' ),
- 		'insertPlaylist'      => __( 'Insert audio playlist' ),
- 		'updatePlaylist'      => __( 'Update audio playlist' ),
- 		'addToPlaylist'       => __( 'Add to audio playlist' ),
- 		'addToPlaylistTitle'  => __( 'Add to Audio Playlist' ),
-
- 		// Video Playlist
- 		'videoPlaylistDragInfo'    => __( 'Drag and drop to reorder videos.' ),
- 		'createVideoPlaylistTitle' => __( 'Create Video Playlist' ),
- 		'editVideoPlaylistTitle'   => __( 'Edit Video Playlist' ),
- 		'cancelVideoPlaylistTitle' => __( '&#8592; Cancel Video Playlist' ),
- 		'insertVideoPlaylist'      => __( 'Insert video playlist' ),
- 		'updateVideoPlaylist'      => __( 'Update video playlist' ),
- 		'addToVideoPlaylist'       => __( 'Add to video playlist' ),
- 		'addToVideoPlaylistTitle'  => __( 'Add to Video Playlist' ),
+		 // Playlist
+		 'playlistDragInfo'    => __( 'Drag and drop to reorder tracks.' ),
+		 'createPlaylistTitle' => __( 'Create Audio Playlist' ),
+		 'editPlaylistTitle'   => __( 'Edit Audio Playlist' ),
+		 'cancelPlaylistTitle' => __( '&#8592; Cancel Audio Playlist' ),
+		 'insertPlaylist'      => __( 'Insert audio playlist' ),
+		 'updatePlaylist'      => __( 'Update audio playlist' ),
+		 'addToPlaylist'       => __( 'Add to audio playlist' ),
+		 'addToPlaylistTitle'  => __( 'Add to Audio Playlist' ),
+
+		 // Video Playlist
+		 'videoPlaylistDragInfo'    => __( 'Drag and drop to reorder videos.' ),
+		 'createVideoPlaylistTitle' => __( 'Create Video Playlist' ),
+		 'editVideoPlaylistTitle'   => __( 'Edit Video Playlist' ),
+		 'cancelVideoPlaylistTitle' => __( '&#8592; Cancel Video Playlist' ),
+		 'insertVideoPlaylist'      => __( 'Insert video playlist' ),
+		 'updateVideoPlaylist'      => __( 'Update video playlist' ),
+		 'addToVideoPlaylist'       => __( 'Add to video playlist' ),
+		 'addToVideoPlaylistTitle'  => __( 'Add to Video Playlist' ),
 	);
 
 	/**
@@ -3666,8 +3738,9 @@
  * @return array Found attachments.
  */
 function get_attached_media( $type, $post = 0 ) {
-	if ( ! $post = get_post( $post ) )
+	if ( ! $post = get_post( $post ) ) {
 		return array();
+	}
 
 	$args = array(
 		'post_parent' => $post->ID,
@@ -3755,11 +3828,13 @@
  *               from the expanded shortcode.
  */
 function get_post_galleries( $post, $html = true ) {
-	if ( ! $post = get_post( $post ) )
+	if ( ! $post = get_post( $post ) ) {
 		return array();
+	}
 
-	if ( ! has_shortcode( $post->post_content, 'gallery' ) )
+	if ( ! has_shortcode( $post->post_content, 'gallery' ) ) {
 		return array();
+	}
 
 	$galleries = array();
 	if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $post->post_content, $matches, PREG_SET_ORDER ) ) {
@@ -3791,13 +3866,13 @@
 					$galleries[] = array_merge(
 						$shortcode_attrs,
 						array(
-							'src' => array_values( array_unique( $srcs ) )
+							'src' => array_values( array_unique( $srcs ) ),
 						)
 					);
 				}
 			}
 		}
-	}
+	}// End if().
 
 	/**
 	 * Filters the list of all found galleries in the given post.
@@ -3944,9 +4019,9 @@
  * @return array The relevant CSS file URLs.
  */
 function wpview_media_sandbox_styles() {
- 	$version = 'ver=' . get_bloginfo( 'version' );
- 	$mediaelement = includes_url( "js/mediaelement/mediaelementplayer.min.css?$version" );
- 	$wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" );
+	 $version = 'ver=' . get_bloginfo( 'version' );
+	 $mediaelement = includes_url( "js/mediaelement/mediaelementplayer.min.css?$version" );
+	 $wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" );
 
 	return array( $mediaelement, $wpmediaelement );
 }
Index: src/wp-includes/meta.php
===================================================================
--- src/wp-includes/meta.php	(revision 40901)
+++ src/wp-includes/meta.php	(working copy)
@@ -27,7 +27,7 @@
  *                           no change will be made.
  * @return int|false The meta ID on success, false on failure.
  */
-function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = false) {
+function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = false ) {
 	global $wpdb;
 
 	if ( ! $meta_type || ! $meta_key || ! is_numeric( $object_id ) ) {
@@ -44,11 +44,11 @@
 		return false;
 	}
 
-	$column = sanitize_key($meta_type . '_id');
+	$column = sanitize_key( $meta_type . '_id' );
 
 	// expected_slashed ($meta_key)
-	$meta_key = wp_unslash($meta_key);
-	$meta_value = wp_unslash($meta_value);
+	$meta_key = wp_unslash( $meta_key );
+	$meta_value = wp_unslash( $meta_value );
 	$meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );
 
 	/**
@@ -68,13 +68,15 @@
 	 *                              for the object. Optional. Default false.
 	 */
 	$check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique );
-	if ( null !== $check )
+	if ( null !== $check ) {
 		return $check;
+	}
 
 	if ( $unique && $wpdb->get_var( $wpdb->prepare(
 		"SELECT COUNT(*) FROM $table WHERE meta_key = %s AND $column = %d",
-		$meta_key, $object_id ) ) )
+	$meta_key, $object_id ) ) ) {
 		return false;
+	}
 
 	$_meta_value = $meta_value;
 	$meta_value = maybe_serialize( $meta_value );
@@ -96,15 +98,16 @@
 	$result = $wpdb->insert( $table, array(
 		$column => $object_id,
 		'meta_key' => $meta_key,
-		'meta_value' => $meta_value
+		'meta_value' => $meta_value,
 	) );
 
-	if ( ! $result )
+	if ( ! $result ) {
 		return false;
+	}
 
 	$mid = (int) $wpdb->insert_id;
 
-	wp_cache_delete($object_id, $meta_type . '_meta');
+	wp_cache_delete( $object_id, $meta_type . '_meta' );
 
 	/**
 	 * Fires immediately after meta of a specific type is added.
@@ -140,7 +143,7 @@
  * 		                     the specified value. Otherwise, update all entries.
  * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
  */
-function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '') {
+function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_value = '' ) {
 	global $wpdb;
 
 	if ( ! $meta_type || ! $meta_key || ! is_numeric( $object_id ) ) {
@@ -157,14 +160,14 @@
 		return false;
 	}
 
-	$column = sanitize_key($meta_type . '_id');
+	$column = sanitize_key( $meta_type . '_id' );
 	$id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
 
 	// expected_slashed ($meta_key)
 	$raw_meta_key = $meta_key;
-	$meta_key = wp_unslash($meta_key);
+	$meta_key = wp_unslash( $meta_key );
 	$passed_value = $meta_value;
-	$meta_value = wp_unslash($meta_value);
+	$meta_value = wp_unslash( $meta_value );
 	$meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );
 
 	/**
@@ -185,15 +188,17 @@
 	 *                              Otherwise, update all entries.
 	 */
 	$check = apply_filters( "update_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $prev_value );
-	if ( null !== $check )
+	if ( null !== $check ) {
 		return (bool) $check;
+	}
 
 	// Compare existing value to new value if no prev value given and the key exists only once.
-	if ( empty($prev_value) ) {
-		$old_value = get_metadata($meta_type, $object_id, $meta_key);
-		if ( count($old_value) == 1 ) {
-			if ( $old_value[0] === $meta_value )
+	if ( empty( $prev_value ) ) {
+		$old_value = get_metadata( $meta_type, $object_id, $meta_key );
+		if ( count( $old_value ) == 1 ) {
+			if ( $old_value[0] === $meta_value ) {
 				return false;
+			}
 		}
 	}
 
@@ -206,10 +211,13 @@
 	$meta_value = maybe_serialize( $meta_value );
 
 	$data  = compact( 'meta_value' );
-	$where = array( $column => $object_id, 'meta_key' => $meta_key );
+	$where = array(
+		$column => $object_id,
+		'meta_key' => $meta_key,
+	);
 
-	if ( !empty( $prev_value ) ) {
-		$prev_value = maybe_serialize($prev_value);
+	if ( ! empty( $prev_value ) ) {
+		$prev_value = maybe_serialize( $prev_value );
 		$where['meta_value'] = $prev_value;
 	}
 
@@ -245,10 +253,11 @@
 	}
 
 	$result = $wpdb->update( $table, $data, $where );
-	if ( ! $result )
+	if ( ! $result ) {
 		return false;
+	}
 
-	wp_cache_delete($object_id, $meta_type . '_meta');
+	wp_cache_delete( $object_id, $meta_type . '_meta' );
 
 	foreach ( $meta_ids as $meta_id ) {
 		/**
@@ -304,7 +313,7 @@
  *                           the specified object_id.
  * @return bool True on successful delete, false on failure.
  */
-function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $delete_all = false) {
+function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $delete_all = false ) {
 	global $wpdb;
 
 	if ( ! $meta_type || ! $meta_key || ! is_numeric( $object_id ) && ! $delete_all ) {
@@ -321,11 +330,11 @@
 		return false;
 	}
 
-	$type_column = sanitize_key($meta_type . '_id');
+	$type_column = sanitize_key( $meta_type . '_id' );
 	$id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
 	// expected_slashed ($meta_key)
-	$meta_key = wp_unslash($meta_key);
-	$meta_value = wp_unslash($meta_value);
+	$meta_key = wp_unslash( $meta_key );
+	$meta_value = wp_unslash( $meta_value );
 
 	/**
 	 * Filters whether to delete metadata of a specific type.
@@ -345,28 +354,32 @@
 	 *                              Default false.
 	 */
 	$check = apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all );
-	if ( null !== $check )
+	if ( null !== $check ) {
 		return (bool) $check;
+	}
 
 	$_meta_value = $meta_value;
 	$meta_value = maybe_serialize( $meta_value );
 
 	$query = $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s", $meta_key );
 
-	if ( !$delete_all )
-		$query .= $wpdb->prepare(" AND $type_column = %d", $object_id );
+	if ( ! $delete_all ) {
+		$query .= $wpdb->prepare( " AND $type_column = %d", $object_id );
+	}
 
-	if ( '' !== $meta_value && null !== $meta_value && false !== $meta_value )
-		$query .= $wpdb->prepare(" AND meta_value = %s", $meta_value );
+	if ( '' !== $meta_value && null !== $meta_value && false !== $meta_value ) {
+		$query .= $wpdb->prepare( ' AND meta_value = %s', $meta_value );
+	}
 
 	$meta_ids = $wpdb->get_col( $query );
-	if ( !count( $meta_ids ) )
+	if ( ! count( $meta_ids ) ) {
 		return false;
+	}
 
 	if ( $delete_all ) {
 		$value_clause = '';
 		if ( '' !== $meta_value && null !== $meta_value && false !== $meta_value ) {
-			$value_clause = $wpdb->prepare( " AND meta_value = %s", $meta_value );
+			$value_clause = $wpdb->prepare( ' AND meta_value = %s', $meta_value );
 		}
 
 		$object_ids = $wpdb->get_col( $wpdb->prepare( "SELECT $type_column FROM $table WHERE meta_key = %s $value_clause", $meta_key ) );
@@ -399,19 +412,20 @@
 		do_action( 'delete_postmeta', $meta_ids );
 	}
 
-	$query = "DELETE FROM $table WHERE $id_column IN( " . implode( ',', $meta_ids ) . " )";
+	$query = "DELETE FROM $table WHERE $id_column IN( " . implode( ',', $meta_ids ) . ' )';
 
-	$count = $wpdb->query($query);
+	$count = $wpdb->query( $query );
 
-	if ( !$count )
+	if ( ! $count ) {
 		return false;
+	}
 
 	if ( $delete_all ) {
 		foreach ( (array) $object_ids as $o_id ) {
-			wp_cache_delete($o_id, $meta_type . '_meta');
+			wp_cache_delete( $o_id, $meta_type . '_meta' );
 		}
 	} else {
-		wp_cache_delete($object_id, $meta_type . '_meta');
+		wp_cache_delete( $object_id, $meta_type . '_meta' );
 	}
 
 	/**
@@ -458,7 +472,7 @@
  *                          This parameter has no effect if meta_key is not specified.
  * @return mixed Single metadata value, or array of values
  */
-function get_metadata($meta_type, $object_id, $meta_key = '', $single = false) {
+function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) {
 	if ( ! $meta_type || ! is_numeric( $object_id ) ) {
 		return false;
 	}
@@ -485,34 +499,34 @@
 	 */
 	$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single );
 	if ( null !== $check ) {
-		if ( $single && is_array( $check ) )
+		if ( $single && is_array( $check ) ) {
 			return $check[0];
-		else
-			return $check;
+		} else { return $check;
+		}
 	}
 
-	$meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
+	$meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' );
 
-	if ( !$meta_cache ) {
+	if ( ! $meta_cache ) {
 		$meta_cache = update_meta_cache( $meta_type, array( $object_id ) );
-		$meta_cache = $meta_cache[$object_id];
+		$meta_cache = $meta_cache[ $object_id ];
 	}
 
 	if ( ! $meta_key ) {
 		return $meta_cache;
 	}
 
-	if ( isset($meta_cache[$meta_key]) ) {
-		if ( $single )
-			return maybe_unserialize( $meta_cache[$meta_key][0] );
-		else
-			return array_map('maybe_unserialize', $meta_cache[$meta_key]);
+	if ( isset( $meta_cache[ $meta_key ] ) ) {
+		if ( $single ) {
+			return maybe_unserialize( $meta_cache[ $meta_key ][0] );
+		} else { return array_map( 'maybe_unserialize', $meta_cache[ $meta_key ] );
+		}
 	}
 
-	if ($single)
+	if ( $single ) {
 		return '';
-	else
-		return array();
+	} else { return array();
+	}
 }
 
 /**
@@ -537,18 +551,20 @@
 
 	/** This filter is documented in wp-includes/meta.php */
 	$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, true );
-	if ( null !== $check )
+	if ( null !== $check ) {
 		return (bool) $check;
+	}
 
 	$meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' );
 
-	if ( !$meta_cache ) {
+	if ( ! $meta_cache ) {
 		$meta_cache = update_meta_cache( $meta_type, array( $object_id ) );
-		$meta_cache = $meta_cache[$object_id];
+		$meta_cache = $meta_cache[ $object_id ];
 	}
 
-	if ( isset( $meta_cache[ $meta_key ] ) )
+	if ( isset( $meta_cache[ $meta_key ] ) ) {
 		return true;
+	}
 
 	return false;
 }
@@ -585,11 +601,13 @@
 
 	$meta = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table WHERE $id_column = %d", $meta_id ) );
 
-	if ( empty( $meta ) )
+	if ( empty( $meta ) ) {
 		return false;
+	}
 
-	if ( isset( $meta->meta_value ) )
+	if ( isset( $meta->meta_value ) ) {
 		$meta->meta_value = maybe_unserialize( $meta->meta_value );
+	}
 
 	return $meta;
 }
@@ -625,7 +643,7 @@
 		return false;
 	}
 
-	$column = sanitize_key($meta_type . '_id');
+	$column = sanitize_key( $meta_type . '_id' );
 	$id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
 
 	// Fetch the meta and go on if it's found.
@@ -649,12 +667,12 @@
 		// Format the data query arguments.
 		$data = array(
 			'meta_key' => $meta_key,
-			'meta_value' => $meta_value
+			'meta_value' => $meta_value,
 		);
 
 		// Format the where query arguments.
 		$where = array();
-		$where[$id_column] = $meta_id;
+		$where[ $id_column ] = $meta_id;
 
 		/** This action is documented in wp-includes/meta.php */
 		do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
@@ -666,11 +684,12 @@
 
 		// Run the update query, all fields in $data are %s, $where is a %d.
 		$result = $wpdb->update( $table, $data, $where, '%s', '%d' );
-		if ( ! $result )
+		if ( ! $result ) {
 			return false;
+		}
 
 		// Clear the caches.
-		wp_cache_delete($object_id, $meta_type . '_meta');
+		wp_cache_delete( $object_id, $meta_type . '_meta' );
 
 		/** This action is documented in wp-includes/meta.php */
 		do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
@@ -681,7 +700,7 @@
 		}
 
 		return true;
-	}
+	}// End if().
 
 	// And if the meta was not found.
 	return false;
@@ -717,7 +736,7 @@
 	}
 
 	// object and id columns
-	$column = sanitize_key($meta_type . '_id');
+	$column = sanitize_key( $meta_type . '_id' );
 	$id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
 
 	// Fetch the meta and go on if it's found.
@@ -743,10 +762,12 @@
 		}
 
 		// Run the query, will return true if deleted, false otherwise
-		$result = (bool) $wpdb->delete( $table, array( $id_column => $meta_id ) );
+		$result = (bool) $wpdb->delete( $table, array(
+			$id_column => $meta_id,
+		) );
 
 		// Clear the caches.
-		wp_cache_delete($object_id, $meta_type . '_meta');
+		wp_cache_delete( $object_id, $meta_type . '_meta' );
 
 		/** This action is documented in wp-includes/meta.php */
 		do_action( "deleted_{$meta_type}_meta", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value );
@@ -768,7 +789,7 @@
 
 		return $result;
 
-	}
+	}// End if().
 
 	// Meta id was not found.
 	return false;
@@ -785,7 +806,7 @@
  * @param int|array $object_ids Array or comma delimited list of object IDs to update cache for
  * @return array|false Metadata cache for the specified objects, or false on failure.
  */
-function update_meta_cache($meta_type, $object_ids) {
+function update_meta_cache( $meta_type, $object_ids ) {
 	global $wpdb;
 
 	if ( ! $meta_type || ! $object_ids ) {
@@ -797,55 +818,59 @@
 		return false;
 	}
 
-	$column = sanitize_key($meta_type . '_id');
+	$column = sanitize_key( $meta_type . '_id' );
 
-	if ( !is_array($object_ids) ) {
-		$object_ids = preg_replace('|[^0-9,]|', '', $object_ids);
-		$object_ids = explode(',', $object_ids);
+	if ( ! is_array( $object_ids ) ) {
+		$object_ids = preg_replace( '|[^0-9,]|', '', $object_ids );
+		$object_ids = explode( ',', $object_ids );
 	}
 
-	$object_ids = array_map('intval', $object_ids);
+	$object_ids = array_map( 'intval', $object_ids );
 
 	$cache_key = $meta_type . '_meta';
 	$ids = array();
 	$cache = array();
 	foreach ( $object_ids as $id ) {
 		$cached_object = wp_cache_get( $id, $cache_key );
-		if ( false === $cached_object )
+		if ( false === $cached_object ) {
 			$ids[] = $id;
-		else
-			$cache[$id] = $cached_object;
+		} else { $cache[ $id ] = $cached_object;
+		}
 	}
 
-	if ( empty( $ids ) )
+	if ( empty( $ids ) ) {
 		return $cache;
+	}
 
 	// Get meta info
 	$id_list = join( ',', $ids );
 	$id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
 	$meta_list = $wpdb->get_results( "SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list) ORDER BY $id_column ASC", ARRAY_A );
 
-	if ( !empty($meta_list) ) {
-		foreach ( $meta_list as $metarow) {
-			$mpid = intval($metarow[$column]);
+	if ( ! empty( $meta_list ) ) {
+		foreach ( $meta_list as $metarow ) {
+			$mpid = intval( $metarow[ $column ] );
 			$mkey = $metarow['meta_key'];
 			$mval = $metarow['meta_value'];
 
 			// Force subkeys to be array type:
-			if ( !isset($cache[$mpid]) || !is_array($cache[$mpid]) )
-				$cache[$mpid] = array();
-			if ( !isset($cache[$mpid][$mkey]) || !is_array($cache[$mpid][$mkey]) )
-				$cache[$mpid][$mkey] = array();
+			if ( ! isset( $cache[ $mpid ] ) || ! is_array( $cache[ $mpid ] ) ) {
+				$cache[ $mpid ] = array();
+			}
+			if ( ! isset( $cache[ $mpid ][ $mkey ] ) || ! is_array( $cache[ $mpid ][ $mkey ] ) ) {
+				$cache[ $mpid ][ $mkey ] = array();
+			}
 
 			// Add a value to the current pid/key:
-			$cache[$mpid][$mkey][] = $mval;
+			$cache[ $mpid ][ $mkey ][] = $mval;
 		}
 	}
 
 	foreach ( $ids as $id ) {
-		if ( ! isset($cache[$id]) )
-			$cache[$id] = array();
-		wp_cache_add( $id, $cache[$id], $cache_key );
+		if ( ! isset( $cache[ $id ] ) ) {
+			$cache[ $id ] = array();
+		}
+		wp_cache_add( $id, $cache[ $id ], $cache_key );
 	}
 
 	return $cache;
@@ -897,13 +922,14 @@
  * @param string $type Type of object to get metadata table for (e.g., comment, post, or user)
  * @return string|false Metadata table name, or false if no metadata table exists
  */
-function _get_meta_table($type) {
+function _get_meta_table( $type ) {
 	global $wpdb;
 
 	$table_name = $type . 'meta';
 
-	if ( empty($wpdb->$table_name) )
+	if ( empty( $wpdb->$table_name ) ) {
 		return false;
+	}
 
 	return $wpdb->$table_name;
 }
Index: src/wp-includes/ms-blogs.php
===================================================================
--- src/wp-includes/ms-blogs.php	(revision 40901)
+++ src/wp-includes/ms-blogs.php	(working copy)
@@ -18,7 +18,9 @@
 function wpmu_update_blogs_date() {
 	global $wpdb;
 
-	update_blog_details( $wpdb->blogid, array('last_updated' => current_time('mysql', true)) );
+	update_blog_details( $wpdb->blogid, array(
+		'last_updated' => current_time( 'mysql', true ),
+	) );
 	/**
 	 * Fires after the blog details are updated.
 	 *
@@ -60,11 +62,13 @@
  */
 function get_blogaddress_by_name( $blogname ) {
 	if ( is_subdomain_install() ) {
-		if ( $blogname == 'main' )
+		if ( $blogname == 'main' ) {
 			$blogname = 'www';
+		}
 		$url = rtrim( network_home_url(), '/' );
-		if ( !empty( $blogname ) )
-			$url = preg_replace( '|^([^\.]+://)|', "\${1}" . $blogname . '.', $url );
+		if ( ! empty( $blogname ) ) {
+			$url = preg_replace( '|^([^\.]+://)|', '\${1}' . $blogname . '.', $url );
+		}
 	} else {
 		$url = network_home_url( $blogname );
 	}
@@ -122,14 +126,15 @@
 function get_blog_details( $fields = null, $get_all = true ) {
 	global $wpdb;
 
-	if ( is_array($fields ) ) {
-		if ( isset($fields['blog_id']) ) {
+	if ( is_array( $fields ) ) {
+		if ( isset( $fields['blog_id'] ) ) {
 			$blog_id = $fields['blog_id'];
-		} elseif ( isset($fields['domain']) && isset($fields['path']) ) {
+		} elseif ( isset( $fields['domain'] ) && isset( $fields['path'] ) ) {
 			$key = md5( $fields['domain'] . $fields['path'] );
-			$blog = wp_cache_get($key, 'blog-lookup');
-			if ( false !== $blog )
+			$blog = wp_cache_get( $key, 'blog-lookup' );
+			if ( false !== $blog ) {
 				return $blog;
+			}
 			if ( substr( $fields['domain'], 0, 4 ) == 'www.' ) {
 				$nowww = substr( $fields['domain'], 4 );
 				$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) AND path = %s ORDER BY CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'], $fields['path'] ) );
@@ -137,16 +142,17 @@
 				$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $fields['domain'], $fields['path'] ) );
 			}
 			if ( $blog ) {
-				wp_cache_set($blog->blog_id . 'short', $blog, 'blog-details');
+				wp_cache_set( $blog->blog_id . 'short', $blog, 'blog-details' );
 				$blog_id = $blog->blog_id;
 			} else {
 				return false;
 			}
-		} elseif ( isset($fields['domain']) && is_subdomain_install() ) {
+		} elseif ( isset( $fields['domain'] ) && is_subdomain_install() ) {
 			$key = md5( $fields['domain'] );
-			$blog = wp_cache_get($key, 'blog-lookup');
-			if ( false !== $blog )
+			$blog = wp_cache_get( $key, 'blog-lookup' );
+			if ( false !== $blog ) {
 				return $blog;
+			}
 			if ( substr( $fields['domain'], 0, 4 ) == 'www.' ) {
 				$nowww = substr( $fields['domain'], 4 );
 				$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) ORDER BY CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'] ) );
@@ -154,22 +160,22 @@
 				$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s", $fields['domain'] ) );
 			}
 			if ( $blog ) {
-				wp_cache_set($blog->blog_id . 'short', $blog, 'blog-details');
+				wp_cache_set( $blog->blog_id . 'short', $blog, 'blog-details' );
 				$blog_id = $blog->blog_id;
 			} else {
 				return false;
 			}
 		} else {
 			return false;
-		}
+		}// End if().
 	} else {
-		if ( ! $fields )
+		if ( ! $fields ) {
 			$blog_id = get_current_blog_id();
-		elseif ( ! is_numeric( $fields ) )
+		} elseif ( ! is_numeric( $fields ) ) {
 			$blog_id = get_id_from_blogname( $fields );
-		else
-			$blog_id = $fields;
-	}
+		} else { $blog_id = $fields;
+		}
+	}// End if().
 
 	$blog_id = (int) $blog_id;
 
@@ -183,7 +189,7 @@
 			} else {
 				// Clear old pre-serialized objects. Cache clients do better with that.
 				wp_cache_delete( $blog_id . $all, 'blog-details' );
-				unset($details);
+				unset( $details );
 			}
 		} else {
 			return $details;
@@ -203,7 +209,7 @@
 				} else {
 					// Clear old pre-serialized objects. Cache clients do better with that.
 					wp_cache_delete( $blog_id, 'blog-details' );
-					unset($details);
+					unset( $details );
 				}
 			} else {
 				return $details;
@@ -211,7 +217,7 @@
 		}
 	}
 
-	if ( empty($details) ) {
+	if ( empty( $details ) ) {
 		$details = WP_Site::get_instance( $blog_id );
 		if ( ! $details ) {
 			// Set the full cache.
@@ -275,7 +281,7 @@
 		$details = (object) array(
 			'blog_id' => $blog_id,
 			'domain' => null,
-			'path' => null
+			'path' => null,
 		);
 	}
 
@@ -305,23 +311,26 @@
 function update_blog_details( $blog_id, $details = array() ) {
 	global $wpdb;
 
-	if ( empty($details) )
+	if ( empty( $details ) ) {
 		return false;
+	}
 
-	if ( is_object($details) )
-		$details = get_object_vars($details);
+	if ( is_object( $details ) ) {
+		$details = get_object_vars( $details );
+	}
 
 	$current_details = get_site( $blog_id );
-	if ( empty($current_details) )
+	if ( empty( $current_details ) ) {
 		return false;
+	}
 
-	$current_details = get_object_vars($current_details);
+	$current_details = get_object_vars( $current_details );
 
-	$details = array_merge($current_details, $details);
-	$details['last_updated'] = current_time('mysql', true);
+	$details = array_merge( $current_details, $details );
+	$details['last_updated'] = current_time( 'mysql', true );
 
 	$update_details = array();
-	$fields = array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id');
+	$fields = array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );
 	foreach ( array_intersect( array_keys( $details ), $fields ) as $field ) {
 		if ( 'path' === $field ) {
 			$details[ $field ] = trailingslashit( '/' . trim( $details[ $field ], '/' ) );
@@ -330,10 +339,13 @@
 		$update_details[ $field ] = $details[ $field ];
 	}
 
-	$result = $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );
+	$result = $wpdb->update( $wpdb->blogs, $update_details, array(
+		'blog_id' => $blog_id,
+	) );
 
-	if ( false === $result )
+	if ( false === $result ) {
 		return false;
+	}
 
 	// If spam status changed, issue actions.
 	if ( $details['spam'] != $current_details['spam'] ) {
@@ -433,7 +445,7 @@
 		restore_current_blog();
 	}
 
-	refresh_blog_details($blog_id);
+	refresh_blog_details( $blog_id );
 
 	return true;
 }
@@ -553,7 +565,7 @@
 
 	$non_cached_ids = _get_non_cached_ids( $ids, 'sites' );
 	if ( ! empty( $non_cached_ids ) ) {
-		$fresh_sites = $wpdb->get_results( sprintf( "SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s)", join( ",", array_map( 'intval', $non_cached_ids ) ) ) );
+		$fresh_sites = $wpdb->get_results( sprintf( "SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) );
 
 		update_site_cache( $fresh_sites );
 	}
@@ -658,11 +670,13 @@
 function get_blog_option( $id, $option, $default = false ) {
 	$id = (int) $id;
 
-	if ( empty( $id ) )
+	if ( empty( $id ) ) {
 		$id = get_current_blog_id();
+	}
 
-	if ( get_current_blog_id() == $id )
+	if ( get_current_blog_id() == $id ) {
 		return get_option( $option, $default );
+	}
 
 	switch_to_blog( $id );
 	$value = get_option( $option, $default );
@@ -703,11 +717,13 @@
 function add_blog_option( $id, $option, $value ) {
 	$id = (int) $id;
 
-	if ( empty( $id ) )
+	if ( empty( $id ) ) {
 		$id = get_current_blog_id();
+	}
 
-	if ( get_current_blog_id() == $id )
+	if ( get_current_blog_id() == $id ) {
 		return add_option( $option, $value );
+	}
 
 	switch_to_blog( $id );
 	$return = add_option( $option, $value );
@@ -728,11 +744,13 @@
 function delete_blog_option( $id, $option ) {
 	$id = (int) $id;
 
-	if ( empty( $id ) )
+	if ( empty( $id ) ) {
 		$id = get_current_blog_id();
+	}
 
-	if ( get_current_blog_id() == $id )
+	if ( get_current_blog_id() == $id ) {
 		return delete_option( $option );
+	}
 
 	switch_to_blog( $id );
 	$return = delete_option( $option );
@@ -755,11 +773,13 @@
 function update_blog_option( $id, $option, $value, $deprecated = null ) {
 	$id = (int) $id;
 
-	if ( null !== $deprecated  )
+	if ( null !== $deprecated ) {
 		_deprecated_argument( __FUNCTION__, '3.1.0' );
+	}
 
-	if ( get_current_blog_id() == $id )
+	if ( get_current_blog_id() == $id ) {
 		return update_option( $option, $value );
+	}
 
 	switch_to_blog( $id );
 	$return = update_option( $option, $value );
@@ -959,7 +979,7 @@
  * @return string Whether the blog is archived or not
  */
 function is_archived( $id ) {
-	return get_blog_status($id, 'archived');
+	return get_blog_status( $id, 'archived' );
 }
 
 /**
@@ -972,7 +992,7 @@
  * @return string $archived
  */
 function update_archived( $id, $archived ) {
-	update_blog_status($id, 'archived', $archived);
+	update_blog_status( $id, 'archived', $archived );
 	return $archived;
 }
 
@@ -992,16 +1012,24 @@
 function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
 	global $wpdb;
 
-	if ( null !== $deprecated  )
+	if ( null !== $deprecated ) {
 		_deprecated_argument( __FUNCTION__, '3.1.0' );
+	}
 
-	if ( ! in_array( $pref, array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id') ) )
+	if ( ! in_array( $pref, array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ) ) ) {
 		return $value;
+	}
 
-	$result = $wpdb->update( $wpdb->blogs, array($pref => $value, 'last_updated' => current_time('mysql', true)), array('blog_id' => $blog_id) );
+	$result = $wpdb->update( $wpdb->blogs, array(
+		$pref => $value,
+		'last_updated' => current_time( 'mysql', true ),
+		), array(
+		'blog_id' => $blog_id,
+	) );
 
-	if ( false === $result )
+	if ( false === $result ) {
 		return false;
+	}
 
 	refresh_blog_details( $blog_id );
 
@@ -1045,9 +1073,9 @@
 		 *
 		 * @param int    $blog_id Blog ID.
 		 * @param string $value   The value of blog status.
- 		 */
+		  */
 		do_action( 'update_blog_public', $blog_id, $value ); // Moved here from update_blog_public().
-	}
+	}// End if().
 
 	return $value;
 }
@@ -1067,10 +1095,11 @@
 	global $wpdb;
 
 	$details = get_site( $id );
-	if ( $details )
+	if ( $details ) {
 		return $details->$pref;
+	}
 
-	return $wpdb->get_var( $wpdb->prepare("SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d", $pref, $id) );
+	return $wpdb->get_var( $wpdb->prepare( "SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d", $pref, $id ) );
 }
 
 /**
@@ -1088,10 +1117,11 @@
 function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) {
 	global $wpdb;
 
-	if ( ! empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, 'MU' ); // never used
+	}
 
-	return $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit %d, %d", $wpdb->siteid, $start, $quantity ) , ARRAY_A );
+	return $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit %d, %d", $wpdb->siteid, $start, $quantity ) , ARRAY_A );
 }
 
 /**
@@ -1216,8 +1246,8 @@
 	global $wpdb;
 
 	$non_cached_ids = _get_non_cached_ids( $network_ids, 'networks' );
-	if ( !empty( $non_cached_ids ) ) {
-		$fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)", join( ",", array_map( 'intval', $non_cached_ids ) ) ) );
+	if ( ! empty( $non_cached_ids ) ) {
+		$fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) );
 
 		update_network_cache( $fresh_networks );
 	}
Index: src/wp-includes/ms-default-constants.php
===================================================================
--- src/wp-includes/ms-default-constants.php	(revision 40901)
+++ src/wp-includes/ms-default-constants.php	(working copy)
@@ -23,12 +23,14 @@
 	// This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.
 	add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
 
-	if ( ! get_site_option( 'ms_files_rewriting' ) )
+	if ( ! get_site_option( 'ms_files_rewriting' ) ) {
 		return;
+	}
 
 	// Base uploads dir relative to ABSPATH
-	if ( !defined( 'UPLOADBLOGSDIR' ) )
+	if ( ! defined( 'UPLOADBLOGSDIR' ) ) {
 		define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
+	}
 
 	// Note, the main site in a post-MU network uses wp-content/uploads.
 	// This is handled in wp_upload_dir() by ignoring UPLOADS for this case.
@@ -36,8 +38,9 @@
 		define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
 
 		// Uploads dir relative to ABSPATH
-		if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) )
+		if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) {
 			define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
+		}
 	}
 }
 
@@ -46,25 +49,27 @@
  *
  * @since 3.0.0
  */
-function ms_cookie_constants(  ) {
+function ms_cookie_constants() {
 	$current_network = get_network();
 
 	/**
 	 * @since 1.2.0
 	 */
-	if ( !defined( 'COOKIEPATH' ) )
+	if ( ! defined( 'COOKIEPATH' ) ) {
 		define( 'COOKIEPATH', $current_network->path );
+	}
 
 	/**
 	 * @since 1.5.0
 	 */
-	if ( !defined( 'SITECOOKIEPATH' ) )
+	if ( ! defined( 'SITECOOKIEPATH' ) ) {
 		define( 'SITECOOKIEPATH', $current_network->path );
+	}
 
 	/**
 	 * @since 2.6.0
 	 */
-	if ( !defined( 'ADMIN_COOKIE_PATH' ) ) {
+	if ( ! defined( 'ADMIN_COOKIE_PATH' ) ) {
 		if ( ! is_subdomain_install() || trim( parse_url( get_option( 'siteurl' ), PHP_URL_PATH ), '/' ) ) {
 			define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );
 		} else {
@@ -75,11 +80,11 @@
 	/**
 	 * @since 2.0.0
 	 */
-	if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) {
-		if ( !empty( $current_network->cookie_domain ) )
-			define('COOKIE_DOMAIN', '.' . $current_network->cookie_domain);
-		else
-			define('COOKIE_DOMAIN', '.' . $current_network->domain);
+	if ( ! defined( 'COOKIE_DOMAIN' ) && is_subdomain_install() ) {
+		if ( ! empty( $current_network->cookie_domain ) ) {
+			define( 'COOKIE_DOMAIN', '.' . $current_network->cookie_domain );
+		} else { define( 'COOKIE_DOMAIN', '.' . $current_network->domain );
+		}
 	}
 }
 
@@ -96,15 +101,17 @@
 	 * Optional support for X-Sendfile header
 	 * @since 3.0.0
 	 */
-	if ( !defined( 'WPMU_SENDFILE' ) )
+	if ( ! defined( 'WPMU_SENDFILE' ) ) {
 		define( 'WPMU_SENDFILE', false );
+	}
 
 	/**
 	 * Optional support for X-Accel-Redirect header
 	 * @since 3.0.0
 	 */
-	if ( !defined( 'WPMU_ACCEL_REDIRECT' ) )
+	if ( ! defined( 'WPMU_ACCEL_REDIRECT' ) ) {
 		define( 'WPMU_ACCEL_REDIRECT', false );
+	}
 }
 
 /**
@@ -140,7 +147,7 @@
 		if ( $subdomain_error_warn ) {
 			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 );
 		} else {
-	 		_deprecated_argument( 'define()', '3.0.0', $vhost_deprecated );
+			 _deprecated_argument( 'define()', '3.0.0', $vhost_deprecated );
 		}
 		return;
 	}
Index: src/wp-includes/ms-default-filters.php
===================================================================
--- src/wp-includes/ms-default-filters.php	(revision 40901)
+++ src/wp-includes/ms-default-filters.php	(working copy)
@@ -54,12 +54,14 @@
 add_action( 'transition_post_status', '_update_posts_count_on_transition_post_status', 10, 2 );
 
 // Counts
-add_action( 'admin_init', 'wp_schedule_update_network_counts');
+add_action( 'admin_init', 'wp_schedule_update_network_counts' );
 add_action( 'update_network_counts', 'wp_update_network_counts', 10, 0 );
-foreach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action )
+foreach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) {
 	add_action( $action, 'wp_maybe_update_network_user_counts', 10, 0 );
-foreach ( array( 'make_spam_blog', 'make_ham_blog', 'archive_blog', 'unarchive_blog', 'make_delete_blog', 'make_undelete_blog' ) as $action )
+}
+foreach ( array( 'make_spam_blog', 'make_ham_blog', 'archive_blog', 'unarchive_blog', 'make_delete_blog', 'make_undelete_blog' ) as $action ) {
 	add_action( $action, 'wp_maybe_update_network_site_counts', 10, 0 );
+}
 unset( $action );
 
 // Files
@@ -74,15 +76,17 @@
 
 // Disable somethings by default for multisite
 add_filter( 'enable_update_services_configuration', '__return_false' );
-if ( ! defined('POST_BY_EMAIL') || ! POST_BY_EMAIL ) // back compat constant.
+if ( ! defined( 'POST_BY_EMAIL' ) || ! POST_BY_EMAIL ) { // back compat constant.
 	add_filter( 'enable_post_by_email_configuration', '__return_false' );
-if ( ! defined('EDIT_ANY_USER') || ! EDIT_ANY_USER ) // back compat constant.
+}
+if ( ! defined( 'EDIT_ANY_USER' ) || ! EDIT_ANY_USER ) { // back compat constant.
 	add_filter( 'enable_edit_any_user_configuration', '__return_false' );
+}
 add_filter( 'force_filtered_html_on_import', '__return_true' );
 
 // WP_HOME and WP_SITEURL should not have any effect in MS
 remove_filter( 'option_siteurl', '_config_wp_siteurl' );
-remove_filter( 'option_home',    '_config_wp_home'    );
+remove_filter( 'option_home',    '_config_wp_home' );
 
 // Some options changes should trigger site details refresh.
 add_action( 'update_option_blogname',   'clean_site_details_cache', 10, 0 );
Index: src/wp-includes/ms-deprecated.php
===================================================================
--- src/wp-includes/ms-deprecated.php	(revision 40901)
+++ src/wp-includes/ms-deprecated.php	(working copy)
@@ -24,12 +24,12 @@
  * @return WP_Site Current site object.
  */
 function get_dashboard_blog() {
-    _deprecated_function( __FUNCTION__, '3.1.0' );
-    if ( $blog = get_site_option( 'dashboard_blog' ) ) {
-	    return get_site( $blog );
-    }
+	_deprecated_function( __FUNCTION__, '3.1.0' );
+	if ( $blog = get_site_option( 'dashboard_blog' ) ) {
+		return get_site( $blog );
+	}
 
-    return get_site( get_network()->site_id );
+	return get_site( get_network()->site_id );
 }
 
 /**
@@ -66,31 +66,33 @@
 
 	if ( empty( $user_login ) ) {
 		$user_id = get_current_user_id();
-		if ( !$user_id )
+		if ( ! $user_id ) {
 			return false;
+		}
 	} else {
 		$user = get_user_by( 'login', $user_login );
-		if ( ! $user->exists() )
+		if ( ! $user->exists() ) {
 			return false;
+		}
 		$user_id = $user->ID;
 	}
 
 	return is_super_admin( $user_id );
 }
 
-if ( !function_exists( 'graceful_fail' ) ) :
-/**
+if ( ! function_exists( 'graceful_fail' ) ) :
+	/**
  * Deprecated functionality to gracefully fail.
  *
  * @since MU
  * @deprecated 3.0.0 Use wp_die()
  * @see wp_die()
  */
-function graceful_fail( $message ) {
-	_deprecated_function( __FUNCTION__, '3.0.0', 'wp_die()' );
-	$message = apply_filters( 'graceful_fail', $message );
-	$message_template = apply_filters( 'graceful_fail_template',
-'<!DOCTYPE html>
+	function graceful_fail( $message ) {
+		_deprecated_function( __FUNCTION__, '3.0.0', 'wp_die()' );
+		$message = apply_filters( 'graceful_fail', $message );
+		$message_template = apply_filters( 'graceful_fail_template',
+			'<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml"><head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>Error!</title>
@@ -113,8 +115,8 @@
 <p class="message">%s</p>
 </body>
 </html>' );
-	die( sprintf( $message_template, $message ) );
-}
+			die( sprintf( $message_template, $message ) );
+	}
 endif;
 
 /**
@@ -128,7 +130,7 @@
  */
 function get_user_details( $username ) {
 	_deprecated_function( __FUNCTION__, '3.0.0', 'get_user_by()' );
-	return get_user_by('login', $username);
+	return get_user_by( 'login', $username );
 }
 
 /**
@@ -167,7 +169,7 @@
  * @param bool   $check_domain Deprecated.
  * @return string|bool Either false or the valid email address.
  */
-function validate_email( $email, $check_domain = true) {
+function validate_email( $email, $check_domain = true ) {
 	_deprecated_function( __FUNCTION__, '3.0.0', 'is_email()' );
 	return is_email( $email, $check_domain );
 }
@@ -187,12 +189,12 @@
 	_deprecated_function( __FUNCTION__, '3.0.0', 'wp_get_sites()' );
 
 	global $wpdb;
-	$blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
+	$blogs = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid ), ARRAY_A );
 
 	$blog_list = array();
 	foreach ( (array) $blogs as $details ) {
 		$blog_list[ $details['blog_id'] ] = $details;
-		$blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( "SELECT COUNT(ID) FROM " . $wpdb->get_blog_prefix( $details['blog_id'] ). "posts WHERE post_status='publish' AND post_type='post'" );
+		$blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( 'SELECT COUNT(ID) FROM ' . $wpdb->get_blog_prefix( $details['blog_id'] ) . "posts WHERE post_status='publish' AND post_type='post'" );
 	}
 
 	if ( ! $blog_list ) {
@@ -242,7 +244,7 @@
 		if ( is_array( $most_active ) ) {
 			reset( $most_active );
 			foreach ( (array) $most_active as $key => $details ) {
-				$url = esc_url('http://' . $details['domain'] . $details['path']);
+				$url = esc_url( 'http://' . $details['domain'] . $details['path'] );
 				echo '<li>' . $details['postcount'] . " <a href='$url'>$url</a></li>";
 			}
 		}
@@ -271,10 +273,12 @@
 	_deprecated_function( __FUNCTION__, '3.3.0' );
 
 	$ref = '';
-	if ( isset( $_GET['ref'] ) )
+	if ( isset( $_GET['ref'] ) ) {
 		$ref = $_GET['ref'];
-	if ( isset( $_POST['ref'] ) )
+	}
+	if ( isset( $_POST['ref'] ) ) {
 		$ref = $_POST['ref'];
+	}
 
 	if ( $ref ) {
 		$ref = wpmu_admin_redirect_add_updated_param( $ref );
@@ -288,8 +292,9 @@
 
 	$url = wpmu_admin_redirect_add_updated_param( $url );
 	if ( isset( $_GET['redirect'] ) ) {
-		if ( substr( $_GET['redirect'], 0, 2 ) == 's_' )
-			$url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) );
+		if ( substr( $_GET['redirect'], 0, 2 ) == 's_' ) {
+			$url .= '&action=blogs&s=' . esc_html( substr( $_GET['redirect'], 2 ) );
+		}
 	} elseif ( isset( $_POST['redirect'] ) ) {
 		$url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] );
 	}
@@ -311,10 +316,10 @@
 	_deprecated_function( __FUNCTION__, '3.3.0' );
 
 	if ( strpos( $url, 'updated=true' ) === false ) {
-		if ( strpos( $url, '?' ) === false )
+		if ( strpos( $url, '?' ) === false ) {
 			return $url . '?updated=true';
-		else
-			return $url . '&updated=true';
+		} else { return $url . '&updated=true';
+		}
 	}
 	return $url;
 }
@@ -335,15 +340,16 @@
 function get_user_id_from_string( $string ) {
 	_deprecated_function( __FUNCTION__, '3.6.0', 'get_user_by()' );
 
-	if ( is_email( $string ) )
+	if ( is_email( $string ) ) {
 		$user = get_user_by( 'email', $string );
-	elseif ( is_numeric( $string ) )
+	} elseif ( is_numeric( $string ) ) {
 		return $string;
-	else
-		$user = get_user_by( 'login', $string );
+	} else { $user = get_user_by( 'login', $string );
+	}
 
-	if ( $user )
+	if ( $user ) {
 		return $user->ID;
+	}
 	return 0;
 }
 
@@ -361,14 +367,15 @@
 	_deprecated_function( __FUNCTION__, '3.7.0' );
 
 	if ( is_subdomain_install() ) {
-		$url = "http://" . $domain.$path;
+		$url = 'http://' . $domain . $path;
 	} else {
 		if ( $domain != $_SERVER['HTTP_HOST'] ) {
 			$blogname = substr( $domain, 0, strpos( $domain, '.' ) );
 			$url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
 			// we're not installing the main blog
-			if ( $blogname != 'www.' )
+			if ( $blogname != 'www.' ) {
 				$url .= $blogname . '/';
+			}
 		} else { // main blog
 			$url = 'http://' . $domain . $path;
 		}
@@ -391,22 +398,25 @@
 function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
 	_deprecated_function( __FUNCTION__, '4.4.0' );
 
-	if ( empty($path) )
+	if ( empty( $path ) ) {
 		$path = '/';
+	}
 
 	// Check if the domain has been used already. We should return an error message.
-	if ( domain_exists($domain, $path, $site_id) )
+	if ( domain_exists( $domain, $path, $site_id ) ) {
 		return __( '<strong>ERROR</strong>: Site URL already taken.' );
+	}
 
 	// Need to back up wpdb table names, and create a new wp_blogs entry for new blog.
 	// Need to get blog_id from wp_blogs, and create new table names.
 	// Must restore table names at the end of function.
 
-	if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
+	if ( ! $blog_id = insert_blog( $domain, $path, $site_id ) ) {
 		return __( '<strong>ERROR</strong>: problem creating site entry.' );
+	}
 
-	switch_to_blog($blog_id);
-	install_blog($blog_id);
+	switch_to_blog( $blog_id );
+	install_blog( $blog_id );
 	restore_current_blog();
 
 	return $blog_id;
@@ -429,13 +439,14 @@
 
 	global $wpdb;
 
-	if ( ! $sitedomain )
+	if ( ! $sitedomain ) {
 		$site_id = $wpdb->siteid;
-	else
-		$site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) );
+	} else { $site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) );
+	}
 
-	if ( $site_id )
+	if ( $site_id ) {
 		return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id ), ARRAY_A );
+	}
 
 	return false;
 }
@@ -472,8 +483,9 @@
 
 	_deprecated_function( __FUNCTION__, '4.6.0', 'get_sites()' );
 
-	if ( wp_is_large_network() )
+	if ( wp_is_large_network() ) {
 		return array();
+	}
 
 	$defaults = array(
 		'network_id' => $wpdb->siteid,
@@ -489,12 +501,12 @@
 	$args = wp_parse_args( $args, $defaults );
 
 	// Backwards compatibility
-	if( is_array( $args['network_id'] ) ){
+	if ( is_array( $args['network_id'] ) ) {
 		$args['network__in'] = $args['network_id'];
 		$args['network_id'] = null;
 	}
 
-	if( is_numeric( $args['limit'] ) ){
+	if ( is_numeric( $args['limit'] ) ) {
 		$args['number'] = $args['limit'];
 		$args['limit'] = null;
 	} elseif ( ! $args['limit'] ) {
Index: src/wp-includes/ms-files.php
===================================================================
--- src/wp-includes/ms-files.php	(revision 40901)
+++ src/wp-includes/ms-files.php	(working copy)
@@ -11,8 +11,9 @@
 define( 'SHORTINIT', true );
 require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
 
-if ( !is_multisite() )
+if ( ! is_multisite() ) {
 	die( 'Multisite support not enabled' );
+}
 
 ms_file_constants();
 
@@ -23,24 +24,26 @@
 	die( '404 &#8212; File not found.' );
 }
 
-$file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $_GET[ 'file' ] );
-if ( !is_file( $file ) ) {
+$file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $_GET['file'] );
+if ( ! is_file( $file ) ) {
 	status_header( 404 );
 	die( '404 &#8212; File not found.' );
 }
 
 $mime = wp_check_filetype( $file );
-if ( false === $mime[ 'type' ] && function_exists( 'mime_content_type' ) )
-	$mime[ 'type' ] = mime_content_type( $file );
+if ( false === $mime['type'] && function_exists( 'mime_content_type' ) ) {
+	$mime['type'] = mime_content_type( $file );
+}
 
-if ( $mime[ 'type' ] )
-	$mimetype = $mime[ 'type' ];
-else
-	$mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 );
+if ( $mime['type'] ) {
+	$mimetype = $mime['type'];
+} else { $mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 );
+}
 
 header( 'Content-Type: ' . $mimetype ); // always send this
-if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) )
+if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) ) {
 	header( 'Content-Length: ' . filesize( $file ) );
+}
 
 // Optional support for X-Sendfile and X-Accel-Redirect
 if ( WPMU_ACCEL_REDIRECT ) {
@@ -60,15 +63,16 @@
 // Support for Conditional GET - use stripslashes to avoid formatting.php dependency
 $client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false;
 
-if ( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) )
+if ( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
 	$_SERVER['HTTP_IF_MODIFIED_SINCE'] = false;
+}
 
 $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
 // If string is empty, return 0. If not, attempt to parse into a timestamp
 $client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;
 
 // Make a timestamp for our most recent modification...
-$modified_timestamp = strtotime($last_modified);
+$modified_timestamp = strtotime( $last_modified );
 
 if ( ( $client_last_modified && $client_etag )
 	? ( ( $client_modified_timestamp >= $modified_timestamp) && ( $client_etag == $etag ) )
Index: src/wp-includes/ms-functions.php
===================================================================
--- src/wp-includes/ms-functions.php	(revision 40901)
+++ src/wp-includes/ms-functions.php	(working copy)
@@ -42,14 +42,16 @@
 function get_active_blog_for_user( $user_id ) {
 	global $wpdb;
 	$blogs = get_blogs_of_user( $user_id );
-	if ( empty( $blogs ) )
+	if ( empty( $blogs ) ) {
 		return;
+	}
 
-	if ( !is_multisite() )
-		return $blogs[$wpdb->blogid];
+	if ( ! is_multisite() ) {
+		return $blogs[ $wpdb->blogid ];
+	}
 
 	$primary_blog = get_user_meta( $user_id, 'primary_blog', true );
-	$first_blog = current($blogs);
+	$first_blog = current( $blogs );
 	if ( false !== $primary_blog ) {
 		if ( ! isset( $blogs[ $primary_blog ] ) ) {
 			update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );
@@ -69,15 +71,18 @@
 		$ret = false;
 		if ( is_array( $blogs ) && count( $blogs ) > 0 ) {
 			foreach ( (array) $blogs as $blog_id => $blog ) {
-				if ( $blog->site_id != $wpdb->siteid )
+				if ( $blog->site_id != $wpdb->siteid ) {
 					continue;
+				}
 				$details = get_site( $blog_id );
 				if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
 					$ret = $blog;
-					if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id )
+					if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id ) {
 						update_user_meta( $user_id, 'primary_blog', $blog_id );
-					if ( !get_user_meta($user_id , 'source_domain', true) )
+					}
+					if ( ! get_user_meta( $user_id , 'source_domain', true ) ) {
 						update_user_meta( $user_id, 'source_domain', $blog->domain );
+					}
 					break;
 				}
 			}
@@ -151,7 +156,7 @@
  * @return true|WP_Error
  */
 function add_user_to_blog( $blog_id, $user_id, $role ) {
-	switch_to_blog($blog_id);
+	switch_to_blog( $blog_id );
 
 	$user = get_userdata( $user_id );
 
@@ -160,13 +165,13 @@
 		return new WP_Error( 'user_does_not_exist', __( 'The requested user does not exist.' ) );
 	}
 
-	if ( !get_user_meta($user_id, 'primary_blog', true) ) {
-		update_user_meta($user_id, 'primary_blog', $blog_id);
+	if ( ! get_user_meta( $user_id, 'primary_blog', true ) ) {
+		update_user_meta( $user_id, 'primary_blog', $blog_id );
 		$site = get_site( $blog_id );
 		update_user_meta( $user_id, 'source_domain', $site->domain );
 	}
 
-	$user->set_role($role);
+	$user->set_role( $role );
 
 	/**
 	 * Fires immediately after a user is added to a site.
@@ -202,9 +207,9 @@
  * @param string $reassign Optional. A user to whom to reassign posts.
  * @return true|WP_Error
  */
-function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') {
+function remove_user_from_blog( $user_id, $blog_id = '', $reassign = '' ) {
 	global $wpdb;
-	switch_to_blog($blog_id);
+	switch_to_blog( $blog_id );
 	$user_id = (int) $user_id;
 	/**
 	 * Fires before a user is removed from a site.
@@ -218,36 +223,37 @@
 
 	// If being removed from the primary blog, set a new primary if the user is assigned
 	// to multiple blogs.
-	$primary_blog = get_user_meta($user_id, 'primary_blog', true);
+	$primary_blog = get_user_meta( $user_id, 'primary_blog', true );
 	if ( $primary_blog == $blog_id ) {
 		$new_id = '';
 		$new_domain = '';
-		$blogs = get_blogs_of_user($user_id);
+		$blogs = get_blogs_of_user( $user_id );
 		foreach ( (array) $blogs as $blog ) {
-			if ( $blog->userblog_id == $blog_id )
+			if ( $blog->userblog_id == $blog_id ) {
 				continue;
+			}
 			$new_id = $blog->userblog_id;
 			$new_domain = $blog->domain;
 			break;
 		}
 
-		update_user_meta($user_id, 'primary_blog', $new_id);
-		update_user_meta($user_id, 'source_domain', $new_domain);
+		update_user_meta( $user_id, 'primary_blog', $new_id );
+		update_user_meta( $user_id, 'source_domain', $new_domain );
 	}
 
 	// wp_revoke_user($user_id);
 	$user = get_userdata( $user_id );
 	if ( ! $user ) {
 		restore_current_blog();
-		return new WP_Error('user_does_not_exist', __('That user does not exist.'));
+		return new WP_Error( 'user_does_not_exist', __( 'That user does not exist.' ) );
 	}
 
 	$user->remove_all_caps();
 
-	$blogs = get_blogs_of_user($user_id);
-	if ( count($blogs) == 0 ) {
-		update_user_meta($user_id, 'primary_blog', '');
-		update_user_meta($user_id, 'source_domain', '');
+	$blogs = get_blogs_of_user( $user_id );
+	if ( count( $blogs ) == 0 ) {
+		update_user_meta( $user_id, 'primary_blog', '' );
+		update_user_meta( $user_id, 'source_domain', '' );
 	}
 
 	if ( $reassign != '' ) {
@@ -309,10 +315,11 @@
 	$path = strtolower( $path );
 	$id = wp_cache_get( md5( $domain . $path ), 'blog-id-cache' );
 
-	if ( $id == -1 ) // blog does not exist
+	if ( $id == -1 ) { // blog does not exist
 		return 0;
-	elseif ( $id )
+	} elseif ( $id ) {
 		return (int) $id;
+	}
 
 	$args = array(
 		'domain' => $domain,
@@ -349,8 +356,9 @@
  */
 function is_email_address_unsafe( $user_email ) {
 	$banned_names = get_site_option( 'banned_email_domains' );
-	if ( $banned_names && ! is_array( $banned_names ) )
+	if ( $banned_names && ! is_array( $banned_names ) ) {
 		$banned_names = explode( "\n", $banned_names );
+	}
 
 	$is_email_address_unsafe = false;
 
@@ -361,8 +369,9 @@
 		list( $email_local_part, $email_domain ) = explode( '@', $normalized_email );
 
 		foreach ( $banned_names as $banned_domain ) {
-			if ( ! $banned_domain )
+			if ( ! $banned_domain ) {
 				continue;
+			}
 
 			if ( $email_domain == $banned_domain ) {
 				$is_email_address_unsafe = true;
@@ -408,7 +417,7 @@
  * @param string $user_email The email provided by the user.
  * @return array Contains username, email, and error messages.
  */
-function wpmu_validate_user_signup($user_name, $user_email) {
+function wpmu_validate_user_signup( $user_name, $user_email ) {
 	global $wpdb;
 
 	$errors = new WP_Error();
@@ -423,12 +432,13 @@
 
 	$user_email = sanitize_email( $user_email );
 
-	if ( empty( $user_name ) )
-	   	$errors->add('user_name', __( 'Please enter a username.' ) );
+	if ( empty( $user_name ) ) {
+		   $errors->add( 'user_name', __( 'Please enter a username.' ) );
+	}
 
 	$illegal_names = get_site_option( 'illegal_names' );
 	if ( ! is_array( $illegal_names ) ) {
-		$illegal_names = array(  'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
+		$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
 		add_site_option( 'illegal_names', $illegal_names );
 	}
 	if ( in_array( $user_name, $illegal_names ) ) {
@@ -448,57 +458,70 @@
 		$errors->add( 'user_email', __( 'You cannot use that email address to signup. We are having problems with them blocking some of our email. Please use another email provider.' ) );
 	}
 
-	if ( strlen( $user_name ) < 4 )
-		$errors->add('user_name',  __( 'Username must be at least 4 characters.' ) );
+	if ( strlen( $user_name ) < 4 ) {
+		$errors->add( 'user_name',  __( 'Username must be at least 4 characters.' ) );
+	}
 
 	if ( strlen( $user_name ) > 60 ) {
 		$errors->add( 'user_name', __( 'Username may not be longer than 60 characters.' ) );
 	}
 
 	// all numeric?
-	if ( preg_match( '/^[0-9]*$/', $user_name ) )
-		$errors->add('user_name', __('Sorry, usernames must have letters too!'));
+	if ( preg_match( '/^[0-9]*$/', $user_name ) ) {
+		$errors->add( 'user_name', __( 'Sorry, usernames must have letters too!' ) );
+	}
 
 	$limited_email_domains = get_site_option( 'limited_email_domains' );
 	if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) {
 		$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
 		if ( ! in_array( $emaildomain, $limited_email_domains ) ) {
-			$errors->add('user_email', __('Sorry, that email address is not allowed!'));
+			$errors->add( 'user_email', __( 'Sorry, that email address is not allowed!' ) );
 		}
 	}
 
 	// Check if the username has been used already.
-	if ( username_exists($user_name) )
+	if ( username_exists( $user_name ) ) {
 		$errors->add( 'user_name', __( 'Sorry, that username already exists!' ) );
+	}
 
 	// Check if the email address has been used already.
-	if ( email_exists($user_email) )
+	if ( email_exists( $user_email ) ) {
 		$errors->add( 'user_email', __( 'Sorry, that email address is already used!' ) );
+	}
 
 	// Has someone already signed up for this username?
-	$signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE user_login = %s", $user_name) );
+	$signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE user_login = %s", $user_name ) );
 	if ( $signup != null ) {
-		$registered_at =  mysql2date('U', $signup->registered);
+		$registered_at = mysql2date( 'U', $signup->registered );
 		$now = current_time( 'timestamp', true );
 		$diff = $now - $registered_at;
 		// If registered more than two days ago, cancel registration and let this signup go through.
-		if ( $diff > 2 * DAY_IN_SECONDS )
-			$wpdb->delete( $wpdb->signups, array( 'user_login' => $user_name ) );
-		else
-			$errors->add('user_name', __('That username is currently reserved but may be available in a couple of days.'));
+		if ( $diff > 2 * DAY_IN_SECONDS ) {
+			$wpdb->delete( $wpdb->signups, array(
+				'user_login' => $user_name,
+			) );
+		} else { $errors->add( 'user_name', __( 'That username is currently reserved but may be available in a couple of days.' ) );
+		}
 	}
 
-	$signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE user_email = %s", $user_email) );
+	$signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE user_email = %s", $user_email ) );
 	if ( $signup != null ) {
-		$diff = current_time( 'timestamp', true ) - mysql2date('U', $signup->registered);
+		$diff = current_time( 'timestamp', true ) - mysql2date( 'U', $signup->registered );
 		// If registered more than two days ago, cancel registration and let this signup go through.
-		if ( $diff > 2 * DAY_IN_SECONDS )
-			$wpdb->delete( $wpdb->signups, array( 'user_email' => $user_email ) );
-		else
-			$errors->add('user_email', __('That email address has already been used. Please check your inbox for an activation email. It will become available in a couple of days if you do nothing.'));
+		if ( $diff > 2 * DAY_IN_SECONDS ) {
+			$wpdb->delete( $wpdb->signups, array(
+				'user_email' => $user_email,
+			) );
+		} else { $errors->add( 'user_email', __( 'That email address has already been used. Please check your inbox for an activation email. It will become available in a couple of days if you do nothing.' ) );
+		}
 	}
 
-	$result = array('user_name' => $user_name, 'orig_username' => $orig_username, 'user_email' => $user_email, 'errors' => $errors);
+	$result = array(
+		'user_name' => $user_name,
+		'orig_username' => $orig_username,
+		'user_email' => $user_email,
+		'errors' => $errors,
+	);
 
 	/**
 	 * Filters the validated user registration details.
@@ -567,15 +590,17 @@
 		$illegal_names = array_merge( $illegal_names, get_subdirectory_reserved_names() );
 	}
 
-	if ( empty( $blogname ) )
-		$errors->add('blogname', __( 'Please enter a site name.' ) );
+	if ( empty( $blogname ) ) {
+		$errors->add( 'blogname', __( 'Please enter a site name.' ) );
+	}
 
 	if ( preg_match( '/[^a-z0-9]+/', $blogname ) ) {
 		$errors->add( 'blogname', __( 'Site names can only contain lowercase letters (a-z) and numbers.' ) );
 	}
 
-	if ( in_array( $blogname, $illegal_names ) )
-		$errors->add('blogname',  __( 'That name is not allowed.' ) );
+	if ( in_array( $blogname, $illegal_names ) ) {
+		$errors->add( 'blogname',  __( 'That name is not allowed.' ) );
+	}
 
 	/**
 	 * Filters the minimum site name length required when validating a site signup.
@@ -592,12 +617,14 @@
 	}
 
 	// do not allow users to create a blog that conflicts with a page on the main blog.
-	if ( !is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM " . $wpdb->get_blog_prefix( $current_network->site_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) )
+	if ( ! is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( 'SELECT post_name FROM ' . $wpdb->get_blog_prefix( $current_network->site_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) ) {
 		$errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) );
+	}
 
 	// all numeric?
-	if ( preg_match( '/^[0-9]*$/', $blogname ) )
-		$errors->add('blogname', __('Sorry, site names must have letters too!'));
+	if ( preg_match( '/^[0-9]*$/', $blogname ) ) {
+		$errors->add( 'blogname', __( 'Sorry, site names must have letters too!' ) );
+	}
 
 	/**
 	 * Filters the new site name during registration.
@@ -611,10 +638,11 @@
 	 */
 	$blogname = apply_filters( 'newblogname', $blogname );
 
-	$blog_title = wp_unslash(  $blog_title );
+	$blog_title = wp_unslash( $blog_title );
 
-	if ( empty( $blog_title ) )
-		$errors->add('blog_title', __( 'Please enter a site title.' ) );
+	if ( empty( $blog_title ) ) {
+		$errors->add( 'blog_title', __( 'Please enter a site title.' ) );
+	}
 
 	// Check if the domain/path has been used already.
 	if ( is_subdomain_install() ) {
@@ -622,28 +650,40 @@
 		$path = $base;
 	} else {
 		$mydomain = "$domain";
-		$path = $base.$blogname.'/';
+		$path = $base . $blogname . '/';
 	}
-	if ( domain_exists($mydomain, $path, $current_network->id) )
+	if ( domain_exists( $mydomain, $path, $current_network->id ) ) {
 		$errors->add( 'blogname', __( 'Sorry, that site already exists!' ) );
+	}
 
 	if ( username_exists( $blogname ) ) {
-		if ( ! is_object( $user ) || ( is_object($user) && ( $user->user_login != $blogname ) ) )
+		if ( ! is_object( $user ) || ( is_object( $user ) && ( $user->user_login != $blogname ) ) ) {
 			$errors->add( 'blogname', __( 'Sorry, that site is reserved!' ) );
+		}
 	}
 
 	// Has someone already signed up for this domain?
-	$signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE domain = %s AND path = %s", $mydomain, $path) ); // TODO: Check email too?
-	if ( ! empty($signup) ) {
-		$diff = current_time( 'timestamp', true ) - mysql2date('U', $signup->registered);
+	$signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE domain = %s AND path = %s", $mydomain, $path ) ); // TODO: Check email too?
+	if ( ! empty( $signup ) ) {
+		$diff = current_time( 'timestamp', true ) - mysql2date( 'U', $signup->registered );
 		// If registered more than two days ago, cancel registration and let this signup go through.
-		if ( $diff > 2 * DAY_IN_SECONDS )
-			$wpdb->delete( $wpdb->signups, array( 'domain' => $mydomain , 'path' => $path ) );
-		else
-			$errors->add('blogname', __('That site is currently reserved but may be available in a couple days.'));
+		if ( $diff > 2 * DAY_IN_SECONDS ) {
+			$wpdb->delete( $wpdb->signups, array(
+				'domain' => $mydomain,
+				'path' => $path,
+			) );
+		} else { $errors->add( 'blogname', __( 'That site is currently reserved but may be available in a couple days.' ) );
+		}
 	}
 
-	$result = array('domain' => $mydomain, 'path' => $path, 'blogname' => $blogname, 'blog_title' => $blog_title, 'user' => $user, 'errors' => $errors);
+	$result = array(
+		'domain' => $mydomain,
+		'path' => $path,
+		'blogname' => $blogname,
+		'blog_title' => $blog_title,
+		'user' => $user,
+		'errors' => $errors,
+	);
 
 	/**
 	 * Filters site details and error messages following registration.
@@ -678,7 +718,7 @@
  * @param string $user_email The user's email address.
  * @param array  $meta       Optional. Signup meta data. By default, contains the requested privacy setting and lang_id.
  */
-function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() )  {
+function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() ) {
 	global $wpdb;
 
 	$key = substr( md5( time() . wp_rand() . $domain ), 0, 16 );
@@ -706,9 +746,9 @@
 		'title' => $title,
 		'user_login' => $user,
 		'user_email' => $user_email,
-		'registered' => current_time('mysql', true),
+		'registered' => current_time( 'mysql', true ),
 		'activation_key' => $key,
-		'meta' => serialize( $meta )
+		'meta' => serialize( $meta ),
 	) );
 
 	/**
@@ -769,9 +809,9 @@
 		'title' => '',
 		'user_login' => $user,
 		'user_email' => $user_email,
-		'registered' => current_time('mysql', true),
+		'registered' => current_time( 'mysql', true ),
 		'activation_key' => $key,
-		'meta' => serialize( $meta )
+		'meta' => serialize( $meta ),
 	) );
 
 	/**
@@ -830,17 +870,18 @@
 	}
 
 	// Send email with activation link.
-	if ( !is_subdomain_install() || get_current_network_id() != 1 )
-		$activate_url = network_site_url("wp-activate.php?key=$key");
-	else
-		$activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; // @todo use *_url() API
+	if ( ! is_subdomain_install() || get_current_network_id() != 1 ) {
+		$activate_url = network_site_url( "wp-activate.php?key=$key" );
+	} else { $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; // End if().
+	}
 
-	$activate_url = esc_url($activate_url);
+	$activate_url = esc_url( $activate_url );
 	$admin_email = get_site_option( 'admin_email' );
-	if ( $admin_email == '' )
+	if ( $admin_email == '' ) {
 		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
+	}
 	$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
-	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
+	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
 
 	$user = get_user_by( 'login', $user_login );
 	$switched_locale = switch_to_locale( get_user_locale( $user ) );
@@ -863,7 +904,7 @@
 		 * @param array  $meta       Signup meta data. By default, contains the requested privacy setting and lang_id.
 		 */
 		apply_filters( 'wpmu_signup_blog_notification_email',
-			__( "To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%s" ),
+			__( "To activate your blog, please click the following link:\n\n%1\$s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%2\$s" ),
 			$domain, $path, $title, $user_login, $user_email, $key, $meta
 		),
 		$activate_url,
@@ -935,18 +976,20 @@
 	 * @param string $key        Activation key created in wpmu_signup_user().
 	 * @param array  $meta       Signup meta data. Default empty array.
 	 */
-	if ( ! apply_filters( 'wpmu_signup_user_notification', $user_login, $user_email, $key, $meta ) )
+	if ( ! apply_filters( 'wpmu_signup_user_notification', $user_login, $user_email, $key, $meta ) ) {
 		return false;
+	}
 
 	$user = get_user_by( 'login', $user_login );
 	$switched_locale = switch_to_locale( get_user_locale( $user ) );
 
 	// Send email with activation link.
 	$admin_email = get_site_option( 'admin_email' );
-	if ( $admin_email == '' )
+	if ( $admin_email == '' ) {
 		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
+	}
 	$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
-	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
+	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
 	$message = sprintf(
 		/**
 		 * Filters the content of the notification email for new user sign-up.
@@ -1012,41 +1055,49 @@
  * @param string $key The activation key provided to the user.
  * @return array|WP_Error An array containing information about the activated user and/or blog
  */
-function wpmu_activate_signup($key) {
+function wpmu_activate_signup( $key ) {
 	global $wpdb;
 
-	$signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE activation_key = %s", $key) );
+	$signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE activation_key = %s", $key ) );
 
-	if ( empty( $signup ) )
+	if ( empty( $signup ) ) {
 		return new WP_Error( 'invalid_key', __( 'Invalid activation key.' ) );
+	}
 
 	if ( $signup->active ) {
-		if ( empty( $signup->domain ) )
+		if ( empty( $signup->domain ) ) {
 			return new WP_Error( 'already_active', __( 'The user is already active.' ), $signup );
-		else
-			return new WP_Error( 'already_active', __( 'The site is already active.' ), $signup );
+		} else { return new WP_Error( 'already_active', __( 'The site is already active.' ), $signup );
+		}
 	}
 
-	$meta = maybe_unserialize($signup->meta);
+	$meta = maybe_unserialize( $signup->meta );
 	$password = wp_generate_password( 12, false );
 
-	$user_id = username_exists($signup->user_login);
+	$user_id = username_exists( $signup->user_login );
 
-	if ( ! $user_id )
-		$user_id = wpmu_create_user($signup->user_login, $password, $signup->user_email);
-	else
-		$user_already_exists = true;
+	if ( ! $user_id ) {
+		$user_id = wpmu_create_user( $signup->user_login, $password, $signup->user_email );
+	} else { $user_already_exists = true;
+	}
 
-	if ( ! $user_id )
-		return new WP_Error('create_user', __('Could not create user'), $signup);
+	if ( ! $user_id ) {
+		return new WP_Error( 'create_user', __( 'Could not create user' ), $signup );
+	}
 
-	$now = current_time('mysql', true);
+	$now = current_time( 'mysql', true );
 
-	if ( empty($signup->domain) ) {
-		$wpdb->update( $wpdb->signups, array('active' => 1, 'activated' => $now), array('activation_key' => $key) );
+	if ( empty( $signup->domain ) ) {
+		$wpdb->update( $wpdb->signups, array(
+			'active' => 1,
+			'activated' => $now,
+			), array(
+			'activation_key' => $key,
+		) );
 
-		if ( isset( $user_already_exists ) )
-			return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), $signup);
+		if ( isset( $user_already_exists ) ) {
+			return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), $signup );
+		}
 
 		/**
 		 * Fires immediately after a new user is activated.
@@ -1058,23 +1109,37 @@
 		 * @param array $meta     Signup meta data.
 		 */
 		do_action( 'wpmu_activate_user', $user_id, $password, $meta );
-		return array( 'user_id' => $user_id, 'password' => $password, 'meta' => $meta );
+		return array(
+			'user_id' => $user_id,
+			'password' => $password,
+			'meta' => $meta,
+		);
 	}
 
 	$blog_id = wpmu_create_blog( $signup->domain, $signup->path, $signup->title, $user_id, $meta, $wpdb->siteid );
 
 	// TODO: What to do if we create a user but cannot create a blog?
-	if ( is_wp_error($blog_id) ) {
+	if ( is_wp_error( $blog_id ) ) {
 		// If blog is taken, that means a previous attempt to activate this blog failed in between creating the blog and
 		// setting the activation flag. Let's just set the active flag and instruct the user to reset their password.
 		if ( 'blog_taken' == $blog_id->get_error_code() ) {
 			$blog_id->add_data( $signup );
-			$wpdb->update( $wpdb->signups, array( 'active' => 1, 'activated' => $now ), array( 'activation_key' => $key ) );
+			$wpdb->update( $wpdb->signups, array(
+				'active' => 1,
+				'activated' => $now,
+				), array(
+				'activation_key' => $key,
+			) );
 		}
 		return $blog_id;
 	}
 
-	$wpdb->update( $wpdb->signups, array('active' => 1, 'activated' => $now), array('activation_key' => $key) );
+	$wpdb->update( $wpdb->signups, array(
+		'active' => 1,
+		'activated' => $now,
+		), array(
+		'activation_key' => $key,
+	) );
 	/**
 	 * Fires immediately after a site is activated.
 	 *
@@ -1088,7 +1153,13 @@
 	 */
 	do_action( 'wpmu_activate_blog', $blog_id, $user_id, $password, $signup->title, $meta );
 
-	return array('blog_id' => $blog_id, 'user_id' => $user_id, 'password' => $password, 'title' => $signup->title, 'meta' => $meta);
+	return array(
+		'blog_id' => $blog_id,
+		'user_id' => $user_id,
+		'password' => $password,
+		'title' => $signup->title,
+		'meta' => $meta,
+	);
 }
 
 /**
@@ -1110,8 +1181,9 @@
 	$user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
 
 	$user_id = wp_create_user( $user_name, $password, $email );
-	if ( is_wp_error( $user_id ) )
+	if ( is_wp_error( $user_id ) ) {
 		return false;
+	}
 
 	// Newly created users have no roles or caps until they are added to a blog.
 	delete_user_option( $user_id, 'capabilities' );
@@ -1160,43 +1232,48 @@
 
 	$domain = preg_replace( '/\s+/', '', sanitize_user( $domain, true ) );
 
-	if ( is_subdomain_install() )
+	if ( is_subdomain_install() ) {
 		$domain = str_replace( '@', '', $domain );
+	}
 
 	$title = strip_tags( $title );
 	$user_id = (int) $user_id;
 
-	if ( empty($path) )
+	if ( empty( $path ) ) {
 		$path = '/';
+	}
 
 	// Check if the domain has been used already. We should return an error message.
-	if ( domain_exists($domain, $path, $site_id) )
+	if ( domain_exists( $domain, $path, $site_id ) ) {
 		return new WP_Error( 'blog_taken', __( 'Sorry, that site already exists!' ) );
+	}
 
 	if ( ! wp_installing() ) {
 		wp_installing( true );
 	}
 
-	if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
-		return new WP_Error('insert_blog', __('Could not create site.'));
+	if ( ! $blog_id = insert_blog( $domain, $path, $site_id ) ) {
+		return new WP_Error( 'insert_blog', __( 'Could not create site.' ) );
+	}
 
-	switch_to_blog($blog_id);
-	install_blog($blog_id, $title);
-	wp_install_defaults($user_id);
+	switch_to_blog( $blog_id );
+	install_blog( $blog_id, $title );
+	wp_install_defaults( $user_id );
 
-	add_user_to_blog($blog_id, $user_id, 'administrator');
+	add_user_to_blog( $blog_id, $user_id, 'administrator' );
 
 	foreach ( $meta as $key => $value ) {
-		if ( in_array( $key, array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ) ) )
+		if ( in_array( $key, array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ) ) ) {
 			update_blog_status( $blog_id, $key, $value );
-		else
-			update_option( $key, $value );
+		} else { update_option( $key, $value );
+		}
 	}
 
 	update_option( 'blog_public', (int) $meta['public'] );
 
-	if ( ! is_super_admin( $user_id ) && ! get_user_meta( $user_id, 'primary_blog', true ) )
+	if ( ! is_super_admin( $user_id ) && ! get_user_meta( $user_id, 'primary_blog', true ) ) {
 		update_user_meta( $user_id, 'primary_blog', $blog_id );
+	}
 
 	restore_current_blog();
 	/**
@@ -1231,14 +1308,16 @@
  * @return bool
  */
 function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
-	if ( get_site_option( 'registrationnotification' ) != 'yes' )
+	if ( get_site_option( 'registrationnotification' ) != 'yes' ) {
 		return false;
+	}
 
 	$email = get_site_option( 'admin_email' );
-	if ( is_email($email) == false )
+	if ( is_email( $email ) == false ) {
 		return false;
+	}
 
-	$options_site_url = esc_url(network_admin_url('settings.php'));
+	$options_site_url = esc_url( network_admin_url( 'settings.php' ) );
 
 	switch_to_blog( $blog_id );
 	$blogname = get_option( 'blogname' );
@@ -1277,17 +1356,19 @@
  * @return bool
  */
 function newuser_notify_siteadmin( $user_id ) {
-	if ( get_site_option( 'registrationnotification' ) != 'yes' )
+	if ( get_site_option( 'registrationnotification' ) != 'yes' ) {
 		return false;
+	}
 
 	$email = get_site_option( 'admin_email' );
 
-	if ( is_email($email) == false )
+	if ( is_email( $email ) == false ) {
 		return false;
+	}
 
 	$user = get_userdata( $user_id );
 
-	$options_site_url = esc_url(network_admin_url('settings.php'));
+	$options_site_url = esc_url( network_admin_url( 'settings.php' ) );
 	/* translators: New user notification email. 1: User login, 2: User IP address, 3: Settings screen URL */
 	$msg = sprintf(__('New User: %1$s
 Remote IP: %2$s
@@ -1304,7 +1385,7 @@
 	 * @param WP_User $user WP_User instance of the new user.
 	 */
 	$msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );
-	wp_mail( $email, sprintf(__('New User Registration: %s'), $user->user_login), $msg );
+	wp_mail( $email, sprintf( __( 'New User Registration: %s' ), $user->user_login ), $msg );
 	return true;
 }
 
@@ -1323,7 +1404,7 @@
  * @param int    $site_id Optional. Relevant only on multi-network installs.
  * @return int
  */
-function domain_exists($domain, $path, $site_id = 1) {
+function domain_exists( $domain, $path, $site_id = 1 ) {
 	$path = trailingslashit( $path );
 	$args = array(
 		'network_id' => $site_id,
@@ -1362,15 +1443,21 @@
  * @param int    $site_id Unless you're running a multi-network install, be sure to set this value to 1.
  * @return int|false The ID of the new row
  */
-function insert_blog($domain, $path, $site_id) {
+function insert_blog( $domain, $path, $site_id ) {
 	global $wpdb;
 
-	$path = trailingslashit($path);
+	$path = trailingslashit( $path );
 	$site_id = (int) $site_id;
 
-	$result = $wpdb->insert( $wpdb->blogs, array('site_id' => $site_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time('mysql')) );
-	if ( ! $result )
+	$result = $wpdb->insert( $wpdb->blogs, array(
+		'site_id' => $site_id,
+		'domain' => $domain,
+		'path' => $path,
+		'registered' => current_time( 'mysql' ),
+	) );
+	if ( ! $result ) {
 		return false;
+	}
 
 	$blog_id = $wpdb->insert_id;
 	refresh_blog_details( $blog_id );
@@ -1404,8 +1491,9 @@
 	require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
 
 	$suppress = $wpdb->suppress_errors();
-	if ( $wpdb->get_results( "DESCRIBE {$wpdb->posts}" ) )
+	if ( $wpdb->get_results( "DESCRIBE {$wpdb->posts}" ) ) {
 		die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p></body></html>' );
+	}
 	$wpdb->suppress_errors( $suppress );
 
 	$url = get_blogaddress_by_id( $blog_id );
@@ -1422,22 +1510,21 @@
 
 	if ( ! is_subdomain_install() ) {
 
- 		if ( 'https' === parse_url( get_site_option( 'siteurl' ), PHP_URL_SCHEME ) ) {
- 			$siteurl = set_url_scheme( $siteurl, 'https' );
- 		}
- 		if ( 'https' === parse_url( get_home_url( get_network()->site_id ), PHP_URL_SCHEME ) ) {
- 			$home = set_url_scheme( $home, 'https' );
- 		}
-
+		if ( 'https' === parse_url( get_site_option( 'siteurl' ), PHP_URL_SCHEME ) ) {
+			$siteurl = set_url_scheme( $siteurl, 'https' );
+		}
+		if ( 'https' === parse_url( get_home_url( get_network()->site_id ), PHP_URL_SCHEME ) ) {
+			$home = set_url_scheme( $home, 'https' );
+		}
 	}
 
 	update_option( 'siteurl', $siteurl );
 	update_option( 'home', $home );
 
-	if ( get_site_option( 'ms_files_rewriting' ) )
+	if ( get_site_option( 'ms_files_rewriting' ) ) {
 		update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" );
-	else
-		update_option( 'upload_path', get_blog_option( get_network()->site_id, 'upload_path' ) );
+	} else { update_option( 'upload_path', get_blog_option( get_network()->site_id, 'upload_path' ) );
+	}
 
 	update_option( 'blogname', wp_unslash( $blog_title ) );
 	update_option( 'admin_email', '' );
@@ -1462,14 +1549,14 @@
  * @param int $blog_id Ignored in this function.
  * @param int $user_id
  */
-function install_blog_defaults($blog_id, $user_id) {
+function install_blog_defaults( $blog_id, $user_id ) {
 	global $wpdb;
 
 	require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
 
 	$suppress = $wpdb->suppress_errors();
 
-	wp_install_defaults($user_id);
+	wp_install_defaults( $user_id );
 
 	$wpdb->suppress_errors( $suppress );
 }
@@ -1507,8 +1594,9 @@
 	 * @param string   $title    Site title.
 	 * @param array    $meta     Signup meta data. By default, contains the requested privacy setting and lang_id.
 	 */
-	if ( ! apply_filters( 'wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta ) )
+	if ( ! apply_filters( 'wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta ) ) {
 		return false;
+	}
 
 	$user = get_userdata( $user_id );
 
@@ -1533,7 +1621,7 @@
 --The Team @ SITE_NAME' );
 	}
 
-	$url = get_blogaddress_by_id($blog_id);
+	$url = get_blogaddress_by_id( $blog_id );
 
 	$welcome_email = str_replace( 'SITE_NAME', $current_network->site_name, $welcome_email );
 	$welcome_email = str_replace( 'BLOG_TITLE', $title, $welcome_email );
@@ -1558,15 +1646,17 @@
 	$welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta );
 	$admin_email = get_site_option( 'admin_email' );
 
-	if ( $admin_email == '' )
+	if ( $admin_email == '' ) {
 		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
+	}
 
 	$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
-	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
+	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
 	$message = $welcome_email;
 
-	if ( empty( $current_network->site_name ) )
+	if ( empty( $current_network->site_name ) ) {
 		$current_network->site_name = 'WordPress';
+	}
 
 	/* translators: New site notification email subject. 1: Network name, 2: New site name */
 	$subject = __( 'New %1$s Site: %2$s' );
@@ -1607,7 +1697,7 @@
 	$current_network = get_network();
 
 	/**
- 	 * Filters whether to bypass the welcome email after user activation.
+	  * Filters whether to bypass the welcome email after user activation.
 	 *
 	 * Returning false disables the welcome email.
 	 *
@@ -1617,8 +1707,9 @@
 	 * @param string $password User password.
 	 * @param array  $meta     Signup meta data. Default empty array.
 	 */
-	if ( ! apply_filters( 'wpmu_welcome_user_notification', $user_id, $password, $meta ) )
+	if ( ! apply_filters( 'wpmu_welcome_user_notification', $user_id, $password, $meta ) ) {
 		return false;
+	}
 
 	$welcome_email = get_site_option( 'welcome_user_email' );
 
@@ -1646,15 +1737,17 @@
 
 	$admin_email = get_site_option( 'admin_email' );
 
-	if ( $admin_email == '' )
+	if ( $admin_email == '' ) {
 		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
+	}
 
 	$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
-	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
+	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
 	$message = $welcome_email;
 
-	if ( empty( $current_network->site_name ) )
+	if ( empty( $current_network->site_name ) ) {
 		$current_network->site_name = 'WordPress';
+	}
 
 	/* translators: New user notification email subject. 1: Network name, 2: New user login */
 	$subject = __( 'New %1$s User: %2$s' );
@@ -1666,7 +1759,7 @@
 	 *
 	 * @param string $subject Subject of the email.
 	 */
-	$subject = apply_filters( 'update_welcome_user_subject', sprintf( $subject, $current_network->site_name, $user->user_login) );
+	$subject = apply_filters( 'update_welcome_user_subject', sprintf( $subject, $current_network->site_name, $user->user_login ) );
 	wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
 
 	if ( $switched_locale ) {
@@ -1718,21 +1811,21 @@
 	// published by $user_id
 	foreach ( (array) $user_blogs as $blog ) {
 		$prefix = $wpdb->get_blog_prefix( $blog->userblog_id );
-		$recent_post = $wpdb->get_row( $wpdb->prepare("SELECT ID, post_date_gmt FROM {$prefix}posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1", $user_id ), ARRAY_A);
+		$recent_post = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_date_gmt FROM {$prefix}posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1", $user_id ), ARRAY_A );
 
 		// Make sure we found a post
-		if ( isset($recent_post['ID']) ) {
-			$post_gmt_ts = strtotime($recent_post['post_date_gmt']);
+		if ( isset( $recent_post['ID'] ) ) {
+			$post_gmt_ts = strtotime( $recent_post['post_date_gmt'] );
 
 			// If this is the first post checked or if this post is
 			// newer than the current recent post, make it the new
 			// most recent post.
-			if ( !isset($most_recent_post['post_gmt_ts']) || ( $post_gmt_ts > $most_recent_post['post_gmt_ts'] ) ) {
+			if ( ! isset( $most_recent_post['post_gmt_ts'] ) || ( $post_gmt_ts > $most_recent_post['post_gmt_ts'] ) ) {
 				$most_recent_post = array(
 					'blog_id'		=> $blog->userblog_id,
 					'post_id'		=> $recent_post['ID'],
 					'post_date_gmt'	=> $recent_post['post_date_gmt'],
-					'post_gmt_ts'	=> $post_gmt_ts
+					'post_gmt_ts'	=> $post_gmt_ts,
 				);
 			}
 		}
@@ -1756,22 +1849,24 @@
  */
 function get_dirsize( $directory ) {
 	$dirsize = get_transient( 'dirsize_cache' );
-	if ( is_array( $dirsize ) && isset( $dirsize[ $directory ][ 'size' ] ) )
-		return $dirsize[ $directory ][ 'size' ];
+	if ( is_array( $dirsize ) && isset( $dirsize[ $directory ]['size'] ) ) {
+		return $dirsize[ $directory ]['size'];
+	}
 
-	if ( ! is_array( $dirsize ) )
+	if ( ! is_array( $dirsize ) ) {
 		$dirsize = array();
+	}
 
 	// Exclude individual site directories from the total when checking the main site,
 	// as they are subdirectories and should not be counted.
 	if ( is_main_site() ) {
-		$dirsize[ $directory ][ 'size' ] = recurse_dirsize( $directory, $directory . '/sites' );
+		$dirsize[ $directory ]['size'] = recurse_dirsize( $directory, $directory . '/sites' );
 	} else {
-		$dirsize[ $directory ][ 'size' ] = recurse_dirsize( $directory );
+		$dirsize[ $directory ]['size'] = recurse_dirsize( $directory );
 	}
 
 	set_transient( 'dirsize_cache', $dirsize, HOUR_IN_SECONDS );
-	return $dirsize[ $directory ][ 'size' ];
+	return $dirsize[ $directory ]['size'];
 }
 
 /**
@@ -1796,20 +1891,21 @@
 		return false;
 	}
 
-	if ($handle = opendir($directory)) {
-		while(($file = readdir($handle)) !== false) {
-			$path = $directory.'/'.$file;
-			if ($file != '.' && $file != '..') {
-				if (is_file($path)) {
-					$size += filesize($path);
-				} elseif (is_dir($path)) {
+	if ( $handle = opendir( $directory ) ) {
+		while ( ($file = readdir( $handle )) !== false ) {
+			$path = $directory . '/' . $file;
+			if ( $file != '.' && $file != '..' ) {
+				if ( is_file( $path ) ) {
+					$size += filesize( $path );
+				} elseif ( is_dir( $path ) ) {
 					$handlesize = recurse_dirsize( $path, $exclude );
-					if ($handlesize > 0)
+					if ( $handlesize > 0 ) {
 						$size += $handlesize;
+					}
 				}
 			}
 		}
-		closedir($handle);
+		closedir( $handle );
 	}
 	return $size;
 }
@@ -1833,8 +1929,9 @@
 	$site_mimes = array();
 	foreach ( $site_exts as $ext ) {
 		foreach ( $mimes as $ext_pattern => $mime ) {
-			if ( $ext != '' && strpos( $ext_pattern, $ext ) !== false )
-				$site_mimes[$ext_pattern] = $mime;
+			if ( $ext != '' && strpos( $ext_pattern, $ext ) !== false ) {
+				$site_mimes[ $ext_pattern ] = $mime;
+			}
 		}
 	}
 	return $site_mimes;
@@ -1872,8 +1969,14 @@
 function wpmu_log_new_registrations( $blog_id, $user_id ) {
 	global $wpdb;
 	$user = get_userdata( (int) $user_id );
-	if ( $user )
-		$wpdb->insert( $wpdb->registration_log, array('email' => $user->user_email, 'IP' => preg_replace( '/[^0-9., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ), 'blog_id' => $blog_id, 'date_registered' => current_time('mysql')) );
+	if ( $user ) {
+		$wpdb->insert( $wpdb->registration_log, array(
+			'email' => $user->user_email,
+			'IP' => preg_replace( '/[^0-9., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ),
+			'blog_id' => $blog_id,
+			'date_registered' => current_time( 'mysql' ),
+		) );
+	}
 }
 
 /**
@@ -1894,8 +1997,9 @@
 	global $wpdb;
 	static $global_terms_recurse = null;
 
-	if ( !global_terms_enabled() )
+	if ( ! global_terms_enabled() ) {
 		return $term_id;
+	}
 
 	// prevent a race condition
 	$recurse_start = false;
@@ -1913,15 +2017,24 @@
 	if ( $global_id == null ) {
 		$used_global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE cat_ID = %d", $c->term_id ) );
 		if ( null == $used_global_id ) {
-			$wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) );
+			$wpdb->insert( $wpdb->sitecategories, array(
+				'cat_ID' => $term_id,
+				'cat_name' => $c->name,
+				'category_nicename' => $c->slug,
+			) );
 			$global_id = $wpdb->insert_id;
-			if ( empty( $global_id ) )
+			if ( empty( $global_id ) ) {
 				return $term_id;
+			}
 		} else {
 			$max_global_id = $wpdb->get_var( "SELECT MAX(cat_ID) FROM $wpdb->sitecategories" );
 			$max_local_id = $wpdb->get_var( "SELECT MAX(term_id) FROM $wpdb->terms" );
 			$new_global_id = max( $max_global_id, $max_local_id ) + mt_rand( 100, 400 );
-			$wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $new_global_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) );
+			$wpdb->insert( $wpdb->sitecategories, array(
+				'cat_ID' => $new_global_id,
+				'cat_name' => $c->name,
+				'category_nicename' => $c->slug,
+			) );
 			$global_id = $wpdb->insert_id;
 		}
 	} elseif ( $global_id != $term_id ) {
@@ -1935,17 +2048,31 @@
 	}
 
 	if ( $global_id != $term_id ) {
-		if ( get_option( 'default_category' ) == $term_id )
+		if ( get_option( 'default_category' ) == $term_id ) {
 			update_option( 'default_category', $global_id );
+		}
 
-		$wpdb->update( $wpdb->terms, array('term_id' => $global_id), array('term_id' => $term_id) );
-		$wpdb->update( $wpdb->term_taxonomy, array('term_id' => $global_id), array('term_id' => $term_id) );
-		$wpdb->update( $wpdb->term_taxonomy, array('parent' => $global_id), array('parent' => $term_id) );
+		$wpdb->update( $wpdb->terms, array(
+			'term_id' => $global_id,
+			), array(
+			'term_id' => $term_id,
+		) );
+		$wpdb->update( $wpdb->term_taxonomy, array(
+			'term_id' => $global_id,
+			), array(
+			'term_id' => $term_id,
+		) );
+		$wpdb->update( $wpdb->term_taxonomy, array(
+			'parent' => $global_id,
+			), array(
+			'parent' => $term_id,
+		) );
 
-		clean_term_cache($term_id);
+		clean_term_cache( $term_id );
 	}
-	if ( $recurse_start )
+	if ( $recurse_start ) {
 		$global_terms_recurse = null;
+	}
 
 	return $global_id;
 }
@@ -1974,10 +2101,11 @@
  * @return string|array If the upload is under the size limit, $upload is returned. Otherwise returns an error message.
  */
 function upload_is_file_too_big( $upload ) {
-	if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) )
+	if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) ) {
 		return $upload;
+	}
 
-	if ( strlen( $upload['bits'] )  > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) {
+	if ( strlen( $upload['bits'] ) > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) {
 		return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_site_option( 'fileupload_maxk', 1500 ) );
 	}
 
@@ -1992,7 +2120,7 @@
 function signup_nonce_fields() {
 	$id = mt_rand();
 	echo "<input type='hidden' name='signup_form_id' value='{$id}' />";
-	wp_nonce_field('signup_form_' . $id, '_signup_form', false);
+	wp_nonce_field( 'signup_form_' . $id, '_signup_form', false );
 }
 
 /**
@@ -2004,11 +2132,13 @@
  * @return array
  */
 function signup_nonce_check( $result ) {
-	if ( !strpos( $_SERVER[ 'PHP_SELF' ], 'wp-signup.php' ) )
+	if ( ! strpos( $_SERVER['PHP_SELF'], 'wp-signup.php' ) ) {
 		return $result;
+	}
 
-	if ( wp_create_nonce('signup_form_' . $_POST[ 'signup_form_id' ]) != $_POST['_signup_form'] )
+	if ( wp_create_nonce( 'signup_form_' . $_POST['signup_form_id'] ) != $_POST['_signup_form'] ) {
 		wp_die( __( 'Please try again.' ) );
+	}
 
 	return $result;
 }
@@ -2029,8 +2159,9 @@
 	 * @param string $no_blog_redirect The redirect URL defined in NOBLOGREDIRECT.
 	 */
 	if ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) && ( $destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT ) ) ) {
-		if ( $destination == '%siteurl%' )
+		if ( $destination == '%siteurl%' ) {
 			$destination = network_home_url();
+		}
 		wp_redirect( $destination );
 		exit();
 	}
@@ -2046,23 +2177,29 @@
  * @since MU
  */
 function maybe_add_existing_user_to_blog() {
-	if ( false === strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) )
+	if ( false === strpos( $_SERVER['REQUEST_URI'], '/newbloguser/' ) ) {
 		return;
+	}
 
-	$parts = explode( '/', $_SERVER[ 'REQUEST_URI' ] );
+	$parts = explode( '/', $_SERVER['REQUEST_URI'] );
 	$key = array_pop( $parts );
 
-	if ( $key == '' )
+	if ( $key == '' ) {
 		$key = array_pop( $parts );
+	}
 
 	$details = get_option( 'new_user_' . $key );
-	if ( !empty( $details ) )
+	if ( ! empty( $details ) ) {
 		delete_option( 'new_user_' . $key );
+	}
 
-	if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) )
-		wp_die( sprintf(__('An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.'), home_url() ) );
+	if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) ) {
+		wp_die( sprintf( __( 'An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.' ), home_url() ) );
+	}
 
-	wp_die( sprintf( __( 'You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">log in</a> using your username and password.' ), home_url(), admin_url() ), __( 'WordPress &rsaquo; Success' ), array( 'response' => 200 ) );
+	wp_die( sprintf( __( 'You have been added to this site. Please visit the <a href="%1$s">homepage</a> or <a href="%2$s">log in</a> using your username and password.' ), home_url(), admin_url() ), __( 'WordPress &rsaquo; Success' ), array(
+		'response' => 200,
+	) );
 }
 
 /**
@@ -2076,7 +2213,7 @@
 function add_existing_user_to_blog( $details = false ) {
 	if ( is_array( $details ) ) {
 		$blog_id = get_current_blog_id();
-		$result = add_user_to_blog( $blog_id, $details[ 'user_id' ], $details[ 'role' ] );
+		$result = add_user_to_blog( $blog_id, $details['user_id'], $details['role'] );
 		/**
 		 * Fires immediately after an existing user is added to a site.
 		 *
@@ -2104,10 +2241,10 @@
  * @param array $meta
  */
 function add_new_user_to_blog( $user_id, $password, $meta ) {
-	if ( !empty( $meta[ 'add_to_blog' ] ) ) {
-		$blog_id = $meta[ 'add_to_blog' ];
-		$role = $meta[ 'new_role' ];
-		remove_user_from_blog($user_id, get_network()->site_id); // remove user from main blog.
+	if ( ! empty( $meta['add_to_blog'] ) ) {
+		$blog_id = $meta['add_to_blog'];
+		$role = $meta['new_role'];
+		remove_user_from_blog( $user_id, get_network()->site_id ); // remove user from main blog.
 		add_user_to_blog( $blog_id, $user_id, $role );
 		update_user_meta( $user_id, 'primary_blog', $blog_id );
 	}
@@ -2134,7 +2271,7 @@
  * @return bool
  */
 function is_user_spammy( $user = null ) {
-    if ( ! ( $user instanceof WP_User ) ) {
+	if ( ! ( $user instanceof WP_User ) ) {
 		if ( $user ) {
 			$user = get_user_by( 'login', $user );
 		} else {
@@ -2191,7 +2328,7 @@
  * @return bool
  */
 function users_can_register_signup_filter() {
-	$registration = get_site_option('registration');
+	$registration = get_site_option( 'registration' );
 	return ( $registration == 'all' || $registration == 'user' );
 }
 
@@ -2204,7 +2341,7 @@
  * @return string
  */
 function welcome_user_msg_filter( $text ) {
-	if ( !$text ) {
+	if ( ! $text ) {
 		remove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );
 
 		/* translators: Do not translate USERNAME, PASSWORD, LOGINLINK, SITE_NAME: those are placeholders. */
@@ -2258,11 +2395,13 @@
  * @return string URL with https as the scheme
  */
 function filter_SSL( $url ) {
-	if ( ! is_string( $url ) )
+	if ( ! is_string( $url ) ) {
 		return get_bloginfo( 'url' ); // Return home blog url with proper scheme
+	}
 
-	if ( force_ssl_content() && is_ssl() )
+	if ( force_ssl_content() && is_ssl() ) {
 		$url = set_url_scheme( $url, 'https' );
+	}
 
 	return $url;
 }
@@ -2273,11 +2412,13 @@
  * @since 3.1.0
  */
 function wp_schedule_update_network_counts() {
-	if ( !is_main_site() )
+	if ( ! is_main_site() ) {
 		return;
+	}
 
-	if ( ! wp_next_scheduled('update_network_counts') && ! wp_installing() )
-		wp_schedule_event(time(), 'twicedaily', 'update_network_counts');
+	if ( ! wp_next_scheduled( 'update_network_counts' ) && ! wp_installing() ) {
+		wp_schedule_event( time(), 'twicedaily', 'update_network_counts' );
+	}
 }
 
 /**
@@ -2317,8 +2458,9 @@
 	 * @param bool   $small_network Whether the network is considered small.
 	 * @param string $context       Context. Either 'users' or 'sites'.
 	 */
-	if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) )
+	if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) ) {
 		return;
+	}
 
 	wp_update_network_site_counts( $network_id );
 }
@@ -2338,8 +2480,9 @@
 	$is_small_network = ! wp_is_large_network( 'users', $network_id );
 
 	/** This filter is documented in wp-includes/ms-functions.php */
-	if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) )
+	if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {
 		return;
+	}
 
 	wp_update_network_user_counts( $network_id );
 }
@@ -2420,11 +2563,13 @@
 function get_space_allowed() {
 	$space_allowed = get_option( 'blog_upload_space' );
 
-	if ( ! is_numeric( $space_allowed ) )
+	if ( ! is_numeric( $space_allowed ) ) {
 		$space_allowed = get_site_option( 'blog_upload_space' );
+	}
 
-	if ( ! is_numeric( $space_allowed ) )
+	if ( ! is_numeric( $space_allowed ) ) {
 		$space_allowed = 100;
+	}
 
 	/**
 	 * Filters the upload quota for the current site.
@@ -2449,13 +2594,15 @@
 		$allowed = 0;
 	}
 	$space_allowed = $allowed * MB_IN_BYTES;
-	if ( get_site_option( 'upload_space_check_disabled' ) )
+	if ( get_site_option( 'upload_space_check_disabled' ) ) {
 		return $space_allowed;
+	}
 
 	$space_used = get_space_used() * MB_IN_BYTES;
 
-	if ( ( $space_allowed - $space_used ) <= 0 )
+	if ( ( $space_allowed - $space_used ) <= 0 ) {
 		return 0;
+	}
 
 	return $space_allowed - $space_used;
 }
@@ -2467,8 +2614,9 @@
  * @return bool True if space is available, false otherwise.
  */
 function is_upload_space_available() {
-	if ( get_site_option( 'upload_space_check_disabled' ) )
+	if ( get_site_option( 'upload_space_check_disabled' ) ) {
 		return true;
+	}
 
 	return (bool) get_upload_space_available();
 }
@@ -2483,8 +2631,9 @@
  */
 function upload_size_limit_filter( $size ) {
 	$fileupload_maxk = KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 );
-	if ( get_site_option( 'upload_space_check_disabled' ) )
+	if ( get_site_option( 'upload_space_check_disabled' ) ) {
 		return min( $size, $fileupload_maxk );
+	}
 
 	return min( $size, $fileupload_maxk, get_upload_space_available() );
 }
@@ -2538,8 +2687,16 @@
  */
 function get_subdirectory_reserved_names() {
 	$names = array(
-		'page', 'comments', 'blog', 'files', 'feed', 'wp-admin',
-		'wp-content', 'wp-includes', 'wp-json', 'embed'
+		'page',
+	'comments',
+	'blog',
+	'files',
+	'feed',
+	'wp-admin',
+		'wp-content',
+	'wp-includes',
+	'wp-json',
+	'embed',
 	);
 
 	/**
Index: src/wp-includes/ms-load.php
===================================================================
--- src/wp-includes/ms-load.php	(revision 40901)
+++ src/wp-includes/ms-load.php	(working copy)
@@ -16,8 +16,9 @@
  * @return bool True if subdomain configuration is enabled, false otherwise.
  */
 function is_subdomain_install() {
-	if ( defined('SUBDOMAIN_INSTALL') )
+	if ( defined( 'SUBDOMAIN_INSTALL' ) ) {
 		return SUBDOMAIN_INSTALL;
+	}
 
 	return ( defined( 'VHOST' ) && VHOST == 'yes' );
 }
@@ -35,8 +36,9 @@
  */
 function wp_get_active_network_plugins() {
 	$active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
-	if ( empty( $active_plugins ) )
+	if ( empty( $active_plugins ) ) {
 		return array();
+	}
 
 	$plugins = array();
 	$active_plugins = array_keys( $active_plugins );
@@ -46,8 +48,9 @@
 		if ( ! validate_file( $plugin ) // $plugin must validate as file
 			&& '.php' == substr( $plugin, -4 ) // $plugin must end with '.php'
 			&& file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist
-			)
-		$plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
+			) {
+			$plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
+		}
 	}
 	return $plugins;
 }
@@ -77,20 +80,24 @@
 	 * @param bool null Whether to skip the blog status check. Default null.
 	*/
 	$check = apply_filters( 'ms_site_check', null );
-	if ( null !== $check )
+	if ( null !== $check ) {
 		return true;
+	}
 
 	// Allow super admins to see blocked sites
-	if ( is_super_admin() )
+	if ( is_super_admin() ) {
 		return true;
+	}
 
 	$blog = get_site();
 
 	if ( '1' == $blog->deleted ) {
-		if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) )
+		if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) {
 			return WP_CONTENT_DIR . '/blog-deleted.php';
-		else
-			wp_die( __( 'This site is no longer available.' ), '', array( 'response' => 410 ) );
+		} else { wp_die( __( 'This site is no longer available.' ), '', array(
+				'response' => 410,
+		) );
+		}
 	}
 
 	if ( '2' == $blog->deleted ) {
@@ -108,10 +115,12 @@
 	}
 
 	if ( $blog->archived == '1' || $blog->spam == '1' ) {
-		if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) )
+		if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) {
 			return WP_CONTENT_DIR . '/blog-suspended.php';
-		else
-			wp_die( __( 'This site has been archived or suspended.' ), '', array( 'response' => 410 ) );
+		} else { wp_die( __( 'This site has been archived or suspended.' ), '', array(
+			'response' => 410,
+		) );
+		}
 	}
 
 	return true;
@@ -135,7 +144,7 @@
 
 /**
  * Retrieves the closest matching site object by its domain and path.
- * 
+ *
  * This will not necessarily return an exact match for a domain and path. Instead, it
  * breaks the domain and path into pieces that are then used to match the closest
  * possibility from a query.
@@ -305,7 +314,6 @@
 			// Otherwise, use the first path segment (as usual).
 			$current_blog = get_site_by_path( $domain, $path, 1 );
 		}
-
 	} elseif ( ! $subdomain ) {
 		/*
 		 * A "subdomain" install can be re-interpreted to mean "can support any domain".
@@ -358,7 +366,7 @@
 			// If you don't have a site with the same domain/path as a network, you're pretty screwed, but:
 			$current_site = WP_Network::get_by_path( $domain, $path, 1 );
 		}
-	}
+	}// End if().
 
 	// The network declared by the site trumps any constants.
 	if ( $current_blog && $current_blog->site_id != $current_site->id ) {
@@ -420,7 +428,7 @@
 		}
 
 		return $destination;
-	}
+	}// End if().
 
 	// Figure out the current network's main site.
 	if ( empty( $current_site->blog_id ) ) {
@@ -428,7 +436,7 @@
 			$current_site->blog_id = $current_blog->blog_id;
 		} elseif ( ! $current_site->blog_id = wp_cache_get( 'network:' . $current_site->id . ':main_site', 'site-options' ) ) {
 			$current_site->blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s",
-				$current_site->domain, $current_site->path ) );
+			$current_site->domain, $current_site->path ) );
 			wp_cache_add( 'network:' . $current_site->id . ':main_site', $current_site->blog_id, 'site-options' );
 		}
 	}
@@ -464,7 +472,7 @@
 	$msg  = '<h1>' . $title . '</h1>';
 	$msg .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';
 	$msg .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>';
-	$query = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->site ) );
+	$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) );
 	if ( ! $wpdb->get_var( $query ) ) {
 		$msg .= '<p>' . sprintf(
 			/* translators: %s: table name */
@@ -486,14 +494,17 @@
 		__( 'https://codex.wordpress.org/Debugging_a_WordPress_Network' )
 	);
 	$msg .= ' ' . __( 'If you&#8217;re still stuck with this message, then check that your database contains the following tables:' ) . '</p><ul>';
-	foreach ( $wpdb->tables('global') as $t => $table ) {
-		if ( 'sitecategories' == $t )
+	foreach ( $wpdb->tables( 'global' ) as $t => $table ) {
+		if ( 'sitecategories' == $t ) {
 			continue;
+		}
 		$msg .= '<li>' . $table . '</li>';
 	}
 	$msg .= '</ul>';
 
-	wp_die( $msg, $title, array( 'response' => 500 ) );
+	wp_die( $msg, $title, array(
+		'response' => 500,
+	) );
 }
 
 /**
Index: src/wp-includes/ms-settings.php
===================================================================
--- src/wp-includes/ms-settings.php	(revision 40901)
+++ src/wp-includes/ms-settings.php	(working copy)
@@ -43,7 +43,7 @@
 
 // This block will process a request if the current network or current site objects
 // have not been populated in the global scope through something like `sunrise.php`.
-if ( !isset( $current_site ) || !isset( $current_blog ) ) {
+if ( ! isset( $current_site ) || ! isset( $current_blog ) ) {
 
 	$domain = strtolower( stripslashes( $_SERVER['HTTP_HOST'] ) );
 	if ( substr( $domain, -3 ) == ':80' ) {
@@ -83,7 +83,7 @@
 
 	$site_id = $current_blog->site_id;
 	wp_load_core_site_options( $site_id );
-}
+}// End if().
 
 $wpdb->set_prefix( $table_prefix, false ); // $table_prefix can be set in sunrise.php
 $wpdb->set_blog_id( $current_blog->blog_id, $current_blog->site_id );
Index: src/wp-includes/nav-menu-template.php
===================================================================
--- src/wp-includes/nav-menu-template.php	(revision 40901)
+++ src/wp-includes/nav-menu-template.php	(working copy)
@@ -48,9 +48,25 @@
 function wp_nav_menu( $args = array() ) {
 	static $menu_id_slugs = array();
 
-	$defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '',
-	'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'item_spacing' => 'preserve',
-	'depth' => 0, 'walker' => '', 'theme_location' => '' );
+	$defaults = array(
+	'menu' => '',
+	'container' => 'div',
+	'container_class' => '',
+	'container_id' => '',
+	'menu_class' => 'menu',
+	'menu_id' => '',
+	'echo' => true,
+	'fallback_cb' => 'wp_page_menu',
+	'before' => '',
+	'after' => '',
+	'link_before' => '',
+	'link_after' => '',
+	'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
+	'item_spacing' => 'preserve',
+	'depth' => 0,
+	'walker' => '',
+	'theme_location' => '',
+	);
 
 	$args = wp_parse_args( $args, $defaults );
 
@@ -100,14 +116,17 @@
 	$menu = wp_get_nav_menu_object( $args->menu );
 
 	// Get the nav menu based on the theme_location
-	if ( ! $menu && $args->theme_location && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) )
+	if ( ! $menu && $args->theme_location && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) ) {
 		$menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] );
+	}
 
 	// get the first menu that has items if we still can't find a menu
-	if ( ! $menu && !$args->theme_location ) {
+	if ( ! $menu && ! $args->theme_location ) {
 		$menus = wp_get_nav_menus();
 		foreach ( $menus as $menu_maybe ) {
-			if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) {
+			if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array(
+				'update_post_term_cache' => false,
+			) ) ) {
 				$menu = $menu_maybe;
 				break;
 			}
@@ -119,8 +138,11 @@
 	}
 
 	// If the menu exists, get its items.
-	if ( $menu && ! is_wp_error($menu) && !isset($menu_items) )
-		$menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) );
+	if ( $menu && ! is_wp_error( $menu ) && ! isset( $menu_items ) ) {
+		$menu_items = wp_get_nav_menu_items( $menu->term_id, array(
+			'update_post_term_cache' => false,
+		) );
+	}
 
 	/*
 	 * If no menu was found:
@@ -130,12 +152,14 @@
 	 *  - Fall back, but only if no theme location was specified.
 	 *  - Otherwise, bail.
 	 */
-	if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) )
-		&& isset( $args->fallback_cb ) && $args->fallback_cb && is_callable( $args->fallback_cb ) )
+	if ( ( ! $menu || is_wp_error( $menu ) || ( isset( $menu_items ) && empty( $menu_items ) && ! $args->theme_location ) )
+		&& isset( $args->fallback_cb ) && $args->fallback_cb && is_callable( $args->fallback_cb ) ) {
 			return call_user_func( $args->fallback_cb, (array) $args );
+	}
 
-	if ( ! $menu || is_wp_error( $menu ) )
+	if ( ! $menu || is_wp_error( $menu ) ) {
 		return false;
+	}
 
 	$nav_menu = $items = '';
 
@@ -152,9 +176,9 @@
 		$allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) );
 		if ( is_string( $args->container ) && in_array( $args->container, $allowed_tags ) ) {
 			$show_container = true;
-			$class = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-'. $menu->slug .'-container"';
+			$class = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-' . $menu->slug . '-container"';
 			$id = $args->container_id ? ' id="' . esc_attr( $args->container_id ) . '"' : '';
-			$nav_menu .= '<'. $args->container . $id . $class . '>';
+			$nav_menu .= '<' . $args->container . $id . $class . '>';
 		}
 	}
 
@@ -164,15 +188,17 @@
 	$sorted_menu_items = $menu_items_with_children = array();
 	foreach ( (array) $menu_items as $menu_item ) {
 		$sorted_menu_items[ $menu_item->menu_order ] = $menu_item;
-		if ( $menu_item->menu_item_parent )
+		if ( $menu_item->menu_item_parent ) {
 			$menu_items_with_children[ $menu_item->menu_item_parent ] = true;
+		}
 	}
 
 	// Add the menu-item-has-children class where applicable
 	if ( $menu_items_with_children ) {
 		foreach ( $sorted_menu_items as &$menu_item ) {
-			if ( isset( $menu_items_with_children[ $menu_item->ID ] ) )
+			if ( isset( $menu_items_with_children[ $menu_item->ID ] ) ) {
 				$menu_item->classes[] = 'menu-item-has-children';
+			}
 		}
 	}
 
@@ -189,7 +215,7 @@
 	$sorted_menu_items = apply_filters( 'wp_nav_menu_objects', $sorted_menu_items, $args );
 
 	$items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );
-	unset($sorted_menu_items);
+	unset( $sorted_menu_items );
 
 	// Attributes
 	if ( ! empty( $args->menu_id ) ) {
@@ -197,10 +223,10 @@
 	} else {
 		$wrap_id = 'menu-' . $menu->slug;
 		while ( in_array( $wrap_id, $menu_id_slugs ) ) {
-			if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) )
-				$wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id );
-			else
-				$wrap_id = $wrap_id . '-1';
+			if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) ) {
+				$wrap_id = preg_replace( '#-(\d+)$#', '-' . ++$matches[1], $wrap_id );
+			} else { $wrap_id = $wrap_id . '-1';
+			}
 		}
 	}
 	$menu_id_slugs[] = $wrap_id;
@@ -231,14 +257,16 @@
 	$items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args );
 
 	// Don't print any markup if there are no items at this point.
-	if ( empty( $items ) )
+	if ( empty( $items ) ) {
 		return false;
+	}
 
 	$nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items );
 	unset( $items );
 
-	if ( $show_container )
+	if ( $show_container ) {
 		$nav_menu .= '</' . $args->container . '>';
+	}
 
 	/**
 	 * Filters the HTML content for navigation menus.
@@ -252,10 +280,10 @@
 	 */
 	$nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args );
 
-	if ( $args->echo )
+	if ( $args->echo ) {
 		echo $nav_menu;
-	else
-		return $nav_menu;
+	} else { return $nav_menu;
+	}
 }
 
 /**
@@ -287,13 +315,16 @@
 		foreach ( (array) get_object_taxonomies( $queried_object->post_type ) as $taxonomy ) {
 			if ( is_taxonomy_hierarchical( $taxonomy ) ) {
 				$term_hierarchy = _get_term_hierarchy( $taxonomy );
-				$terms = wp_get_object_terms( $queried_object_id, $taxonomy, array( 'fields' => 'ids' ) );
+				$terms = wp_get_object_terms( $queried_object_id, $taxonomy, array(
+					'fields' => 'ids',
+				) );
 				if ( is_array( $terms ) ) {
 					$possible_object_parents = array_merge( $possible_object_parents, $terms );
 					$term_to_ancestor = array();
 					foreach ( (array) $term_hierarchy as $anc => $descs ) {
-						foreach ( (array) $descs as $desc )
+						foreach ( (array) $descs as $desc ) {
 							$term_to_ancestor[ $desc ] = $anc;
+						}
 					}
 
 					foreach ( $terms as $desc ) {
@@ -315,8 +346,9 @@
 		$term_hierarchy = _get_term_hierarchy( $queried_object->taxonomy );
 		$term_to_ancestor = array();
 		foreach ( (array) $term_hierarchy as $anc => $descs ) {
-			foreach ( (array) $descs as $desc )
+			foreach ( (array) $descs as $desc ) {
 				$term_to_ancestor[ $desc ] = $anc;
+			}
 		}
 		$desc = $queried_object->term_id;
 		do {
@@ -329,7 +361,7 @@
 				$desc = 0;
 			}
 		} while ( ! empty( $desc ) );
-	}
+	}// End if().
 
 	$possible_object_parents = array_filter( $possible_object_parents );
 
@@ -338,7 +370,7 @@
 
 	foreach ( (array) $menu_items as $key => $menu_item ) {
 
-		$menu_items[$key]->current = false;
+		$menu_items[ $key ]->current = false;
 
 		$classes = (array) $menu_item->classes;
 		$classes[] = 'menu-item';
@@ -356,7 +388,7 @@
 			$active_parent_item_ids[] = (int) $menu_item->db_id;
 			$active_object = $queried_object->post_type;
 
-		// if the menu item corresponds to the currently-queried post or taxonomy object
+			// if the menu item corresponds to the currently-queried post or taxonomy object
 		} elseif (
 			$menu_item->object_id == $queried_object_id &&
 			(
@@ -366,10 +398,10 @@
 			)
 		) {
 			$classes[] = 'current-menu-item';
-			$menu_items[$key]->current = true;
+			$menu_items[ $key ]->current = true;
 			$_anc_id = (int) $menu_item->db_id;
 
-			while(
+			while (
 				( $_anc_id = get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) ) &&
 				! in_array( $_anc_id, $active_ancestor_item_ids )
 			) {
@@ -387,14 +419,14 @@
 			$active_parent_object_ids[] = (int) $menu_item->post_parent;
 			$active_object = $menu_item->object;
 
-		// if the menu item corresponds to the currently-queried post type archive
+			// if the menu item corresponds to the currently-queried post type archive
 		} elseif (
 			'post_type_archive' == $menu_item->type &&
 			is_post_type_archive( array( $menu_item->object ) )
 		) {
 			$classes[] = 'current-menu-item';
-			$menu_items[$key]->current = true;
-		// if the menu item corresponds to the currently-requested URL
+			$menu_items[ $key ]->current = true;
+			// if the menu item corresponds to the currently-requested URL
 		} elseif ( 'custom' == $menu_item->object && isset( $_SERVER['HTTP_HOST'] ) ) {
 			$_root_relative_current = untrailingslashit( $_SERVER['REQUEST_URI'] );
 
@@ -409,10 +441,10 @@
 
 			if ( $raw_item_url && in_array( $item_url, array( $current_url, $_indexless_current, $_root_relative_current ) ) ) {
 				$classes[] = 'current-menu-item';
-				$menu_items[$key]->current = true;
+				$menu_items[ $key ]->current = true;
 				$_anc_id = (int) $menu_item->db_id;
 
-				while(
+				while (
 					( $_anc_id = get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) ) &&
 					! in_array( $_anc_id, $active_ancestor_item_ids )
 				) {
@@ -427,21 +459,23 @@
 				$active_parent_object_ids[] = (int) $menu_item->post_parent;
 				$active_object = $menu_item->object;
 
-			// give front page item current-menu-item class when extra query arguments involved
+				// give front page item current-menu-item class when extra query arguments involved
 			} elseif ( $item_url == $front_page_url && is_front_page() ) {
 				$classes[] = 'current-menu-item';
 			}
 
-			if ( untrailingslashit($item_url) == home_url() )
+			if ( untrailingslashit( $item_url ) == home_url() ) {
 				$classes[] = 'menu-item-home';
-		}
+			}
+		}// End if().
 
 		// back-compat with wp_page_menu: add "current_page_parent" to static home page link for any non-page query
-		if ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && empty( $wp_query->is_page ) && $home_page_id == $menu_item->object_id )
+		if ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && empty( $wp_query->is_page ) && $home_page_id == $menu_item->object_id ) {
 			$classes[] = 'current_page_parent';
+		}
 
-		$menu_items[$key]->classes = array_unique( $classes );
-	}
+		$menu_items[ $key ]->classes = array_unique( $classes );
+	}// End foreach().
 	$active_ancestor_item_ids = array_filter( array_unique( $active_ancestor_item_ids ) );
 	$active_parent_item_ids = array_filter( array_unique( $active_parent_item_ids ) );
 	$active_parent_object_ids = array_filter( array_unique( $active_parent_object_ids ) );
@@ -449,8 +483,8 @@
 	// set parent's class
 	foreach ( (array) $menu_items as $key => $parent_item ) {
 		$classes = (array) $parent_item->classes;
-		$menu_items[$key]->current_item_ancestor = false;
-		$menu_items[$key]->current_item_parent = false;
+		$menu_items[ $key ]->current_item_ancestor = false;
+		$menu_items[ $key ]->current_item_parent = false;
 
 		if (
 			isset( $parent_item->type ) &&
@@ -479,27 +513,30 @@
 			$classes[] = empty( $queried_object->taxonomy ) ? 'current-' . $queried_object->post_type . '-ancestor' : 'current-' . $queried_object->taxonomy . '-ancestor';
 		}
 
-		if ( in_array(  intval( $parent_item->db_id ), $active_ancestor_item_ids ) ) {
+		if ( in_array( intval( $parent_item->db_id ), $active_ancestor_item_ids ) ) {
 			$classes[] = 'current-menu-ancestor';
-			$menu_items[$key]->current_item_ancestor = true;
+			$menu_items[ $key ]->current_item_ancestor = true;
 		}
 		if ( in_array( $parent_item->db_id, $active_parent_item_ids ) ) {
 			$classes[] = 'current-menu-parent';
-			$menu_items[$key]->current_item_parent = true;
+			$menu_items[ $key ]->current_item_parent = true;
 		}
-		if ( in_array( $parent_item->object_id, $active_parent_object_ids ) )
+		if ( in_array( $parent_item->object_id, $active_parent_object_ids ) ) {
 			$classes[] = 'current-' . $active_object . '-parent';
+		}
 
 		if ( 'post_type' == $parent_item->type && 'page' == $parent_item->object ) {
 			// Back compat classes for pages to match wp_page_menu()
-			if ( in_array('current-menu-parent', $classes) )
+			if ( in_array( 'current-menu-parent', $classes ) ) {
 				$classes[] = 'current_page_parent';
-			if ( in_array('current-menu-ancestor', $classes) )
+			}
+			if ( in_array( 'current-menu-ancestor', $classes ) ) {
 				$classes[] = 'current_page_ancestor';
+			}
 		}
 
-		$menu_items[$key]->classes = array_unique( $classes );
-	}
+		$menu_items[ $key ]->classes = array_unique( $classes );
+	}// End foreach().
 }
 
 /**
@@ -514,7 +551,7 @@
  * @return string The HTML list content for the menu items.
  */
 function walk_nav_menu_tree( $items, $depth, $r ) {
-	$walker = ( empty($r->walker) ) ? new Walker_Nav_Menu : $r->walker;
+	$walker = ( empty( $r->walker ) ) ? new Walker_Nav_Menu : $r->walker;
 	$args = array( $items, $depth, $r );
 
 	return call_user_func_array( array( $walker, 'walk' ), $args );
Index: src/wp-includes/nav-menu.php
===================================================================
--- src/wp-includes/nav-menu.php	(revision 40901)
+++ src/wp-includes/nav-menu.php	(working copy)
@@ -60,8 +60,9 @@
  * @return bool Whether the menu exists.
  */
 function is_nav_menu( $menu ) {
-	if ( ! $menu )
+	if ( ! $menu ) {
 		return false;
+	}
 
 	$menu_obj = wp_get_nav_menu_object( $menu );
 
@@ -70,8 +71,9 @@
 		! is_wp_error( $menu_obj ) &&
 		! empty( $menu_obj->taxonomy ) &&
 		'nav_menu' == $menu_obj->taxonomy
-	)
+	) {
 		return true;
+	}
 
 	return false;
 }
@@ -105,8 +107,8 @@
 function unregister_nav_menu( $location ) {
 	global $_wp_registered_nav_menus;
 
-	if ( is_array( $_wp_registered_nav_menus ) && isset( $_wp_registered_nav_menus[$location] ) ) {
-		unset( $_wp_registered_nav_menus[$location] );
+	if ( is_array( $_wp_registered_nav_menus ) && isset( $_wp_registered_nav_menus[ $location ] ) ) {
+		unset( $_wp_registered_nav_menus[ $location ] );
 		if ( empty( $_wp_registered_nav_menus ) ) {
 			_remove_theme_support( 'menus' );
 		}
@@ -124,7 +126,9 @@
  * @param string $description Menu location descriptive text.
  */
 function register_nav_menu( $location, $description ) {
-	register_nav_menus( array( $location => $description ) );
+	register_nav_menus( array(
+		$location => $description,
+	) );
 }
 /**
  * Retrieves all registered navigation menu locations in a theme.
@@ -137,8 +141,9 @@
  */
 function get_registered_nav_menus() {
 	global $_wp_registered_nav_menus;
-	if ( isset( $_wp_registered_nav_menus ) )
+	if ( isset( $_wp_registered_nav_menus ) ) {
 		return $_wp_registered_nav_menus;
+	}
 	return array();
 }
 
@@ -208,7 +213,9 @@
  */
 function wp_create_nav_menu( $menu_name ) {
 	// expected_slashed ($menu_name)
-	return wp_update_nav_menu_object( 0, array( 'menu-name' => $menu_name ) );
+	return wp_update_nav_menu_object( 0, array(
+		'menu-name' => $menu_name,
+	) );
 }
 
 /**
@@ -221,8 +228,9 @@
  */
 function wp_delete_nav_menu( $menu ) {
 	$menu = wp_get_nav_menu_object( $menu );
-	if ( ! $menu )
+	if ( ! $menu ) {
 		return false;
+	}
 
 	$menu_objects = get_objects_in_term( $menu->term_id, 'nav_menu' );
 	if ( ! empty( $menu_objects ) ) {
@@ -236,12 +244,13 @@
 	// Remove this menu from any locations.
 	$locations = get_nav_menu_locations();
 	foreach ( $locations as $location => $menu_id ) {
-		if ( $menu_id == $menu->term_id )
+		if ( $menu_id == $menu->term_id ) {
 			$locations[ $location ] = 0;
+		}
 	}
 	set_theme_mod( 'nav_menu_locations', $locations );
 
-	if ( $result && !is_wp_error($result) )
+	if ( $result && ! is_wp_error( $result ) ) {
 
 		/**
 		 * Fires after a navigation menu has been successfully deleted.
@@ -251,6 +260,7 @@
 		 * @param int $term_id ID of the deleted menu.
 		 */
 		do_action( 'wp_delete_nav_menu', $menu->term_id );
+	}
 
 	return $result;
 }
@@ -274,8 +284,8 @@
 
 	$args = array(
 		'description' => ( isset( $menu_data['description'] ) ? $menu_data['description']  : '' ),
-		'name'        => ( isset( $menu_data['menu-name']   ) ? $menu_data['menu-name']    : '' ),
-		'parent'      => ( isset( $menu_data['parent']      ) ? (int) $menu_data['parent'] : 0  ),
+		'name'        => ( isset( $menu_data['menu-name'] ) ? $menu_data['menu-name']    : '' ),
+		'parent'      => ( isset( $menu_data['parent'] ) ? (int) $menu_data['parent'] : 0  ),
 		'slug'        => null,
 	);
 
@@ -310,8 +320,9 @@
 
 		$_menu = wp_insert_term( $menu_data['menu-name'], 'nav_menu', $args );
 
-		if ( is_wp_error( $_menu ) )
+		if ( is_wp_error( $_menu ) ) {
 			return $_menu;
+		}
 
 		/**
 		 * Fires after a navigation menu is successfully created.
@@ -326,15 +337,17 @@
 		return (int) $_menu['term_id'];
 	}
 
-	if ( ! $_menu || ! isset( $_menu->term_id ) )
+	if ( ! $_menu || ! isset( $_menu->term_id ) ) {
 		return 0;
+	}
 
 	$menu_id = (int) $_menu->term_id;
 
 	$update_response = wp_update_term( $menu_id, 'nav_menu', $args );
 
-	if ( is_wp_error( $update_response ) )
+	if ( is_wp_error( $update_response ) ) {
 		return $update_response;
+	}
 
 	$menu_id = (int) $update_response['term_id'];
 
@@ -368,8 +381,9 @@
 	$menu_item_db_id = (int) $menu_item_db_id;
 
 	// make sure that we don't convert non-nav_menu_item objects into nav_menu_item objects
-	if ( ! empty( $menu_item_db_id ) && ! is_nav_menu_item( $menu_item_db_id ) )
+	if ( ! empty( $menu_item_db_id ) && ! is_nav_menu_item( $menu_item_db_id ) ) {
 		return new WP_Error( 'update_nav_menu_item_failed', __( 'The given object ID is not that of a menu item.' ) );
+	}
 
 	$menu = wp_get_nav_menu_object( $menu_id );
 
@@ -403,7 +417,9 @@
 	if ( 0 == $menu_id ) {
 		$args['menu-item-position'] = 1;
 	} elseif ( 0 == (int) $args['menu-item-position'] ) {
-		$menu_items = 0 == $menu_id ? array() : (array) wp_get_nav_menu_items( $menu_id, array( 'post_status' => 'publish,draft' ) );
+		$menu_items = 0 == $menu_id ? array() : (array) wp_get_nav_menu_items( $menu_id, array(
+			'post_status' => 'publish,draft',
+		) );
 		$last_item = array_pop( $menu_items );
 		$args['menu-item-position'] = ( $last_item && isset( $last_item->menu_order ) ) ? 1 + $last_item->menu_order : count( $menu_items );
 	}
@@ -434,12 +450,14 @@
 			}
 		}
 
-		if ( $args['menu-item-title'] == $original_title )
+		if ( $args['menu-item-title'] == $original_title ) {
 			$args['menu-item-title'] = '';
+		}
 
 		// hack to get wp to create a post object when too many properties are empty
-		if ( '' ==  $args['menu-item-title'] && '' == $args['menu-item-description'] )
+		if ( '' == $args['menu-item-title'] && '' == $args['menu-item-description'] ) {
 			$args['menu-item-description'] = ' ';
+		}
 	}
 
 	// Populate the menu item object
@@ -460,8 +478,9 @@
 		$post['ID'] = 0;
 		$post['post_status'] = 'publish' == $args['menu-item-status'] ? 'publish' : 'draft';
 		$menu_item_db_id = wp_insert_post( $post );
-		if ( ! $menu_item_db_id	|| is_wp_error( $menu_item_db_id ) )
+		if ( ! $menu_item_db_id	|| is_wp_error( $menu_item_db_id ) ) {
 			return $menu_item_db_id;
+		}
 
 		/**
 		 * Fires immediately after a new navigation menu item has been added.
@@ -479,7 +498,7 @@
 
 	// Associate the menu item with the menu term
 	// Only set the menu term if it isn't set to avoid unnecessary wp_get_object_terms()
-	 if ( $menu_id && ( ! $update || ! is_object_in_term( $menu_item_db_id, 'nav_menu', (int) $menu->term_id ) ) ) {
+	if ( $menu_id && ( ! $update || ! is_object_in_term( $menu_item_db_id, 'nav_menu', (int) $menu->term_id ) ) ) {
 		wp_set_object_terms( $menu_item_db_id, array( $menu->term_id ), 'nav_menu' );
 	}
 
@@ -490,22 +509,23 @@
 
 	$menu_item_db_id = (int) $menu_item_db_id;
 
-	update_post_meta( $menu_item_db_id, '_menu_item_type', sanitize_key($args['menu-item-type']) );
+	update_post_meta( $menu_item_db_id, '_menu_item_type', sanitize_key( $args['menu-item-type'] ) );
 	update_post_meta( $menu_item_db_id, '_menu_item_menu_item_parent', strval( (int) $args['menu-item-parent-id'] ) );
 	update_post_meta( $menu_item_db_id, '_menu_item_object_id', strval( (int) $args['menu-item-object-id'] ) );
-	update_post_meta( $menu_item_db_id, '_menu_item_object', sanitize_key($args['menu-item-object']) );
-	update_post_meta( $menu_item_db_id, '_menu_item_target', sanitize_key($args['menu-item-target']) );
+	update_post_meta( $menu_item_db_id, '_menu_item_object', sanitize_key( $args['menu-item-object'] ) );
+	update_post_meta( $menu_item_db_id, '_menu_item_target', sanitize_key( $args['menu-item-target'] ) );
 
 	$args['menu-item-classes'] = array_map( 'sanitize_html_class', explode( ' ', $args['menu-item-classes'] ) );
 	$args['menu-item-xfn'] = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['menu-item-xfn'] ) ) );
 	update_post_meta( $menu_item_db_id, '_menu_item_classes', $args['menu-item-classes'] );
 	update_post_meta( $menu_item_db_id, '_menu_item_xfn', $args['menu-item-xfn'] );
-	update_post_meta( $menu_item_db_id, '_menu_item_url', esc_url_raw($args['menu-item-url']) );
+	update_post_meta( $menu_item_db_id, '_menu_item_url', esc_url_raw( $args['menu-item-url'] ) );
 
-	if ( 0 == $menu_id )
+	if ( 0 == $menu_id ) {
 		update_post_meta( $menu_item_db_id, '_menu_item_orphaned', (string) time() );
-	elseif ( get_post_meta( $menu_item_db_id, '_menu_item_orphaned' ) )
+	} elseif ( get_post_meta( $menu_item_db_id, '_menu_item_orphaned' ) ) {
 		delete_post_meta( $menu_item_db_id, '_menu_item_orphaned' );
+	}
 
 	// Update existing menu item. Default is publish status
 	if ( $update ) {
@@ -542,7 +562,10 @@
  * @return array Menu objects.
  */
 function wp_get_nav_menus( $args = array() ) {
-	$defaults = array( 'hide_empty' => false, 'orderby' => 'name' );
+	$defaults = array(
+		'hide_empty' => false,
+		'orderby' => 'name',
+	);
 	$args = wp_parse_args( $args, $defaults );
 
 	/**
@@ -555,7 +578,7 @@
 	 * @param array $menus An array of menu objects.
 	 * @param array $args  An array of arguments used to retrieve menu objects.
 	 */
-	return apply_filters( 'wp_get_nav_menus', get_terms( 'nav_menu',  $args), $args );
+	return apply_filters( 'wp_get_nav_menus', get_terms( 'nav_menu',  $args ), $args );
 }
 
 /**
@@ -599,8 +622,15 @@
 		return false;
 	}
 
-	$defaults = array( 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item',
-		'post_status' => 'publish', 'output' => ARRAY_A, 'output_key' => 'menu_order', 'nopaging' => true );
+	$defaults = array(
+	'order' => 'ASC',
+	'orderby' => 'menu_order',
+	'post_type' => 'nav_menu_item',
+		'post_status' => 'publish',
+	'output' => ARRAY_A,
+	'output_key' => 'menu_order',
+	'nopaging' => true,
+	);
 	$args = wp_parse_args( $args, $defaults );
 	$args['include'] = $items;
 
@@ -611,8 +641,8 @@
 	}
 
 	// Get all posts and terms at once to prime the caches
-	if ( empty( $fetched[$menu->term_id] ) || wp_using_ext_object_cache() ) {
-		$fetched[$menu->term_id] = true;
+	if ( empty( $fetched[ $menu->term_id ] ) || wp_using_ext_object_cache() ) {
+		$fetched[ $menu->term_id ] = true;
 		$posts = array();
 		$terms = array();
 		foreach ( $items as $item ) {
@@ -620,29 +650,35 @@
 			$object    = get_post_meta( $item->ID, '_menu_item_object',    true );
 			$type      = get_post_meta( $item->ID, '_menu_item_type',      true );
 
-			if ( 'post_type' == $type )
-				$posts[$object][] = $object_id;
-			elseif ( 'taxonomy' == $type)
-				$terms[$object][] = $object_id;
+			if ( 'post_type' == $type ) {
+				$posts[ $object ][] = $object_id;
+			} elseif ( 'taxonomy' == $type ) {
+				$terms[ $object ][] = $object_id;
+			}
 		}
 
 		if ( ! empty( $posts ) ) {
-			foreach ( array_keys($posts) as $post_type ) {
-				get_posts( array('post__in' => $posts[$post_type], 'post_type' => $post_type, 'nopaging' => true, 'update_post_term_cache' => false) );
+			foreach ( array_keys( $posts ) as $post_type ) {
+				get_posts( array(
+					'post__in' => $posts[ $post_type ],
+					'post_type' => $post_type,
+					'nopaging' => true,
+					'update_post_term_cache' => false,
+				) );
 			}
 		}
-		unset($posts);
+		unset( $posts );
 
 		if ( ! empty( $terms ) ) {
-			foreach ( array_keys($terms) as $taxonomy ) {
+			foreach ( array_keys( $terms ) as $taxonomy ) {
 				get_terms( $taxonomy, array(
 					'include' => $terms[ $taxonomy ],
 					'hierarchical' => false,
 				) );
 			}
 		}
-		unset($terms);
-	}
+		unset( $terms );
+	}// End if().
 
 	$items = array_map( 'wp_setup_nav_menu_item', $items );
 
@@ -656,7 +692,7 @@
 		) );
 		$i = 1;
 		foreach ( $items as $k => $item ) {
-			$items[$k]->{$args['output_key']} = $i++;
+			$items[ $k ]->{$args['output_key']} = $i++;
 		}
 	}
 
@@ -735,7 +771,7 @@
 				$menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;
 
 			} elseif ( 'post_type_archive' == $menu_item->type ) {
-				$object =  get_post_type_object( $menu_item->object );
+				$object = get_post_type_object( $menu_item->object );
 				if ( $object ) {
 					$menu_item->title = '' == $menu_item->post_title ? $object->labels->archives : $menu_item->post_title;
 					$post_type_description = $object->description;
@@ -758,18 +794,19 @@
 				}
 
 				$term_url = get_term_link( (int) $menu_item->object_id, $menu_item->object );
-				$menu_item->url = !is_wp_error( $term_url ) ? $term_url : '';
+				$menu_item->url = ! is_wp_error( $term_url ) ? $term_url : '';
 
 				$original_title = get_term_field( 'name', $menu_item->object_id, $menu_item->object, 'raw' );
-				if ( is_wp_error( $original_title ) )
+				if ( is_wp_error( $original_title ) ) {
 					$original_title = false;
+				}
 				$menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;
 
 			} else {
-				$menu_item->type_label = __('Custom Link');
+				$menu_item->type_label = __( 'Custom Link' );
 				$menu_item->title = $menu_item->post_title;
 				$menu_item->url = ! isset( $menu_item->url ) ? get_post_meta( $menu_item->ID, '_menu_item_url', true ) : $menu_item->url;
-			}
+			}// End if().
 
 			$menu_item->target = ! isset( $menu_item->target ) ? get_post_meta( $menu_item->ID, '_menu_item_target', true ) : $menu_item->target;
 
@@ -821,7 +858,7 @@
 			$menu_item->description = apply_filters( 'nav_menu_description', '' );
 			$menu_item->classes = array();
 			$menu_item->xfn = '';
-		}
+		}// End if().
 	} elseif ( isset( $menu_item->taxonomy ) ) {
 		$menu_item->ID = $menu_item->term_id;
 		$menu_item->db_id = 0;
@@ -842,7 +879,7 @@
 		$menu_item->classes = array();
 		$menu_item->xfn = '';
 
-	}
+	}// End if().
 
 	/**
 	 * Filters a navigation menu item object.
@@ -949,16 +986,20 @@
  * @param object $post       The post object being transitioned from one status to another.
  */
 function _wp_auto_add_pages_to_menu( $new_status, $old_status, $post ) {
-	if ( 'publish' != $new_status || 'publish' == $old_status || 'page' != $post->post_type )
+	if ( 'publish' != $new_status || 'publish' == $old_status || 'page' != $post->post_type ) {
 		return;
-	if ( ! empty( $post->post_parent ) )
+	}
+	if ( ! empty( $post->post_parent ) ) {
 		return;
+	}
 	$auto_add = get_option( 'nav_menu_options' );
-	if ( empty( $auto_add ) || ! is_array( $auto_add ) || ! isset( $auto_add['auto_add'] ) )
+	if ( empty( $auto_add ) || ! is_array( $auto_add ) || ! isset( $auto_add['auto_add'] ) ) {
 		return;
+	}
 	$auto_add = $auto_add['auto_add'];
-	if ( empty( $auto_add ) || ! is_array( $auto_add ) )
+	if ( empty( $auto_add ) || ! is_array( $auto_add ) ) {
 		return;
+	}
 
 	$args = array(
 		'menu-item-object-id' => $post->ID,
@@ -968,12 +1009,16 @@
 	);
 
 	foreach ( $auto_add as $menu_id ) {
-		$items = wp_get_nav_menu_items( $menu_id, array( 'post_status' => 'publish,draft' ) );
-		if ( ! is_array( $items ) )
+		$items = wp_get_nav_menu_items( $menu_id, array(
+			'post_status' => 'publish,draft',
+		) );
+		if ( ! is_array( $items ) ) {
 			continue;
+		}
 		foreach ( $items as $item ) {
-			if ( $post->ID == $item->object_id )
+			if ( $post->ID == $item->object_id ) {
 				continue 2;
+			}
 		}
 		wp_update_nav_menu_item( $menu_id, 0, $args );
 	}
Index: src/wp-includes/option.php
===================================================================
--- src/wp-includes/option.php	(revision 40901)
+++ src/wp-includes/option.php	(working copy)
@@ -31,8 +31,9 @@
 	global $wpdb;
 
 	$option = trim( $option );
-	if ( empty( $option ) )
+	if ( empty( $option ) ) {
 		return false;
+	}
 
 	/**
 	 * Filters the value of an existing option before it is retrieved.
@@ -50,11 +51,13 @@
 	 * @param string     $option     Option name.
 	 */
 	$pre = apply_filters( "pre_option_{$option}", false, $option );
-	if ( false !== $pre )
+	if ( false !== $pre ) {
 		return $pre;
+	}
 
-	if ( defined( 'WP_SETUP_CONFIG' ) )
+	if ( defined( 'WP_SETUP_CONFIG' ) ) {
 		return false;
+	}
 
 	// Distinguish between `false` as a default, and not passing one.
 	$passed_default = func_num_args() > 1;
@@ -82,8 +85,8 @@
 
 		$alloptions = wp_load_alloptions();
 
-		if ( isset( $alloptions[$option] ) ) {
-			$value = $alloptions[$option];
+		if ( isset( $alloptions[ $option ] ) ) {
+			$value = $alloptions[ $option ];
 		} else {
 			$value = wp_cache_get( $option, 'options' );
 
@@ -98,7 +101,7 @@
 					if ( ! is_array( $notoptions ) ) {
 						 $notoptions = array();
 					}
-					$notoptions[$option] = true;
+					$notoptions[ $option ] = true;
 					wp_cache_set( 'notoptions', $notoptions, 'options' );
 
 					/** This filter is documented in wp-includes/option.php */
@@ -116,14 +119,16 @@
 			/** This filter is documented in wp-includes/option.php */
 			return apply_filters( "default_option_{$option}", $default, $option, $passed_default );
 		}
-	}
+	}// End if().
 
 	// If home is not set use siteurl.
-	if ( 'home' == $option && '' == $value )
+	if ( 'home' == $option && '' == $value ) {
 		return get_option( 'siteurl' );
+	}
 
-	if ( in_array( $option, array('siteurl', 'home', 'category_base', 'tag_base') ) )
+	if ( in_array( $option, array( 'siteurl', 'home', 'category_base', 'tag_base' ) ) ) {
 		$value = untrailingslashit( $value );
+	}
 
 	/**
 	 * Filters the value of an existing option.
@@ -152,8 +157,9 @@
  * @param string $option Option name.
  */
 function wp_protect_special_option( $option ) {
-	if ( 'alloptions' === $option || 'notoptions' === $option )
+	if ( 'alloptions' === $option || 'notoptions' === $option ) {
 		wp_die( sprintf( __( '%s is a protected WP option and may not be modified' ), esc_html( $option ) ) );
+	}
 }
 
 /**
@@ -179,22 +185,24 @@
 function wp_load_alloptions() {
 	global $wpdb;
 
-	if ( ! wp_installing() || ! is_multisite() )
+	if ( ! wp_installing() || ! is_multisite() ) {
 		$alloptions = wp_cache_get( 'alloptions', 'options' );
-	else
-		$alloptions = false;
+	} else { $alloptions = false;
+	}
 
-	if ( !$alloptions ) {
+	if ( ! $alloptions ) {
 		$suppress = $wpdb->suppress_errors();
-		if ( !$alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) )
+		if ( ! $alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) ) {
 			$alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
-		$wpdb->suppress_errors($suppress);
+		}
+		$wpdb->suppress_errors( $suppress );
 		$alloptions = array();
 		foreach ( (array) $alloptions_db as $o ) {
-			$alloptions[$o->option_name] = $o->option_value;
+			$alloptions[ $o->option_name ] = $o->option_value;
 		}
-		if ( ! wp_installing() || ! is_multisite() )
+		if ( ! wp_installing() || ! is_multisite() ) {
 			wp_cache_add( 'alloptions', $alloptions, 'options' );
+		}
 	}
 
 	return $alloptions;
@@ -212,16 +220,18 @@
 function wp_load_core_site_options( $site_id = null ) {
 	global $wpdb;
 
-	if ( ! is_multisite() || wp_using_ext_object_cache() || wp_installing() )
+	if ( ! is_multisite() || wp_using_ext_object_cache() || wp_installing() ) {
 		return;
+	}
 
-	if ( empty($site_id) )
+	if ( empty( $site_id ) ) {
 		$site_id = $wpdb->siteid;
+	}
 
-	$core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'can_compress_scripts', 'global_terms_enabled', 'ms_files_rewriting' );
+	$core_options = array( 'site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'can_compress_scripts', 'global_terms_enabled', 'ms_files_rewriting' );
 
-	$core_options_in = "'" . implode("', '", $core_options) . "'";
-	$options = $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $site_id) );
+	$core_options_in = "'" . implode( "', '", $core_options ) . "'";
+	$options = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $site_id ) );
 
 	foreach ( $options as $option ) {
 		$key = $option->meta_key;
@@ -258,14 +268,16 @@
 function update_option( $option, $value, $autoload = null ) {
 	global $wpdb;
 
-	$option = trim($option);
-	if ( empty($option) )
+	$option = trim( $option );
+	if ( empty( $option ) ) {
 		return false;
+	}
 
 	wp_protect_special_option( $option );
 
-	if ( is_object( $value ) )
+	if ( is_object( $value ) ) {
 		$value = clone $value;
+	}
 
 	$value = sanitize_option( $option, $value );
 	$old_value = get_option( $option );
@@ -339,19 +351,22 @@
 		$update_args['autoload'] = ( 'no' === $autoload || false === $autoload ) ? 'no' : 'yes';
 	}
 
-	$result = $wpdb->update( $wpdb->options, $update_args, array( 'option_name' => $option ) );
-	if ( ! $result )
+	$result = $wpdb->update( $wpdb->options, $update_args, array(
+		'option_name' => $option,
+	) );
+	if ( ! $result ) {
 		return false;
+	}
 
 	$notoptions = wp_cache_get( 'notoptions', 'options' );
-	if ( is_array( $notoptions ) && isset( $notoptions[$option] ) ) {
-		unset( $notoptions[$option] );
+	if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) {
+		unset( $notoptions[ $option ] );
 		wp_cache_set( 'notoptions', $notoptions, 'options' );
 	}
 
 	if ( ! wp_installing() ) {
 		$alloptions = wp_load_alloptions();
-		if ( isset( $alloptions[$option] ) ) {
+		if ( isset( $alloptions[ $option ] ) ) {
 			$alloptions[ $option ] = $serialized_value;
 			wp_cache_set( 'alloptions', $alloptions, 'options' );
 		} else {
@@ -412,26 +427,31 @@
 function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) {
 	global $wpdb;
 
-	if ( !empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '2.3.0' );
+	}
 
-	$option = trim($option);
-	if ( empty($option) )
+	$option = trim( $option );
+	if ( empty( $option ) ) {
 		return false;
+	}
 
 	wp_protect_special_option( $option );
 
-	if ( is_object($value) )
+	if ( is_object( $value ) ) {
 		$value = clone $value;
+	}
 
 	$value = sanitize_option( $option, $value );
 
 	// Make sure the option doesn't already exist. We can check the 'notoptions' cache before we ask for a db query
 	$notoptions = wp_cache_get( 'notoptions', 'options' );
-	if ( !is_array( $notoptions ) || !isset( $notoptions[$option] ) )
+	if ( ! is_array( $notoptions ) || ! isset( $notoptions[ $option ] ) ) {
 		/** This filter is documented in wp-includes/option.php */
-		if ( apply_filters( "default_option_{$option}", false, $option, false ) !== get_option( $option ) )
+		if ( apply_filters( "default_option_{$option}", false, $option, false ) !== get_option( $option ) ) {
 			return false;
+		}
+	}
 
 	$serialized_value = maybe_serialize( $value );
 	$autoload = ( 'no' === $autoload || false === $autoload ) ? 'no' : 'yes';
@@ -447,8 +467,9 @@
 	do_action( 'add_option', $option, $value );
 
 	$result = $wpdb->query( $wpdb->prepare( "INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, %s) ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)", $option, $serialized_value, $autoload ) );
-	if ( ! $result )
+	if ( ! $result ) {
 		return false;
+	}
 
 	if ( ! wp_installing() ) {
 		if ( 'yes' == $autoload ) {
@@ -462,8 +483,8 @@
 
 	// This option exists now
 	$notoptions = wp_cache_get( 'notoptions', 'options' ); // yes, again... we need it to be fresh
-	if ( is_array( $notoptions ) && isset( $notoptions[$option] ) ) {
-		unset( $notoptions[$option] );
+	if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) {
+		unset( $notoptions[ $option ] );
 		wp_cache_set( 'notoptions', $notoptions, 'options' );
 	}
 
@@ -506,15 +527,17 @@
 	global $wpdb;
 
 	$option = trim( $option );
-	if ( empty( $option ) )
+	if ( empty( $option ) ) {
 		return false;
+	}
 
 	wp_protect_special_option( $option );
 
 	// Get the ID, if no ID then return
 	$row = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s", $option ) );
-	if ( is_null( $row ) )
+	if ( is_null( $row ) ) {
 		return false;
+	}
 
 	/**
 	 * Fires immediately before an option is deleted.
@@ -525,12 +548,14 @@
 	 */
 	do_action( 'delete_option', $option );
 
-	$result = $wpdb->delete( $wpdb->options, array( 'option_name' => $option ) );
+	$result = $wpdb->delete( $wpdb->options, array(
+		'option_name' => $option,
+	) );
 	if ( ! wp_installing() ) {
 		if ( 'yes' == $row->autoload ) {
 			$alloptions = wp_load_alloptions();
-			if ( is_array( $alloptions ) && isset( $alloptions[$option] ) ) {
-				unset( $alloptions[$option] );
+			if ( is_array( $alloptions ) && isset( $alloptions[ $option ] ) ) {
+				unset( $alloptions[ $option ] );
 				wp_cache_set( 'alloptions', $alloptions, 'options' );
 			}
 		} else {
@@ -590,8 +615,9 @@
 		$option_timeout = '_transient_timeout_' . $transient;
 		$option = '_transient_' . $transient;
 		$result = delete_option( $option );
-		if ( $result )
+		if ( $result ) {
 			delete_option( $option_timeout );
+		}
 	}
 
 	if ( $result ) {
@@ -639,8 +665,9 @@
 	 * @param string $transient     Transient name.
 	 */
 	$pre = apply_filters( "pre_transient_{$transient}", false, $transient );
-	if ( false !== $pre )
+	if ( false !== $pre ) {
 		return $pre;
+	}
 
 	if ( wp_using_ext_object_cache() ) {
 		$value = wp_cache_get( $transient, 'transient' );
@@ -649,19 +676,20 @@
 		if ( ! wp_installing() ) {
 			// If option is not in alloptions, it is not autoloaded and thus has a timeout
 			$alloptions = wp_load_alloptions();
-			if ( !isset( $alloptions[$transient_option] ) ) {
+			if ( ! isset( $alloptions[ $transient_option ] ) ) {
 				$transient_timeout = '_transient_timeout_' . $transient;
 				$timeout = get_option( $transient_timeout );
 				if ( false !== $timeout && $timeout < time() ) {
-					delete_option( $transient_option  );
+					delete_option( $transient_option );
 					delete_option( $transient_timeout );
 					$value = false;
 				}
 			}
 		}
 
-		if ( ! isset( $value ) )
+		if ( ! isset( $value ) ) {
 			$value = get_option( $transient_option );
+		}
 	}
 
 	/**
@@ -814,15 +842,16 @@
 
 	$settings = (string) get_user_option( 'user-settings', $user_id );
 
-	if ( isset( $_COOKIE['wp-settings-' . $user_id] ) ) {
-		$cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['wp-settings-' . $user_id] );
+	if ( isset( $_COOKIE[ 'wp-settings-' . $user_id ] ) ) {
+		$cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] );
 
 		// No change or both empty
-		if ( $cookie == $settings )
+		if ( $cookie == $settings ) {
 			return;
+		}
 
 		$last_saved = (int) get_user_option( 'user-settings-time', $user_id );
-		$current = isset( $_COOKIE['wp-settings-time-' . $user_id]) ? preg_replace( '/[^0-9]/', '', $_COOKIE['wp-settings-time-' . $user_id] ) : 0;
+		$current = isset( $_COOKIE[ 'wp-settings-time-' . $user_id ] ) ? preg_replace( '/[^0-9]/', '', $_COOKIE[ 'wp-settings-time-' . $user_id ] ) : 0;
 
 		// The cookie is newer than the saved value. Update the user_option and leave the cookie as-is
 		if ( $current > $last_saved ) {
@@ -836,7 +865,7 @@
 	$secure = ( 'https' === parse_url( admin_url(), PHP_URL_SCHEME ) );
 	setcookie( 'wp-settings-' . $user_id, $settings, time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure );
 	setcookie( 'wp-settings-time-' . $user_id, time(), time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure );
-	$_COOKIE['wp-settings-' . $user_id] = $settings;
+	$_COOKIE[ 'wp-settings-' . $user_id ] = $settings;
 }
 
 /**
@@ -851,7 +880,7 @@
 function get_user_setting( $name, $default = false ) {
 	$all_user_settings = get_all_user_settings();
 
-	return isset( $all_user_settings[$name] ) ? $all_user_settings[$name] : $default;
+	return isset( $all_user_settings[ $name ] ) ? $all_user_settings[ $name ] : $default;
 }
 
 /**
@@ -873,7 +902,7 @@
 	}
 
 	$all_user_settings = get_all_user_settings();
-	$all_user_settings[$name] = $value;
+	$all_user_settings[ $name ] = $value;
 
 	return wp_set_all_user_settings( $all_user_settings );
 }
@@ -900,8 +929,8 @@
 	$deleted = false;
 
 	foreach ( $names as $name ) {
-		if ( isset( $all_user_settings[$name] ) ) {
-			unset( $all_user_settings[$name] );
+		if ( isset( $all_user_settings[ $name ] ) ) {
+			unset( $all_user_settings[ $name ] );
 			$deleted = true;
 		}
 	}
@@ -935,8 +964,8 @@
 
 	$user_settings = array();
 
-	if ( isset( $_COOKIE['wp-settings-' . $user_id] ) ) {
-		$cookie = preg_replace( '/[^A-Za-z0-9=&_-]/', '', $_COOKIE['wp-settings-' . $user_id] );
+	if ( isset( $_COOKIE[ 'wp-settings-' . $user_id ] ) ) {
+		$cookie = preg_replace( '/[^A-Za-z0-9=&_-]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] );
 
 		if ( strpos( $cookie, '=' ) ) { // '=' cannot be 1st char
 			parse_str( $cookie, $user_settings );
@@ -1262,7 +1291,7 @@
 		$value = sanitize_option( $option, $value );
 
 		$serialized_value = maybe_serialize( $value );
-		$result = $wpdb->insert( $wpdb->sitemeta, array( 'site_id'    => $network_id, 'meta_key'   => $option, 'meta_value' => $serialized_value ) );
+		$result = $wpdb->insert( $wpdb->sitemeta, array( 'site_id' => $network_id, 'meta_key' => $option, 'meta_value' => $serialized_value ) );
 
 		if ( ! $result ) {
 			return false;
@@ -1542,8 +1571,9 @@
 		$option_timeout = '_site_transient_timeout_' . $transient;
 		$option = '_site_transient_' . $transient;
 		$result = delete_site_option( $option );
-		if ( $result )
+		if ( $result ) {
 			delete_site_option( $option_timeout );
+		}
 	}
 	if ( $result ) {
 
@@ -1593,27 +1623,29 @@
 	 */
 	$pre = apply_filters( "pre_site_transient_{$transient}", false, $transient );
 
-	if ( false !== $pre )
+	if ( false !== $pre ) {
 		return $pre;
+	}
 
 	if ( wp_using_ext_object_cache() ) {
 		$value = wp_cache_get( $transient, 'site-transient' );
 	} else {
 		// Core transients that do not have a timeout. Listed here so querying timeouts can be avoided.
-		$no_timeout = array('update_core', 'update_plugins', 'update_themes');
+		$no_timeout = array( 'update_core', 'update_plugins', 'update_themes' );
 		$transient_option = '_site_transient_' . $transient;
 		if ( ! in_array( $transient, $no_timeout ) ) {
 			$transient_timeout = '_site_transient_timeout_' . $transient;
 			$timeout = get_site_option( $transient_timeout );
 			if ( false !== $timeout && $timeout < time() ) {
-				delete_site_option( $transient_option  );
+				delete_site_option( $transient_option );
 				delete_site_option( $transient_timeout );
 				$value = false;
 			}
 		}
 
-		if ( ! isset( $value ) )
+		if ( ! isset( $value ) ) {
 			$value = get_site_option( $transient_option );
+		}
 	}
 
 	/**
@@ -1682,12 +1714,14 @@
 		$transient_timeout = '_site_transient_timeout_' . $transient;
 		$option = '_site_transient_' . $transient;
 		if ( false === get_site_option( $option ) ) {
-			if ( $expiration )
+			if ( $expiration ) {
 				add_site_option( $transient_timeout, time() + $expiration );
+			}
 			$result = add_site_option( $option, $value );
 		} else {
-			if ( $expiration )
+			if ( $expiration ) {
 				update_site_option( $transient_timeout, time() + $expiration );
+			}
 			$result = update_site_option( $option, $value );
 		}
 	}
Index: src/wp-includes/pluggable-deprecated.php
===================================================================
--- src/wp-includes/pluggable-deprecated.php	(revision 40901)
+++ src/wp-includes/pluggable-deprecated.php	(working copy)
@@ -15,8 +15,8 @@
  * Deprecated functions come here to die.
  */
 
-if ( !function_exists('set_current_user') ) :
-/**
+if ( ! function_exists( 'set_current_user' ) ) :
+	/**
  * Changes the current user by ID or name.
  *
  * Set $id to null and specify a name if you do not know a user's ID.
@@ -29,14 +29,14 @@
  * @param string $name Optional. The user's username
  * @return WP_User returns wp_set_current_user()
  */
-function set_current_user($id, $name = '') {
-	_deprecated_function( __FUNCTION__, '3.0.0', 'wp_set_current_user()' );
-	return wp_set_current_user($id, $name);
-}
+	function set_current_user( $id, $name = '' ) {
+		_deprecated_function( __FUNCTION__, '3.0.0', 'wp_set_current_user()' );
+		return wp_set_current_user( $id, $name );
+	}
 endif;
 
-if ( !function_exists('get_currentuserinfo') ) :
-/**
+if ( ! function_exists( 'get_currentuserinfo' ) ) :
+	/**
  * Populate global variables with information about the currently logged in user.
  *
  * @since 0.71
@@ -45,15 +45,15 @@
  *
  * @return bool|WP_User False on XMLRPC Request and invalid auth cookie, WP_User instance otherwise.
  */
-function get_currentuserinfo() {
-	_deprecated_function( __FUNCTION__, '4.5.0', 'wp_get_current_user()' );
+	function get_currentuserinfo() {
+		_deprecated_function( __FUNCTION__, '4.5.0', 'wp_get_current_user()' );
 
-	return _wp_get_current_user();
-}
+		return _wp_get_current_user();
+	}
 endif;
 
-if ( !function_exists('get_userdatabylogin') ) :
-/**
+if ( ! function_exists( 'get_userdatabylogin' ) ) :
+	/**
  * Retrieve user info by login name.
  *
  * @since 0.71
@@ -63,14 +63,14 @@
  * @param string $user_login User's username
  * @return bool|object False on failure, User DB row object
  */
-function get_userdatabylogin($user_login) {
-	_deprecated_function( __FUNCTION__, '3.3.0', "get_user_by('login')" );
-	return get_user_by('login', $user_login);
-}
+	function get_userdatabylogin( $user_login ) {
+		_deprecated_function( __FUNCTION__, '3.3.0', "get_user_by('login')" );
+		return get_user_by( 'login', $user_login );
+	}
 endif;
 
-if ( !function_exists('get_user_by_email') ) :
-/**
+if ( ! function_exists( 'get_user_by_email' ) ) :
+	/**
  * Retrieve user info by email.
  *
  * @since 2.5.0
@@ -80,14 +80,14 @@
  * @param string $email User's email address
  * @return bool|object False on failure, User DB row object
  */
-function get_user_by_email($email) {
-	_deprecated_function( __FUNCTION__, '3.3.0', "get_user_by('email')" );
-	return get_user_by('email', $email);
-}
+	function get_user_by_email( $email ) {
+		_deprecated_function( __FUNCTION__, '3.3.0', "get_user_by('email')" );
+		return get_user_by( 'email', $email );
+	}
 endif;
 
-if ( !function_exists('wp_setcookie') ) :
-/**
+if ( ! function_exists( 'wp_setcookie' ) ) :
+	/**
  * Sets a cookie for a user who just logged in. This function is deprecated.
  *
  * @since 1.5.0
@@ -101,33 +101,33 @@
  * @param string $siteurl Optional. Will be used instead of SITECOOKIEPATH if set
  * @param bool $remember Optional. Remember that the user is logged in
  */
-function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) {
-	_deprecated_function( __FUNCTION__, '2.5.0', 'wp_set_auth_cookie()' );
-	$user = get_user_by('login', $username);
-	wp_set_auth_cookie($user->ID, $remember);
-}
+	function wp_setcookie( $username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false ) {
+		_deprecated_function( __FUNCTION__, '2.5.0', 'wp_set_auth_cookie()' );
+		$user = get_user_by( 'login', $username );
+		wp_set_auth_cookie( $user->ID, $remember );
+	}
 else :
 	_deprecated_function( 'wp_setcookie', '2.5.0', 'wp_set_auth_cookie()' );
 endif;
 
-if ( !function_exists('wp_clearcookie') ) :
-/**
+if ( ! function_exists( 'wp_clearcookie' ) ) :
+	/**
  * Clears the authentication cookie, logging the user out. This function is deprecated.
  *
  * @since 1.5.0
  * @deprecated 2.5.0 Use wp_clear_auth_cookie()
  * @see wp_clear_auth_cookie()
  */
-function wp_clearcookie() {
-	_deprecated_function( __FUNCTION__, '2.5.0', 'wp_clear_auth_cookie()' );
-	wp_clear_auth_cookie();
-}
+	function wp_clearcookie() {
+		_deprecated_function( __FUNCTION__, '2.5.0', 'wp_clear_auth_cookie()' );
+		wp_clear_auth_cookie();
+	}
 else :
 	_deprecated_function( 'wp_clearcookie', '2.5.0', 'wp_clear_auth_cookie()' );
 endif;
 
-if ( !function_exists('wp_get_cookie_login') ):
-/**
+if ( ! function_exists( 'wp_get_cookie_login' ) ) :
+	/**
  * Gets the user cookie login. This function is deprecated.
  *
  * This function is deprecated and should no longer be extended as it won't be
@@ -138,16 +138,16 @@
  *
  * @return bool Always returns false
  */
-function wp_get_cookie_login() {
-	_deprecated_function( __FUNCTION__, '2.5.0' );
-	return false;
-}
+	function wp_get_cookie_login() {
+		_deprecated_function( __FUNCTION__, '2.5.0' );
+		return false;
+	}
 else :
 	_deprecated_function( 'wp_get_cookie_login', '2.5.0' );
 endif;
 
-if ( !function_exists('wp_login') ) :
-/**
+if ( ! function_exists( 'wp_login' ) ) :
+	/**
  * Checks a users login information and logs them in if it checks out. This function is deprecated.
  *
  * Use the global $error to get the reason why the login failed. If the username
@@ -168,18 +168,19 @@
  * @param string $deprecated Not used
  * @return bool False on login failure, true on successful check
  */
-function wp_login($username, $password, $deprecated = '') {
-	_deprecated_function( __FUNCTION__, '2.5.0', 'wp_signon()' );
-	global $error;
+	function wp_login( $username, $password, $deprecated = '' ) {
+		_deprecated_function( __FUNCTION__, '2.5.0', 'wp_signon()' );
+		global $error;
 
-	$user = wp_authenticate($username, $password);
+		$user = wp_authenticate( $username, $password );
 
-	if ( ! is_wp_error($user) )
-		return true;
+		if ( ! is_wp_error( $user ) ) {
+			return true;
+		}
 
-	$error = $user->get_error_message();
-	return false;
-}
+		$error = $user->get_error_message();
+		return false;
+	}
 else :
 	_deprecated_function( 'wp_login', '2.5.0', 'wp_signon()' );
 endif;
Index: src/wp-includes/pluggable.php
===================================================================
--- src/wp-includes/pluggable.php	(revision 40901)
+++ src/wp-includes/pluggable.php	(working copy)
@@ -6,8 +6,8 @@
  * @package WordPress
  */
 
-if ( !function_exists('wp_set_current_user') ) :
-/**
+if ( ! function_exists( 'wp_set_current_user' ) ) :
+	/**
  * Changes the current user by ID or name.
  *
  * Set $id to null and specify a name if you do not know a user's ID.
@@ -23,35 +23,35 @@
  * @param string $name User's username
  * @return WP_User Current user User object
  */
-function wp_set_current_user($id, $name = '') {
-	global $current_user;
+	function wp_set_current_user( $id, $name = '' ) {
+		global $current_user;
 
-	// If `$id` matches the user who's already current, there's nothing to do.
-	if ( isset( $current_user )
+		// If `$id` matches the user who's already current, there's nothing to do.
+		if ( isset( $current_user )
 		&& ( $current_user instanceof WP_User )
 		&& ( $id == $current_user->ID )
 		&& ( null !== $id )
-	) {
-		return $current_user;
-	}
+			) {
+				return $current_user;
+		}
 
-	$current_user = new WP_User( $id, $name );
+		$current_user = new WP_User( $id, $name );
 
-	setup_userdata( $current_user->ID );
+		setup_userdata( $current_user->ID );
 
-	/**
+		/**
 	 * Fires after the current user is set.
 	 *
 	 * @since 2.0.1
 	 */
-	do_action( 'set_current_user' );
+		do_action( 'set_current_user' );
 
-	return $current_user;
-}
+		return $current_user;
+	}
 endif;
 
-if ( !function_exists('wp_get_current_user') ) :
-/**
+if ( ! function_exists( 'wp_get_current_user' ) ) :
+	/**
  * Retrieve the current user object.
  *
  * Will set the current user, if the current user is not set. The current user
@@ -65,13 +65,13 @@
  *
  * @return WP_User Current WP_User instance.
  */
-function wp_get_current_user() {
-	return _wp_get_current_user();
-}
+	function wp_get_current_user() {
+		return _wp_get_current_user();
+	}
 endif;
 
-if ( !function_exists('get_userdata') ) :
-/**
+if ( ! function_exists( 'get_userdata' ) ) :
+	/**
  * Retrieve user info by user ID.
  *
  * @since 0.71
@@ -79,13 +79,13 @@
  * @param int $user_id User ID
  * @return WP_User|false WP_User object on success, false on failure.
  */
-function get_userdata( $user_id ) {
-	return get_user_by( 'id', $user_id );
-}
+	function get_userdata( $user_id ) {
+		return get_user_by( 'id', $user_id );
+	}
 endif;
 
-if ( !function_exists('get_user_by') ) :
-/**
+if ( ! function_exists( 'get_user_by' ) ) :
+	/**
  * Retrieve user info by a given field
  *
  * @since 2.8.0
@@ -95,21 +95,22 @@
  * @param int|string $value A value for $field. A user ID, slug, email address, or login name.
  * @return WP_User|false WP_User object on success, false on failure.
  */
-function get_user_by( $field, $value ) {
-	$userdata = WP_User::get_data_by( $field, $value );
+	function get_user_by( $field, $value ) {
+		$userdata = WP_User::get_data_by( $field, $value );
 
-	if ( !$userdata )
-		return false;
+		if ( ! $userdata ) {
+			return false;
+		}
 
-	$user = new WP_User;
-	$user->init( $userdata );
+		$user = new WP_User;
+		$user->init( $userdata );
 
-	return $user;
-}
+		return $user;
+	}
 endif;
 
-if ( !function_exists('cache_users') ) :
-/**
+if ( ! function_exists( 'cache_users' ) ) :
+	/**
  * Retrieve info for user lists to prevent multiple queries by get_userdata()
  *
  * @since 3.0.0
@@ -118,29 +119,30 @@
  *
  * @param array $user_ids User ID numbers list
  */
-function cache_users( $user_ids ) {
-	global $wpdb;
+	function cache_users( $user_ids ) {
+		global $wpdb;
 
-	$clean = _get_non_cached_ids( $user_ids, 'users' );
+		$clean = _get_non_cached_ids( $user_ids, 'users' );
 
-	if ( empty( $clean ) )
-		return;
+		if ( empty( $clean ) ) {
+			return;
+		}
 
-	$list = implode( ',', $clean );
+		$list = implode( ',', $clean );
 
-	$users = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($list)" );
+		$users = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($list)" );
 
-	$ids = array();
-	foreach ( $users as $user ) {
-		update_user_caches( $user );
-		$ids[] = $user->ID;
+		$ids = array();
+		foreach ( $users as $user ) {
+			update_user_caches( $user );
+			$ids[] = $user->ID;
+		}
+		update_meta_cache( 'user', $ids );
 	}
-	update_meta_cache( 'user', $ids );
-}
 endif;
 
-if ( !function_exists( 'wp_mail' ) ) :
-/**
+if ( ! function_exists( 'wp_mail' ) ) :
+	/**
  * Send mail, similar to PHP's mail
  *
  * A true return value does not automatically mean that the user received the
@@ -170,10 +172,10 @@
  * @param string|array $attachments Optional. Files to attach.
  * @return bool Whether the email contents were sent successfully.
  */
-function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
-	// Compact the input, apply the filters, and extract them back out
+	function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
+		// Compact the input, apply the filters, and extract them back out
 
-	/**
+		/**
 	 * Filters the wp_mail() arguments.
 	 *
 	 * @since 2.2.0
@@ -181,310 +183,313 @@
 	 * @param array $args A compacted array of wp_mail() arguments, including the "to" email,
 	 *                    subject, message, headers, and attachments values.
 	 */
-	$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
+		$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
 
-	if ( isset( $atts['to'] ) ) {
-		$to = $atts['to'];
-	}
+		if ( isset( $atts['to'] ) ) {
+			$to = $atts['to'];
+		}
 
-	if ( !is_array( $to ) ) {
-		$to = explode( ',', $to );
-	}
+		if ( ! is_array( $to ) ) {
+			$to = explode( ',', $to );
+		}
 
-	if ( isset( $atts['subject'] ) ) {
-		$subject = $atts['subject'];
-	}
+		if ( isset( $atts['subject'] ) ) {
+			$subject = $atts['subject'];
+		}
 
-	if ( isset( $atts['message'] ) ) {
-		$message = $atts['message'];
-	}
+		if ( isset( $atts['message'] ) ) {
+			$message = $atts['message'];
+		}
 
-	if ( isset( $atts['headers'] ) ) {
-		$headers = $atts['headers'];
-	}
+		if ( isset( $atts['headers'] ) ) {
+			$headers = $atts['headers'];
+		}
 
-	if ( isset( $atts['attachments'] ) ) {
-		$attachments = $atts['attachments'];
-	}
+		if ( isset( $atts['attachments'] ) ) {
+			$attachments = $atts['attachments'];
+		}
 
-	if ( ! is_array( $attachments ) ) {
-		$attachments = explode( "\n", str_replace( "\r\n", "\n", $attachments ) );
-	}
-	global $phpmailer;
+		if ( ! is_array( $attachments ) ) {
+			$attachments = explode( "\n", str_replace( "\r\n", "\n", $attachments ) );
+		}
+		global $phpmailer;
 
-	// (Re)create it, if it's gone missing
-	if ( ! ( $phpmailer instanceof PHPMailer ) ) {
-		require_once ABSPATH . WPINC . '/class-phpmailer.php';
-		require_once ABSPATH . WPINC . '/class-smtp.php';
-		$phpmailer = new PHPMailer( true );
-	}
+		// (Re)create it, if it's gone missing
+		if ( ! ( $phpmailer instanceof PHPMailer ) ) {
+			require_once ABSPATH . WPINC . '/class-phpmailer.php';
+			require_once ABSPATH . WPINC . '/class-smtp.php';
+			$phpmailer = new PHPMailer( true );
+		}
 
-	// Headers
-	$cc = $bcc = $reply_to = array();
+		// Headers
+		$cc = $bcc = $reply_to = array();
 
-	if ( empty( $headers ) ) {
-		$headers = array();
-	} else {
-		if ( !is_array( $headers ) ) {
-			// Explode the headers out, so this function can take both
-			// string headers and an array of headers.
-			$tempheaders = explode( "\n", str_replace( "\r\n", "\n", $headers ) );
+		if ( empty( $headers ) ) {
+			$headers = array();
 		} else {
-			$tempheaders = $headers;
-		}
-		$headers = array();
+			if ( ! is_array( $headers ) ) {
+				// Explode the headers out, so this function can take both
+				// string headers and an array of headers.
+				$tempheaders = explode( "\n", str_replace( "\r\n", "\n", $headers ) );
+			} else {
+				$tempheaders = $headers;
+			}
+			$headers = array();
 
-		// If it's actually got contents
-		if ( !empty( $tempheaders ) ) {
-			// Iterate through the raw headers
-			foreach ( (array) $tempheaders as $header ) {
-				if ( strpos($header, ':') === false ) {
-					if ( false !== stripos( $header, 'boundary=' ) ) {
-						$parts = preg_split('/boundary=/i', trim( $header ) );
-						$boundary = trim( str_replace( array( "'", '"' ), '', $parts[1] ) );
+			// If it's actually got contents
+			if ( ! empty( $tempheaders ) ) {
+				// Iterate through the raw headers
+				foreach ( (array) $tempheaders as $header ) {
+					if ( strpos( $header, ':' ) === false ) {
+						if ( false !== stripos( $header, 'boundary=' ) ) {
+							$parts = preg_split( '/boundary=/i', trim( $header ) );
+							$boundary = trim( str_replace( array( "'", '"' ), '', $parts[1] ) );
+						}
+						continue;
 					}
-					continue;
-				}
-				// Explode them out
-				list( $name, $content ) = explode( ':', trim( $header ), 2 );
+					// Explode them out
+					list( $name, $content ) = explode( ':', trim( $header ), 2 );
 
-				// Cleanup crew
-				$name    = trim( $name    );
-				$content = trim( $content );
-
-				switch ( strtolower( $name ) ) {
-					// Mainly for legacy -- process a From: header if it's there
-					case 'from':
-						$bracket_pos = strpos( $content, '<' );
-						if ( $bracket_pos !== false ) {
-							// Text before the bracketed email is the "From" name.
-							if ( $bracket_pos > 0 ) {
-								$from_name = substr( $content, 0, $bracket_pos - 1 );
-								$from_name = str_replace( '"', '', $from_name );
-								$from_name = trim( $from_name );
+					// Cleanup crew
+					$name    = trim( $name );
+					$content = trim( $content );
+
+					switch ( strtolower( $name ) ) {
+						// Mainly for legacy -- process a From: header if it's there
+						case 'from':
+							$bracket_pos = strpos( $content, '<' );
+							if ( $bracket_pos !== false ) {
+								// Text before the bracketed email is the "From" name.
+								if ( $bracket_pos > 0 ) {
+									$from_name = substr( $content, 0, $bracket_pos - 1 );
+									$from_name = str_replace( '"', '', $from_name );
+									$from_name = trim( $from_name );
+								}
+
+								$from_email = substr( $content, $bracket_pos + 1 );
+								$from_email = str_replace( '>', '', $from_email );
+								$from_email = trim( $from_email );
+
+								// Avoid setting an empty $from_email.
+							} elseif ( '' !== trim( $content ) ) {
+								$from_email = trim( $content );
 							}
-
-							$from_email = substr( $content, $bracket_pos + 1 );
-							$from_email = str_replace( '>', '', $from_email );
-							$from_email = trim( $from_email );
-
-						// Avoid setting an empty $from_email.
-						} elseif ( '' !== trim( $content ) ) {
-							$from_email = trim( $content );
-						}
-						break;
-					case 'content-type':
-						if ( strpos( $content, ';' ) !== false ) {
-							list( $type, $charset_content ) = explode( ';', $content );
-							$content_type = trim( $type );
-							if ( false !== stripos( $charset_content, 'charset=' ) ) {
-								$charset = trim( str_replace( array( 'charset=', '"' ), '', $charset_content ) );
-							} elseif ( false !== stripos( $charset_content, 'boundary=' ) ) {
-								$boundary = trim( str_replace( array( 'BOUNDARY=', 'boundary=', '"' ), '', $charset_content ) );
-								$charset = '';
+							break;
+						case 'content-type':
+							if ( strpos( $content, ';' ) !== false ) {
+								list( $type, $charset_content ) = explode( ';', $content );
+								$content_type = trim( $type );
+								if ( false !== stripos( $charset_content, 'charset=' ) ) {
+									$charset = trim( str_replace( array( 'charset=', '"' ), '', $charset_content ) );
+								} elseif ( false !== stripos( $charset_content, 'boundary=' ) ) {
+									$boundary = trim( str_replace( array( 'BOUNDARY=', 'boundary=', '"' ), '', $charset_content ) );
+									$charset = '';
+								}
+							} elseif ( '' !== trim( $content ) ) {
+								$content_type = trim( $content );
 							}
+							break;
+						case 'cc':
+							$cc = array_merge( (array) $cc, explode( ',', $content ) );
+							break;
+						case 'bcc':
+							$bcc = array_merge( (array) $bcc, explode( ',', $content ) );
+							break;
+						case 'reply-to':
+							$reply_to = array_merge( (array) $reply_to, explode( ',', $content ) );
+							break;
+						default:
+							// Add it to our grand headers array
+							$headers[ trim( $name ) ] = trim( $content );
+							break;
+					}// End switch().
+				}// End foreach().
+			}// End if().
+		}// End if().
+
+			// Empty out the values that may be set
+			$phpmailer->clearAllRecipients();
+			$phpmailer->clearAttachments();
+			$phpmailer->clearCustomHeaders();
+			$phpmailer->clearReplyTos();
+
+			// From email and name
+			// If we don't have a name from the input headers
+		if ( ! isset( $from_name ) ) {
+			$from_name = 'WordPress';
+		}
 
-						// Avoid setting an empty $content_type.
-						} elseif ( '' !== trim( $content ) ) {
-							$content_type = trim( $content );
-						}
-						break;
-					case 'cc':
-						$cc = array_merge( (array) $cc, explode( ',', $content ) );
-						break;
-					case 'bcc':
-						$bcc = array_merge( (array) $bcc, explode( ',', $content ) );
-						break;
-					case 'reply-to':
-						$reply_to = array_merge( (array) $reply_to, explode( ',', $content ) );
-						break;
-					default:
-						// Add it to our grand headers array
-						$headers[trim( $name )] = trim( $content );
-						break;
-				}
+			/* If we don't have an email from the input headers default to wordpress@$sitename
+			 * Some hosts will block outgoing mail from this address if it doesn't exist but
+			 * there's no easy alternative. Defaulting to admin_email might appear to be another
+			 * option but some hosts may refuse to relay mail from an unknown domain. See
+			 * https://core.trac.wordpress.org/ticket/5007.
+			 */
+
+		if ( ! isset( $from_email ) ) {
+			// Get the site domain and get rid of www.
+			$sitename = strtolower( $_SERVER['SERVER_NAME'] );
+			if ( substr( $sitename, 0, 4 ) == 'www.' ) {
+				$sitename = substr( $sitename, 4 );
 			}
-		}
-	}
 
-	// Empty out the values that may be set
-	$phpmailer->clearAllRecipients();
-	$phpmailer->clearAttachments();
-	$phpmailer->clearCustomHeaders();
-	$phpmailer->clearReplyTos();
-
-	// From email and name
-	// If we don't have a name from the input headers
-	if ( !isset( $from_name ) )
-		$from_name = 'WordPress';
-
-	/* If we don't have an email from the input headers default to wordpress@$sitename
-	 * Some hosts will block outgoing mail from this address if it doesn't exist but
-	 * there's no easy alternative. Defaulting to admin_email might appear to be another
-	 * option but some hosts may refuse to relay mail from an unknown domain. See
-	 * https://core.trac.wordpress.org/ticket/5007.
-	 */
-
-	if ( !isset( $from_email ) ) {
-		// Get the site domain and get rid of www.
-		$sitename = strtolower( $_SERVER['SERVER_NAME'] );
-		if ( substr( $sitename, 0, 4 ) == 'www.' ) {
-			$sitename = substr( $sitename, 4 );
+			$from_email = 'wordpress@' . $sitename;
 		}
 
-		$from_email = 'wordpress@' . $sitename;
-	}
-
-	/**
+			/**
 	 * Filters the email address to send from.
 	 *
 	 * @since 2.2.0
 	 *
 	 * @param string $from_email Email address to send from.
 	 */
-	$from_email = apply_filters( 'wp_mail_from', $from_email );
+			$from_email = apply_filters( 'wp_mail_from', $from_email );
 
-	/**
+			/**
 	 * Filters the name to associate with the "from" email address.
 	 *
 	 * @since 2.3.0
 	 *
 	 * @param string $from_name Name associated with the "from" email address.
 	 */
-	$from_name = apply_filters( 'wp_mail_from_name', $from_name );
+			$from_name = apply_filters( 'wp_mail_from_name', $from_name );
 
-	try {
-		$phpmailer->setFrom( $from_email, $from_name, false );
-	} catch ( phpmailerException $e ) {
-		$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
-		$mail_error_data['phpmailer_exception_code'] = $e->getCode();
-
-		/** This filter is documented in wp-includes/pluggable.php */
-		do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) );
+		try {
+			$phpmailer->setFrom( $from_email, $from_name, false );
+		} catch ( phpmailerException $e ) {
+			$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
+			$mail_error_data['phpmailer_exception_code'] = $e->getCode();
 
-		return false;
-	}
+			/** This filter is documented in wp-includes/pluggable.php */
+			do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) );
 
-	// Set mail's subject and body
-	$phpmailer->Subject = $subject;
-	$phpmailer->Body    = $message;
+			return false;
+		}
 
-	// Set destination addresses, using appropriate methods for handling addresses
-	$address_headers = compact( 'to', 'cc', 'bcc', 'reply_to' );
+			// Set mail's subject and body
+			$phpmailer->Subject = $subject;
+			$phpmailer->Body    = $message;
 
-	foreach ( $address_headers as $address_header => $addresses ) {
-		if ( empty( $addresses ) ) {
-			continue;
-		}
+			// Set destination addresses, using appropriate methods for handling addresses
+			$address_headers = compact( 'to', 'cc', 'bcc', 'reply_to' );
 
-		foreach ( (array) $addresses as $address ) {
-			try {
-				// Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
-				$recipient_name = '';
+		foreach ( $address_headers as $address_header => $addresses ) {
+			if ( empty( $addresses ) ) {
+				continue;
+			}
 
-				if ( preg_match( '/(.*)<(.+)>/', $address, $matches ) ) {
-					if ( count( $matches ) == 3 ) {
-						$recipient_name = $matches[1];
-						$address        = $matches[2];
+			foreach ( (array) $addresses as $address ) {
+				try {
+					// Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
+					$recipient_name = '';
+
+					if ( preg_match( '/(.*)<(.+)>/', $address, $matches ) ) {
+						if ( count( $matches ) == 3 ) {
+							$recipient_name = $matches[1];
+							$address        = $matches[2];
+						}
 					}
-				}
 
-				switch ( $address_header ) {
-					case 'to':
-						$phpmailer->addAddress( $address, $recipient_name );
-						break;
-					case 'cc':
-						$phpmailer->addCc( $address, $recipient_name );
-						break;
-					case 'bcc':
-						$phpmailer->addBcc( $address, $recipient_name );
-						break;
-					case 'reply_to':
-						$phpmailer->addReplyTo( $address, $recipient_name );
-						break;
+					switch ( $address_header ) {
+						case 'to':
+							$phpmailer->addAddress( $address, $recipient_name );
+							break;
+						case 'cc':
+							$phpmailer->addCc( $address, $recipient_name );
+							break;
+						case 'bcc':
+							$phpmailer->addBcc( $address, $recipient_name );
+							break;
+						case 'reply_to':
+							$phpmailer->addReplyTo( $address, $recipient_name );
+							break;
+					}
+				} catch ( phpmailerException $e ) {
+					continue;
 				}
-			} catch ( phpmailerException $e ) {
-				continue;
 			}
-		}
-	}
+		}// End foreach().
 
-	// Set to use PHP's mail()
-	$phpmailer->isMail();
+			// Set to use PHP's mail()
+			$phpmailer->isMail();
 
-	// Set Content-Type and charset
-	// If we don't have a content-type from the input headers
-	if ( !isset( $content_type ) )
-		$content_type = 'text/plain';
+			// Set Content-Type and charset
+			// If we don't have a content-type from the input headers
+		if ( ! isset( $content_type ) ) {
+			$content_type = 'text/plain';
+		}
 
-	/**
+			/**
 	 * Filters the wp_mail() content type.
 	 *
 	 * @since 2.3.0
 	 *
 	 * @param string $content_type Default wp_mail() content type.
 	 */
-	$content_type = apply_filters( 'wp_mail_content_type', $content_type );
+			$content_type = apply_filters( 'wp_mail_content_type', $content_type );
 
-	$phpmailer->ContentType = $content_type;
+			$phpmailer->ContentType = $content_type;
 
-	// Set whether it's plaintext, depending on $content_type
-	if ( 'text/html' == $content_type )
-		$phpmailer->isHTML( true );
+			// Set whether it's plaintext, depending on $content_type
+		if ( 'text/html' == $content_type ) {
+			$phpmailer->isHTML( true );
+		}
 
-	// If we don't have a charset from the input headers
-	if ( !isset( $charset ) )
-		$charset = get_bloginfo( 'charset' );
+			// If we don't have a charset from the input headers
+		if ( ! isset( $charset ) ) {
+			$charset = get_bloginfo( 'charset' );
+		}
 
-	// Set the content-type and charset
+			// Set the content-type and charset
 
-	/**
+			/**
 	 * Filters the default wp_mail() charset.
 	 *
 	 * @since 2.3.0
 	 *
 	 * @param string $charset Default email charset.
 	 */
-	$phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
+			$phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
 
-	// Set custom headers
-	if ( !empty( $headers ) ) {
-		foreach ( (array) $headers as $name => $content ) {
-			$phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );
-		}
+			// Set custom headers
+		if ( ! empty( $headers ) ) {
+			foreach ( (array) $headers as $name => $content ) {
+				$phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );
+			}
 
-		if ( false !== stripos( $content_type, 'multipart' ) && ! empty($boundary) )
-			$phpmailer->addCustomHeader( sprintf( "Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary ) );
-	}
+			if ( false !== stripos( $content_type, 'multipart' ) && ! empty( $boundary ) ) {
+				$phpmailer->addCustomHeader( sprintf( "Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary ) );
+			}
+		}
 
-	if ( !empty( $attachments ) ) {
-		foreach ( $attachments as $attachment ) {
-			try {
-				$phpmailer->addAttachment($attachment);
-			} catch ( phpmailerException $e ) {
-				continue;
+		if ( ! empty( $attachments ) ) {
+			foreach ( $attachments as $attachment ) {
+				try {
+					$phpmailer->addAttachment( $attachment );
+				} catch ( phpmailerException $e ) {
+					continue;
+				}
 			}
 		}
-	}
 
-	/**
+			/**
 	 * Fires after PHPMailer is initialized.
 	 *
 	 * @since 2.2.0
 	 *
 	 * @param PHPMailer &$phpmailer The PHPMailer instance, passed by reference.
 	 */
-	do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
+			do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
 
-	// Send!
-	try {
-		return $phpmailer->send();
-	} catch ( phpmailerException $e ) {
+			// Send!
+		try {
+			return $phpmailer->send();
+		} catch ( phpmailerException $e ) {
 
-		$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
-		$mail_error_data['phpmailer_exception_code'] = $e->getCode();
+			$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
+			$mail_error_data['phpmailer_exception_code'] = $e->getCode();
 
-		/**
+			/**
 		 * Fires after a phpmailerException is caught.
 		 *
 		 * @since 4.4.0
@@ -492,15 +497,15 @@
 		 * @param WP_Error $error A WP_Error object with the phpmailerException message, and an array
 		 *                        containing the mail recipient, subject, message, headers, and attachments.
 		 */
-		do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) );
+			do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) );
 
-		return false;
+			return false;
+		}
 	}
-}
 endif;
 
-if ( !function_exists('wp_authenticate') ) :
-/**
+if ( ! function_exists( 'wp_authenticate' ) ) :
+	/**
  * Authenticate a user, confirming the login credentials are valid.
  *
  * @since 2.5.0
@@ -511,11 +516,11 @@
  * @return WP_User|WP_Error WP_User object if the credentials are valid,
  *                          otherwise WP_Error.
  */
-function wp_authenticate($username, $password) {
-	$username = sanitize_user($username);
-	$password = trim($password);
+	function wp_authenticate( $username, $password ) {
+		$username = sanitize_user( $username );
+		$password = trim( $password );
 
-	/**
+		/**
 	 * Filters whether a set of user login credentials are valid.
 	 *
 	 * A WP_User object is returned if the credentials authenticate a user.
@@ -529,18 +534,18 @@
 	 * @param string                $username Username or email address.
 	 * @param string                $password User password
 	 */
-	$user = apply_filters( 'authenticate', null, $username, $password );
+		$user = apply_filters( 'authenticate', null, $username, $password );
 
-	if ( $user == null ) {
-		// TODO what should the error message be? (Or would these even happen?)
-		// Only needed if all authentication handlers fail to return anything.
-		$user = new WP_Error( 'authentication_failed', __( '<strong>ERROR</strong>: Invalid username, email address or incorrect password.' ) );
-	}
+		if ( $user == null ) {
+			// TODO what should the error message be? (Or would these even happen?)
+			// Only needed if all authentication handlers fail to return anything.
+			$user = new WP_Error( 'authentication_failed', __( '<strong>ERROR</strong>: Invalid username, email address or incorrect password.' ) );
+		}
 
-	$ignore_codes = array('empty_username', 'empty_password');
+		$ignore_codes = array( 'empty_username', 'empty_password' );
 
-	if (is_wp_error($user) && !in_array($user->get_error_code(), $ignore_codes) ) {
-		/**
+		if ( is_wp_error( $user ) && ! in_array( $user->get_error_code(), $ignore_codes ) ) {
+			/**
 		 * Fires after a user login has failed.
 		 *
 		 * @since 2.5.0
@@ -548,34 +553,34 @@
 		 *
 		 * @param string $username Username or email address.
 		 */
-		do_action( 'wp_login_failed', $username );
-	}
+			do_action( 'wp_login_failed', $username );
+		}
 
-	return $user;
-}
+		return $user;
+	}
 endif;
 
-if ( !function_exists('wp_logout') ) :
-/**
+if ( ! function_exists( 'wp_logout' ) ) :
+	/**
  * Log the current user out.
  *
  * @since 2.5.0
  */
-function wp_logout() {
-	wp_destroy_current_session();
-	wp_clear_auth_cookie();
+	function wp_logout() {
+		wp_destroy_current_session();
+		wp_clear_auth_cookie();
 
-	/**
+		/**
 	 * Fires after a user is logged-out.
 	 *
 	 * @since 1.5.0
 	 */
-	do_action( 'wp_logout' );
-}
+		do_action( 'wp_logout' );
+	}
 endif;
 
-if ( !function_exists('wp_validate_auth_cookie') ) :
-/**
+if ( ! function_exists( 'wp_validate_auth_cookie' ) ) :
+	/**
  * Validates authentication cookie.
  *
  * The checks include making sure that the authentication cookie is set and
@@ -592,9 +597,9 @@
  * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
  * @return false|int False if invalid cookie, User ID if valid.
  */
-function wp_validate_auth_cookie($cookie = '', $scheme = '') {
-	if ( ! $cookie_elements = wp_parse_auth_cookie($cookie, $scheme) ) {
-		/**
+	function wp_validate_auth_cookie( $cookie = '', $scheme = '' ) {
+		if ( ! $cookie_elements = wp_parse_auth_cookie( $cookie, $scheme ) ) {
+			/**
 		 * Fires if an authentication cookie is malformed.
 		 *
 		 * @since 2.7.0
@@ -603,79 +608,79 @@
 		 * @param string $scheme Authentication scheme. Values include 'auth', 'secure_auth',
 		 *                       or 'logged_in'.
 		 */
-		do_action( 'auth_cookie_malformed', $cookie, $scheme );
-		return false;
-	}
+			do_action( 'auth_cookie_malformed', $cookie, $scheme );
+			return false;
+		}
 
-	$scheme = $cookie_elements['scheme'];
-	$username = $cookie_elements['username'];
-	$hmac = $cookie_elements['hmac'];
-	$token = $cookie_elements['token'];
-	$expired = $expiration = $cookie_elements['expiration'];
-
-	// Allow a grace period for POST and Ajax requests
-	if ( wp_doing_ajax() || 'POST' == $_SERVER['REQUEST_METHOD'] ) {
-		$expired += HOUR_IN_SECONDS;
-	}
+		$scheme = $cookie_elements['scheme'];
+		$username = $cookie_elements['username'];
+		$hmac = $cookie_elements['hmac'];
+		$token = $cookie_elements['token'];
+		$expired = $expiration = $cookie_elements['expiration'];
+
+		// Allow a grace period for POST and Ajax requests
+		if ( wp_doing_ajax() || 'POST' == $_SERVER['REQUEST_METHOD'] ) {
+			$expired += HOUR_IN_SECONDS;
+		}
 
-	// Quick check to see if an honest cookie has expired
-	if ( $expired < time() ) {
-		/**
+		// Quick check to see if an honest cookie has expired
+		if ( $expired < time() ) {
+			/**
 		 * Fires once an authentication cookie has expired.
 		 *
 		 * @since 2.7.0
 		 *
 		 * @param array $cookie_elements An array of data for the authentication cookie.
 		 */
-		do_action( 'auth_cookie_expired', $cookie_elements );
-		return false;
-	}
+			do_action( 'auth_cookie_expired', $cookie_elements );
+			return false;
+		}
 
-	$user = get_user_by('login', $username);
-	if ( ! $user ) {
-		/**
+		$user = get_user_by( 'login', $username );
+		if ( ! $user ) {
+			/**
 		 * Fires if a bad username is entered in the user authentication process.
 		 *
 		 * @since 2.7.0
 		 *
 		 * @param array $cookie_elements An array of data for the authentication cookie.
 		 */
-		do_action( 'auth_cookie_bad_username', $cookie_elements );
-		return false;
-	}
+			do_action( 'auth_cookie_bad_username', $cookie_elements );
+			return false;
+		}
 
-	$pass_frag = substr($user->user_pass, 8, 4);
+		$pass_frag = substr( $user->user_pass, 8, 4 );
 
-	$key = wp_hash( $username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme );
+		$key = wp_hash( $username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme );
 
-	// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
-	$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
-	$hash = hash_hmac( $algo, $username . '|' . $expiration . '|' . $token, $key );
+		// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
+		$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
+		$hash = hash_hmac( $algo, $username . '|' . $expiration . '|' . $token, $key );
 
-	if ( ! hash_equals( $hash, $hmac ) ) {
-		/**
+		if ( ! hash_equals( $hash, $hmac ) ) {
+			/**
 		 * Fires if a bad authentication cookie hash is encountered.
 		 *
 		 * @since 2.7.0
 		 *
 		 * @param array $cookie_elements An array of data for the authentication cookie.
 		 */
-		do_action( 'auth_cookie_bad_hash', $cookie_elements );
-		return false;
-	}
+			do_action( 'auth_cookie_bad_hash', $cookie_elements );
+			return false;
+		}
 
-	$manager = WP_Session_Tokens::get_instance( $user->ID );
-	if ( ! $manager->verify( $token ) ) {
-		do_action( 'auth_cookie_bad_session_token', $cookie_elements );
-		return false;
-	}
+		$manager = WP_Session_Tokens::get_instance( $user->ID );
+		if ( ! $manager->verify( $token ) ) {
+			do_action( 'auth_cookie_bad_session_token', $cookie_elements );
+			return false;
+		}
 
-	// Ajax/POST grace period set above
-	if ( $expiration < time() ) {
-		$GLOBALS['login_grace_period'] = 1;
-	}
+		// Ajax/POST grace period set above
+		if ( $expiration < time() ) {
+			$GLOBALS['login_grace_period'] = 1;
+		}
 
-	/**
+		/**
 	 * Fires once an authentication cookie has been validated.
 	 *
 	 * @since 2.7.0
@@ -683,14 +688,14 @@
 	 * @param array   $cookie_elements An array of data for the authentication cookie.
 	 * @param WP_User $user            User object.
 	 */
-	do_action( 'auth_cookie_valid', $cookie_elements, $user );
+		do_action( 'auth_cookie_valid', $cookie_elements, $user );
 
-	return $user->ID;
-}
+		return $user->ID;
+	}
 endif;
 
-if ( !function_exists('wp_generate_auth_cookie') ) :
-/**
+if ( ! function_exists( 'wp_generate_auth_cookie' ) ) :
+	/**
  * Generate authentication cookie contents.
  *
  * @since 2.5.0
@@ -701,28 +706,28 @@
  * @param string $token      User's session token to use for this cookie
  * @return string Authentication cookie contents. Empty string if user does not exist.
  */
-function wp_generate_auth_cookie( $user_id, $expiration, $scheme = 'auth', $token = '' ) {
-	$user = get_userdata($user_id);
-	if ( ! $user ) {
-		return '';
-	}
+	function wp_generate_auth_cookie( $user_id, $expiration, $scheme = 'auth', $token = '' ) {
+		$user = get_userdata( $user_id );
+		if ( ! $user ) {
+			return '';
+		}
 
-	if ( ! $token ) {
-		$manager = WP_Session_Tokens::get_instance( $user_id );
-		$token = $manager->create( $expiration );
-	}
+		if ( ! $token ) {
+			$manager = WP_Session_Tokens::get_instance( $user_id );
+			$token = $manager->create( $expiration );
+		}
 
-	$pass_frag = substr($user->user_pass, 8, 4);
+		$pass_frag = substr( $user->user_pass, 8, 4 );
 
-	$key = wp_hash( $user->user_login . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme );
+		$key = wp_hash( $user->user_login . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme );
 
-	// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
-	$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
-	$hash = hash_hmac( $algo, $user->user_login . '|' . $expiration . '|' . $token, $key );
+		// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
+		$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
+		$hash = hash_hmac( $algo, $user->user_login . '|' . $expiration . '|' . $token, $key );
 
-	$cookie = $user->user_login . '|' . $expiration . '|' . $token . '|' . $hash;
+		$cookie = $user->user_login . '|' . $expiration . '|' . $token . '|' . $hash;
 
-	/**
+		/**
 	 * Filters the authentication cookie.
 	 *
 	 * @since 2.5.0
@@ -733,12 +738,12 @@
 	 * @param string $scheme     Cookie scheme used. Accepts 'auth', 'secure_auth', or 'logged_in'.
 	 * @param string $token      User's session token used.
 	 */
-	return apply_filters( 'auth_cookie', $cookie, $user_id, $expiration, $scheme, $token );
-}
+		return apply_filters( 'auth_cookie', $cookie, $user_id, $expiration, $scheme, $token );
+	}
 endif;
 
-if ( !function_exists('wp_parse_auth_cookie') ) :
-/**
+if ( ! function_exists( 'wp_parse_auth_cookie' ) ) :
+	/**
  * Parse a cookie into its components
  *
  * @since 2.7.0
@@ -747,46 +752,47 @@
  * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
  * @return array|false Authentication cookie components
  */
-function wp_parse_auth_cookie($cookie = '', $scheme = '') {
-	if ( empty($cookie) ) {
-		switch ($scheme){
-			case 'auth':
-				$cookie_name = AUTH_COOKIE;
-				break;
-			case 'secure_auth':
-				$cookie_name = SECURE_AUTH_COOKIE;
-				break;
-			case "logged_in":
-				$cookie_name = LOGGED_IN_COOKIE;
-				break;
-			default:
-				if ( is_ssl() ) {
-					$cookie_name = SECURE_AUTH_COOKIE;
-					$scheme = 'secure_auth';
-				} else {
+	function wp_parse_auth_cookie( $cookie = '', $scheme = '' ) {
+		if ( empty( $cookie ) ) {
+			switch ( $scheme ) {
+				case 'auth':
 					$cookie_name = AUTH_COOKIE;
-					$scheme = 'auth';
-				}
-	    }
+					break;
+				case 'secure_auth':
+					$cookie_name = SECURE_AUTH_COOKIE;
+					break;
+				case 'logged_in':
+					$cookie_name = LOGGED_IN_COOKIE;
+					break;
+				default:
+					if ( is_ssl() ) {
+						$cookie_name = SECURE_AUTH_COOKIE;
+						$scheme = 'secure_auth';
+					} else {
+						$cookie_name = AUTH_COOKIE;
+						$scheme = 'auth';
+					}
+			}
 
-		if ( empty($_COOKIE[$cookie_name]) )
-			return false;
-		$cookie = $_COOKIE[$cookie_name];
-	}
+			if ( empty( $_COOKIE[ $cookie_name ] ) ) {
+				return false;
+			}
+			$cookie = $_COOKIE[ $cookie_name ];
+		}
 
-	$cookie_elements = explode('|', $cookie);
-	if ( count( $cookie_elements ) !== 4 ) {
-		return false;
-	}
+		$cookie_elements = explode( '|', $cookie );
+		if ( count( $cookie_elements ) !== 4 ) {
+			return false;
+		}
 
-	list( $username, $expiration, $token, $hmac ) = $cookie_elements;
+		list( $username, $expiration, $token, $hmac ) = $cookie_elements;
 
-	return compact( 'username', 'expiration', 'token', 'hmac', 'scheme' );
-}
+		return compact( 'username', 'expiration', 'token', 'hmac', 'scheme' );
+	}
 endif;
 
-if ( !function_exists('wp_set_auth_cookie') ) :
-/**
+if ( ! function_exists( 'wp_set_auth_cookie' ) ) :
+	/**
  * Log in a user by setting authentication cookies.
  *
  * The $remember parameter increases the time that the cookie will be kept. The
@@ -802,9 +808,9 @@
  *                         Default is_ssl().
  * @param string $token    Optional. User's session token to use for this cookie.
  */
-function wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token = '' ) {
-	if ( $remember ) {
-		/**
+	function wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token = '' ) {
+		if ( $remember ) {
+			/**
 		 * Filters the duration of the authentication cookie expiration period.
 		 *
 		 * @since 2.8.0
@@ -813,27 +819,27 @@
 		 * @param int  $user_id  User ID.
 		 * @param bool $remember Whether to remember the user login. Default false.
 		 */
-		$expiration = time() + apply_filters( 'auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember );
+			$expiration = time() + apply_filters( 'auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember );
 
-		/*
-		 * Ensure the browser will continue to send the cookie after the expiration time is reached.
-		 * Needed for the login grace period in wp_validate_auth_cookie().
-		 */
-		$expire = $expiration + ( 12 * HOUR_IN_SECONDS );
-	} else {
-		/** This filter is documented in wp-includes/pluggable.php */
-		$expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember );
-		$expire = 0;
-	}
+			/*
+			 * Ensure the browser will continue to send the cookie after the expiration time is reached.
+			 * Needed for the login grace period in wp_validate_auth_cookie().
+			 */
+			$expire = $expiration + ( 12 * HOUR_IN_SECONDS );
+		} else {
+			/** This filter is documented in wp-includes/pluggable.php */
+			$expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember );
+			$expire = 0;
+		}
 
-	if ( '' === $secure ) {
-		$secure = is_ssl();
-	}
+		if ( '' === $secure ) {
+			$secure = is_ssl();
+		}
 
-	// Front-end cookie is secure when the auth cookie is secure and the site's home URL is forced HTTPS.
-	$secure_logged_in_cookie = $secure && 'https' === parse_url( get_option( 'home' ), PHP_URL_SCHEME );
+			// Front-end cookie is secure when the auth cookie is secure and the site's home URL is forced HTTPS.
+			$secure_logged_in_cookie = $secure && 'https' === parse_url( get_option( 'home' ), PHP_URL_SCHEME );
 
-	/**
+			/**
 	 * Filters whether the connection is secure.
 	 *
 	 * @since 3.1.0
@@ -841,9 +847,9 @@
 	 * @param bool $secure  Whether the connection is secure.
 	 * @param int  $user_id User ID.
 	 */
-	$secure = apply_filters( 'secure_auth_cookie', $secure, $user_id );
+			$secure = apply_filters( 'secure_auth_cookie', $secure, $user_id );
 
-	/**
+			/**
 	 * Filters whether to use a secure cookie when logged-in.
 	 *
 	 * @since 3.1.0
@@ -852,25 +858,25 @@
 	 * @param int  $user_id                 User ID.
 	 * @param bool $secure                  Whether the connection is secure.
 	 */
-	$secure_logged_in_cookie = apply_filters( 'secure_logged_in_cookie', $secure_logged_in_cookie, $user_id, $secure );
+			$secure_logged_in_cookie = apply_filters( 'secure_logged_in_cookie', $secure_logged_in_cookie, $user_id, $secure );
 
-	if ( $secure ) {
-		$auth_cookie_name = SECURE_AUTH_COOKIE;
-		$scheme = 'secure_auth';
-	} else {
-		$auth_cookie_name = AUTH_COOKIE;
-		$scheme = 'auth';
-	}
+		if ( $secure ) {
+			$auth_cookie_name = SECURE_AUTH_COOKIE;
+			$scheme = 'secure_auth';
+		} else {
+			$auth_cookie_name = AUTH_COOKIE;
+			$scheme = 'auth';
+		}
 
-	if ( '' === $token ) {
-		$manager = WP_Session_Tokens::get_instance( $user_id );
-		$token   = $manager->create( $expiration );
-	}
+		if ( '' === $token ) {
+			$manager = WP_Session_Tokens::get_instance( $user_id );
+			$token   = $manager->create( $expiration );
+		}
 
-	$auth_cookie = wp_generate_auth_cookie( $user_id, $expiration, $scheme, $token );
-	$logged_in_cookie = wp_generate_auth_cookie( $user_id, $expiration, 'logged_in', $token );
+			$auth_cookie = wp_generate_auth_cookie( $user_id, $expiration, $scheme, $token );
+			$logged_in_cookie = wp_generate_auth_cookie( $user_id, $expiration, 'logged_in', $token );
 
-	/**
+			/**
 	 * Fires immediately before the authentication cookie is set.
 	 *
 	 * @since 2.5.0
@@ -883,9 +889,9 @@
 	 * @param int    $user_id     User ID.
 	 * @param string $scheme      Authentication scheme. Values include 'auth', 'secure_auth', or 'logged_in'.
 	 */
-	do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme );
+			do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme );
 
-	/**
+			/**
 	 * Fires immediately before the logged-in authentication cookie is set.
 	 *
 	 * @since 2.6.0
@@ -898,165 +904,166 @@
 	 * @param int    $user_id          User ID.
 	 * @param string $scheme           Authentication scheme. Default 'logged_in'.
 	 */
-	do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in' );
+			do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in' );
 
-	/**
+			/**
 	 * Allows preventing auth cookies from actually being sent to the client.
 	 *
 	 * @since 4.7.4
 	 *
 	 * @param bool $send Whether to send auth cookies to the client.
 	 */
-	if ( ! apply_filters( 'send_auth_cookies', true ) ) {
-		return;
-	}
+		if ( ! apply_filters( 'send_auth_cookies', true ) ) {
+			return;
+		}
 
-	setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
-	setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
-	setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true);
-	if ( COOKIEPATH != SITECOOKIEPATH )
-		setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true);
-}
+			setcookie( $auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
+			setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
+			setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
+		if ( COOKIEPATH != SITECOOKIEPATH ) {
+			setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
+		}
+	}
 endif;
 
-if ( !function_exists('wp_clear_auth_cookie') ) :
-/**
+if ( ! function_exists( 'wp_clear_auth_cookie' ) ) :
+	/**
  * Removes all of the cookies associated with authentication.
  *
  * @since 2.5.0
  */
-function wp_clear_auth_cookie() {
-	/**
+	function wp_clear_auth_cookie() {
+		/**
 	 * Fires just before the authentication cookies are cleared.
 	 *
 	 * @since 2.7.0
 	 */
-	do_action( 'clear_auth_cookie' );
+		do_action( 'clear_auth_cookie' );
+
+		/** This filter is documented in wp-includes/pluggable.php */
+		if ( ! apply_filters( 'send_auth_cookies', true ) ) {
+			return;
+		}
 
-	/** This filter is documented in wp-includes/pluggable.php */
-	if ( ! apply_filters( 'send_auth_cookies', true ) ) {
-		return;
-	}
-
-	// Auth cookies
-	setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH,   COOKIE_DOMAIN );
-	setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH,   COOKIE_DOMAIN );
-	setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
-	setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
-	setcookie( LOGGED_IN_COOKIE,   ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,          COOKIE_DOMAIN );
-	setcookie( LOGGED_IN_COOKIE,   ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH,      COOKIE_DOMAIN );
-
-	// Settings cookies
-	setcookie( 'wp-settings-' . get_current_user_id(),      ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH );
-	setcookie( 'wp-settings-time-' . get_current_user_id(), ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH );
-
-	// Old cookies
-	setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
-	setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
-	setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
-	setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
-
-	// Even older cookies
-	setcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
-	setcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
-	setcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
-	setcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
-}
+		// Auth cookies
+		setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH,   COOKIE_DOMAIN );
+		setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH,   COOKIE_DOMAIN );
+		setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
+		setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
+		setcookie( LOGGED_IN_COOKIE,   ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,          COOKIE_DOMAIN );
+		setcookie( LOGGED_IN_COOKIE,   ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH,      COOKIE_DOMAIN );
+
+		// Settings cookies
+		setcookie( 'wp-settings-' . get_current_user_id(),      ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH );
+		setcookie( 'wp-settings-time-' . get_current_user_id(), ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH );
+
+		// Old cookies
+		setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
+		setcookie( AUTH_COOKIE,        ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
+		setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
+		setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
+
+		// Even older cookies
+		setcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
+		setcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH,     COOKIE_DOMAIN );
+		setcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
+		setcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );
+	}
 endif;
 
-if ( !function_exists('is_user_logged_in') ) :
-/**
+if ( ! function_exists( 'is_user_logged_in' ) ) :
+	/**
  * Checks if the current visitor is a logged in user.
  *
  * @since 2.0.0
  *
  * @return bool True if user is logged in, false if not logged in.
  */
-function is_user_logged_in() {
-	$user = wp_get_current_user();
+	function is_user_logged_in() {
+		$user = wp_get_current_user();
 
-	return $user->exists();
-}
+		return $user->exists();
+	}
 endif;
 
-if ( !function_exists('auth_redirect') ) :
-/**
+if ( ! function_exists( 'auth_redirect' ) ) :
+	/**
  * Checks if a user is logged in, if not it redirects them to the login page.
  *
  * @since 1.5.0
  */
-function auth_redirect() {
-	// Checks if a user is logged in, if not redirects them to the login page
+	function auth_redirect() {
+		// Checks if a user is logged in, if not redirects them to the login page
 
-	$secure = ( is_ssl() || force_ssl_admin() );
+		$secure = ( is_ssl() || force_ssl_admin() );
 
-	/**
+		/**
 	 * Filters whether to use a secure authentication redirect.
 	 *
 	 * @since 3.1.0
 	 *
 	 * @param bool $secure Whether to use a secure authentication redirect. Default false.
 	 */
-	$secure = apply_filters( 'secure_auth_redirect', $secure );
+		$secure = apply_filters( 'secure_auth_redirect', $secure );
 
-	// If https is required and request is http, redirect
-	if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
-		if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
-			wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
-			exit();
-		} else {
-			wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
-			exit();
+		// If https is required and request is http, redirect
+		if ( $secure && ! is_ssl() && false !== strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) ) {
+			if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
+				wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
+				exit();
+			} else {
+				wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+				exit();
+			}
 		}
-	}
 
-	/**
+		/**
 	 * Filters the authentication redirect scheme.
 	 *
 	 * @since 2.9.0
 	 *
 	 * @param string $scheme Authentication redirect scheme. Default empty.
 	 */
-	$scheme = apply_filters( 'auth_redirect_scheme', '' );
+		$scheme = apply_filters( 'auth_redirect_scheme', '' );
 
-	if ( $user_id = wp_validate_auth_cookie( '',  $scheme) ) {
-		/**
+		if ( $user_id = wp_validate_auth_cookie( '',  $scheme ) ) {
+			/**
 		 * Fires before the authentication redirect.
 		 *
 		 * @since 2.8.0
 		 *
 		 * @param int $user_id User ID.
 		 */
-		do_action( 'auth_redirect', $user_id );
+			do_action( 'auth_redirect', $user_id );
 
-		// If the user wants ssl but the session is not ssl, redirect.
-		if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
-			if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
-				wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
-				exit();
-			} else {
-				wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
-				exit();
+			// If the user wants ssl but the session is not ssl, redirect.
+			if ( ! $secure && get_user_option( 'use_ssl', $user_id ) && false !== strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) ) {
+				if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
+					wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
+					exit();
+				} else {
+					wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+					exit();
+				}
 			}
-		}
 
-		return;  // The cookie is good so we're done
-	}
+			return;  // The cookie is good so we're done
+		}
 
-	// The cookie is no good so force login
-	nocache_headers();
+		// The cookie is no good so force login
+		nocache_headers();
 
-	$redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+		$redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
 
-	$login_url = wp_login_url($redirect, true);
+		$login_url = wp_login_url( $redirect, true );
 
-	wp_redirect($login_url);
-	exit();
-}
+		wp_redirect( $login_url );
+		exit();
+	}
 endif;
 
-if ( !function_exists('check_admin_referer') ) :
-/**
+if ( ! function_exists( 'check_admin_referer' ) ) :
+	/**
  * Makes sure that a user was referred from another admin page.
  *
  * To avoid security exploits.
@@ -1069,15 +1076,16 @@
  * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
  *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
  */
-function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
-	if ( -1 == $action )
-		_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' );
-
-	$adminurl = strtolower(admin_url());
-	$referer = strtolower(wp_get_referer());
-	$result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
+	function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
+		if ( -1 == $action ) {
+			_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' );
+		}
 
-	/**
+		$adminurl = strtolower( admin_url() );
+		$referer = strtolower( wp_get_referer() );
+		$result = isset( $_REQUEST[ $query_arg ] ) ? wp_verify_nonce( $_REQUEST[ $query_arg ], $action ) : false;
+
+		/**
 	 * Fires once the admin request has been validated or not.
 	 *
 	 * @since 1.5.1
@@ -1086,19 +1094,19 @@
 	 * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
 	 *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 	 */
-	do_action( 'check_admin_referer', $action, $result );
+		do_action( 'check_admin_referer', $action, $result );
 
-	if ( ! $result && ! ( -1 == $action && strpos( $referer, $adminurl ) === 0 ) ) {
-		wp_nonce_ays( $action );
-		die();
-	}
+		if ( ! $result && ! ( -1 == $action && strpos( $referer, $adminurl ) === 0 ) ) {
+			wp_nonce_ays( $action );
+			die();
+		}
 
-	return $result;
-}
+		return $result;
+	}
 endif;
 
-if ( !function_exists('check_ajax_referer') ) :
-/**
+if ( ! function_exists( 'check_ajax_referer' ) ) :
+	/**
  * Verifies the Ajax request to prevent processing requests external of the blog.
  *
  * @since 2.0.3
@@ -1112,23 +1120,24 @@
  * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
  *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
  */
-function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
-	if ( -1 == $action ) {
-		_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '4.7' );
-	}
+	function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
+		if ( -1 == $action ) {
+			_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '4.7' );
+		}
 
-	$nonce = '';
+		$nonce = '';
 
-	if ( $query_arg && isset( $_REQUEST[ $query_arg ] ) )
-		$nonce = $_REQUEST[ $query_arg ];
-	elseif ( isset( $_REQUEST['_ajax_nonce'] ) )
-		$nonce = $_REQUEST['_ajax_nonce'];
-	elseif ( isset( $_REQUEST['_wpnonce'] ) )
-		$nonce = $_REQUEST['_wpnonce'];
+		if ( $query_arg && isset( $_REQUEST[ $query_arg ] ) ) {
+			$nonce = $_REQUEST[ $query_arg ];
+		} elseif ( isset( $_REQUEST['_ajax_nonce'] ) ) {
+			$nonce = $_REQUEST['_ajax_nonce'];
+		} elseif ( isset( $_REQUEST['_wpnonce'] ) ) {
+			$nonce = $_REQUEST['_wpnonce'];
+		}
 
-	$result = wp_verify_nonce( $nonce, $action );
+		$result = wp_verify_nonce( $nonce, $action );
 
-	/**
+		/**
 	 * Fires once the Ajax request has been validated or not.
 	 *
 	 * @since 2.1.0
@@ -1137,22 +1146,22 @@
 	 * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
 	 *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 	 */
-	do_action( 'check_ajax_referer', $action, $result );
+		do_action( 'check_ajax_referer', $action, $result );
 
-	if ( $die && false === $result ) {
-		if ( wp_doing_ajax() ) {
-			wp_die( -1, 403 );
-		} else {
-			die( '-1' );
+		if ( $die && false === $result ) {
+			if ( wp_doing_ajax() ) {
+				wp_die( -1, 403 );
+			} else {
+				die( '-1' );
+			}
 		}
-	}
 
-	return $result;
-}
+		return $result;
+	}
 endif;
 
-if ( !function_exists('wp_redirect') ) :
-/**
+if ( ! function_exists( 'wp_redirect' ) ) :
+	/**
  * Redirects to another page.
  *
  * Note: wp_redirect() does not exit automatically, and should almost always be
@@ -1176,10 +1185,10 @@
  * @param int    $status   Status code to use.
  * @return bool False if $location is not provided, true otherwise.
  */
-function wp_redirect($location, $status = 302) {
-	global $is_IIS;
+	function wp_redirect( $location, $status = 302 ) {
+		global $is_IIS;
 
-	/**
+		/**
 	 * Filters the redirect location.
 	 *
 	 * @since 2.1.0
@@ -1187,9 +1196,9 @@
 	 * @param string $location The path to redirect to.
 	 * @param int    $status   Status code to use.
 	 */
-	$location = apply_filters( 'wp_redirect', $location, $status );
+		$location = apply_filters( 'wp_redirect', $location, $status );
 
-	/**
+		/**
 	 * Filters the redirect status code.
 	 *
 	 * @since 2.3.0
@@ -1197,24 +1206,26 @@
 	 * @param int    $status   Status code to use.
 	 * @param string $location The path to redirect to.
 	 */
-	$status = apply_filters( 'wp_redirect_status', $status, $location );
+		$status = apply_filters( 'wp_redirect_status', $status, $location );
 
-	if ( ! $location )
-		return false;
+		if ( ! $location ) {
+			return false;
+		}
 
-	$location = wp_sanitize_redirect($location);
+		$location = wp_sanitize_redirect( $location );
 
-	if ( !$is_IIS && PHP_SAPI != 'cgi-fcgi' )
-		status_header($status); // This causes problems on IIS and some FastCGI setups
+		if ( ! $is_IIS && PHP_SAPI != 'cgi-fcgi' ) {
+			status_header( $status ); // This causes problems on IIS and some FastCGI setups
+		}
 
-	header("Location: $location", true, $status);
+		header( "Location: $location", true, $status );
 
-	return true;
-}
+		return true;
+	}
 endif;
 
-if ( !function_exists('wp_sanitize_redirect') ) :
-/**
+if ( ! function_exists( 'wp_sanitize_redirect' ) ) :
+	/**
  * Sanitizes a URL for use in a redirect.
  *
  * @since 2.3.0
@@ -1222,8 +1233,8 @@
  * @param string $location The path to redirect to.
  * @return string Redirect-sanitized URL.
  **/
-function wp_sanitize_redirect($location) {
-	$regex = '/
+	function wp_sanitize_redirect( $location ) {
+		$regex = '/
 		(
 			(?: [\xC2-\xDF][\x80-\xBF]        # double-byte sequences   110xxxxx 10xxxxxx
 			|   \xE0[\xA0-\xBF][\x80-\xBF]    # triple-byte sequences   1110xxxx 10xxxxxx * 2
@@ -1235,16 +1246,16 @@
 			|   \xF4[\x80-\x8F][\x80-\xBF]{2}
 		){1,40}                              # ...one or more times
 		)/x';
-	$location = preg_replace_callback( $regex, '_wp_sanitize_utf8_in_redirect', $location );
-	$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%!*\[\]()@]|i', '', $location);
-	$location = wp_kses_no_null($location);
-
-	// remove %0d and %0a from location
-	$strip = array('%0d', '%0a', '%0D', '%0A');
-	return _deep_replace( $strip, $location );
-}
+		$location = preg_replace_callback( $regex, '_wp_sanitize_utf8_in_redirect', $location );
+		$location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!*\[\]()@]|i', '', $location );
+		$location = wp_kses_no_null( $location );
+
+		// remove %0d and %0a from location
+		$strip = array( '%0d', '%0a', '%0D', '%0A' );
+		return _deep_replace( $strip, $location );
+	}
 
-/**
+	/**
  * URL encode UTF-8 characters in a URL.
  *
  * @ignore
@@ -1256,13 +1267,13 @@
  * @param array $matches RegEx matches against the redirect location.
  * @return string URL-encoded version of the first RegEx match.
  */
-function _wp_sanitize_utf8_in_redirect( $matches ) {
-	return urlencode( $matches[0] );
-}
+	function _wp_sanitize_utf8_in_redirect( $matches ) {
+		return urlencode( $matches[0] );
+	}
 endif;
 
-if ( !function_exists('wp_safe_redirect') ) :
-/**
+if ( ! function_exists( 'wp_safe_redirect' ) ) :
+	/**
  * Performs a safe (local) redirect, using wp_redirect().
  *
  * Checks whether the $location is using an allowed host, if it has an absolute
@@ -1278,12 +1289,12 @@
  * @param string $location The path to redirect to.
  * @param int    $status   Status code to use.
  */
-function wp_safe_redirect($location, $status = 302) {
+	function wp_safe_redirect( $location, $status = 302 ) {
 
-	// Need to look at the URL the way it will end up in wp_redirect()
-	$location = wp_sanitize_redirect($location);
+		// Need to look at the URL the way it will end up in wp_redirect()
+		$location = wp_sanitize_redirect( $location );
 
-	/**
+		/**
 	 * Filters the redirect fallback URL for when the provided redirect is not safe (local).
 	 *
 	 * @since 4.3.0
@@ -1291,14 +1302,14 @@
 	 * @param string $fallback_url The fallback URL to use by default.
 	 * @param int    $status       The redirect status.
 	 */
-	$location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );
+		$location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );
 
-	wp_redirect($location, $status);
-}
+		wp_redirect( $location, $status );
+	}
 endif;
 
-if ( !function_exists('wp_validate_redirect') ) :
-/**
+if ( ! function_exists( 'wp_validate_redirect' ) ) :
+	/**
  * Validates a URL for use in a redirect.
  *
  * Checks whether the $location is using an allowed host, if it has an absolute
@@ -1313,41 +1324,44 @@
  * @param string $default  The value to return if $location is not allowed
  * @return string redirect-sanitized URL
  **/
-function wp_validate_redirect($location, $default = '') {
-	$location = trim( $location, " \t\n\r\0\x08\x0B" );
-	// browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'
-	if ( substr($location, 0, 2) == '//' )
-		$location = 'http:' . $location;
-
-	// In php 5 parse_url may fail if the URL query part contains http://, bug #38143
-	$test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
-
-	// @-operator is used to prevent possible warnings in PHP < 5.3.3.
-	$lp = @parse_url($test);
-
-	// Give up if malformed URL
-	if ( false === $lp )
-		return $default;
-
-	// Allow only http and https schemes. No data:, etc.
-	if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) )
-		return $default;
-
-	// 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.
-	if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
-		return $default;
-	}
-
-	// Reject malformed components parse_url() can return on odd inputs.
-	foreach ( array( 'user', 'pass', 'host' ) as $component ) {
-		if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) {
+	function wp_validate_redirect( $location, $default = '' ) {
+		$location = trim( $location, " \t\n\r\0\x08\x0B" );
+		// browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'
+		if ( substr( $location, 0, 2 ) == '//' ) {
+			$location = 'http:' . $location;
+		}
+
+		// In php 5 parse_url may fail if the URL query part contains http://, bug #38143
+		$test = ( $cut = strpos( $location, '?' ) ) ? substr( $location, 0, $cut ) : $location;
+
+		// @-operator is used to prevent possible warnings in PHP < 5.3.3.
+		$lp = @parse_url( $test );
+
+		// Give up if malformed URL
+		if ( false === $lp ) {
 			return $default;
 		}
-	}
 
-	$wpp = parse_url(home_url());
+		// Allow only http and https schemes. No data:, etc.
+		if ( isset( $lp['scheme'] ) && ! ('http' == $lp['scheme'] || 'https' == $lp['scheme']) ) {
+			return $default;
+		}
 
-	/**
+		// 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.
+		if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
+			return $default;
+		}
+
+		// Reject malformed components parse_url() can return on odd inputs.
+		foreach ( array( 'user', 'pass', 'host' ) as $component ) {
+			if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) {
+				return $default;
+			}
+		}
+
+		$wpp = parse_url( home_url() );
+
+		/**
 	 * Filters the whitelist of hosts to redirect to.
 	 *
 	 * @since 2.3.0
@@ -1355,17 +1369,18 @@
 	 * @param array       $hosts An array of allowed hosts.
 	 * @param bool|string $host  The parsed host; empty if not isset.
 	 */
-	$allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '' );
+		$allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
 
-	if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
-		$location = $default;
+		if ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts ) && $lp['host'] != strtolower( $wpp['host'] )) ) {
+			$location = $default;
+		}
 
-	return $location;
-}
+		return $location;
+	}
 endif;
 
-if ( ! function_exists('wp_notify_postauthor') ) :
-/**
+if ( ! function_exists( 'wp_notify_postauthor' ) ) :
+	/**
  * Notify an author (and/or others) of a comment/trackback/pingback on a post.
  *
  * @since 1.0.0
@@ -1374,25 +1389,26 @@
  * @param string          $deprecated Not used
  * @return bool True on completion. False if no email addresses were specified.
  */
-function wp_notify_postauthor( $comment_id, $deprecated = null ) {
-	if ( null !== $deprecated ) {
-		_deprecated_argument( __FUNCTION__, '3.8.0' );
-	}
+	function wp_notify_postauthor( $comment_id, $deprecated = null ) {
+		if ( null !== $deprecated ) {
+			_deprecated_argument( __FUNCTION__, '3.8.0' );
+		}
 
-	$comment = get_comment( $comment_id );
-	if ( empty( $comment ) || empty( $comment->comment_post_ID ) )
-		return false;
+		$comment = get_comment( $comment_id );
+		if ( empty( $comment ) || empty( $comment->comment_post_ID ) ) {
+			return false;
+		}
 
-	$post    = get_post( $comment->comment_post_ID );
-	$author  = get_userdata( $post->post_author );
+		$post    = get_post( $comment->comment_post_ID );
+		$author  = get_userdata( $post->post_author );
 
-	// Who to notify? By default, just the post author, but others can be added.
-	$emails = array();
-	if ( $author ) {
-		$emails[] = $author->user_email;
-	}
+		// Who to notify? By default, just the post author, but others can be added.
+		$emails = array();
+		if ( $author ) {
+			$emails[] = $author->user_email;
+		}
 
-	/**
+		/**
 	 * Filters the list of email addresses to receive a comment notification.
 	 *
 	 * By default, only post authors are notified of comments. This filter allows
@@ -1403,18 +1419,18 @@
 	 * @param array $emails     An array of email addresses to receive a comment notification.
 	 * @param int   $comment_id The comment ID.
 	 */
-	$emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );
-	$emails = array_filter( $emails );
+		$emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );
+		$emails = array_filter( $emails );
 
-	// If there are no addresses to send the comment to, bail.
-	if ( ! count( $emails ) ) {
-		return false;
-	}
+		// If there are no addresses to send the comment to, bail.
+		if ( ! count( $emails ) ) {
+			return false;
+		}
 
-	// Facilitate unsetting below without knowing the keys.
-	$emails = array_flip( $emails );
+		// Facilitate unsetting below without knowing the keys.
+		$emails = array_flip( $emails );
 
-	/**
+		/**
 	 * Filters whether to notify comment authors of their comments on their own posts.
 	 *
 	 * By default, comment authors aren't notified of their comments on their own
@@ -1426,105 +1442,108 @@
 	 *                         Default false.
 	 * @param int  $comment_id The comment ID.
 	 */
-	$notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID );
+		$notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID );
 
-	// The comment was left by the author
-	if ( $author && ! $notify_author && $comment->user_id == $post->post_author ) {
-		unset( $emails[ $author->user_email ] );
-	}
+		// The comment was left by the author
+		if ( $author && ! $notify_author && $comment->user_id == $post->post_author ) {
+			unset( $emails[ $author->user_email ] );
+		}
 
-	// The author moderated a comment on their own post
-	if ( $author && ! $notify_author && $post->post_author == get_current_user_id() ) {
-		unset( $emails[ $author->user_email ] );
-	}
+		// The author moderated a comment on their own post
+		if ( $author && ! $notify_author && $post->post_author == get_current_user_id() ) {
+			unset( $emails[ $author->user_email ] );
+		}
 
-	// The post author is no longer a member of the blog
-	if ( $author && ! $notify_author && ! user_can( $post->post_author, 'read_post', $post->ID ) ) {
-		unset( $emails[ $author->user_email ] );
-	}
+		// The post author is no longer a member of the blog
+		if ( $author && ! $notify_author && ! user_can( $post->post_author, 'read_post', $post->ID ) ) {
+			unset( $emails[ $author->user_email ] );
+		}
 
-	// If there's no email to send the comment to, bail, otherwise flip array back around for use below
-	if ( ! count( $emails ) ) {
-		return false;
-	} else {
-		$emails = array_flip( $emails );
-	}
+		// If there's no email to send the comment to, bail, otherwise flip array back around for use below
+		if ( ! count( $emails ) ) {
+			return false;
+		} else {
+			$emails = array_flip( $emails );
+		}
 
-	$switched_locale = switch_to_locale( get_locale() );
+			$switched_locale = switch_to_locale( get_locale() );
 
-	$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
+			$comment_author_domain = @gethostbyaddr( $comment->comment_author_IP );
 
-	// The blogname option is escaped with esc_html on the way into the database in sanitize_option
-	// we want to reverse this for the plain text arena of emails.
-	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
-	$comment_content = wp_specialchars_decode( $comment->comment_content );
-
-	switch ( $comment->comment_type ) {
-		case 'trackback':
-			/* translators: 1: Post title */
-			$notify_message  = sprintf( __( 'New trackback on your post "%s"' ), $post->post_title ) . "\r\n";
-			/* translators: 1: Trackback/pingback website name, 2: website IP, 3: website hostname */
-			$notify_message .= sprintf( __('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
-			$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
-			$notify_message .= __( 'You can see all trackbacks on this post here:' ) . "\r\n";
-			/* translators: 1: blog name, 2: post title */
-			$subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title );
-			break;
-		case 'pingback':
-			/* translators: 1: Post title */
-			$notify_message  = sprintf( __( 'New pingback on your post "%s"' ), $post->post_title ) . "\r\n";
-			/* translators: 1: Trackback/pingback website name, 2: website IP, 3: website hostname */
-			$notify_message .= sprintf( __('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
-			$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
-			$notify_message .= __( 'You can see all pingbacks on this post here:' ) . "\r\n";
-			/* translators: 1: blog name, 2: post title */
-			$subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
-			break;
-		default: // Comments
-			$notify_message  = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n";
-			/* translators: 1: comment author, 2: author IP, 3: author domain */
-			$notify_message .= sprintf( __( 'Author: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
-			$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
-			$notify_message .= sprintf( __('Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
-			$notify_message .= __( 'You can see all comments on this post here:' ) . "\r\n";
-			/* translators: 1: blog name, 2: post title */
-			$subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title );
-			break;
-	}
-	$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
-	$notify_message .= sprintf( __('Permalink: %s'), get_comment_link( $comment ) ) . "\r\n";
+			// The blogname option is escaped with esc_html on the way into the database in sanitize_option
+			// we want to reverse this for the plain text arena of emails.
+			$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
+			$comment_content = wp_specialchars_decode( $comment->comment_content );
+
+		switch ( $comment->comment_type ) {
+			case 'trackback':
+				/* translators: 1: Post title */
+				$notify_message  = sprintf( __( 'New trackback on your post "%s"' ), $post->post_title ) . "\r\n";
+				/* translators: 1: Trackback/pingback website name, 2: website IP, 3: website hostname */
+				$notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
+				$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
+				$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
+				$notify_message .= __( 'You can see all trackbacks on this post here:' ) . "\r\n";
+				/* translators: 1: blog name, 2: post title */
+				$subject = sprintf( __( '[%1$s] Trackback: "%2$s"' ), $blogname, $post->post_title );
+				break;
+			case 'pingback':
+				/* translators: 1: Post title */
+				$notify_message  = sprintf( __( 'New pingback on your post "%s"' ), $post->post_title ) . "\r\n";
+				/* translators: 1: Trackback/pingback website name, 2: website IP, 3: website hostname */
+				$notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
+				$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
+				$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
+				$notify_message .= __( 'You can see all pingbacks on this post here:' ) . "\r\n";
+				/* translators: 1: blog name, 2: post title */
+				$subject = sprintf( __( '[%1$s] Pingback: "%2$s"' ), $blogname, $post->post_title );
+				break;
+			default: // Comments
+				$notify_message  = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n";
+				/* translators: 1: comment author, 2: author IP, 3: author domain */
+				$notify_message .= sprintf( __( 'Author: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
+				$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
+				$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
+				$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
+				$notify_message .= __( 'You can see all comments on this post here:' ) . "\r\n";
+				/* translators: 1: blog name, 2: post title */
+				$subject = sprintf( __( '[%1$s] Comment: "%2$s"' ), $blogname, $post->post_title );
+				break;
+		}
+			$notify_message .= get_permalink( $comment->comment_post_ID ) . "#comments\r\n\r\n";
+			$notify_message .= sprintf( __( 'Permalink: %s' ), get_comment_link( $comment ) ) . "\r\n";
 
-	if ( user_can( $post->post_author, 'edit_comment', $comment->comment_ID ) ) {
-		if ( EMPTY_TRASH_DAYS ) {
-			$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
-		} else {
-			$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
+		if ( user_can( $post->post_author, 'edit_comment', $comment->comment_ID ) ) {
+			if ( EMPTY_TRASH_DAYS ) {
+				$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
+			} else {
+				$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
+			}
+			$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
 		}
-		$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
-	}
 
-	$wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
+			$wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', strtolower( $_SERVER['SERVER_NAME'] ) );
 
-	if ( '' == $comment->comment_author ) {
-		$from = "From: \"$blogname\" <$wp_email>";
-		if ( '' != $comment->comment_author_email )
-			$reply_to = "Reply-To: $comment->comment_author_email";
-	} else {
-		$from = "From: \"$comment->comment_author\" <$wp_email>";
-		if ( '' != $comment->comment_author_email )
-			$reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
-	}
+		if ( '' == $comment->comment_author ) {
+			$from = "From: \"$blogname\" <$wp_email>";
+			if ( '' != $comment->comment_author_email ) {
+				$reply_to = "Reply-To: $comment->comment_author_email";
+			}
+		} else {
+			$from = "From: \"$comment->comment_author\" <$wp_email>";
+			if ( '' != $comment->comment_author_email ) {
+				$reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
+			}
+		}
 
-	$message_headers = "$from\n"
-		. "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
+			$message_headers = "$from\n"
+			. 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
 
-	if ( isset($reply_to) )
-		$message_headers .= $reply_to . "\n";
+		if ( isset( $reply_to ) ) {
+			$message_headers .= $reply_to . "\n";
+		}
 
-	/**
+			/**
 	 * Filters the comment notification email text.
 	 *
 	 * @since 1.5.2
@@ -1532,9 +1551,9 @@
 	 * @param string $notify_message The comment notification email text.
 	 * @param int    $comment_id     Comment ID.
 	 */
-	$notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment->comment_ID );
+			$notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment->comment_ID );
 
-	/**
+			/**
 	 * Filters the comment notification email subject.
 	 *
 	 * @since 1.5.2
@@ -1542,9 +1561,9 @@
 	 * @param string $subject    The comment notification email subject.
 	 * @param int    $comment_id Comment ID.
 	 */
-	$subject = apply_filters( 'comment_notification_subject', $subject, $comment->comment_ID );
+			$subject = apply_filters( 'comment_notification_subject', $subject, $comment->comment_ID );
 
-	/**
+			/**
 	 * Filters the comment notification email headers.
 	 *
 	 * @since 1.5.2
@@ -1552,22 +1571,22 @@
 	 * @param string $message_headers Headers for the comment notification email.
 	 * @param int    $comment_id      Comment ID.
 	 */
-	$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment->comment_ID );
+			$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment->comment_ID );
 
-	foreach ( $emails as $email ) {
-		@wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
-	}
+		foreach ( $emails as $email ) {
+			@wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
+		}
 
-	if ( $switched_locale ) {
-		restore_previous_locale();
-	}
+		if ( $switched_locale ) {
+			restore_previous_locale();
+		}
 
-	return true;
-}
+			return true;
+	}
 endif;
 
-if ( !function_exists('wp_notify_moderator') ) :
-/**
+if ( ! function_exists( 'wp_notify_moderator' ) ) :
+	/**
  * Notifies the moderator of the site about a new comment that is awaiting approval.
  *
  * @since 1.0.0
@@ -1580,12 +1599,12 @@
  * @param int $comment_id Comment ID.
  * @return true Always returns true.
  */
-function wp_notify_moderator($comment_id) {
-	global $wpdb;
+	function wp_notify_moderator( $comment_id ) {
+		global $wpdb;
 
-	$maybe_notify = get_option( 'moderation_notify' );
+		$maybe_notify = get_option( 'moderation_notify' );
 
-	/**
+		/**
 	 * Filters whether to send the site moderator email notifications, overriding the site setting.
 	 *
 	 * @since 4.4.0
@@ -1593,92 +1612,93 @@
 	 * @param bool $maybe_notify Whether to notify blog moderator.
 	 * @param int  $comment_ID   The id of the comment for the notification.
 	 */
-	$maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id );
+		$maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id );
 
-	if ( ! $maybe_notify ) {
-		return true;
-	}
+		if ( ! $maybe_notify ) {
+			return true;
+		}
 
-	$comment = get_comment($comment_id);
-	$post = get_post($comment->comment_post_ID);
-	$user = get_userdata( $post->post_author );
-	// Send to the administration and to the post author if the author can modify the comment.
-	$emails = array( get_option( 'admin_email' ) );
-	if ( $user && user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) {
-		if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) )
-			$emails[] = $user->user_email;
-	}
-
-	$switched_locale = switch_to_locale( get_locale() );
-
-	$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
-	$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
-
-	// The blogname option is escaped with esc_html on the way into the database in sanitize_option
-	// we want to reverse this for the plain text arena of emails.
-	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
-	$comment_content = wp_specialchars_decode( $comment->comment_content );
-
-	switch ( $comment->comment_type ) {
-		case 'trackback':
-			/* translators: 1: Post title */
-			$notify_message  = sprintf( __('A new trackback on the post "%s" is waiting for your approval'), $post->post_title ) . "\r\n";
-			$notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
-			/* translators: 1: Trackback/pingback website name, 2: website IP, 3: website hostname */
-			$notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
-			/* translators: 1: Trackback/pingback/comment author URL */
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
-			$notify_message .= __('Trackback excerpt: ') . "\r\n" . $comment_content . "\r\n\r\n";
-			break;
-		case 'pingback':
-			/* translators: 1: Post title */
-			$notify_message  = sprintf( __('A new pingback on the post "%s" is waiting for your approval'), $post->post_title ) . "\r\n";
-			$notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
-			/* translators: 1: Trackback/pingback website name, 2: website IP, 3: website hostname */
-			$notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
-			/* translators: 1: Trackback/pingback/comment author URL */
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
-			$notify_message .= __('Pingback excerpt: ') . "\r\n" . $comment_content . "\r\n\r\n";
-			break;
-		default: // Comments
-			/* translators: 1: Post title */
-			$notify_message  = sprintf( __('A new comment on the post "%s" is waiting for your approval'), $post->post_title ) . "\r\n";
-			$notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
-			/* translators: 1: Comment author name, 2: comment author's IP, 3: comment author IP's hostname */
-			$notify_message .= sprintf( __( 'Author: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
-			/* translators: 1: Comment author URL */
-			$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
-			/* translators: 1: Trackback/pingback/comment author URL */
-			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
-			/* translators: 1: Comment text */
-			$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
-			break;
-	}
+		$comment = get_comment( $comment_id );
+		$post = get_post( $comment->comment_post_ID );
+		$user = get_userdata( $post->post_author );
+		// Send to the administration and to the post author if the author can modify the comment.
+		$emails = array( get_option( 'admin_email' ) );
+		if ( $user && user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) {
+			if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
+				$emails[] = $user->user_email;
+			}
+		}
+
+		$switched_locale = switch_to_locale( get_locale() );
 
-	/* translators: Comment moderation. 1: Comment action URL */
-	$notify_message .= sprintf( __( 'Approve it: %s' ), admin_url( "comment.php?action=approve&c={$comment_id}#wpbody-content" ) ) . "\r\n";
+		$comment_author_domain = @gethostbyaddr( $comment->comment_author_IP );
+		$comments_waiting = $wpdb->get_var( "SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'" );
+
+		// The blogname option is escaped with esc_html on the way into the database in sanitize_option
+		// we want to reverse this for the plain text arena of emails.
+		$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
+		$comment_content = wp_specialchars_decode( $comment->comment_content );
+
+		switch ( $comment->comment_type ) {
+			case 'trackback':
+				/* translators: 1: Post title */
+				$notify_message  = sprintf( __( 'A new trackback on the post "%s" is waiting for your approval' ), $post->post_title ) . "\r\n";
+				$notify_message .= get_permalink( $comment->comment_post_ID ) . "\r\n\r\n";
+				/* translators: 1: Trackback/pingback website name, 2: website IP, 3: website hostname */
+				$notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
+				/* translators: 1: Trackback/pingback/comment author URL */
+				$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
+				$notify_message .= __( 'Trackback excerpt: ' ) . "\r\n" . $comment_content . "\r\n\r\n";
+				break;
+			case 'pingback':
+				/* translators: 1: Post title */
+				$notify_message  = sprintf( __( 'A new pingback on the post "%s" is waiting for your approval' ), $post->post_title ) . "\r\n";
+				$notify_message .= get_permalink( $comment->comment_post_ID ) . "\r\n\r\n";
+				/* translators: 1: Trackback/pingback website name, 2: website IP, 3: website hostname */
+				$notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
+				/* translators: 1: Trackback/pingback/comment author URL */
+				$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
+				$notify_message .= __( 'Pingback excerpt: ' ) . "\r\n" . $comment_content . "\r\n\r\n";
+				break;
+			default: // Comments
+				/* translators: 1: Post title */
+				$notify_message  = sprintf( __( 'A new comment on the post "%s" is waiting for your approval' ), $post->post_title ) . "\r\n";
+				$notify_message .= get_permalink( $comment->comment_post_ID ) . "\r\n\r\n";
+				/* translators: 1: Comment author name, 2: comment author's IP, 3: comment author IP's hostname */
+				$notify_message .= sprintf( __( 'Author: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
+				/* translators: 1: Comment author URL */
+				$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
+				/* translators: 1: Trackback/pingback/comment author URL */
+				$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
+				/* translators: 1: Comment text */
+				$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
+				break;
+		}
 
-	if ( EMPTY_TRASH_DAYS ) {
-		/* translators: Comment moderation. 1: Comment action URL */
-		$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment_id}#wpbody-content" ) ) . "\r\n";
-	} else {
 		/* translators: Comment moderation. 1: Comment action URL */
-		$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment_id}#wpbody-content" ) ) . "\r\n";
-	}
+		$notify_message .= sprintf( __( 'Approve it: %s' ), admin_url( "comment.php?action=approve&c={$comment_id}#wpbody-content" ) ) . "\r\n";
 
-	/* translators: Comment moderation. 1: Comment action URL */
-	$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment_id}#wpbody-content" ) ) . "\r\n";
+		if ( EMPTY_TRASH_DAYS ) {
+			/* translators: Comment moderation. 1: Comment action URL */
+			$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment_id}#wpbody-content" ) ) . "\r\n";
+		} else {
+			/* translators: Comment moderation. 1: Comment action URL */
+			$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment_id}#wpbody-content" ) ) . "\r\n";
+		}
 
-	/* translators: Comment moderation. 1: Number of comments awaiting approval */
-	$notify_message .= sprintf( _n('Currently %s comment is waiting for approval. Please visit the moderation panel:',
- 		'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n";
-	$notify_message .= admin_url( "edit-comments.php?comment_status=moderated#wpbody-content" ) . "\r\n";
+			/* translators: Comment moderation. 1: Comment action URL */
+			$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment_id}#wpbody-content" ) ) . "\r\n";
 
-	/* translators: Comment moderation notification email subject. 1: Site name, 2: Post title */
-	$subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title );
-	$message_headers = '';
+			/* translators: Comment moderation. 1: Number of comments awaiting approval */
+			$notify_message .= sprintf( _n('Currently %s comment is waiting for approval. Please visit the moderation panel:',
+			'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n( $comments_waiting ) ) . "\r\n";
+			$notify_message .= admin_url( 'edit-comments.php?comment_status=moderated#wpbody-content' ) . "\r\n";
+
+			/* translators: Comment moderation notification email subject. 1: Site name, 2: Post title */
+			$subject = sprintf( __( '[%1$s] Please moderate: "%2$s"' ), $blogname, $post->post_title );
+			$message_headers = '';
 
-	/**
+			/**
 	 * Filters the list of recipients for comment moderation emails.
 	 *
 	 * @since 3.7.0
@@ -1686,9 +1706,9 @@
 	 * @param array $emails     List of email addresses to notify for comment moderation.
 	 * @param int   $comment_id Comment ID.
 	 */
-	$emails = apply_filters( 'comment_moderation_recipients', $emails, $comment_id );
+			$emails = apply_filters( 'comment_moderation_recipients', $emails, $comment_id );
 
-	/**
+			/**
 	 * Filters the comment moderation email text.
 	 *
 	 * @since 1.5.2
@@ -1696,9 +1716,9 @@
 	 * @param string $notify_message Text of the comment moderation email.
 	 * @param int    $comment_id     Comment ID.
 	 */
-	$notify_message = apply_filters( 'comment_moderation_text', $notify_message, $comment_id );
+			$notify_message = apply_filters( 'comment_moderation_text', $notify_message, $comment_id );
 
-	/**
+			/**
 	 * Filters the comment moderation email subject.
 	 *
 	 * @since 1.5.2
@@ -1706,9 +1726,9 @@
 	 * @param string $subject    Subject of the comment moderation email.
 	 * @param int    $comment_id Comment ID.
 	 */
-	$subject = apply_filters( 'comment_moderation_subject', $subject, $comment_id );
+			$subject = apply_filters( 'comment_moderation_subject', $subject, $comment_id );
 
-	/**
+			/**
 	 * Filters the comment moderation email headers.
 	 *
 	 * @since 2.8.0
@@ -1716,45 +1736,45 @@
 	 * @param string $message_headers Headers for the comment moderation email.
 	 * @param int    $comment_id      Comment ID.
 	 */
-	$message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id );
+			$message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id );
 
-	foreach ( $emails as $email ) {
-		@wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
-	}
+		foreach ( $emails as $email ) {
+			@wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
+		}
 
-	if ( $switched_locale ) {
-		restore_previous_locale();
-	}
+		if ( $switched_locale ) {
+			restore_previous_locale();
+		}
 
-	return true;
-}
+			return true;
+	}
 endif;
 
-if ( !function_exists('wp_password_change_notification') ) :
-/**
+if ( ! function_exists( 'wp_password_change_notification' ) ) :
+	/**
  * Notify the blog admin of a user changing password, normally via email.
  *
  * @since 2.7.0
  *
  * @param WP_User $user User object.
  */
-function wp_password_change_notification( $user ) {
-	// send a copy of password change notification to the admin
-	// but check to see if it's the admin whose password we're changing, and skip this
-	if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
-		/* translators: %s: user name */
-		$message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . "\r\n";
-		// The blogname option is escaped with esc_html on the way into the database in sanitize_option
-		// we want to reverse this for the plain text arena of emails.
-		$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
-		/* translators: %s: site title */
-		wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Password Changed' ), $blogname ), $message );
+	function wp_password_change_notification( $user ) {
+		// send a copy of password change notification to the admin
+		// but check to see if it's the admin whose password we're changing, and skip this
+		if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
+			/* translators: %s: user name */
+			$message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . "\r\n";
+			// The blogname option is escaped with esc_html on the way into the database in sanitize_option
+			// we want to reverse this for the plain text arena of emails.
+			$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
+			/* translators: %s: site title */
+			wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Password Changed' ), $blogname ), $message );
+		}
 	}
-}
 endif;
 
-if ( !function_exists('wp_new_user_notification') ) :
-/**
+if ( ! function_exists( 'wp_new_user_notification' ) ) :
+	/**
  * Email login credentials to a newly-registered user.
  *
  * A new user registration notification is also sent to admin email.
@@ -1772,68 +1792,72 @@
  * @param string $notify     Optional. Type of notification that should happen. Accepts 'admin' or an empty
  *                           string (admin only), 'user', or 'both' (admin and user). Default empty.
  */
-function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
-	if ( $deprecated !== null ) {
-		_deprecated_argument( __FUNCTION__, '4.3.1' );
-	}
+	function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
+		if ( $deprecated !== null ) {
+			_deprecated_argument( __FUNCTION__, '4.3.1' );
+		}
 
-	global $wpdb, $wp_hasher;
-	$user = get_userdata( $user_id );
+		global $wpdb, $wp_hasher;
+		$user = get_userdata( $user_id );
 
-	// The blogname option is escaped with esc_html on the way into the database in sanitize_option
-	// we want to reverse this for the plain text arena of emails.
-	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
+		// The blogname option is escaped with esc_html on the way into the database in sanitize_option
+		// we want to reverse this for the plain text arena of emails.
+		$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
 
-	if ( 'user' !== $notify ) {
-		$switched_locale = switch_to_locale( get_locale() );
-		$message  = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
-		$message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
-		$message .= sprintf( __( 'Email: %s' ), $user->user_email ) . "\r\n";
+		if ( 'user' !== $notify ) {
+			$switched_locale = switch_to_locale( get_locale() );
+			$message  = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
+			$message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
+			$message .= sprintf( __( 'Email: %s' ), $user->user_email ) . "\r\n";
 
-		@wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] New User Registration' ), $blogname ), $message );
+			@wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] New User Registration' ), $blogname ), $message );
 
-		if ( $switched_locale ) {
-			restore_previous_locale();
+			if ( $switched_locale ) {
+				restore_previous_locale();
+			}
 		}
-	}
 
-	// `$deprecated was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification.
-	if ( 'admin' === $notify || ( empty( $deprecated ) && empty( $notify ) ) ) {
-		return;
-	}
-
-	// Generate something random for a password reset key.
-	$key = wp_generate_password( 20, false );
-
-	/** This action is documented in wp-login.php */
-	do_action( 'retrieve_password_key', $user->user_login, $key );
+		// `$deprecated was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification.
+		if ( 'admin' === $notify || ( empty( $deprecated ) && empty( $notify ) ) ) {
+			return;
+		}
 
-	// Now insert the key, hashed, into the DB.
-	if ( empty( $wp_hasher ) ) {
-		require_once ABSPATH . WPINC . '/class-phpass.php';
-		$wp_hasher = new PasswordHash( 8, true );
-	}
-	$hashed = time() . ':' . $wp_hasher->HashPassword( $key );
-	$wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user->user_login ) );
+		// Generate something random for a password reset key.
+		$key = wp_generate_password( 20, false );
 
-	$switched_locale = switch_to_locale( get_user_locale( $user ) );
+		/** This action is documented in wp-login.php */
+		do_action( 'retrieve_password_key', $user->user_login, $key );
 
-	$message = sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
-	$message .= __('To set your password, visit the following address:') . "\r\n\r\n";
-	$message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login), 'login') . ">\r\n\r\n";
+		// Now insert the key, hashed, into the DB.
+		if ( empty( $wp_hasher ) ) {
+			require_once ABSPATH . WPINC . '/class-phpass.php';
+			$wp_hasher = new PasswordHash( 8, true );
+		}
+		$hashed = time() . ':' . $wp_hasher->HashPassword( $key );
+		$wpdb->update( $wpdb->users, array(
+			'user_activation_key' => $hashed,
+			), array(
+			'user_login' => $user->user_login,
+		) );
+
+		$switched_locale = switch_to_locale( get_user_locale( $user ) );
+
+		$message = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
+		$message .= __( 'To set your password, visit the following address:' ) . "\r\n\r\n";
+		$message .= '<' . network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . ">\r\n\r\n";
 
-	$message .= wp_login_url() . "\r\n";
+		$message .= wp_login_url() . "\r\n";
 
-	wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message);
+		wp_mail( $user->user_email, sprintf( __( '[%s] Your username and password info' ), $blogname ), $message );
 
-	if ( $switched_locale ) {
-		restore_previous_locale();
+		if ( $switched_locale ) {
+			restore_previous_locale();
+		}
 	}
-}
 endif;
 
-if ( !function_exists('wp_nonce_tick') ) :
-/**
+if ( ! function_exists( 'wp_nonce_tick' ) ) :
+	/**
  * Get the time-dependent variable for nonce creation.
  *
  * A nonce has a lifespan of two ticks. Nonces in their second tick may be
@@ -1843,22 +1867,22 @@
  *
  * @return float Float value rounded up to the next highest integer.
  */
-function wp_nonce_tick() {
-	/**
+	function wp_nonce_tick() {
+		/**
 	 * Filters the lifespan of nonces in seconds.
 	 *
 	 * @since 2.5.0
 	 *
 	 * @param int $lifespan Lifespan of nonces in seconds. Default 86,400 seconds, or one day.
 	 */
-	$nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS );
+		$nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS );
 
-	return ceil(time() / ( $nonce_life / 2 ));
-}
+		return ceil( time() / ( $nonce_life / 2 ) );
+	}
 endif;
 
-if ( !function_exists('wp_verify_nonce') ) :
-/**
+if ( ! function_exists( 'wp_verify_nonce' ) ) :
+	/**
  * Verify that correct nonce was used with time limit.
  *
  * The user is given an amount of time to use the token, so therefore, since the
@@ -1871,12 +1895,12 @@
  * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
  *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
  */
-function wp_verify_nonce( $nonce, $action = -1 ) {
-	$nonce = (string) $nonce;
-	$user = wp_get_current_user();
-	$uid = (int) $user->ID;
-	if ( ! $uid ) {
-		/**
+	function wp_verify_nonce( $nonce, $action = -1 ) {
+		$nonce = (string) $nonce;
+		$user = wp_get_current_user();
+		$uid = (int) $user->ID;
+		if ( ! $uid ) {
+			/**
 		 * Filters whether the user who generated the nonce is logged out.
 		 *
 		 * @since 3.5.0
@@ -1884,29 +1908,29 @@
 		 * @param int    $uid    ID of the nonce-owning user.
 		 * @param string $action The nonce action.
 		 */
-		$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
-	}
+			$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
+		}
 
-	if ( empty( $nonce ) ) {
-		return false;
-	}
+		if ( empty( $nonce ) ) {
+			return false;
+		}
 
-	$token = wp_get_session_token();
-	$i = wp_nonce_tick();
+		$token = wp_get_session_token();
+		$i = wp_nonce_tick();
 
-	// Nonce generated 0-12 hours ago
-	$expected = substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10 );
-	if ( hash_equals( $expected, $nonce ) ) {
-		return 1;
-	}
+		// Nonce generated 0-12 hours ago
+		$expected = substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
+		if ( hash_equals( $expected, $nonce ) ) {
+			return 1;
+		}
 
-	// Nonce generated 12-24 hours ago
-	$expected = substr( wp_hash( ( $i - 1 ) . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
-	if ( hash_equals( $expected, $nonce ) ) {
-		return 2;
-	}
+		// Nonce generated 12-24 hours ago
+		$expected = substr( wp_hash( ( $i - 1 ) . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
+		if ( hash_equals( $expected, $nonce ) ) {
+			return 2;
+		}
 
-	/**
+		/**
 	 * Fires when nonce verification fails.
 	 *
 	 * @since 4.4.0
@@ -1916,15 +1940,15 @@
 	 * @param WP_User    $user   The current user object.
 	 * @param string     $token  The user's session token.
 	 */
-	do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token );
+		do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token );
 
-	// Invalid nonce
-	return false;
-}
+		// Invalid nonce
+		return false;
+	}
 endif;
 
-if ( !function_exists('wp_create_nonce') ) :
-/**
+if ( ! function_exists( 'wp_create_nonce' ) ) :
+	/**
  * Creates a cryptographic token tied to a specific action, user, user session,
  * and window of time.
  *
@@ -1934,23 +1958,23 @@
  * @param string|int $action Scalar value to add context to the nonce.
  * @return string The token.
  */
-function wp_create_nonce($action = -1) {
-	$user = wp_get_current_user();
-	$uid = (int) $user->ID;
-	if ( ! $uid ) {
-		/** This filter is documented in wp-includes/pluggable.php */
-		$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
-	}
+	function wp_create_nonce( $action = -1 ) {
+		$user = wp_get_current_user();
+		$uid = (int) $user->ID;
+		if ( ! $uid ) {
+			/** This filter is documented in wp-includes/pluggable.php */
+			$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
+		}
 
-	$token = wp_get_session_token();
-	$i = wp_nonce_tick();
+		$token = wp_get_session_token();
+		$i = wp_nonce_tick();
 
-	return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
-}
+		return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
+	}
 endif;
 
-if ( !function_exists('wp_salt') ) :
-/**
+if ( ! function_exists( 'wp_salt' ) ) :
+	/**
  * Get salt to add to hashes.
  *
  * Salts are created using secret keys. Secret keys are located in two places:
@@ -1985,10 +2009,10 @@
  * @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce)
  * @return string Salt value
  */
-function wp_salt( $scheme = 'auth' ) {
-	static $cached_salts = array();
-	if ( isset( $cached_salts[ $scheme ] ) ) {
-		/**
+	function wp_salt( $scheme = 'auth' ) {
+		static $cached_salts = array();
+		if ( isset( $cached_salts[ $scheme ] ) ) {
+			/**
 		 * Filters the WordPress salt.
 		 *
 		 * @since 2.5.0
@@ -1997,67 +2021,69 @@
 		 * @param string $scheme      Authentication scheme. Values include 'auth',
 		 *                            'secure_auth', 'logged_in', and 'nonce'.
 		 */
-		return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
-	}
+			return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
+		}
 
-	static $duplicated_keys;
-	if ( null === $duplicated_keys ) {
-		$duplicated_keys = array( 'put your unique phrase here' => true );
-		foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
-			foreach ( array( 'KEY', 'SALT' ) as $second ) {
-				if ( ! defined( "{$first}_{$second}" ) ) {
-					continue;
+		static $duplicated_keys;
+		if ( null === $duplicated_keys ) {
+			$duplicated_keys = array(
+				'put your unique phrase here' => true,
+			);
+			foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
+				foreach ( array( 'KEY', 'SALT' ) as $second ) {
+					if ( ! defined( "{$first}_{$second}" ) ) {
+						continue;
+					}
+					$value = constant( "{$first}_{$second}" );
+					$duplicated_keys[ $value ] = isset( $duplicated_keys[ $value ] );
 				}
-				$value = constant( "{$first}_{$second}" );
-				$duplicated_keys[ $value ] = isset( $duplicated_keys[ $value ] );
 			}
 		}
-	}
 
-	$values = array(
+		$values = array(
 		'key' => '',
-		'salt' => ''
-	);
-	if ( defined( 'SECRET_KEY' ) && SECRET_KEY && empty( $duplicated_keys[ SECRET_KEY ] ) ) {
-		$values['key'] = SECRET_KEY;
-	}
-	if ( 'auth' == $scheme && defined( 'SECRET_SALT' ) && SECRET_SALT && empty( $duplicated_keys[ SECRET_SALT ] ) ) {
-		$values['salt'] = SECRET_SALT;
-	}
-
-	if ( in_array( $scheme, array( 'auth', 'secure_auth', 'logged_in', 'nonce' ) ) ) {
-		foreach ( array( 'key', 'salt' ) as $type ) {
-			$const = strtoupper( "{$scheme}_{$type}" );
-			if ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) {
-				$values[ $type ] = constant( $const );
-			} elseif ( ! $values[ $type ] ) {
-				$values[ $type ] = get_site_option( "{$scheme}_{$type}" );
-				if ( ! $values[ $type ] ) {
-					$values[ $type ] = wp_generate_password( 64, true, true );
-					update_site_option( "{$scheme}_{$type}", $values[ $type ] );
+		'salt' => '',
+			);
+		if ( defined( 'SECRET_KEY' ) && SECRET_KEY && empty( $duplicated_keys[ SECRET_KEY ] ) ) {
+			$values['key'] = SECRET_KEY;
+		}
+		if ( 'auth' == $scheme && defined( 'SECRET_SALT' ) && SECRET_SALT && empty( $duplicated_keys[ SECRET_SALT ] ) ) {
+			$values['salt'] = SECRET_SALT;
+		}
+
+		if ( in_array( $scheme, array( 'auth', 'secure_auth', 'logged_in', 'nonce' ) ) ) {
+			foreach ( array( 'key', 'salt' ) as $type ) {
+				$const = strtoupper( "{$scheme}_{$type}" );
+				if ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) {
+					$values[ $type ] = constant( $const );
+				} elseif ( ! $values[ $type ] ) {
+					$values[ $type ] = get_site_option( "{$scheme}_{$type}" );
+					if ( ! $values[ $type ] ) {
+						$values[ $type ] = wp_generate_password( 64, true, true );
+						update_site_option( "{$scheme}_{$type}", $values[ $type ] );
+					}
 				}
 			}
-		}
-	} else {
-		if ( ! $values['key'] ) {
-			$values['key'] = get_site_option( 'secret_key' );
+		} else {
 			if ( ! $values['key'] ) {
-				$values['key'] = wp_generate_password( 64, true, true );
-				update_site_option( 'secret_key', $values['key'] );
+				$values['key'] = get_site_option( 'secret_key' );
+				if ( ! $values['key'] ) {
+					$values['key'] = wp_generate_password( 64, true, true );
+					update_site_option( 'secret_key', $values['key'] );
+				}
 			}
+			$values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
 		}
-		$values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
-	}
 
-	$cached_salts[ $scheme ] = $values['key'] . $values['salt'];
+			$cached_salts[ $scheme ] = $values['key'] . $values['salt'];
 
-	/** This filter is documented in wp-includes/pluggable.php */
-	return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
-}
+			/** This filter is documented in wp-includes/pluggable.php */
+			return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
+	}
 endif;
 
-if ( !function_exists('wp_hash') ) :
-/**
+if ( ! function_exists( 'wp_hash' ) ) :
+	/**
  * Get hash of given string.
  *
  * @since 2.0.3
@@ -2066,15 +2092,15 @@
  * @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce)
  * @return string Hash of $data
  */
-function wp_hash($data, $scheme = 'auth') {
-	$salt = wp_salt($scheme);
+	function wp_hash( $data, $scheme = 'auth' ) {
+		$salt = wp_salt( $scheme );
 
-	return hash_hmac('md5', $data, $salt);
-}
+		return hash_hmac( 'md5', $data, $salt );
+	}
 endif;
 
-if ( !function_exists('wp_hash_password') ) :
-/**
+if ( ! function_exists( 'wp_hash_password' ) ) :
+	/**
  * Create a hash (encrypt) of a plain text password.
  *
  * For integration with other applications, this function can be overwritten to
@@ -2087,21 +2113,21 @@
  * @param string $password Plain text user password to hash
  * @return string The hash string of the password
  */
-function wp_hash_password($password) {
-	global $wp_hasher;
+	function wp_hash_password( $password ) {
+		global $wp_hasher;
 
-	if ( empty($wp_hasher) ) {
-		require_once( ABSPATH . WPINC . '/class-phpass.php');
-		// By default, use the portable hash from phpass
-		$wp_hasher = new PasswordHash(8, true);
-	}
+		if ( empty( $wp_hasher ) ) {
+			require_once( ABSPATH . WPINC . '/class-phpass.php' );
+			// By default, use the portable hash from phpass
+			$wp_hasher = new PasswordHash( 8, true );
+		}
 
-	return $wp_hasher->HashPassword( trim( $password ) );
-}
+		return $wp_hasher->HashPassword( trim( $password ) );
+	}
 endif;
 
-if ( !function_exists('wp_check_password') ) :
-/**
+if ( ! function_exists( 'wp_check_password' ) ) :
+	/**
  * Checks the plaintext password against the encrypted Password.
  *
  * Maintains compatibility between old version and the new cookie authentication
@@ -2123,19 +2149,19 @@
  * @param string|int $user_id  Optional. User ID.
  * @return bool False, if the $password does not match the hashed password
  */
-function wp_check_password($password, $hash, $user_id = '') {
-	global $wp_hasher;
+	function wp_check_password( $password, $hash, $user_id = '' ) {
+		global $wp_hasher;
 
-	// If the hash is still md5...
-	if ( strlen($hash) <= 32 ) {
-		$check = hash_equals( $hash, md5( $password ) );
-		if ( $check && $user_id ) {
-			// Rehash using new hash.
-			wp_set_password($password, $user_id);
-			$hash = wp_hash_password($password);
-		}
+		// If the hash is still md5...
+		if ( strlen( $hash ) <= 32 ) {
+			$check = hash_equals( $hash, md5( $password ) );
+			if ( $check && $user_id ) {
+				// Rehash using new hash.
+				wp_set_password( $password, $user_id );
+				$hash = wp_hash_password( $password );
+			}
 
-		/**
+			/**
 		 * Filters whether the plaintext password matches the encrypted password.
 		 *
 		 * @since 2.5.0
@@ -2145,26 +2171,26 @@
 		 * @param string     $hash     The hashed password.
 		 * @param string|int $user_id  User ID. Can be empty.
 		 */
-		return apply_filters( 'check_password', $check, $password, $hash, $user_id );
-	}
+			return apply_filters( 'check_password', $check, $password, $hash, $user_id );
+		}
 
-	// If the stored hash is longer than an MD5, presume the
-	// new style phpass portable hash.
-	if ( empty($wp_hasher) ) {
-		require_once( ABSPATH . WPINC . '/class-phpass.php');
-		// By default, use the portable hash from phpass
-		$wp_hasher = new PasswordHash(8, true);
-	}
+		// If the stored hash is longer than an MD5, presume the
+		// new style phpass portable hash.
+		if ( empty( $wp_hasher ) ) {
+			require_once( ABSPATH . WPINC . '/class-phpass.php' );
+			// By default, use the portable hash from phpass
+			$wp_hasher = new PasswordHash( 8, true );
+		}
 
-	$check = $wp_hasher->CheckPassword($password, $hash);
+		$check = $wp_hasher->CheckPassword( $password, $hash );
 
-	/** This filter is documented in wp-includes/pluggable.php */
-	return apply_filters( 'check_password', $check, $password, $hash, $user_id );
-}
+		/** This filter is documented in wp-includes/pluggable.php */
+		return apply_filters( 'check_password', $check, $password, $hash, $user_id );
+	}
 endif;
 
-if ( !function_exists('wp_generate_password') ) :
-/**
+if ( ! function_exists( 'wp_generate_password' ) ) :
+	/**
  * Generates a random password drawn from the defined set of characters.
  *
  * @since 2.5.0
@@ -2176,31 +2202,33 @@
  *                                  Used when generating secret keys and salts. Default false.
  * @return string The random password.
  */
-function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) {
-	$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
-	if ( $special_chars )
-		$chars .= '!@#$%^&*()';
-	if ( $extra_special_chars )
-		$chars .= '-_ []{}<>~`+=,.;:/?|';
-
-	$password = '';
-	for ( $i = 0; $i < $length; $i++ ) {
-		$password .= substr($chars, wp_rand(0, strlen($chars) - 1), 1);
-	}
+	function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) {
+		$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
+		if ( $special_chars ) {
+			$chars .= '!@#$%^&*()';
+		}
+		if ( $extra_special_chars ) {
+			$chars .= '-_ []{}<>~`+=,.;:/?|';
+		}
 
-	/**
+		$password = '';
+		for ( $i = 0; $i < $length; $i++ ) {
+			$password .= substr( $chars, wp_rand( 0, strlen( $chars ) - 1 ), 1 );
+		}
+
+		/**
 	 * Filters the randomly-generated password.
 	 *
 	 * @since 3.0.0
 	 *
 	 * @param string $password The generated password.
 	 */
-	return apply_filters( 'random_password', $password );
-}
+		return apply_filters( 'random_password', $password );
+	}
 endif;
 
-if ( !function_exists('wp_rand') ) :
-/**
+if ( ! function_exists( 'wp_rand' ) ) :
+	/**
  * Generates a random number
  *
  * @since 2.6.2
@@ -2214,71 +2242,72 @@
  * @param int $max Upper limit for the generated number
  * @return int A random number between min and max
  */
-function wp_rand( $min = 0, $max = 0 ) {
-	global $rnd_value;
+	function wp_rand( $min = 0, $max = 0 ) {
+		global $rnd_value;
 
-	// 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.
-	$max_random_number = 3000000000 === 2147483647 ? (float) "4294967295" : 4294967295; // 4294967295 = 0xffffffff
+		// 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.
+		$max_random_number = 3000000000 === 2147483647 ? (float) '4294967295' : 4294967295; // 4294967295 = 0xffffffff
 
-	// We only handle Ints, floats are truncated to their integer value.
-	$min = (int) $min;
-	$max = (int) $max;
-
-	// Use PHP's CSPRNG, or a compatible method
-	static $use_random_int_functionality = true;
-	if ( $use_random_int_functionality ) {
-		try {
-			$_max = ( 0 != $max ) ? $max : $max_random_number;
-			// wp_rand() can accept arguments in either order, PHP cannot.
-			$_max = max( $min, $_max );
-			$_min = min( $min, $_max );
-			$val = random_int( $_min, $_max );
-			if ( false !== $val ) {
-				return absint( $val );
-			} else {
+		// We only handle Ints, floats are truncated to their integer value.
+		$min = (int) $min;
+		$max = (int) $max;
+
+		// Use PHP's CSPRNG, or a compatible method
+		static $use_random_int_functionality = true;
+		if ( $use_random_int_functionality ) {
+			try {
+				$_max = ( 0 != $max ) ? $max : $max_random_number;
+				// wp_rand() can accept arguments in either order, PHP cannot.
+				$_max = max( $min, $_max );
+				$_min = min( $min, $_max );
+				$val = random_int( $_min, $_max );
+				if ( false !== $val ) {
+					return absint( $val );
+				} else {
+					$use_random_int_functionality = false;
+				}
+			} catch ( Error $e ) {
+				$use_random_int_functionality = false;
+			} catch ( Exception $e ) {
 				$use_random_int_functionality = false;
 			}
-		} catch ( Error $e ) {
-			$use_random_int_functionality = false;
-		} catch ( Exception $e ) {
-			$use_random_int_functionality = false;
 		}
-	}
 
-	// Reset $rnd_value after 14 uses
-	// 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value
-	if ( strlen($rnd_value) < 8 ) {
-		if ( defined( 'WP_SETUP_CONFIG' ) )
-			static $seed = '';
-		else
-			$seed = get_transient('random_seed');
-		$rnd_value = md5( uniqid(microtime() . mt_rand(), true ) . $seed );
-		$rnd_value .= sha1($rnd_value);
-		$rnd_value .= sha1($rnd_value . $seed);
-		$seed = md5($seed . $rnd_value);
-		if ( ! defined( 'WP_SETUP_CONFIG' ) && ! defined( 'WP_INSTALLING' ) ) {
-			set_transient( 'random_seed', $seed );
+		// Reset $rnd_value after 14 uses
+		// 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value
+		if ( strlen( $rnd_value ) < 8 ) {
+			if ( defined( 'WP_SETUP_CONFIG' ) ) {
+				static $seed = '';
+			} else { $seed = get_transient( 'random_seed' );
+			}
+			$rnd_value = md5( uniqid( microtime() . mt_rand(), true ) . $seed );
+			$rnd_value .= sha1( $rnd_value );
+			$rnd_value .= sha1( $rnd_value . $seed );
+			$seed = md5( $seed . $rnd_value );
+			if ( ! defined( 'WP_SETUP_CONFIG' ) && ! defined( 'WP_INSTALLING' ) ) {
+				set_transient( 'random_seed', $seed );
+			}
 		}
-	}
 
-	// Take the first 8 digits for our value
-	$value = substr($rnd_value, 0, 8);
+		// Take the first 8 digits for our value
+		$value = substr( $rnd_value, 0, 8 );
 
-	// Strip the first eight, leaving the remainder for the next call to wp_rand().
-	$rnd_value = substr($rnd_value, 8);
+		// Strip the first eight, leaving the remainder for the next call to wp_rand().
+		$rnd_value = substr( $rnd_value, 8 );
 
-	$value = abs(hexdec($value));
+		$value = abs( hexdec( $value ) );
 
-	// Reduce the value to be within the min - max range
-	if ( $max != 0 )
-		$value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 );
+		// Reduce the value to be within the min - max range
+		if ( $max != 0 ) {
+			$value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 );
+		}
 
-	return abs(intval($value));
-}
+		return abs( intval( $value ) );
+	}
 endif;
 
-if ( !function_exists('wp_set_password') ) :
-/**
+if ( ! function_exists( 'wp_set_password' ) ) :
+	/**
  * Updates the user's password with a new encrypted one.
  *
  * For integration with other applications, this function can be overwritten to
@@ -2295,18 +2324,23 @@
  * @param string $password The plaintext new user password
  * @param int    $user_id  User ID
  */
-function wp_set_password( $password, $user_id ) {
-	global $wpdb;
+	function wp_set_password( $password, $user_id ) {
+		global $wpdb;
 
-	$hash = wp_hash_password( $password );
-	$wpdb->update($wpdb->users, array('user_pass' => $hash, 'user_activation_key' => ''), array('ID' => $user_id) );
+		$hash = wp_hash_password( $password );
+		$wpdb->update( $wpdb->users, array(
+			'user_pass' => $hash,
+			'user_activation_key' => '',
+			), array(
+			'ID' => $user_id,
+		) );
 
-	wp_cache_delete($user_id, 'users');
-}
+		wp_cache_delete( $user_id, 'users' );
+	}
 endif;
 
-if ( !function_exists( 'get_avatar' ) ) :
-/**
+if ( ! function_exists( 'get_avatar' ) ) :
+	/**
  * Retrieve the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post.
  *
  * @since 2.5.0
@@ -2340,8 +2374,8 @@
  * }
  * @return false|string `<img>` tag for the user's avatar. False on failure.
  */
-function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = null ) {
-	$defaults = array(
+	function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = null ) {
+		$defaults = array(
 		// get_avatar_data() args.
 		'size'          => 96,
 		'height'        => null,
@@ -2354,30 +2388,30 @@
 		'class'         => null,
 		'force_display' => false,
 		'extra_attr'    => '',
-	);
+			);
 
-	if ( empty( $args ) ) {
-		$args = array();
-	}
+		if ( empty( $args ) ) {
+			$args = array();
+		}
 
-	$args['size']    = (int) $size;
-	$args['default'] = $default;
-	$args['alt']     = $alt;
+			$args['size']    = (int) $size;
+			$args['default'] = $default;
+			$args['alt']     = $alt;
 
-	$args = wp_parse_args( $args, $defaults );
+			$args = wp_parse_args( $args, $defaults );
 
-	if ( empty( $args['height'] ) ) {
-		$args['height'] = $args['size'];
-	}
-	if ( empty( $args['width'] ) ) {
-		$args['width'] = $args['size'];
-	}
+		if ( empty( $args['height'] ) ) {
+			$args['height'] = $args['size'];
+		}
+		if ( empty( $args['width'] ) ) {
+			$args['width'] = $args['size'];
+		}
 
-	if ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) {
-		$id_or_email = get_comment( $id_or_email );
-	}
+		if ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) {
+			$id_or_email = get_comment( $id_or_email );
+		}
 
-	/**
+			/**
 	 * Filters whether to retrieve the avatar URL early.
 	 *
 	 * Passing a non-null value will effectively short-circuit get_avatar(), passing
@@ -2390,53 +2424,55 @@
 	 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
 	 * @param array  $args        Arguments passed to get_avatar_url(), after processing.
 	 */
-	$avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args );
+			$avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args );
 
-	if ( ! is_null( $avatar ) ) {
-		/** This filter is documented in wp-includes/pluggable.php */
-		return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
-	}
+		if ( ! is_null( $avatar ) ) {
+			/** This filter is documented in wp-includes/pluggable.php */
+			return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
+		}
 
-	if ( ! $args['force_display'] && ! get_option( 'show_avatars' ) ) {
-		return false;
-	}
+		if ( ! $args['force_display'] && ! get_option( 'show_avatars' ) ) {
+			return false;
+		}
 
-	$url2x = get_avatar_url( $id_or_email, array_merge( $args, array( 'size' => $args['size'] * 2 ) ) );
+			$url2x = get_avatar_url( $id_or_email, array_merge( $args, array(
+				'size' => $args['size'] * 2,
+			) ) );
 
-	$args = get_avatar_data( $id_or_email, $args );
+			$args = get_avatar_data( $id_or_email, $args );
 
-	$url = $args['url'];
+			$url = $args['url'];
 
-	if ( ! $url || is_wp_error( $url ) ) {
-		return false;
-	}
+		if ( ! $url || is_wp_error( $url ) ) {
+			return false;
+		}
 
-	$class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );
+			$class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );
 
-	if ( ! $args['found_avatar'] || $args['force_default'] ) {
-		$class[] = 'avatar-default';
-	}
+		if ( ! $args['found_avatar'] || $args['force_default'] ) {
+			$class[] = 'avatar-default';
+		}
 
-	if ( $args['class'] ) {
-		if ( is_array( $args['class'] ) ) {
-			$class = array_merge( $class, $args['class'] );
-		} else {
-			$class[] = $args['class'];
+		if ( $args['class'] ) {
+			if ( is_array( $args['class'] ) ) {
+				$class = array_merge( $class, $args['class'] );
+			} else {
+				$class[] = $args['class'];
+			}
 		}
-	}
 
-	$avatar = sprintf(
-		"<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>",
-		esc_attr( $args['alt'] ),
-		esc_url( $url ),
-		esc_attr( "$url2x 2x" ),
-		esc_attr( join( ' ', $class ) ),
-		(int) $args['height'],
-		(int) $args['width'],
-		$args['extra_attr']
-	);
+			$avatar = sprintf(
+				"<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>",
+				esc_attr( $args['alt'] ),
+				esc_url( $url ),
+				esc_attr( "$url2x 2x" ),
+				esc_attr( join( ' ', $class ) ),
+				(int) $args['height'],
+				(int) $args['width'],
+				$args['extra_attr']
+			);
 
-	/**
+			/**
 	 * Filters the avatar to retrieve.
 	 *
 	 * @since 2.5.0
@@ -2452,12 +2488,12 @@
 	 * @param string $alt         Alternative text to use in the avatar image tag. Default empty.
 	 * @param array  $args        Arguments passed to get_avatar_data(), after processing.
 	 */
-	return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
-}
+			return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
+	}
 endif;
 
-if ( !function_exists( 'wp_text_diff' ) ) :
-/**
+if ( ! function_exists( 'wp_text_diff' ) ) :
+	/**
  * Displays a human readable HTML representation of the difference between two strings.
  *
  * The Diff is available for getting the changes between versions. The output is
@@ -2484,50 +2520,59 @@
  * @param string|array $args         Optional. Change 'title', 'title_left', and 'title_right' defaults.
  * @return string Empty string if strings are equivalent or HTML with differences.
  */
-function wp_text_diff( $left_string, $right_string, $args = null ) {
-	$defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' );
-	$args = wp_parse_args( $args, $defaults );
-
-	if ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) )
-		require( ABSPATH . WPINC . '/wp-diff.php' );
-
-	$left_string  = normalize_whitespace($left_string);
-	$right_string = normalize_whitespace($right_string);
-
-	$left_lines  = explode("\n", $left_string);
-	$right_lines = explode("\n", $right_string);
-	$text_diff = new Text_Diff($left_lines, $right_lines);
-	$renderer  = new WP_Text_Diff_Renderer_Table( $args );
-	$diff = $renderer->render($text_diff);
-
-	if ( !$diff )
-		return '';
-
-	$r  = "<table class='diff'>\n";
-
-	if ( ! empty( $args[ 'show_split_view' ] ) ) {
-		$r .= "<col class='content diffsplit left' /><col class='content diffsplit middle' /><col class='content diffsplit right' />";
-	} else {
-		$r .= "<col class='content' />";
-	}
-
-	if ( $args['title'] || $args['title_left'] || $args['title_right'] )
-		$r .= "<thead>";
-	if ( $args['title'] )
-		$r .= "<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\n";
-	if ( $args['title_left'] || $args['title_right'] ) {
-		$r .= "<tr class='diff-sub-title'>\n";
-		$r .= "\t<td></td><th>$args[title_left]</th>\n";
-		$r .= "\t<td></td><th>$args[title_right]</th>\n";
-		$r .= "</tr>\n";
-	}
-	if ( $args['title'] || $args['title_left'] || $args['title_right'] )
-		$r .= "</thead>\n";
+	function wp_text_diff( $left_string, $right_string, $args = null ) {
+		$defaults = array(
+			'title' => '',
+			'title_left' => '',
+			'title_right' => '',
+		);
+		$args = wp_parse_args( $args, $defaults );
 
-	$r .= "<tbody>\n$diff\n</tbody>\n";
-	$r .= "</table>";
+		if ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) ) {
+			require( ABSPATH . WPINC . '/wp-diff.php' );
+		}
+
+		$left_string  = normalize_whitespace( $left_string );
+		$right_string = normalize_whitespace( $right_string );
+
+		$left_lines  = explode( "\n", $left_string );
+		$right_lines = explode( "\n", $right_string );
+		$text_diff = new Text_Diff( $left_lines, $right_lines );
+		$renderer  = new WP_Text_Diff_Renderer_Table( $args );
+		$diff = $renderer->render( $text_diff );
+
+		if ( ! $diff ) {
+			return '';
+		}
+
+		$r  = "<table class='diff'>\n";
+
+		if ( ! empty( $args['show_split_view'] ) ) {
+			$r .= "<col class='content diffsplit left' /><col class='content diffsplit middle' /><col class='content diffsplit right' />";
+		} else {
+			$r .= "<col class='content' />";
+		}
+
+		if ( $args['title'] || $args['title_left'] || $args['title_right'] ) {
+			$r .= '<thead>';
+		}
+		if ( $args['title'] ) {
+			$r .= "<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\n";
+		}
+		if ( $args['title_left'] || $args['title_right'] ) {
+			$r .= "<tr class='diff-sub-title'>\n";
+			$r .= "\t<td></td><th>$args[title_left]</th>\n";
+			$r .= "\t<td></td><th>$args[title_right]</th>\n";
+			$r .= "</tr>\n";
+		}
+		if ( $args['title'] || $args['title_left'] || $args['title_right'] ) {
+			$r .= "</thead>\n";
+		}
 
-	return $r;
-}
+			$r .= "<tbody>\n$diff\n</tbody>\n";
+			$r .= '</table>';
+
+			return $r;
+	}
 endif;
 
Index: src/wp-includes/plugin.php
===================================================================
--- src/wp-includes/plugin.php	(revision 40901)
+++ src/wp-includes/plugin.php	(working copy)
@@ -33,11 +33,13 @@
 	$wp_filter = array();
 }
 
-if ( ! isset( $wp_actions ) )
+if ( ! isset( $wp_actions ) ) {
 	$wp_actions = array();
+}
 
-if ( ! isset( $wp_current_filter ) )
+if ( ! isset( $wp_current_filter ) ) {
 	$wp_current_filter = array();
+}
 
 /**
  * Hook a function or method to a specific filter action.
@@ -128,7 +130,7 @@
  *                   that evaluates to false (e.g.) 0, so use the === operator for testing the
  *                   return value.
  */
-function has_filter($tag, $function_to_check = false) {
+function has_filter( $tag, $function_to_check = false ) {
 	global $wp_filter;
 
 	if ( ! isset( $wp_filter[ $tag ] ) ) {
@@ -179,23 +181,26 @@
 	$args = array();
 
 	// Do 'all' actions first.
-	if ( isset($wp_filter['all']) ) {
+	if ( isset( $wp_filter['all'] ) ) {
 		$wp_current_filter[] = $tag;
 		$args = func_get_args();
-		_wp_call_all_hook($args);
+		_wp_call_all_hook( $args );
 	}
 
-	if ( !isset($wp_filter[$tag]) ) {
-		if ( isset($wp_filter['all']) )
-			array_pop($wp_current_filter);
+	if ( ! isset( $wp_filter[ $tag ] ) ) {
+		if ( isset( $wp_filter['all'] ) ) {
+			array_pop( $wp_current_filter );
+		}
 		return $value;
 	}
 
-	if ( !isset($wp_filter['all']) )
+	if ( ! isset( $wp_filter['all'] ) ) {
 		$wp_current_filter[] = $tag;
+	}
 
-	if ( empty($args) )
+	if ( empty( $args ) ) {
 		$args = func_get_args();
+	}
 
 	// don't pass the tag name to WP_Hook
 	array_shift( $args );
@@ -222,24 +227,26 @@
  * @param array  $args The arguments supplied to the functions hooked to $tag.
  * @return mixed The filtered value after all hooked functions are applied to it.
  */
-function apply_filters_ref_array($tag, $args) {
+function apply_filters_ref_array( $tag, $args ) {
 	global $wp_filter, $wp_current_filter;
 
 	// Do 'all' actions first
-	if ( isset($wp_filter['all']) ) {
+	if ( isset( $wp_filter['all'] ) ) {
 		$wp_current_filter[] = $tag;
 		$all_args = func_get_args();
-		_wp_call_all_hook($all_args);
+		_wp_call_all_hook( $all_args );
 	}
 
-	if ( !isset($wp_filter[$tag]) ) {
-		if ( isset($wp_filter['all']) )
-			array_pop($wp_current_filter);
+	if ( ! isset( $wp_filter[ $tag ] ) ) {
+		if ( isset( $wp_filter['all'] ) ) {
+			array_pop( $wp_current_filter );
+		}
 		return $args[0];
 	}
 
-	if ( !isset($wp_filter['all']) )
+	if ( ! isset( $wp_filter['all'] ) ) {
 		$wp_current_filter[] = $tag;
+	}
 
 	$filtered = $wp_filter[ $tag ]->apply_filters( $args[0], $args );
 
@@ -296,7 +303,7 @@
 function remove_all_filters( $tag, $priority = false ) {
 	global $wp_filter;
 
-	if ( isset( $wp_filter[ $tag ]) ) {
+	if ( isset( $wp_filter[ $tag ] ) ) {
 		$wp_filter[ $tag ]->remove_all_filters( $priority );
 		if ( ! $wp_filter[ $tag ]->has_filters() ) {
 			unset( $wp_filter[ $tag ] );
@@ -395,8 +402,8 @@
  * @param int      $accepted_args   Optional. The number of arguments the function accepts. Default 1.
  * @return true Will always return true.
  */
-function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
-	return add_filter($tag, $function_to_add, $priority, $accepted_args);
+function add_action( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {
+	return add_filter( $tag, $function_to_add, $priority, $accepted_args );
 }
 
 /**
@@ -418,41 +425,44 @@
  * @param mixed  $arg,... Optional. Additional arguments which are passed on to the
  *                        functions hooked to the action. Default empty.
  */
-function do_action($tag, $arg = '') {
+function do_action( $tag, $arg = '' ) {
 	global $wp_filter, $wp_actions, $wp_current_filter;
 
-	if ( ! isset($wp_actions[$tag]) )
-		$wp_actions[$tag] = 1;
-	else
-		++$wp_actions[$tag];
+	if ( ! isset( $wp_actions[ $tag ] ) ) {
+		$wp_actions[ $tag ] = 1;
+	} else { ++$wp_actions[ $tag ];
+	}
 
 	// Do 'all' actions first
-	if ( isset($wp_filter['all']) ) {
+	if ( isset( $wp_filter['all'] ) ) {
 		$wp_current_filter[] = $tag;
 		$all_args = func_get_args();
-		_wp_call_all_hook($all_args);
+		_wp_call_all_hook( $all_args );
 	}
 
-	if ( !isset($wp_filter[$tag]) ) {
-		if ( isset($wp_filter['all']) )
-			array_pop($wp_current_filter);
+	if ( ! isset( $wp_filter[ $tag ] ) ) {
+		if ( isset( $wp_filter['all'] ) ) {
+			array_pop( $wp_current_filter );
+		}
 		return;
 	}
 
-	if ( !isset($wp_filter['all']) )
+	if ( ! isset( $wp_filter['all'] ) ) {
 		$wp_current_filter[] = $tag;
+	}
 
 	$args = array();
-	if ( is_array($arg) && 1 == count($arg) && isset($arg[0]) && is_object($arg[0]) ) // array(&$this)
+	if ( is_array( $arg ) && 1 == count( $arg ) && isset( $arg[0] ) && is_object( $arg[0] ) ) { // array(&$this)
 		$args[] =& $arg[0];
-	else
-		$args[] = $arg;
-	for ( $a = 2, $num = func_num_args(); $a < $num; $a++ )
-		$args[] = func_get_arg($a);
+	} else { $args[] = $arg;
+	}
+	for ( $a = 2, $num = func_num_args(); $a < $num; $a++ ) {
+		$args[] = func_get_arg( $a );
+	}
 
 	$wp_filter[ $tag ]->do_action( $args );
 
-	array_pop($wp_current_filter);
+	array_pop( $wp_current_filter );
 }
 
 /**
@@ -465,13 +475,14 @@
  * @param string $tag The name of the action hook.
  * @return int The number of times action hook $tag is fired.
  */
-function did_action($tag) {
+function did_action( $tag ) {
 	global $wp_actions;
 
-	if ( ! isset( $wp_actions[ $tag ] ) )
+	if ( ! isset( $wp_actions[ $tag ] ) ) {
 		return 0;
+	}
 
-	return $wp_actions[$tag];
+	return $wp_actions[ $tag ];
 }
 
 /**
@@ -488,33 +499,35 @@
  * @param string $tag  The name of the action to be executed.
  * @param array  $args The arguments supplied to the functions hooked to `$tag`.
  */
-function do_action_ref_array($tag, $args) {
+function do_action_ref_array( $tag, $args ) {
 	global $wp_filter, $wp_actions, $wp_current_filter;
 
-	if ( ! isset($wp_actions[$tag]) )
-		$wp_actions[$tag] = 1;
-	else
-		++$wp_actions[$tag];
+	if ( ! isset( $wp_actions[ $tag ] ) ) {
+		$wp_actions[ $tag ] = 1;
+	} else { ++$wp_actions[ $tag ];
+	}
 
 	// Do 'all' actions first
-	if ( isset($wp_filter['all']) ) {
+	if ( isset( $wp_filter['all'] ) ) {
 		$wp_current_filter[] = $tag;
 		$all_args = func_get_args();
-		_wp_call_all_hook($all_args);
+		_wp_call_all_hook( $all_args );
 	}
 
-	if ( !isset($wp_filter[$tag]) ) {
-		if ( isset($wp_filter['all']) )
-			array_pop($wp_current_filter);
+	if ( ! isset( $wp_filter[ $tag ] ) ) {
+		if ( isset( $wp_filter['all'] ) ) {
+			array_pop( $wp_current_filter );
+		}
 		return;
 	}
 
-	if ( !isset($wp_filter['all']) )
+	if ( ! isset( $wp_filter['all'] ) ) {
 		$wp_current_filter[] = $tag;
+	}
 
 	$wp_filter[ $tag ]->do_action( $args );
 
-	array_pop($wp_current_filter);
+	array_pop( $wp_current_filter );
 }
 
 /**
@@ -533,8 +546,8 @@
  *                  that evaluates to false (e.g.) 0, so use the === operator for testing the
  *                  return value.
  */
-function has_action($tag, $function_to_check = false) {
-	return has_filter($tag, $function_to_check);
+function has_action( $tag, $function_to_check = false ) {
+	return has_filter( $tag, $function_to_check );
 }
 
 /**
@@ -564,8 +577,8 @@
  * @param int|bool $priority The priority number to remove them from. Default false.
  * @return true True when finished.
  */
-function remove_all_actions($tag, $priority = false) {
-	return remove_all_filters($tag, $priority);
+function remove_all_actions( $tag, $priority = false ) {
+	return remove_all_filters( $tag, $priority );
 }
 
 /**
@@ -654,8 +667,8 @@
 	$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
 	$mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );
 
-	$file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir
-	$file = trim($file, '/');
+	$file = preg_replace( '#^' . preg_quote( $plugin_dir, '#' ) . '/|^' . preg_quote( $mu_plugin_dir, '#' ) . '/#','',$file ); // get relative path from plugins dir
+	$file = trim( $file, '/' );
 	return $file;
 }
 
@@ -682,7 +695,7 @@
 	// Normalize, but store as static to avoid recalculation of a constant value
 	static $wp_plugin_path = null, $wpmu_plugin_path = null;
 	if ( ! isset( $wp_plugin_path ) ) {
-		$wp_plugin_path   = wp_normalize_path( WP_PLUGIN_DIR   );
+		$wp_plugin_path   = wp_normalize_path( WP_PLUGIN_DIR );
 		$wpmu_plugin_path = wp_normalize_path( WPMU_PLUGIN_DIR );
 	}
 
@@ -742,9 +755,9 @@
  * @param string   $file     The filename of the plugin including the path.
  * @param callable $function The function hooked to the 'activate_PLUGIN' action.
  */
-function register_activation_hook($file, $function) {
-	$file = plugin_basename($file);
-	add_action('activate_' . $file, $function);
+function register_activation_hook( $file, $function ) {
+	$file = plugin_basename( $file );
+	add_action( 'activate_' . $file, $function );
 }
 
 /**
@@ -765,9 +778,9 @@
  * @param string   $file     The filename of the plugin including the path.
  * @param callable $function The function hooked to the 'deactivate_PLUGIN' action.
  */
-function register_deactivation_hook($file, $function) {
-	$file = plugin_basename($file);
-	add_action('deactivate_' . $file, $function);
+function register_deactivation_hook( $file, $function ) {
+	$file = plugin_basename( $file );
+	add_action( 'deactivate_' . $file, $function );
 }
 
 /**
@@ -807,10 +820,10 @@
 	 * cases. Emphasis should be put on using the 'uninstall.php' way of
 	 * uninstalling the plugin.
 	 */
-	$uninstallable_plugins = (array) get_option('uninstall_plugins');
-	$uninstallable_plugins[plugin_basename($file)] = $callback;
+	$uninstallable_plugins = (array) get_option( 'uninstall_plugins' );
+	$uninstallable_plugins[ plugin_basename( $file ) ] = $callback;
 
-	update_option('uninstall_plugins', $uninstallable_plugins);
+	update_option( 'uninstall_plugins', $uninstallable_plugins );
 }
 
 /**
@@ -831,7 +844,7 @@
  *
  * @param array $args The collected parameters from the hook that was called.
  */
-function _wp_call_all_hook($args) {
+function _wp_call_all_hook( $args ) {
 	global $wp_filter;
 
 	$wp_filter['all']->do_all_hook( $args );
@@ -871,30 +884,32 @@
  *                      and $function is an object reference, and it does not already have
  *                      a unique id.
  */
-function _wp_filter_build_unique_id($tag, $function, $priority) {
+function _wp_filter_build_unique_id( $tag, $function, $priority ) {
 	global $wp_filter;
 	static $filter_id_count = 0;
 
-	if ( is_string($function) )
+	if ( is_string( $function ) ) {
 		return $function;
+	}
 
-	if ( is_object($function) ) {
+	if ( is_object( $function ) ) {
 		// Closures are currently implemented as objects
 		$function = array( $function, '' );
 	} else {
 		$function = (array) $function;
 	}
 
-	if (is_object($function[0]) ) {
+	if ( is_object( $function[0] ) ) {
 		// Object Class Calling
-		if ( function_exists('spl_object_hash') ) {
-			return spl_object_hash($function[0]) . $function[1];
+		if ( function_exists( 'spl_object_hash' ) ) {
+			return spl_object_hash( $function[0] ) . $function[1];
 		} else {
-			$obj_idx = get_class($function[0]).$function[1];
-			if ( !isset($function[0]->wp_filter_id) ) {
-				if ( false === $priority )
+			$obj_idx = get_class( $function[0] ) . $function[1];
+			if ( ! isset( $function[0]->wp_filter_id ) ) {
+				if ( false === $priority ) {
 					return false;
-				$obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : $filter_id_count;
+				}
+				$obj_idx .= isset( $wp_filter[ $tag ][ $priority ] ) ? count( (array) $wp_filter[ $tag ][ $priority ] ) : $filter_id_count;
 				$function[0]->wp_filter_id = $filter_id_count;
 				++$filter_id_count;
 			} else {
Index: src/wp-includes/pomo/entry.php
===================================================================
--- src/wp-includes/pomo/entry.php	(revision 40901)
+++ src/wp-includes/pomo/entry.php	(working copy)
@@ -7,29 +7,29 @@
  * @subpackage entry
  */
 
-if ( ! class_exists( 'Translation_Entry', false ) ):
-/**
+if ( ! class_exists( 'Translation_Entry', false ) ) :
+	/**
  * Translation_Entry class encapsulates a translatable string
  */
-class Translation_Entry {
+	class Translation_Entry {
 
-	/**
+		/**
 	 * Whether the entry contains a string and its plural form, default is false
 	 *
 	 * @var boolean
 	 */
-	var $is_plural = false;
+		var $is_plural = false;
 
-	var $context = null;
-	var $singular = null;
-	var $plural = null;
-	var $translations = array();
-	var $translator_comments = '';
-	var $extracted_comments = '';
-	var $references = array();
-	var $flags = array();
+		var $context = null;
+		var $singular = null;
+		var $plural = null;
+		var $translations = array();
+		var $translator_comments = '';
+		var $extracted_comments = '';
+		var $references = array();
+		var $flags = array();
 
-	/**
+		/**
 	 * @param array $args associative array, support following keys:
 	 * 	- singular (string) -- the string to translate, if omitted and empty entry will be created
 	 * 	- plural (string) -- the plural form of the string, setting this will set {@link $is_plural} to true
@@ -40,54 +40,59 @@
 	 * 	- references (array) -- places in the code this strings is used, in relative_to_root_path/file.php:linenum form
 	 * 	- flags (array) -- flags like php-format
 	 */
-	function __construct( $args = array() ) {
-		// if no singular -- empty object
-		if (!isset($args['singular'])) {
-			return;
-		}
-		// get member variable values from args hash
-		foreach ($args as $varname => $value) {
-			$this->$varname = $value;
+		function __construct( $args = array() ) {
+			// if no singular -- empty object
+			if ( ! isset( $args['singular'] ) ) {
+				return;
+			}
+			// get member variable values from args hash
+			foreach ( $args as $varname => $value ) {
+				$this->$varname = $value;
+			}
+			if ( isset( $args['plural'] ) && $args['plural'] ) { $this->is_plural = true;
+			}
+			if ( ! is_array( $this->translations ) ) { $this->translations = array();
+			}
+			if ( ! is_array( $this->references ) ) { $this->references = array();
+			}
+			if ( ! is_array( $this->flags ) ) { $this->flags = array();
+			}
 		}
-		if (isset($args['plural']) && $args['plural']) $this->is_plural = true;
-		if (!is_array($this->translations)) $this->translations = array();
-		if (!is_array($this->references)) $this->references = array();
-		if (!is_array($this->flags)) $this->flags = array();
-	}
 
-	/**
+		/**
 	 * PHP4 constructor.
 	 */
-	public function Translation_Entry( $args = array() ) {
-		self::__construct( $args );
-	}
+		public function Translation_Entry( $args = array() ) {
+			self::__construct( $args );
+		}
 
-	/**
+		/**
 	 * Generates a unique key for this entry
 	 *
 	 * @return string|bool the key or false if the entry is empty
 	 */
-	function key() {
-		if ( null === $this->singular || '' === $this->singular ) return false;
-
-		// Prepend context and EOT, like in MO files
-		$key = !$this->context? $this->singular : $this->context.chr(4).$this->singular;
-		// Standardize on \n line endings
-		$key = str_replace( array( "\r\n", "\r" ), "\n", $key );
+		function key() {
+			if ( null === $this->singular || '' === $this->singular ) { return false;
+			}
+
+			// Prepend context and EOT, like in MO files
+			$key = ! $this->context? $this->singular : $this->context . chr( 4 ) . $this->singular;
+			// Standardize on \n line endings
+			$key = str_replace( array( "\r\n", "\r" ), "\n", $key );
 
-		return $key;
-	}
+			return $key;
+		}
 
-	/**
+		/**
 	 * @param object $other
 	 */
-	function merge_with(&$other) {
-		$this->flags = array_unique( array_merge( $this->flags, $other->flags ) );
-		$this->references = array_unique( array_merge( $this->references, $other->references ) );
-		if ( $this->extracted_comments != $other->extracted_comments ) {
-			$this->extracted_comments .= $other->extracted_comments;
-		}
+		function merge_with( &$other ) {
+			$this->flags = array_unique( array_merge( $this->flags, $other->flags ) );
+			$this->references = array_unique( array_merge( $this->references, $other->references ) );
+			if ( $this->extracted_comments != $other->extracted_comments ) {
+				$this->extracted_comments .= $other->extracted_comments;
+			}
 
+		}
 	}
-}
-endif;
\ No newline at end of file
+endif;
Index: src/wp-includes/pomo/mo.php
===================================================================
--- src/wp-includes/pomo/mo.php	(revision 40901)
+++ src/wp-includes/pomo/mo.php	(working copy)
@@ -7,275 +7,282 @@
  * @subpackage mo
  */
 
-require_once dirname(__FILE__) . '/translations.php';
-require_once dirname(__FILE__) . '/streams.php';
+require_once dirname( __FILE__ ) . '/translations.php';
+require_once dirname( __FILE__ ) . '/streams.php';
 
-if ( ! class_exists( 'MO', false ) ):
-class MO extends Gettext_Translations {
+if ( ! class_exists( 'MO', false ) ) :
+	class MO extends Gettext_Translations {
 
-	var $_nplurals = 2;
+		var $_nplurals = 2;
 
-	/**
+		/**
 	 * Loaded MO file.
 	 *
 	 * @var string
 	 */
-	private $filename = '';
+		private $filename = '';
 
-	/**
+		/**
 	 * Returns the loaded MO file.
 	 *
 	 * @return string The loaded MO file.
 	 */
-	public function get_filename() {
-		return $this->filename;
-	}
+		public function get_filename() {
+			return $this->filename;
+		}
 
-	/**
+		/**
 	 * Fills up with the entries from MO file $filename
 	 *
 	 * @param string $filename MO file to load
 	 */
-	function import_from_file($filename) {
-		$reader = new POMO_FileReader( $filename );
+		function import_from_file( $filename ) {
+			$reader = new POMO_FileReader( $filename );
 
-		if ( ! $reader->is_resource() ) {
-			return false;
-		}
+			if ( ! $reader->is_resource() ) {
+				return false;
+			}
 
-		$this->filename = (string) $filename;
+			$this->filename = (string) $filename;
 
-		return $this->import_from_reader( $reader );
-	}
+			return $this->import_from_reader( $reader );
+		}
 
-	/**
+		/**
 	 * @param string $filename
 	 * @return bool
 	 */
-	function export_to_file($filename) {
-		$fh = fopen($filename, 'wb');
-		if ( !$fh ) return false;
-		$res = $this->export_to_file_handle( $fh );
-		fclose($fh);
-		return $res;
-	}
+		function export_to_file( $filename ) {
+			$fh = fopen( $filename, 'wb' );
+			if ( ! $fh ) { return false;
+			}
+			$res = $this->export_to_file_handle( $fh );
+			fclose( $fh );
+			return $res;
+		}
 
-	/**
+		/**
 	 * @return string|false
 	 */
-	function export() {
-		$tmp_fh = fopen("php://temp", 'r+');
-		if ( !$tmp_fh ) return false;
-		$this->export_to_file_handle( $tmp_fh );
-		rewind( $tmp_fh );
-		return stream_get_contents( $tmp_fh );
-	}
+		function export() {
+			$tmp_fh = fopen( 'php://temp', 'r+' );
+			if ( ! $tmp_fh ) { return false;
+			}
+			$this->export_to_file_handle( $tmp_fh );
+			rewind( $tmp_fh );
+			return stream_get_contents( $tmp_fh );
+		}
 
-	/**
+		/**
 	 * @param Translation_Entry $entry
 	 * @return bool
 	 */
-	function is_entry_good_for_export( $entry ) {
-		if ( empty( $entry->translations ) ) {
-			return false;
-		}
+		function is_entry_good_for_export( $entry ) {
+			if ( empty( $entry->translations ) ) {
+				return false;
+			}
 
-		if ( !array_filter( $entry->translations ) ) {
-			return false;
-		}
+			if ( ! array_filter( $entry->translations ) ) {
+				return false;
+			}
 
-		return true;
-	}
+			return true;
+		}
 
-	/**
+		/**
 	 * @param resource $fh
 	 * @return true
 	 */
-	function export_to_file_handle($fh) {
-		$entries = array_filter( $this->entries, array( $this, 'is_entry_good_for_export' ) );
-		ksort($entries);
-		$magic = 0x950412de;
-		$revision = 0;
-		$total = count($entries) + 1; // all the headers are one entry
-		$originals_lenghts_addr = 28;
-		$translations_lenghts_addr = $originals_lenghts_addr + 8 * $total;
-		$size_of_hash = 0;
-		$hash_addr = $translations_lenghts_addr + 8 * $total;
-		$current_addr = $hash_addr;
-		fwrite($fh, pack('V*', $magic, $revision, $total, $originals_lenghts_addr,
+		function export_to_file_handle( $fh ) {
+			$entries = array_filter( $this->entries, array( $this, 'is_entry_good_for_export' ) );
+			ksort( $entries );
+			$magic = 0x950412de;
+			$revision = 0;
+			$total = count( $entries ) + 1; // all the headers are one entry
+			$originals_lenghts_addr = 28;
+			$translations_lenghts_addr = $originals_lenghts_addr + 8 * $total;
+			$size_of_hash = 0;
+			$hash_addr = $translations_lenghts_addr + 8 * $total;
+			$current_addr = $hash_addr;
+			fwrite($fh, pack('V*', $magic, $revision, $total, $originals_lenghts_addr,
 			$translations_lenghts_addr, $size_of_hash, $hash_addr));
-		fseek($fh, $originals_lenghts_addr);
-
-		// headers' msgid is an empty string
-		fwrite($fh, pack('VV', 0, $current_addr));
-		$current_addr++;
-		$originals_table = chr(0);
+			fseek( $fh, $originals_lenghts_addr );
 
-		$reader = new POMO_Reader();
-
-		foreach($entries as $entry) {
-			$originals_table .= $this->export_original($entry) . chr(0);
-			$length = $reader->strlen($this->export_original($entry));
-			fwrite($fh, pack('VV', $length, $current_addr));
-			$current_addr += $length + 1; // account for the NULL byte after
-		}
+			// headers' msgid is an empty string
+			fwrite( $fh, pack( 'VV', 0, $current_addr ) );
+			$current_addr++;
+			$originals_table = chr( 0 );
+
+			$reader = new POMO_Reader();
+
+			foreach ( $entries as $entry ) {
+					$originals_table .= $this->export_original( $entry ) . chr( 0 );
+					$length = $reader->strlen( $this->export_original( $entry ) );
+					fwrite( $fh, pack( 'VV', $length, $current_addr ) );
+					$current_addr += $length + 1; // account for the NULL byte after
+			}
 
-		$exported_headers = $this->export_headers();
-		fwrite($fh, pack('VV', $reader->strlen($exported_headers), $current_addr));
-		$current_addr += strlen($exported_headers) + 1;
-		$translations_table = $exported_headers . chr(0);
+			$exported_headers = $this->export_headers();
+			fwrite( $fh, pack( 'VV', $reader->strlen( $exported_headers ), $current_addr ) );
+			$current_addr += strlen( $exported_headers ) + 1;
+			$translations_table = $exported_headers . chr( 0 );
+
+			foreach ( $entries as $entry ) {
+					$translations_table .= $this->export_translations( $entry ) . chr( 0 );
+					$length = $reader->strlen( $this->export_translations( $entry ) );
+					fwrite( $fh, pack( 'VV', $length, $current_addr ) );
+					$current_addr += $length + 1;
+			}
 
-		foreach($entries as $entry) {
-			$translations_table .= $this->export_translations($entry) . chr(0);
-			$length = $reader->strlen($this->export_translations($entry));
-			fwrite($fh, pack('VV', $length, $current_addr));
-			$current_addr += $length + 1;
+			fwrite( $fh, $originals_table );
+			fwrite( $fh, $translations_table );
+			return true;
 		}
 
-		fwrite($fh, $originals_table);
-		fwrite($fh, $translations_table);
-		return true;
-	}
-
-	/**
+		/**
 	 * @param Translation_Entry $entry
 	 * @return string
 	 */
-	function export_original($entry) {
-		//TODO: warnings for control characters
-		$exported = $entry->singular;
-		if ($entry->is_plural) $exported .= chr(0).$entry->plural;
-		if ($entry->context) $exported = $entry->context . chr(4) . $exported;
-		return $exported;
-	}
+		function export_original( $entry ) {
+			//TODO: warnings for control characters
+			$exported = $entry->singular;
+			if ( $entry->is_plural ) { $exported .= chr( 0 ) . $entry->plural;
+			}
+			if ( $entry->context ) { $exported = $entry->context . chr( 4 ) . $exported;
+			}
+			return $exported;
+		}
 
-	/**
+		/**
 	 * @param Translation_Entry $entry
 	 * @return string
 	 */
-	function export_translations($entry) {
-		//TODO: warnings for control characters
-		return $entry->is_plural ? implode(chr(0), $entry->translations) : $entry->translations[0];
-	}
+		function export_translations( $entry ) {
+			//TODO: warnings for control characters
+			return $entry->is_plural ? implode( chr( 0 ), $entry->translations ) : $entry->translations[0];
+		}
 
-	/**
+		/**
 	 * @return string
 	 */
-	function export_headers() {
-		$exported = '';
-		foreach($this->headers as $header => $value) {
-			$exported.= "$header: $value\n";
+		function export_headers() {
+			$exported = '';
+			foreach ( $this->headers as $header => $value ) {
+				$exported .= "$header: $value\n";
+			}
+			return $exported;
 		}
-		return $exported;
-	}
 
-	/**
+		/**
 	 * @param int $magic
 	 * @return string|false
 	 */
-	function get_byteorder($magic) {
-		// The magic is 0x950412de
+		function get_byteorder( $magic ) {
+			// The magic is 0x950412de
 
-		// bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
-		$magic_little = (int) - 1794895138;
-		$magic_little_64 = (int) 2500072158;
-		// 0xde120495
-		$magic_big = ((int) - 569244523) & 0xFFFFFFFF;
-		if ($magic_little == $magic || $magic_little_64 == $magic) {
-			return 'little';
-		} else if ($magic_big == $magic) {
-			return 'big';
-		} else {
-			return false;
+			// bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
+			$magic_little = (int) - 1794895138;
+			$magic_little_64 = (int) 2500072158;
+			// 0xde120495
+			$magic_big = ( (int) - 569244523) & 0xFFFFFFFF;
+			if ( $magic_little == $magic || $magic_little_64 == $magic ) {
+				return 'little';
+			} elseif ( $magic_big == $magic ) {
+				return 'big';
+			} else {
+				return false;
+			}
 		}
-	}
 
-	/**
+		/**
 	 * @param POMO_FileReader $reader
 	 */
-	function import_from_reader($reader) {
-		$endian_string = MO::get_byteorder($reader->readint32());
-		if (false === $endian_string) {
-			return false;
-		}
-		$reader->setEndian($endian_string);
-
-		$endian = ('big' == $endian_string)? 'N' : 'V';
-
-		$header = $reader->read(24);
-		if ($reader->strlen($header) != 24)
-			return false;
-
-		// parse header
-		$header = unpack("{$endian}revision/{$endian}total/{$endian}originals_lenghts_addr/{$endian}translations_lenghts_addr/{$endian}hash_length/{$endian}hash_addr", $header);
-		if (!is_array($header))
-			return false;
-
-		// support revision 0 of MO format specs, only
-		if ( $header['revision'] != 0 ) {
-			return false;
-		}
-
-		// seek to data blocks
-		$reader->seekto( $header['originals_lenghts_addr'] );
-
-		// read originals' indices
-		$originals_lengths_length = $header['translations_lenghts_addr'] - $header['originals_lenghts_addr'];
-		if ( $originals_lengths_length != $header['total'] * 8 ) {
-			return false;
-		}
-
-		$originals = $reader->read($originals_lengths_length);
-		if ( $reader->strlen( $originals ) != $originals_lengths_length ) {
-			return false;
-		}
+		function import_from_reader( $reader ) {
+			$endian_string = MO::get_byteorder( $reader->readint32() );
+			if ( false === $endian_string ) {
+				return false;
+			}
+			$reader->setEndian( $endian_string );
 
-		// read translations' indices
-		$translations_lenghts_length = $header['hash_addr'] - $header['translations_lenghts_addr'];
-		if ( $translations_lenghts_length != $header['total'] * 8 ) {
-			return false;
-		}
+			$endian = ('big' == $endian_string)? 'N' : 'V';
 
-		$translations = $reader->read($translations_lenghts_length);
-		if ( $reader->strlen( $translations ) != $translations_lenghts_length ) {
-			return false;
-		}
+			$header = $reader->read( 24 );
+			if ( $reader->strlen( $header ) != 24 ) {
+				return false;
+			}
 
-		// transform raw data into set of indices
-		$originals    = $reader->str_split( $originals, 8 );
-		$translations = $reader->str_split( $translations, 8 );
+			// parse header
+			$header = unpack( "{$endian}revision/{$endian}total/{$endian}originals_lenghts_addr/{$endian}translations_lenghts_addr/{$endian}hash_length/{$endian}hash_addr", $header );
+			if ( ! is_array( $header ) ) {
+				return false;
+			}
 
-		// skip hash table
-		$strings_addr = $header['hash_addr'] + $header['hash_length'] * 4;
+			// support revision 0 of MO format specs, only
+			if ( $header['revision'] != 0 ) {
+				return false;
+			}
 
-		$reader->seekto($strings_addr);
+			// seek to data blocks
+			$reader->seekto( $header['originals_lenghts_addr'] );
 
-		$strings = $reader->read_all();
-		$reader->close();
+			// read originals' indices
+			$originals_lengths_length = $header['translations_lenghts_addr'] - $header['originals_lenghts_addr'];
+			if ( $originals_lengths_length != $header['total'] * 8 ) {
+				return false;
+			}
 
-		for ( $i = 0; $i < $header['total']; $i++ ) {
-			$o = unpack( "{$endian}length/{$endian}pos", $originals[$i] );
-			$t = unpack( "{$endian}length/{$endian}pos", $translations[$i] );
-			if ( !$o || !$t ) return false;
+			$originals = $reader->read( $originals_lengths_length );
+			if ( $reader->strlen( $originals ) != $originals_lengths_length ) {
+				return false;
+			}
 
-			// adjust offset due to reading strings to separate space before
-			$o['pos'] -= $strings_addr;
-			$t['pos'] -= $strings_addr;
+			// read translations' indices
+			$translations_lenghts_length = $header['hash_addr'] - $header['translations_lenghts_addr'];
+			if ( $translations_lenghts_length != $header['total'] * 8 ) {
+				return false;
+			}
 
-			$original    = $reader->substr( $strings, $o['pos'], $o['length'] );
-			$translation = $reader->substr( $strings, $t['pos'], $t['length'] );
+			$translations = $reader->read( $translations_lenghts_length );
+			if ( $reader->strlen( $translations ) != $translations_lenghts_length ) {
+				return false;
+			}
 
-			if ('' === $original) {
-				$this->set_headers($this->make_headers($translation));
-			} else {
-				$entry = &$this->make_entry($original, $translation);
-				$this->entries[$entry->key()] = &$entry;
+			// transform raw data into set of indices
+			$originals    = $reader->str_split( $originals, 8 );
+			$translations = $reader->str_split( $translations, 8 );
+
+			// skip hash table
+			$strings_addr = $header['hash_addr'] + $header['hash_length'] * 4;
+
+			$reader->seekto( $strings_addr );
+
+			$strings = $reader->read_all();
+			$reader->close();
+
+			for ( $i = 0; $i < $header['total']; $i++ ) {
+				$o = unpack( "{$endian}length/{$endian}pos", $originals[ $i ] );
+				$t = unpack( "{$endian}length/{$endian}pos", $translations[ $i ] );
+				if ( ! $o || ! $t ) { return false;
+				}
+
+				// adjust offset due to reading strings to separate space before
+				$o['pos'] -= $strings_addr;
+				$t['pos'] -= $strings_addr;
+
+				$original    = $reader->substr( $strings, $o['pos'], $o['length'] );
+				$translation = $reader->substr( $strings, $t['pos'], $t['length'] );
+
+				if ( '' === $original ) {
+					$this->set_headers( $this->make_headers( $translation ) );
+				} else {
+					$entry = &$this->make_entry( $original, $translation );
+					$this->entries[ $entry->key() ] = &$entry;
+				}
 			}
+			return true;
 		}
-		return true;
-	}
 
-	/**
+		/**
 	 * Build a Translation_Entry from original string and translation strings,
 	 * found in a MO file
 	 *
@@ -285,39 +292,39 @@
 	 * @param string $translation translation string from MO file. Might contain
 	 * 	0x00 as a plural translations separator
 	 */
-	function &make_entry($original, $translation) {
-		$entry = new Translation_Entry();
-		// look for context
-		$parts = explode(chr(4), $original);
-		if (isset($parts[1])) {
-			$original = $parts[1];
-			$entry->context = $parts[0];
-		}
-		// look for plural original
-		$parts = explode(chr(0), $original);
-		$entry->singular = $parts[0];
-		if (isset($parts[1])) {
-			$entry->is_plural = true;
-			$entry->plural = $parts[1];
-		}
-		// plural translations are also separated by \0
-		$entry->translations = explode(chr(0), $translation);
-		return $entry;
-	}
+		function &make_entry( $original, $translation ) {
+			$entry = new Translation_Entry();
+			// look for context
+			$parts = explode( chr( 4 ), $original );
+			if ( isset( $parts[1] ) ) {
+				$original = $parts[1];
+				$entry->context = $parts[0];
+			}
+			// look for plural original
+			$parts = explode( chr( 0 ), $original );
+			$entry->singular = $parts[0];
+			if ( isset( $parts[1] ) ) {
+				$entry->is_plural = true;
+				$entry->plural = $parts[1];
+			}
+			// plural translations are also separated by \0
+			$entry->translations = explode( chr( 0 ), $translation );
+			return $entry;
+		}
 
-	/**
+		/**
 	 * @param int $count
 	 * @return string
 	 */
-	function select_plural_form($count) {
-		return $this->gettext_select_plural_form($count);
-	}
+		function select_plural_form( $count ) {
+			return $this->gettext_select_plural_form( $count );
+		}
 
-	/**
+		/**
 	 * @return int
 	 */
-	function get_plural_forms_count() {
-		return $this->_nplurals;
+		function get_plural_forms_count() {
+			return $this->_nplurals;
+		}
 	}
-}
 endif;
Index: src/wp-includes/pomo/po.php
===================================================================
--- src/wp-includes/pomo/po.php	(revision 40901)
+++ src/wp-includes/pomo/po.php	(working copy)
@@ -7,158 +7,165 @@
  * @subpackage po
  */
 
-require_once dirname(__FILE__) . '/translations.php';
+require_once dirname( __FILE__ ) . '/translations.php';
 
 if ( ! defined( 'PO_MAX_LINE_LEN' ) ) {
-	define('PO_MAX_LINE_LEN', 79);
+	define( 'PO_MAX_LINE_LEN', 79 );
 }
 
-ini_set('auto_detect_line_endings', 1);
+ini_set( 'auto_detect_line_endings', 1 );
 
 /**
  * Routines for working with PO files
  */
-if ( ! class_exists( 'PO', false ) ):
-class PO extends Gettext_Translations {
+if ( ! class_exists( 'PO', false ) ) :
+	class PO extends Gettext_Translations {
 
-	var $comments_before_headers = '';
+		var $comments_before_headers = '';
 
-	/**
+		/**
 	 * Exports headers to a PO entry
 	 *
 	 * @return string msgid/msgstr PO entry for this PO file headers, doesn't contain newline at the end
 	 */
-	function export_headers() {
-		$header_string = '';
-		foreach($this->headers as $header => $value) {
-			$header_string.= "$header: $value\n";
-		}
-		$poified = PO::poify($header_string);
-		if ($this->comments_before_headers)
-			$before_headers = $this->prepend_each_line(rtrim($this->comments_before_headers)."\n", '# ');
-		else
-			$before_headers = '';
-		return rtrim("{$before_headers}msgid \"\"\nmsgstr $poified");
-	}
+		function export_headers() {
+			$header_string = '';
+			foreach ( $this->headers as $header => $value ) {
+				$header_string .= "$header: $value\n";
+			}
+			$poified = PO::poify( $header_string );
+			if ( $this->comments_before_headers ) {
+				$before_headers = $this->prepend_each_line( rtrim( $this->comments_before_headers ) . "\n", '# ' );
+			} else { $before_headers = '';
+			}
+			return rtrim( "{$before_headers}msgid \"\"\nmsgstr $poified" );
+		}
 
-	/**
+		/**
 	 * Exports all entries to PO format
 	 *
 	 * @return string sequence of mgsgid/msgstr PO strings, doesn't containt newline at the end
 	 */
-	function export_entries() {
-		//TODO sorting
-		return implode("\n\n", array_map(array('PO', 'export_entry'), $this->entries));
-	}
+		function export_entries() {
+			//TODO sorting
+			return implode( "\n\n", array_map( array( 'PO', 'export_entry' ), $this->entries ) );
+		}
 
-	/**
+		/**
 	 * Exports the whole PO file as a string
 	 *
 	 * @param bool $include_headers whether to include the headers in the export
 	 * @return string ready for inclusion in PO file string for headers and all the enrtries
 	 */
-	function export($include_headers = true) {
-		$res = '';
-		if ($include_headers) {
-			$res .= $this->export_headers();
-			$res .= "\n\n";
+		function export( $include_headers = true ) {
+			$res = '';
+			if ( $include_headers ) {
+				$res .= $this->export_headers();
+				$res .= "\n\n";
+			}
+			$res .= $this->export_entries();
+			return $res;
 		}
-		$res .= $this->export_entries();
-		return $res;
-	}
 
-	/**
+		/**
 	 * Same as {@link export}, but writes the result to a file
 	 *
 	 * @param string $filename where to write the PO string
 	 * @param bool $include_headers whether to include tje headers in the export
 	 * @return bool true on success, false on error
 	 */
-	function export_to_file($filename, $include_headers = true) {
-		$fh = fopen($filename, 'w');
-		if (false === $fh) return false;
-		$export = $this->export($include_headers);
-		$res = fwrite($fh, $export);
-		if (false === $res) return false;
-		return fclose($fh);
-	}
+		function export_to_file( $filename, $include_headers = true ) {
+			$fh = fopen( $filename, 'w' );
+			if ( false === $fh ) { return false;
+			}
+			$export = $this->export( $include_headers );
+			$res = fwrite( $fh, $export );
+			if ( false === $res ) { return false;
+			}
+			return fclose( $fh );
+		}
 
-	/**
+		/**
 	 * Text to include as a comment before the start of the PO contents
 	 *
 	 * Doesn't need to include # in the beginning of lines, these are added automatically
 	 */
-	function set_comment_before_headers( $text ) {
-		$this->comments_before_headers = $text;
-	}
+		function set_comment_before_headers( $text ) {
+			$this->comments_before_headers = $text;
+		}
 
-	/**
+		/**
 	 * Formats a string in PO-style
 	 *
 	 * @static
 	 * @param string $string the string to format
 	 * @return string the poified string
 	 */
-	public static function poify($string) {
-		$quote = '"';
-		$slash = '\\';
-		$newline = "\n";
+		public static function poify( $string ) {
+			$quote = '"';
+			$slash = '\\';
+			$newline = "\n";
 
-		$replaces = array(
+			$replaces = array(
 			"$slash" 	=> "$slash$slash",
 			"$quote"	=> "$slash$quote",
 			"\t" 		=> '\t',
-		);
+			);
 
-		$string = str_replace(array_keys($replaces), array_values($replaces), $string);
+			$string = str_replace( array_keys( $replaces ), array_values( $replaces ), $string );
 
-		$po = $quote.implode("${slash}n$quote$newline$quote", explode($newline, $string)).$quote;
-		// add empty string on first line for readbility
-		if (false !== strpos($string, $newline) &&
-				(substr_count($string, $newline) > 1 || !($newline === substr($string, -strlen($newline))))) {
-			$po = "$quote$quote$newline$po";
-		}
-		// remove empty strings
-		$po = str_replace("$newline$quote$quote", '', $po);
-		return $po;
-	}
+			$po = $quote . implode( "${slash}n$quote$newline$quote", explode( $newline, $string ) ) . $quote;
+			// add empty string on first line for readbility
+			if ( false !== strpos( $string, $newline ) &&
+				(substr_count( $string, $newline ) > 1 || ! ($newline === substr( $string, -strlen( $newline ) ))) ) {
+				$po = "$quote$quote$newline$po";
+			}
+			// remove empty strings
+			$po = str_replace( "$newline$quote$quote", '', $po );
+			return $po;
+		}
 
-	/**
+		/**
 	 * Gives back the original string from a PO-formatted string
 	 *
 	 * @static
 	 * @param string $string PO-formatted string
 	 * @return string enascaped string
 	 */
-	public static function unpoify($string) {
-		$escapes = array('t' => "\t", 'n' => "\n", 'r' => "\r", '\\' => '\\');
-		$lines = array_map('trim', explode("\n", $string));
-		$lines = array_map(array('PO', 'trim_quotes'), $lines);
-		$unpoified = '';
-		$previous_is_backslash = false;
-		foreach($lines as $line) {
-			preg_match_all('/./u', $line, $chars);
-			$chars = $chars[0];
-			foreach($chars as $char) {
-				if (!$previous_is_backslash) {
-					if ('\\' == $char)
-						$previous_is_backslash = true;
-					else
-						$unpoified .= $char;
-				} else {
-					$previous_is_backslash = false;
-					$unpoified .= isset($escapes[$char])? $escapes[$char] : $char;
+		public static function unpoify( $string ) {
+			$escapes = array(
+				't' => "\t",
+				'n' => "\n",
+				'r' => "\r",
+				'\\' => '\\',
+			);
+			$lines = array_map( 'trim', explode( "\n", $string ) );
+			$lines = array_map( array( 'PO', 'trim_quotes' ), $lines );
+			$unpoified = '';
+			$previous_is_backslash = false;
+			foreach ( $lines as $line ) {
+				preg_match_all( '/./u', $line, $chars );
+				$chars = $chars[0];
+				foreach ( $chars as $char ) {
+					if ( ! $previous_is_backslash ) {
+						if ( '\\' == $char ) {
+							$previous_is_backslash = true;
+						} else { $unpoified .= $char;
+						}
+					} else {
+						$previous_is_backslash = false;
+						$unpoified .= isset( $escapes[ $char ] )? $escapes[ $char ] : $char;
+					}
 				}
 			}
-		}
 
-		// Standardise the line endings on imported content, technically PO files shouldn't contain \r
-		$unpoified = str_replace( array( "\r\n", "\r" ), "\n", $unpoified );
+			// Standardise the line endings on imported content, technically PO files shouldn't contain \r
+			$unpoified = str_replace( array( "\r\n", "\r" ), "\n", $unpoified );
 
-		return $unpoified;
-	}
+			return $unpoified;
+		}
 
-	/**
+		/**
 	 * Inserts $with in the beginning of every new line of $string and
 	 * returns the modified string
 	 *
@@ -166,24 +173,24 @@
 	 * @param string $string prepend lines in this string
 	 * @param string $with prepend lines with this string
 	 */
-	public static function prepend_each_line($string, $with) {
-		$lines = explode("\n", $string);
-		$append = '';
-		if ("\n" === substr($string, -1) && '' === end($lines)) {
-			// Last line might be empty because $string was terminated
-			// with a newline, remove it from the $lines array,
-			// we'll restore state by re-terminating the string at the end
-			array_pop($lines);
-			$append = "\n";
-		}
-		foreach ($lines as &$line) {
-			$line = $with . $line;
+		public static function prepend_each_line( $string, $with ) {
+			$lines = explode( "\n", $string );
+			$append = '';
+			if ( "\n" === substr( $string, -1 ) && '' === end( $lines ) ) {
+				// Last line might be empty because $string was terminated
+				// with a newline, remove it from the $lines array,
+				// we'll restore state by re-terminating the string at the end
+				array_pop( $lines );
+				$append = "\n";
+			}
+			foreach ( $lines as &$line ) {
+				$line = $with . $line;
+			}
+			unset( $line );
+			return implode( "\n", $lines ) . $append;
 		}
-		unset($line);
-		return implode("\n", $lines) . $append;
-	}
 
-	/**
+		/**
 	 * Prepare a text as a comment -- wraps the lines and prepends #
 	 * and a special character to each line
 	 *
@@ -192,12 +199,12 @@
 	 * @param string $char character to denote a special PO comment,
 	 * 	like :, default is a space
 	 */
-	public static function comment_block($text, $char=' ') {
-		$text = wordwrap($text, PO_MAX_LINE_LEN - 3);
-		return PO::prepend_each_line($text, "#$char ");
-	}
+		public static function comment_block( $text, $char = ' ' ) {
+			$text = wordwrap( $text, PO_MAX_LINE_LEN - 3 );
+			return PO::prepend_each_line( $text, "#$char " );
+		}
 
-	/**
+		/**
 	 * Builds a string from the entry for inclusion in PO file
 	 *
 	 * @static
@@ -205,214 +212,231 @@
 	 * @return false|string PO-style formatted string for the entry or
 	 * 	false if the entry is empty
 	 */
-	public static function export_entry(&$entry) {
-		if ( null === $entry->singular || '' === $entry->singular ) return false;
-		$po = array();
-		if (!empty($entry->translator_comments)) $po[] = PO::comment_block($entry->translator_comments);
-		if (!empty($entry->extracted_comments)) $po[] = PO::comment_block($entry->extracted_comments, '.');
-		if (!empty($entry->references)) $po[] = PO::comment_block(implode(' ', $entry->references), ':');
-		if (!empty($entry->flags)) $po[] = PO::comment_block(implode(", ", $entry->flags), ',');
-		if ($entry->context) $po[] = 'msgctxt '.PO::poify($entry->context);
-		$po[] = 'msgid '.PO::poify($entry->singular);
-		if (!$entry->is_plural) {
-			$translation = empty($entry->translations)? '' : $entry->translations[0];
-			$translation = PO::match_begin_and_end_newlines( $translation, $entry->singular );
-			$po[] = 'msgstr '.PO::poify($translation);
-		} else {
-			$po[] = 'msgid_plural '.PO::poify($entry->plural);
-			$translations = empty($entry->translations)? array('', '') : $entry->translations;
-			foreach($translations as $i => $translation) {
-				$translation = PO::match_begin_and_end_newlines( $translation, $entry->plural );
-				$po[] = "msgstr[$i] ".PO::poify($translation);
+		public static function export_entry( &$entry ) {
+			if ( null === $entry->singular || '' === $entry->singular ) { return false;
 			}
-		}
-		return implode("\n", $po);
-	}
-
-	public static function match_begin_and_end_newlines( $translation, $original ) {
-		if ( '' === $translation ) {
-			return $translation;
+			$po = array();
+			if ( ! empty( $entry->translator_comments ) ) { $po[] = PO::comment_block( $entry->translator_comments );
+			}
+			if ( ! empty( $entry->extracted_comments ) ) { $po[] = PO::comment_block( $entry->extracted_comments, '.' );
+			}
+			if ( ! empty( $entry->references ) ) { $po[] = PO::comment_block( implode( ' ', $entry->references ), ':' );
+			}
+			if ( ! empty( $entry->flags ) ) { $po[] = PO::comment_block( implode( ', ', $entry->flags ), ',' );
+			}
+			if ( $entry->context ) { $po[] = 'msgctxt ' . PO::poify( $entry->context );
+			}
+			$po[] = 'msgid ' . PO::poify( $entry->singular );
+			if ( ! $entry->is_plural ) {
+				$translation = empty( $entry->translations )? '' : $entry->translations[0];
+				$translation = PO::match_begin_and_end_newlines( $translation, $entry->singular );
+				$po[] = 'msgstr ' . PO::poify( $translation );
+			} else {
+				$po[] = 'msgid_plural ' . PO::poify( $entry->plural );
+				$translations = empty( $entry->translations )? array( '', '' ) : $entry->translations;
+				foreach ( $translations as $i => $translation ) {
+					$translation = PO::match_begin_and_end_newlines( $translation, $entry->plural );
+					$po[] = "msgstr[$i] " . PO::poify( $translation );
+				}
+			}
+			return implode( "\n", $po );
 		}
 
-		$original_begin = "\n" === substr( $original, 0, 1 );
-		$original_end = "\n" === substr( $original, -1 );
-		$translation_begin = "\n" === substr( $translation, 0, 1 );
-		$translation_end = "\n" === substr( $translation, -1 );
+		public static function match_begin_and_end_newlines( $translation, $original ) {
+			if ( '' === $translation ) {
+				return $translation;
+			}
 
-		if ( $original_begin ) {
-			if ( ! $translation_begin ) {
-				$translation = "\n" . $translation;
+			$original_begin = "\n" === substr( $original, 0, 1 );
+			$original_end = "\n" === substr( $original, -1 );
+			$translation_begin = "\n" === substr( $translation, 0, 1 );
+			$translation_end = "\n" === substr( $translation, -1 );
+
+			if ( $original_begin ) {
+				if ( ! $translation_begin ) {
+					$translation = "\n" . $translation;
+				}
+			} elseif ( $translation_begin ) {
+				$translation = ltrim( $translation, "\n" );
 			}
-		} elseif ( $translation_begin ) {
-			$translation = ltrim( $translation, "\n" );
-		}
 
-		if ( $original_end ) {
-			if ( ! $translation_end ) {
-				$translation .= "\n";
+			if ( $original_end ) {
+				if ( ! $translation_end ) {
+					$translation .= "\n";
+				}
+			} elseif ( $translation_end ) {
+				$translation = rtrim( $translation, "\n" );
 			}
-		} elseif ( $translation_end ) {
-			$translation = rtrim( $translation, "\n" );
-		}
 
-		return $translation;
-	}
+			return $translation;
+		}
 
-	/**
+		/**
 	 * @param string $filename
 	 * @return boolean
 	 */
-	function import_from_file($filename) {
-		$f = fopen($filename, 'r');
-		if (!$f) return false;
-		$lineno = 0;
-		while (true) {
-			$res = $this->read_entry($f, $lineno);
-			if (!$res) break;
-			if ($res['entry']->singular == '') {
-				$this->set_headers($this->make_headers($res['entry']->translations[0]));
-			} else {
-				$this->add_entry($res['entry']);
+		function import_from_file( $filename ) {
+			$f = fopen( $filename, 'r' );
+			if ( ! $f ) { return false;
 			}
+			$lineno = 0;
+			while ( true ) {
+				$res = $this->read_entry( $f, $lineno );
+				if ( ! $res ) { break;
+				}
+				if ( $res['entry']->singular == '' ) {
+					$this->set_headers( $this->make_headers( $res['entry']->translations[0] ) );
+				} else {
+					$this->add_entry( $res['entry'] );
+				}
+			}
+			PO::read_line( $f, 'clear' );
+			if ( false === $res ) {
+				return false;
+			}
+			if ( ! $this->headers && ! $this->entries ) {
+				return false;
+			}
+			return true;
 		}
-		PO::read_line($f, 'clear');
-		if ( false === $res ) {
-			return false;
-		}
-		if ( ! $this->headers && ! $this->entries ) {
-			return false;
-		}
-		return true;
-	}
 
-	/**
+		/**
 	 * Helper function for read_entry
 	 * @param string $context
 	 * @return bool
 	 */
-	protected static function is_final($context) {
-		return ($context === 'msgstr') || ($context === 'msgstr_plural');
-	}
+		protected static function is_final( $context ) {
+			return ($context === 'msgstr') || ($context === 'msgstr_plural');
+		}
 
-	/**
+		/**
 	 * @param resource $f
 	 * @param int      $lineno
 	 * @return null|false|array
 	 */
-	function read_entry($f, $lineno = 0) {
-		$entry = new Translation_Entry();
-		// where were we in the last step
-		// can be: comment, msgctxt, msgid, msgid_plural, msgstr, msgstr_plural
-		$context = '';
-		$msgstr_index = 0;
-		while (true) {
-			$lineno++;
-			$line = PO::read_line($f);
-			if (!$line)  {
-				if (feof($f)) {
-					if (self::is_final($context))
-						break;
-					elseif (!$context) // we haven't read a line and eof came
-						return null;
-					else
+		function read_entry( $f, $lineno = 0 ) {
+			$entry = new Translation_Entry();
+			// where were we in the last step
+			// can be: comment, msgctxt, msgid, msgid_plural, msgstr, msgstr_plural
+			$context = '';
+			$msgstr_index = 0;
+			while ( true ) {
+				$lineno++;
+				$line = PO::read_line( $f );
+				if ( ! $line ) {
+					if ( feof( $f ) ) {
+						if ( self::is_final( $context ) ) {
+							break;
+						} elseif ( ! $context ) { // we haven't read a line and eof came
+							return null;
+						} else { return false;
+						}
+					} else {
 						return false;
-				} else {
-					return false;
+					}
 				}
-			}
-			if ($line == "\n") continue;
-			$line = trim($line);
-			if (preg_match('/^#/', $line, $m)) {
-				// the comment is the start of a new entry
-				if (self::is_final($context)) {
-					PO::read_line($f, 'put-back');
-					$lineno--;
-					break;
-				}
-				// comments have to be at the beginning
-				if ($context && $context != 'comment') {
-					return false;
+				if ( $line == "\n" ) { continue;
 				}
-				// add comment
-				$this->add_comment_to_entry($entry, $line);
-			} elseif (preg_match('/^msgctxt\s+(".*")/', $line, $m)) {
-				if (self::is_final($context)) {
-					PO::read_line($f, 'put-back');
-					$lineno--;
-					break;
-				}
-				if ($context && $context != 'comment') {
+				$line = trim( $line );
+				if ( preg_match( '/^#/', $line, $m ) ) {
+					// the comment is the start of a new entry
+					if ( self::is_final( $context ) ) {
+						PO::read_line( $f, 'put-back' );
+						$lineno--;
+						break;
+					}
+					// comments have to be at the beginning
+					if ( $context && $context != 'comment' ) {
+						return false;
+					}
+					// add comment
+					$this->add_comment_to_entry( $entry, $line );
+				} elseif ( preg_match( '/^msgctxt\s+(".*")/', $line, $m ) ) {
+					if ( self::is_final( $context ) ) {
+						PO::read_line( $f, 'put-back' );
+						$lineno--;
+						break;
+					}
+					if ( $context && $context != 'comment' ) {
+						return false;
+					}
+					$context = 'msgctxt';
+					$entry->context .= PO::unpoify( $m[1] );
+				} elseif ( preg_match( '/^msgid\s+(".*")/', $line, $m ) ) {
+					if ( self::is_final( $context ) ) {
+						PO::read_line( $f, 'put-back' );
+						$lineno--;
+						break;
+					}
+					if ( $context && $context != 'msgctxt' && $context != 'comment' ) {
+						return false;
+					}
+					$context = 'msgid';
+					$entry->singular .= PO::unpoify( $m[1] );
+				} elseif ( preg_match( '/^msgid_plural\s+(".*")/', $line, $m ) ) {
+					if ( $context != 'msgid' ) {
+						return false;
+					}
+					$context = 'msgid_plural';
+					$entry->is_plural = true;
+					$entry->plural .= PO::unpoify( $m[1] );
+				} elseif ( preg_match( '/^msgstr\s+(".*")/', $line, $m ) ) {
+					if ( $context != 'msgid' ) {
+						return false;
+					}
+					$context = 'msgstr';
+					$entry->translations = array( PO::unpoify( $m[1] ) );
+				} elseif ( preg_match( '/^msgstr\[(\d+)\]\s+(".*")/', $line, $m ) ) {
+					if ( $context != 'msgid_plural' && $context != 'msgstr_plural' ) {
+						return false;
+					}
+					$context = 'msgstr_plural';
+					$msgstr_index = $m[1];
+					$entry->translations[ $m[1] ] = PO::unpoify( $m[2] );
+				} elseif ( preg_match( '/^".*"$/', $line ) ) {
+					$unpoified = PO::unpoify( $line );
+					switch ( $context ) {
+						case 'msgid':
+							$entry->singular .= $unpoified;
+break;
+						case 'msgctxt':
+							$entry->context .= $unpoified;
+break;
+						case 'msgid_plural':
+							$entry->plural .= $unpoified;
+break;
+						case 'msgstr':
+							$entry->translations[0] .= $unpoified;
+break;
+						case 'msgstr_plural':
+							$entry->translations[ $msgstr_index ] .= $unpoified;
+break;
+						default:
+							return false;
+					}
+				} else {
 					return false;
-				}
-				$context = 'msgctxt';
-				$entry->context .= PO::unpoify($m[1]);
-			} elseif (preg_match('/^msgid\s+(".*")/', $line, $m)) {
-				if (self::is_final($context)) {
-					PO::read_line($f, 'put-back');
-					$lineno--;
+				}// End if().
+			}// End while().
+
+			$have_translations = false;
+			foreach ( $entry->translations as $t ) {
+				if ( $t || ('0' === $t) ) {
+					$have_translations = true;
 					break;
 				}
-				if ($context && $context != 'msgctxt' && $context != 'comment') {
-					return false;
-				}
-				$context = 'msgid';
-				$entry->singular .= PO::unpoify($m[1]);
-			} elseif (preg_match('/^msgid_plural\s+(".*")/', $line, $m)) {
-				if ($context != 'msgid') {
-					return false;
-				}
-				$context = 'msgid_plural';
-				$entry->is_plural = true;
-				$entry->plural .= PO::unpoify($m[1]);
-			} elseif (preg_match('/^msgstr\s+(".*")/', $line, $m)) {
-				if ($context != 'msgid') {
-					return false;
-				}
-				$context = 'msgstr';
-				$entry->translations = array(PO::unpoify($m[1]));
-			} elseif (preg_match('/^msgstr\[(\d+)\]\s+(".*")/', $line, $m)) {
-				if ($context != 'msgid_plural' && $context != 'msgstr_plural') {
-					return false;
-				}
-				$context = 'msgstr_plural';
-				$msgstr_index = $m[1];
-				$entry->translations[$m[1]] = PO::unpoify($m[2]);
-			} elseif (preg_match('/^".*"$/', $line)) {
-				$unpoified = PO::unpoify($line);
-				switch ($context) {
-					case 'msgid':
-						$entry->singular .= $unpoified; break;
-					case 'msgctxt':
-						$entry->context .= $unpoified; break;
-					case 'msgid_plural':
-						$entry->plural .= $unpoified; break;
-					case 'msgstr':
-						$entry->translations[0] .= $unpoified; break;
-					case 'msgstr_plural':
-						$entry->translations[$msgstr_index] .= $unpoified; break;
-					default:
-						return false;
-				}
-			} else {
-				return false;
 			}
-		}
-
-		$have_translations = false;
-		foreach ( $entry->translations as $t ) {
-			if ( $t || ('0' === $t) ) {
-				$have_translations = true;
-				break;
+			if ( false === $have_translations ) {
+				$entry->translations = array();
 			}
-		}
-		if ( false === $have_translations ) {
-			$entry->translations = array();
-		}
 
-		return array('entry' => $entry, 'lineno' => $lineno);
-	}
+			return array(
+				'entry' => $entry,
+				'lineno' => $lineno,
+			);
+		}
 
-	/**
+		/**
 	 * @staticvar string   $last_line
 	 * @staticvar boolean  $use_last_line
 	 *
@@ -420,50 +444,52 @@
 	 * @param     string   $action
 	 * @return boolean
 	 */
-	function read_line($f, $action = 'read') {
-		static $last_line = '';
-		static $use_last_line = false;
-		if ('clear' == $action) {
-			$last_line = '';
-			return true;
-		}
-		if ('put-back' == $action) {
-			$use_last_line = true;
-			return true;
+		function read_line( $f, $action = 'read' ) {
+			static $last_line = '';
+			static $use_last_line = false;
+			if ( 'clear' == $action ) {
+				$last_line = '';
+				return true;
+			}
+			if ( 'put-back' == $action ) {
+				$use_last_line = true;
+				return true;
+			}
+			$line = $use_last_line? $last_line : fgets( $f );
+			$line = ( "\r\n" == substr( $line, -2 ) ) ? rtrim( $line, "\r\n" ) . "\n" : $line;
+			$last_line = $line;
+			$use_last_line = false;
+			return $line;
 		}
-		$line = $use_last_line? $last_line : fgets($f);
-		$line = ( "\r\n" == substr( $line, -2 ) ) ? rtrim( $line, "\r\n" ) . "\n" : $line;
-		$last_line = $line;
-		$use_last_line = false;
-		return $line;
-	}
 
-	/**
+		/**
 	 * @param Translation_Entry $entry
 	 * @param string            $po_comment_line
 	 */
-	function add_comment_to_entry(&$entry, $po_comment_line) {
-		$first_two = substr($po_comment_line, 0, 2);
-		$comment = trim(substr($po_comment_line, 2));
-		if ('#:' == $first_two) {
-			$entry->references = array_merge($entry->references, preg_split('/\s+/', $comment));
-		} elseif ('#.' == $first_two) {
-			$entry->extracted_comments = trim($entry->extracted_comments . "\n" . $comment);
-		} elseif ('#,' == $first_two) {
-			$entry->flags = array_merge($entry->flags, preg_split('/,\s*/', $comment));
-		} else {
-			$entry->translator_comments = trim($entry->translator_comments . "\n" . $comment);
+		function add_comment_to_entry( &$entry, $po_comment_line ) {
+			$first_two = substr( $po_comment_line, 0, 2 );
+			$comment = trim( substr( $po_comment_line, 2 ) );
+			if ( '#:' == $first_two ) {
+				$entry->references = array_merge( $entry->references, preg_split( '/\s+/', $comment ) );
+			} elseif ( '#.' == $first_two ) {
+				$entry->extracted_comments = trim( $entry->extracted_comments . "\n" . $comment );
+			} elseif ( '#,' == $first_two ) {
+				$entry->flags = array_merge( $entry->flags, preg_split( '/,\s*/', $comment ) );
+			} else {
+				$entry->translator_comments = trim( $entry->translator_comments . "\n" . $comment );
+			}
 		}
-	}
 
-	/**
+		/**
 	 * @param string $s
 	 * @return sring
 	 */
-	public static function trim_quotes($s) {
-		if ( substr($s, 0, 1) == '"') $s = substr($s, 1);
-		if ( substr($s, -1, 1) == '"') $s = substr($s, 0, -1);
-		return $s;
+		public static function trim_quotes( $s ) {
+			if ( substr( $s, 0, 1 ) == '"' ) { $s = substr( $s, 1 );
+			}
+			if ( substr( $s, -1, 1 ) == '"' ) { $s = substr( $s, 0, -1 );
+			}
+			return $s;
+		}
 	}
-}
 endif;
Index: src/wp-includes/pomo/streams.php
===================================================================
--- src/wp-includes/pomo/streams.php	(revision 40901)
+++ src/wp-includes/pomo/streams.php	(working copy)
@@ -8,308 +8,314 @@
  * @subpackage streams
  */
 
-if ( ! class_exists( 'POMO_Reader', false ) ):
-class POMO_Reader {
+if ( ! class_exists( 'POMO_Reader', false ) ) :
+	class POMO_Reader {
 
-	var $endian = 'little';
-	var $_post = '';
+		var $endian = 'little';
+		var $_post = '';
 
-	/**
+		/**
 	 * PHP5 constructor.
 	 */
-	function __construct() {
-		$this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr');
-		$this->_pos = 0;
-	}
+		function __construct() {
+			$this->is_overloaded = ((ini_get( 'mbstring.func_overload' ) & 2) != 0) && function_exists( 'mb_substr' );
+			$this->_pos = 0;
+		}
 
-	/**
+		/**
 	 * PHP4 constructor.
 	 */
-	public function POMO_Reader() {
-		self::__construct();
-	}
+		public function POMO_Reader() {
+			self::__construct();
+		}
 
-	/**
+		/**
 	 * Sets the endianness of the file.
 	 *
 	 * @param $endian string 'big' or 'little'
 	 */
-	function setEndian($endian) {
-		$this->endian = $endian;
-	}
+		function setEndian( $endian ) {
+			$this->endian = $endian;
+		}
 
-	/**
+		/**
 	 * Reads a 32bit Integer from the Stream
 	 *
 	 * @return mixed The integer, corresponding to the next 32 bits from
 	 * 	the stream of false if there are not enough bytes or on error
 	 */
-	function readint32() {
-		$bytes = $this->read(4);
-		if (4 != $this->strlen($bytes))
-			return false;
-		$endian_letter = ('big' == $this->endian)? 'N' : 'V';
-		$int = unpack($endian_letter, $bytes);
-		return reset( $int );
-	}
+		function readint32() {
+			$bytes = $this->read( 4 );
+			if ( 4 != $this->strlen( $bytes ) ) {
+				return false;
+			}
+			$endian_letter = ('big' == $this->endian)? 'N' : 'V';
+			$int = unpack( $endian_letter, $bytes );
+			return reset( $int );
+		}
 
-	/**
+		/**
 	 * Reads an array of 32-bit Integers from the Stream
 	 *
 	 * @param integer count How many elements should be read
 	 * @return mixed Array of integers or false if there isn't
 	 * 	enough data or on error
 	 */
-	function readint32array($count) {
-		$bytes = $this->read(4 * $count);
-		if (4*$count != $this->strlen($bytes))
-			return false;
-		$endian_letter = ('big' == $this->endian)? 'N' : 'V';
-		return unpack($endian_letter.$count, $bytes);
-	}
+		function readint32array( $count ) {
+			$bytes = $this->read( 4 * $count );
+			if ( 4 * $count != $this->strlen( $bytes ) ) {
+				return false;
+			}
+			$endian_letter = ('big' == $this->endian)? 'N' : 'V';
+			return unpack( $endian_letter . $count, $bytes );
+		}
 
-	/**
+		/**
 	 * @param string $string
 	 * @param int    $start
 	 * @param int    $length
 	 * @return string
 	 */
-	function substr($string, $start, $length) {
-		if ($this->is_overloaded) {
-			return mb_substr($string, $start, $length, 'ascii');
-		} else {
-			return substr($string, $start, $length);
+		function substr( $string, $start, $length ) {
+			if ( $this->is_overloaded ) {
+				return mb_substr( $string, $start, $length, 'ascii' );
+			} else {
+				return substr( $string, $start, $length );
+			}
 		}
-	}
 
-	/**
+		/**
 	 * @param string $string
 	 * @return int
 	 */
-	function strlen($string) {
-		if ($this->is_overloaded) {
-			return mb_strlen($string, 'ascii');
-		} else {
-			return strlen($string);
+		function strlen( $string ) {
+			if ( $this->is_overloaded ) {
+				return mb_strlen( $string, 'ascii' );
+			} else {
+				return strlen( $string );
+			}
 		}
-	}
 
-	/**
+		/**
 	 * @param string $string
 	 * @param int    $chunk_size
 	 * @return array
 	 */
-	function str_split($string, $chunk_size) {
-		if (!function_exists('str_split')) {
-			$length = $this->strlen($string);
-			$out = array();
-			for ($i = 0; $i < $length; $i += $chunk_size)
-				$out[] = $this->substr($string, $i, $chunk_size);
-			return $out;
-		} else {
-			return str_split( $string, $chunk_size );
+		function str_split( $string, $chunk_size ) {
+			if ( ! function_exists( 'str_split' ) ) {
+				$length = $this->strlen( $string );
+				$out = array();
+				for ( $i = 0; $i < $length; $i += $chunk_size ) {
+					$out[] = $this->substr( $string, $i, $chunk_size );
+				}
+				return $out;
+			} else {
+				return str_split( $string, $chunk_size );
+			}
 		}
-	}
 
-	/**
+		/**
 	 * @return int
 	 */
-	function pos() {
-		return $this->_pos;
-	}
+		function pos() {
+			return $this->_pos;
+		}
 
-	/**
+		/**
 	 * @return true
 	 */
-	function is_resource() {
-		return true;
-	}
+		function is_resource() {
+			return true;
+		}
 
-	/**
+		/**
 	 * @return true
 	 */
-	function close() {
-		return true;
+		function close() {
+			return true;
+		}
 	}
-}
 endif;
 
-if ( ! class_exists( 'POMO_FileReader', false ) ):
-class POMO_FileReader extends POMO_Reader {
+if ( ! class_exists( 'POMO_FileReader', false ) ) :
+	class POMO_FileReader extends POMO_Reader {
 
-	/**
+		/**
 	 * @param string $filename
 	 */
-	function __construct( $filename ) {
-		parent::POMO_Reader();
-		$this->_f = fopen($filename, 'rb');
-	}
+		function __construct( $filename ) {
+			parent::POMO_Reader();
+			$this->_f = fopen( $filename, 'rb' );
+		}
 
-	/**
+		/**
 	 * PHP4 constructor.
 	 */
-	public function POMO_FileReader( $filename ) {
-		self::__construct( $filename );
-	}
+		public function POMO_FileReader( $filename ) {
+			self::__construct( $filename );
+		}
 
-	/**
+		/**
 	 * @param int $bytes
 	 */
-	function read($bytes) {
-		return fread($this->_f, $bytes);
-	}
+		function read( $bytes ) {
+			return fread( $this->_f, $bytes );
+		}
 
-	/**
+		/**
 	 * @param int $pos
 	 * @return boolean
 	 */
-	function seekto($pos) {
-		if ( -1 == fseek($this->_f, $pos, SEEK_SET)) {
-			return false;
+		function seekto( $pos ) {
+			if ( -1 == fseek( $this->_f, $pos, SEEK_SET ) ) {
+				return false;
+			}
+			$this->_pos = $pos;
+			return true;
 		}
-		$this->_pos = $pos;
-		return true;
-	}
 
-	/**
+		/**
 	 * @return bool
 	 */
-	function is_resource() {
-		return is_resource($this->_f);
-	}
+		function is_resource() {
+			return is_resource( $this->_f );
+		}
 
-	/**
+		/**
 	 * @return bool
 	 */
-	function feof() {
-		return feof($this->_f);
-	}
+		function feof() {
+			return feof( $this->_f );
+		}
 
-	/**
+		/**
 	 * @return bool
 	 */
-	function close() {
-		return fclose($this->_f);
-	}
+		function close() {
+			return fclose( $this->_f );
+		}
 
-	/**
+		/**
 	 * @return string
 	 */
-	function read_all() {
-		$all = '';
-		while ( !$this->feof() )
-			$all .= $this->read(4096);
-		return $all;
+		function read_all() {
+			$all = '';
+			while ( ! $this->feof() ) {			$all .= $this->read( 4096 );
+			}
+			return $all;
+		}
 	}
-}
 endif;
 
-if ( ! class_exists( 'POMO_StringReader', false ) ):
-/**
+if ( ! class_exists( 'POMO_StringReader', false ) ) :
+	/**
  * Provides file-like methods for manipulating a string instead
  * of a physical file.
  */
-class POMO_StringReader extends POMO_Reader {
+	class POMO_StringReader extends POMO_Reader {
 
-	var $_str = '';
+		var $_str = '';
 
-	/**
+		/**
 	 * PHP5 constructor.
 	 */
-	function __construct( $str = '' ) {
-		parent::POMO_Reader();
-		$this->_str = $str;
-		$this->_pos = 0;
-	}
+		function __construct( $str = '' ) {
+			parent::POMO_Reader();
+			$this->_str = $str;
+			$this->_pos = 0;
+		}
 
-	/**
+		/**
 	 * PHP4 constructor.
 	 */
-	public function POMO_StringReader( $str = '' ) {
-		self::__construct( $str );
-	}
+		public function POMO_StringReader( $str = '' ) {
+			self::__construct( $str );
+		}
 
-	/**
+		/**
 	 * @param string $bytes
 	 * @return string
 	 */
-	function read($bytes) {
-		$data = $this->substr($this->_str, $this->_pos, $bytes);
-		$this->_pos += $bytes;
-		if ($this->strlen($this->_str) < $this->_pos) $this->_pos = $this->strlen($this->_str);
-		return $data;
-	}
+		function read( $bytes ) {
+			$data = $this->substr( $this->_str, $this->_pos, $bytes );
+			$this->_pos += $bytes;
+			if ( $this->strlen( $this->_str ) < $this->_pos ) { $this->_pos = $this->strlen( $this->_str );
+			}
+			return $data;
+		}
 
-	/**
+		/**
 	 * @param int $pos
 	 * @return int
 	 */
-	function seekto($pos) {
-		$this->_pos = $pos;
-		if ($this->strlen($this->_str) < $this->_pos) $this->_pos = $this->strlen($this->_str);
-		return $this->_pos;
-	}
+		function seekto( $pos ) {
+			$this->_pos = $pos;
+			if ( $this->strlen( $this->_str ) < $this->_pos ) { $this->_pos = $this->strlen( $this->_str );
+			}
+			return $this->_pos;
+		}
 
-	/**
+		/**
 	 * @return int
 	 */
-	function length() {
-		return $this->strlen($this->_str);
-	}
+		function length() {
+			return $this->strlen( $this->_str );
+		}
 
-	/**
+		/**
 	 * @return string
 	 */
-	function read_all() {
-		return $this->substr($this->_str, $this->_pos, $this->strlen($this->_str));
-	}
+		function read_all() {
+			return $this->substr( $this->_str, $this->_pos, $this->strlen( $this->_str ) );
+		}
 
-}
+	}
 endif;
 
-if ( ! class_exists( 'POMO_CachedFileReader', false ) ):
-/**
+if ( ! class_exists( 'POMO_CachedFileReader', false ) ) :
+	/**
  * Reads the contents of the file in the beginning.
  */
-class POMO_CachedFileReader extends POMO_StringReader {
-	/**
+	class POMO_CachedFileReader extends POMO_StringReader {
+		/**
 	 * PHP5 constructor.
 	 */
-	function __construct( $filename ) {
-		parent::POMO_StringReader();
-		$this->_str = file_get_contents($filename);
-		if (false === $this->_str)
-			return false;
-		$this->_pos = 0;
-	}
+		function __construct( $filename ) {
+			parent::POMO_StringReader();
+			$this->_str = file_get_contents( $filename );
+			if ( false === $this->_str ) {
+				return false;
+			}
+			$this->_pos = 0;
+		}
 
-	/**
+		/**
 	 * PHP4 constructor.
 	 */
-	public function POMO_CachedFileReader( $filename ) {
-		self::__construct( $filename );
+		public function POMO_CachedFileReader( $filename ) {
+			self::__construct( $filename );
+		}
 	}
-}
 endif;
 
-if ( ! class_exists( 'POMO_CachedIntFileReader', false ) ):
-/**
+if ( ! class_exists( 'POMO_CachedIntFileReader', false ) ) :
+	/**
  * Reads the contents of the file in the beginning.
  */
-class POMO_CachedIntFileReader extends POMO_CachedFileReader {
-	/**
+	class POMO_CachedIntFileReader extends POMO_CachedFileReader {
+		/**
 	 * PHP5 constructor.
 	 */
-	public function __construct( $filename ) {
-		parent::POMO_CachedFileReader($filename);
-	}
+		public function __construct( $filename ) {
+			parent::POMO_CachedFileReader( $filename );
+		}
 
-	/**
+		/**
 	 * PHP4 constructor.
 	 */
-	function POMO_CachedIntFileReader( $filename ) {
-		self::__construct( $filename );
+		function POMO_CachedIntFileReader( $filename ) {
+			self::__construct( $filename );
+		}
 	}
-}
 endif;
 
Index: src/wp-includes/pomo/translations.php
===================================================================
--- src/wp-includes/pomo/translations.php	(revision 40901)
+++ src/wp-includes/pomo/translations.php	(working copy)
@@ -7,47 +7,49 @@
  * @subpackage translations
  */
 
-require_once dirname(__FILE__) . '/entry.php';
+require_once dirname( __FILE__ ) . '/entry.php';
 
-if ( ! class_exists( 'Translations', false ) ):
-class Translations {
-	var $entries = array();
-	var $headers = array();
+if ( ! class_exists( 'Translations', false ) ) :
+	class Translations {
+		var $entries = array();
+		var $headers = array();
 
-	/**
+		/**
 	 * Add entry to the PO structure
 	 *
 	 * @param array|Translation_Entry &$entry
 	 * @return bool true on success, false if the entry doesn't have a key
 	 */
-	function add_entry($entry) {
-		if (is_array($entry)) {
-			$entry = new Translation_Entry($entry);
-		}
-		$key = $entry->key();
-		if (false === $key) return false;
-		$this->entries[$key] = &$entry;
-		return true;
-	}
+		function add_entry( $entry ) {
+			if ( is_array( $entry ) ) {
+				$entry = new Translation_Entry( $entry );
+			}
+			$key = $entry->key();
+			if ( false === $key ) { return false;
+			}
+			$this->entries[ $key ] = &$entry;
+			return true;
+		}
 
-	/**
+		/**
 	 * @param array|Translation_Entry $entry
 	 * @return bool
 	 */
-	function add_entry_or_merge($entry) {
-		if (is_array($entry)) {
-			$entry = new Translation_Entry($entry);
-		}
-		$key = $entry->key();
-		if (false === $key) return false;
-		if (isset($this->entries[$key]))
-			$this->entries[$key]->merge_with($entry);
-		else
-			$this->entries[$key] = &$entry;
-		return true;
-	}
+		function add_entry_or_merge( $entry ) {
+			if ( is_array( $entry ) ) {
+				$entry = new Translation_Entry( $entry );
+			}
+			$key = $entry->key();
+			if ( false === $key ) { return false;
+			}
+			if ( isset( $this->entries[ $key ] ) ) {
+				$this->entries[ $key ]->merge_with( $entry );
+			} else { $this->entries[ $key ] = &$entry;
+			}
+			return true;
+		}
 
-	/**
+		/**
 	 * Sets $header PO header to $value
 	 *
 	 * If the header already exists, it will be overwritten
@@ -57,46 +59,49 @@
 	 * @param string $header header name, without trailing :
 	 * @param string $value header value, without trailing \n
 	 */
-	function set_header($header, $value) {
-		$this->headers[$header] = $value;
-	}
+		function set_header( $header, $value ) {
+			$this->headers[ $header ] = $value;
+		}
 
-	/**
+		/**
 	 * @param array $headers
 	 */
-	function set_headers($headers) {
-		foreach($headers as $header => $value) {
-			$this->set_header($header, $value);
+		function set_headers( $headers ) {
+			foreach ( $headers as $header => $value ) {
+				$this->set_header( $header, $value );
+			}
 		}
-	}
 
-	/**
+		/**
 	 * @param string $header
 	 */
-	function get_header($header) {
-		return isset($this->headers[$header])? $this->headers[$header] : false;
-	}
+		function get_header( $header ) {
+			return isset( $this->headers[ $header ] )? $this->headers[ $header ] : false;
+		}
 
-	/**
+		/**
 	 * @param Translation_Entry $entry
 	 */
-	function translate_entry(&$entry) {
-		$key = $entry->key();
-		return isset($this->entries[$key])? $this->entries[$key] : false;
-	}
+		function translate_entry( &$entry ) {
+			$key = $entry->key();
+			return isset( $this->entries[ $key ] )? $this->entries[ $key ] : false;
+		}
 
-	/**
+		/**
 	 * @param string $singular
 	 * @param string $context
 	 * @return string
 	 */
-	function translate($singular, $context=null) {
-		$entry = new Translation_Entry(array('singular' => $singular, 'context' => $context));
-		$translated = $this->translate_entry($entry);
-		return ($translated && !empty($translated->translations))? $translated->translations[0] : $singular;
-	}
+		function translate( $singular, $context = null ) {
+			$entry = new Translation_Entry( array(
+				'singular' => $singular,
+				'context' => $context,
+			) );
+			$translated = $this->translate_entry( $entry );
+			return ($translated && ! empty( $translated->translations ))? $translated->translations[0] : $singular;
+		}
 
-	/**
+		/**
 	 * Given the number of items, returns the 0-based index of the plural form to use
 	 *
 	 * Here, in the base Translations class, the common logic for English is implemented:
@@ -107,63 +112,67 @@
 	 *
 	 * @param integer $count number of items
 	 */
-	function select_plural_form($count) {
-		return 1 == $count? 0 : 1;
-	}
+		function select_plural_form( $count ) {
+			return 1 == $count? 0 : 1;
+		}
 
-	/**
+		/**
 	 * @return int
 	 */
-	function get_plural_forms_count() {
-		return 2;
-	}
+		function get_plural_forms_count() {
+			return 2;
+		}
 
-	/**
+		/**
 	 * @param string $singular
 	 * @param string $plural
 	 * @param int    $count
 	 * @param string $context
 	 */
-	function translate_plural($singular, $plural, $count, $context = null) {
-		$entry = new Translation_Entry(array('singular' => $singular, 'plural' => $plural, 'context' => $context));
-		$translated = $this->translate_entry($entry);
-		$index = $this->select_plural_form($count);
-		$total_plural_forms = $this->get_plural_forms_count();
-		if ($translated && 0 <= $index && $index < $total_plural_forms &&
-				is_array($translated->translations) &&
-				isset($translated->translations[$index]))
-			return $translated->translations[$index];
-		else
-			return 1 == $count? $singular : $plural;
-	}
+		function translate_plural( $singular, $plural, $count, $context = null ) {
+			$entry = new Translation_Entry( array(
+				'singular' => $singular,
+				'plural' => $plural,
+				'context' => $context,
+			) );
+			$translated = $this->translate_entry( $entry );
+			$index = $this->select_plural_form( $count );
+			$total_plural_forms = $this->get_plural_forms_count();
+			if ( $translated && 0 <= $index && $index < $total_plural_forms &&
+				is_array( $translated->translations ) &&
+				isset( $translated->translations[ $index ] ) ) {
+				return $translated->translations[ $index ];
+			} else { return 1 == $count? $singular : $plural;
+			}
+		}
 
-	/**
+		/**
 	 * Merge $other in the current object.
 	 *
 	 * @param Object &$other Another Translation object, whose translations will be merged in this one
 	 * @return void
 	 **/
-	function merge_with(&$other) {
-		foreach( $other->entries as $entry ) {
-			$this->entries[$entry->key()] = $entry;
+		function merge_with( &$other ) {
+			foreach ( $other->entries as $entry ) {
+				$this->entries[ $entry->key() ] = $entry;
+			}
 		}
-	}
 
-	/**
+		/**
 	 * @param object $other
 	 */
-	function merge_originals_with(&$other) {
-		foreach( $other->entries as $entry ) {
-			if ( !isset( $this->entries[$entry->key()] ) )
-				$this->entries[$entry->key()] = $entry;
-			else
-				$this->entries[$entry->key()]->merge_with($entry);
+		function merge_originals_with( &$other ) {
+			foreach ( $other->entries as $entry ) {
+				if ( ! isset( $this->entries[ $entry->key() ] ) ) {
+					$this->entries[ $entry->key() ] = $entry;
+				} else { $this->entries[ $entry->key() ]->merge_with( $entry );
+				}
+			}
 		}
 	}
-}
 
-class Gettext_Translations extends Translations {
-	/**
+	class Gettext_Translations extends Translations {
+		/**
 	 * The gettext implementation of select_plural_form.
 	 *
 	 * It lives in this class, because there are more than one descendand, which will use it and
@@ -171,188 +180,189 @@
 	 *
 	 * @param int $count
 	 */
-	function gettext_select_plural_form($count) {
-		if (!isset($this->_gettext_select_plural_form) || is_null($this->_gettext_select_plural_form)) {
-			list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header($this->get_header('Plural-Forms'));
-			$this->_nplurals = $nplurals;
-			$this->_gettext_select_plural_form = $this->make_plural_form_function($nplurals, $expression);
+		function gettext_select_plural_form( $count ) {
+			if ( ! isset( $this->_gettext_select_plural_form ) || is_null( $this->_gettext_select_plural_form ) ) {
+				list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) );
+				$this->_nplurals = $nplurals;
+				$this->_gettext_select_plural_form = $this->make_plural_form_function( $nplurals, $expression );
+			}
+			return call_user_func( $this->_gettext_select_plural_form, $count );
 		}
-		return call_user_func($this->_gettext_select_plural_form, $count);
-	}
 
-	/**
+		/**
 	 * @param string $header
 	 * @return array
 	 */
-	function nplurals_and_expression_from_header($header) {
-		if (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches)) {
-			$nplurals = (int)$matches[1];
-			$expression = trim($this->parenthesize_plural_exression($matches[2]));
-			return array($nplurals, $expression);
-		} else {
-			return array(2, 'n != 1');
+		function nplurals_and_expression_from_header( $header ) {
+			if ( preg_match( '/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches ) ) {
+				$nplurals = (int) $matches[1];
+				$expression = trim( $this->parenthesize_plural_exression( $matches[2] ) );
+				return array( $nplurals, $expression );
+			} else {
+				return array( 2, 'n != 1' );
+			}
 		}
-	}
 
-	/**
+		/**
 	 * Makes a function, which will return the right translation index, according to the
 	 * plural forms header
 	 * @param int    $nplurals
 	 * @param string $expression
 	 */
-	function make_plural_form_function($nplurals, $expression) {
-		$expression = str_replace('n', '$n', $expression);
-		$func_body = "
+		function make_plural_form_function( $nplurals, $expression ) {
+			$expression = str_replace( 'n', '$n', $expression );
+			$func_body = "
 			\$index = (int)($expression);
 			return (\$index < $nplurals)? \$index : $nplurals - 1;";
-		return create_function('$n', $func_body);
-	}
+			return create_function( '$n', $func_body );
+		}
 
-	/**
+		/**
 	 * Adds parentheses to the inner parts of ternary operators in
 	 * plural expressions, because PHP evaluates ternary oerators from left to right
 	 *
 	 * @param string $expression the expression without parentheses
 	 * @return string the expression with parentheses added
 	 */
-	function parenthesize_plural_exression($expression) {
-		$expression .= ';';
-		$res = '';
-		$depth = 0;
-		for ($i = 0; $i < strlen($expression); ++$i) {
-			$char = $expression[$i];
-			switch ($char) {
-				case '?':
-					$res .= ' ? (';
-					$depth++;
-					break;
-				case ':':
-					$res .= ') : (';
-					break;
-				case ';':
-					$res .= str_repeat(')', $depth) . ';';
-					$depth= 0;
-					break;
-				default:
-					$res .= $char;
+		function parenthesize_plural_exression( $expression ) {
+			$expression .= ';';
+			$res = '';
+			$depth = 0;
+			for ( $i = 0; $i < strlen( $expression ); ++$i ) {
+				$char = $expression[ $i ];
+				switch ( $char ) {
+					case '?':
+						$res .= ' ? (';
+						$depth++;
+						break;
+					case ':':
+						$res .= ') : (';
+						break;
+					case ';':
+						$res .= str_repeat( ')', $depth ) . ';';
+						$depth = 0;
+						break;
+					default:
+						$res .= $char;
+				}
 			}
+			return rtrim( $res, ';' );
 		}
-		return rtrim($res, ';');
-	}
 
-	/**
+		/**
 	 * @param string $translation
 	 * @return array
 	 */
-	function make_headers($translation) {
-		$headers = array();
-		// sometimes \ns are used instead of real new lines
-		$translation = str_replace('\n', "\n", $translation);
-		$lines = explode("\n", $translation);
-		foreach($lines as $line) {
-			$parts = explode(':', $line, 2);
-			if (!isset($parts[1])) continue;
-			$headers[trim($parts[0])] = trim($parts[1]);
+		function make_headers( $translation ) {
+			$headers = array();
+			// sometimes \ns are used instead of real new lines
+			$translation = str_replace( '\n', "\n", $translation );
+			$lines = explode( "\n", $translation );
+			foreach ( $lines as $line ) {
+				$parts = explode( ':', $line, 2 );
+				if ( ! isset( $parts[1] ) ) { continue;
+				}
+				$headers[ trim( $parts[0] ) ] = trim( $parts[1] );
+			}
+			return $headers;
 		}
-		return $headers;
-	}
 
-	/**
+		/**
 	 * @param string $header
 	 * @param string $value
 	 */
-	function set_header($header, $value) {
-		parent::set_header($header, $value);
-		if ('Plural-Forms' == $header) {
-			list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header($this->get_header('Plural-Forms'));
-			$this->_nplurals = $nplurals;
-			$this->_gettext_select_plural_form = $this->make_plural_form_function($nplurals, $expression);
+		function set_header( $header, $value ) {
+			parent::set_header( $header, $value );
+			if ( 'Plural-Forms' == $header ) {
+				list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) );
+				$this->_nplurals = $nplurals;
+				$this->_gettext_select_plural_form = $this->make_plural_form_function( $nplurals, $expression );
+			}
 		}
 	}
-}
 endif;
 
-if ( ! class_exists( 'NOOP_Translations', false ) ):
-/**
+if ( ! class_exists( 'NOOP_Translations', false ) ) :
+	/**
  * Provides the same interface as Translations, but doesn't do anything
  */
-class NOOP_Translations {
-	var $entries = array();
-	var $headers = array();
+	class NOOP_Translations {
+		var $entries = array();
+		var $headers = array();
 
-	function add_entry($entry) {
-		return true;
-	}
+		function add_entry( $entry ) {
+			return true;
+		}
 
-	/**
+		/**
 	 *
 	 * @param string $header
 	 * @param string $value
 	 */
-	function set_header($header, $value) {
-	}
+		function set_header( $header, $value ) {
+		}
 
-	/**
+		/**
 	 *
 	 * @param array $headers
 	 */
-	function set_headers($headers) {
-	}
+		function set_headers( $headers ) {
+		}
 
-	/**
+		/**
 	 * @param string $header
 	 * @return false
 	 */
-	function get_header($header) {
-		return false;
-	}
+		function get_header( $header ) {
+			return false;
+		}
 
-	/**
+		/**
 	 * @param Translation_Entry $entry
 	 * @return false
 	 */
-	function translate_entry(&$entry) {
-		return false;
-	}
+		function translate_entry( &$entry ) {
+			return false;
+		}
 
-	/**
+		/**
 	 * @param string $singular
 	 * @param string $context
 	 */
-	function translate($singular, $context=null) {
-		return $singular;
-	}
+		function translate( $singular, $context = null ) {
+			return $singular;
+		}
 
-	/**
+		/**
 	 *
 	 * @param int $count
 	 * @return bool
 	 */
-	function select_plural_form($count) {
-		return 1 == $count? 0 : 1;
-	}
+		function select_plural_form( $count ) {
+			return 1 == $count? 0 : 1;
+		}
 
-	/**
+		/**
 	 * @return int
 	 */
-	function get_plural_forms_count() {
-		return 2;
-	}
+		function get_plural_forms_count() {
+			return 2;
+		}
 
-	/**
+		/**
 	 * @param string $singular
 	 * @param string $plural
 	 * @param int    $count
 	 * @param string $context
 	 */
-	function translate_plural($singular, $plural, $count, $context = null) {
+		function translate_plural( $singular, $plural, $count, $context = null ) {
 			return 1 == $count? $singular : $plural;
-	}
+		}
 
-	/**
+		/**
 	 * @param object $other
 	 */
-	function merge_with(&$other) {
+		function merge_with( &$other ) {
+		}
 	}
-}
 endif;
Index: src/wp-includes/post-formats.php
===================================================================
--- src/wp-includes/post-formats.php	(revision 40901)
+++ src/wp-includes/post-formats.php	(working copy)
@@ -15,20 +15,23 @@
  * @return string|false The format if successful. False otherwise.
  */
 function get_post_format( $post = null ) {
-	if ( ! $post = get_post( $post ) )
+	if ( ! $post = get_post( $post ) ) {
 		return false;
+	}
 
-	if ( ! post_type_supports( $post->post_type, 'post-formats' ) )
+	if ( ! post_type_supports( $post->post_type, 'post-formats' ) ) {
 		return false;
+	}
 
 	$_format = get_the_terms( $post->ID, 'post_format' );
 
-	if ( empty( $_format ) )
+	if ( empty( $_format ) ) {
 		return false;
+	}
 
 	$format = reset( $_format );
 
-	return str_replace('post-format-', '', $format->slug );
+	return str_replace( 'post-format-', '', $format->slug );
 }
 
 /**
@@ -64,15 +67,16 @@
 function set_post_format( $post, $format ) {
 	$post = get_post( $post );
 
-	if ( empty( $post ) )
+	if ( empty( $post ) ) {
 		return new WP_Error( 'invalid_post', __( 'Invalid post.' ) );
+	}
 
 	if ( ! empty( $format ) ) {
 		$format = sanitize_key( $format );
-		if ( 'standard' === $format || ! in_array( $format, get_post_format_slugs() ) )
+		if ( 'standard' === $format || ! in_array( $format, get_post_format_slugs() ) ) {
 			$format = '';
-		else
-			$format = 'post-format-' . $format;
+		} else { $format = 'post-format-' . $format;
+		}
 	}
 
 	return wp_set_post_terms( $post->ID, $format, 'post_format' );
@@ -123,10 +127,10 @@
  */
 function get_post_format_string( $slug ) {
 	$strings = get_post_format_strings();
-	if ( !$slug )
+	if ( ! $slug ) {
 		return $strings['standard'];
-	else
-		return ( isset( $strings[$slug] ) ) ? $strings[$slug] : '';
+	} else { return ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : '';
+	}
 }
 
 /**
@@ -138,9 +142,10 @@
  * @return string|WP_Error|false The post format term link.
  */
 function get_post_format_link( $format ) {
-	$term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
-	if ( ! $term || is_wp_error( $term ) )
+	$term = get_term_by( 'slug', 'post-format-' . $format, 'post_format' );
+	if ( ! $term || is_wp_error( $term ) ) {
 		return false;
+	}
 	return get_term_link( $term );
 }
 
@@ -154,14 +159,17 @@
  * @return array
  */
 function _post_format_request( $qvs ) {
-	if ( ! isset( $qvs['post_format'] ) )
+	if ( ! isset( $qvs['post_format'] ) ) {
 		return $qvs;
+	}
 	$slugs = get_post_format_slugs();
-	if ( isset( $slugs[ $qvs['post_format'] ] ) )
+	if ( isset( $slugs[ $qvs['post_format'] ] ) ) {
 		$qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];
+	}
 	$tax = get_taxonomy( 'post_format' );
-	if ( ! is_admin() )
+	if ( ! is_admin() ) {
 		$qvs['post_type'] = $tax->object_type;
+	}
 	return $qvs;
 }
 
@@ -222,12 +230,12 @@
 	if ( in_array( 'post_format', (array) $taxonomies ) ) {
 		if ( isset( $args['fields'] ) && 'names' == $args['fields'] ) {
 			foreach ( $terms as $order => $name ) {
-				$terms[$order] = get_post_format_string( str_replace( 'post-format-', '', $name ) );
+				$terms[ $order ] = get_post_format_string( str_replace( 'post-format-', '', $name ) );
 			}
 		} else {
 			foreach ( (array) $terms as $order => $term ) {
 				if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
-					$terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
+					$terms[ $order ]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
 				}
 			}
 		}
@@ -247,7 +255,7 @@
 function _post_format_wp_get_object_terms( $terms ) {
 	foreach ( (array) $terms as $order => $term ) {
 		if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
-			$terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
+			$terms[ $order ]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
 		}
 	}
 	return $terms;
Index: src/wp-includes/post-template.php
===================================================================
--- src/wp-includes/post-template.php	(revision 40901)
+++ src/wp-includes/post-template.php	(working copy)
@@ -42,15 +42,16 @@
 function the_title( $before = '', $after = '', $echo = true ) {
 	$title = get_the_title();
 
-	if ( strlen($title) == 0 )
+	if ( strlen( $title ) == 0 ) {
 		return;
+	}
 
 	$title = $before . $title . $after;
 
-	if ( $echo )
+	if ( $echo ) {
 		echo $title;
-	else
-		return $title;
+	} else { return $title;
+	}
 }
 
 /**
@@ -76,7 +77,12 @@
  * @return string|void String when echo is false.
  */
 function the_title_attribute( $args = '' ) {
-	$defaults = array( 'before' => '', 'after' =>  '', 'echo' => true, 'post' => get_post() );
+	$defaults = array(
+		'before' => '',
+		'after' => '',
+		'echo' => true,
+		'post' => get_post(),
+	);
 	$r = wp_parse_args( $args, $defaults );
 
 	$title = get_the_title( $r['post'] );
@@ -227,7 +233,7 @@
  * @param string $more_link_text Optional. Content for when there is more text.
  * @param bool   $strip_teaser   Optional. Strip teaser content before the more text. Default is false.
  */
-function the_content( $more_link_text = null, $strip_teaser = false) {
+function the_content( $more_link_text = null, $strip_teaser = false ) {
 	$content = get_the_content( $more_link_text, $strip_teaser );
 
 	/**
@@ -268,7 +274,9 @@
 			sprintf(
 				/* translators: %s: Name of current post */
 				__( 'Continue reading %s' ),
-				the_title_attribute( array( 'echo' => false ) )
+				the_title_attribute( array(
+					'echo' => false,
+				) )
 			),
 			__( '(more&hellip;)' )
 		);
@@ -278,30 +286,35 @@
 	$has_teaser = false;
 
 	// If post password required and it doesn't match the cookie.
-	if ( post_password_required( $post ) )
+	if ( post_password_required( $post ) ) {
 		return get_the_password_form( $post );
+	}
 
-	if ( $page > count( $pages ) ) // if the requested page doesn't exist
+	if ( $page > count( $pages ) ) { // if the requested page doesn't exist
 		$page = count( $pages ); // give them the highest numbered page that DOES exist
+	}
 
-	$content = $pages[$page - 1];
+	$content = $pages[ $page - 1 ];
 	if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {
 		$content = explode( $matches[0], $content, 2 );
-		if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) )
+		if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) ) {
 			$more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) );
+		}
 
 		$has_teaser = true;
 	} else {
 		$content = array( $content );
 	}
 
-	if ( false !== strpos( $post->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) )
+	if ( false !== strpos( $post->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) ) {
 		$strip_teaser = true;
+	}
 
 	$teaser = $content[0];
 
-	if ( $more && $strip_teaser && $has_teaser )
+	if ( $more && $strip_teaser && $has_teaser ) {
 		$teaser = '';
+	}
 
 	$output .= $teaser;
 
@@ -309,7 +322,7 @@
 		if ( $more ) {
 			$output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];
 		} else {
-			if ( ! empty( $more_link_text ) )
+			if ( ! empty( $more_link_text ) ) {
 
 				/**
 				 * Filters the Read More link text.
@@ -320,12 +333,14 @@
 				 * @param string $more_link_text    Read More text.
 				 */
 				$output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );
+			}
 			$output = force_balance_tags( $output );
 		}
 	}
 
-	if ( $preview ) // Preview fix for JavaScript bug with foreign languages.
-		$output =	preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output );
+	if ( $preview ) { // Preview fix for JavaScript bug with foreign languages.
+		$output = preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output );
+	}
 
 	return $output;
 }
@@ -407,7 +422,7 @@
  */
 function has_excerpt( $post = 0 ) {
 	$post = get_post( $post );
-	return ( !empty( $post->post_excerpt ) );
+	return ( ! empty( $post->post_excerpt ) );
 }
 
 /**
@@ -464,8 +479,9 @@
 	}
 
 	$classes[] = 'post-' . $post->ID;
-	if ( ! is_admin() )
+	if ( ! is_admin() ) {
 		$classes[] = $post->post_type;
+	}
 	$classes[] = 'type-' . $post->post_type;
 	$classes[] = 'status-' . $post->post_status;
 
@@ -473,10 +489,10 @@
 	if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
 		$post_format = get_post_format( $post->ID );
 
-		if ( $post_format && !is_wp_error($post_format) )
+		if ( $post_format && ! is_wp_error( $post_format ) ) {
 			$classes[] = 'format-' . sanitize_html_class( $post_format );
-		else
-			$classes[] = 'format-standard';
+		} else { $classes[] = 'format-standard';
+		}
 	}
 
 	$post_password_required = post_password_required( $post->ID );
@@ -506,7 +522,9 @@
 	$classes[] = 'hentry';
 
 	// All public taxonomies
-	$taxonomies = get_taxonomies( array( 'public' => true ) );
+	$taxonomies = get_taxonomies( array(
+		'public' => true,
+	) );
 	foreach ( (array) $taxonomies as $taxonomy ) {
 		if ( is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {
 			foreach ( (array) get_the_terms( $post->ID, $taxonomy ) as $term ) {
@@ -572,27 +590,35 @@
 
 	$classes = array();
 
-	if ( is_rtl() )
+	if ( is_rtl() ) {
 		$classes[] = 'rtl';
+	}
 
-	if ( is_front_page() )
+	if ( is_front_page() ) {
 		$classes[] = 'home';
-	if ( is_home() )
+	}
+	if ( is_home() ) {
 		$classes[] = 'blog';
-	if ( is_archive() )
+	}
+	if ( is_archive() ) {
 		$classes[] = 'archive';
-	if ( is_date() )
+	}
+	if ( is_date() ) {
 		$classes[] = 'date';
+	}
 	if ( is_search() ) {
 		$classes[] = 'search';
 		$classes[] = $wp_query->posts ? 'search-results' : 'search-no-results';
 	}
-	if ( is_paged() )
+	if ( is_paged() ) {
 		$classes[] = 'paged';
-	if ( is_attachment() )
+	}
+	if ( is_attachment() ) {
 		$classes[] = 'attachment';
-	if ( is_404() )
+	}
+	if ( is_404() ) {
 		$classes[] = 'error404';
+	}
 
 	if ( is_singular() ) {
 		$post_id = $wp_query->get_queried_object_id();
@@ -623,16 +649,16 @@
 				if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
 					$post_format = get_post_format( $post->ID );
 
-					if ( $post_format && !is_wp_error($post_format) )
+					if ( $post_format && ! is_wp_error( $post_format ) ) {
 						$classes[] = 'single-format-' . sanitize_html_class( $post_format );
-					else
-						$classes[] = 'single-format-standard';
+					} else { $classes[] = 'single-format-standard';
+					}
 				}
 			}
 		}
 
 		if ( is_attachment() ) {
-			$mime_type = get_post_mime_type($post_id);
+			$mime_type = get_post_mime_type( $post_id );
 			$mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' );
 			$classes[] = 'attachmentid-' . $post_id;
 			$classes[] = 'attachment-' . str_replace( $mime_prefix, '', $mime_type );
@@ -641,11 +667,14 @@
 
 			$page_id = $wp_query->get_queried_object_id();
 
-			$post = get_post($page_id);
+			$post = get_post( $page_id );
 
 			$classes[] = 'page-id-' . $page_id;
 
-			if ( get_pages( array( 'parent' => $page_id, 'number' => 1 ) ) ) {
+			if ( get_pages( array(
+				'parent' => $page_id,
+				'number' => 1,
+			) ) ) {
 				$classes[] = 'page-parent';
 			}
 
@@ -658,8 +687,9 @@
 		if ( is_post_type_archive() ) {
 			$classes[] = 'post-type-archive';
 			$post_type = get_query_var( 'post_type' );
-			if ( is_array( $post_type ) )
+			if ( is_array( $post_type ) ) {
 				$post_type = reset( $post_type );
+			}
 			$classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
 		} elseif ( is_author() ) {
 			$author = $wp_query->get_queried_object();
@@ -704,19 +734,21 @@
 				$classes[] = 'term-' . $term_class;
 				$classes[] = 'term-' . $term->term_id;
 			}
-		}
-	}
+		}// End if().
+	}// End if().
 
-	if ( is_user_logged_in() )
+	if ( is_user_logged_in() ) {
 		$classes[] = 'logged-in';
+	}
 
 	if ( is_admin_bar_showing() ) {
 		$classes[] = 'admin-bar';
 		$classes[] = 'no-customize-support';
 	}
 
-	if ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() )
+	if ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() ) {
 		$classes[] = 'custom-background';
+	}
 
 	if ( has_custom_logo() ) {
 		$classes[] = 'wp-custom-logo';
@@ -724,33 +756,36 @@
 
 	$page = $wp_query->get( 'page' );
 
-	if ( ! $page || $page < 2 )
+	if ( ! $page || $page < 2 ) {
 		$page = $wp_query->get( 'paged' );
+	}
 
 	if ( $page && $page > 1 && ! is_404() ) {
 		$classes[] = 'paged-' . $page;
 
-		if ( is_single() )
+		if ( is_single() ) {
 			$classes[] = 'single-paged-' . $page;
-		elseif ( is_page() )
+		} elseif ( is_page() ) {
 			$classes[] = 'page-paged-' . $page;
-		elseif ( is_category() )
+		} elseif ( is_category() ) {
 			$classes[] = 'category-paged-' . $page;
-		elseif ( is_tag() )
+		} elseif ( is_tag() ) {
 			$classes[] = 'tag-paged-' . $page;
-		elseif ( is_date() )
+		} elseif ( is_date() ) {
 			$classes[] = 'date-paged-' . $page;
-		elseif ( is_author() )
+		} elseif ( is_author() ) {
 			$classes[] = 'author-paged-' . $page;
-		elseif ( is_search() )
+		} elseif ( is_search() ) {
 			$classes[] = 'search-paged-' . $page;
-		elseif ( is_post_type_archive() )
+		} elseif ( is_post_type_archive() ) {
 			$classes[] = 'post-type-paged-' . $page;
+		}
 	}
 
 	if ( ! empty( $class ) ) {
-		if ( !is_array( $class ) )
+		if ( ! is_array( $class ) ) {
 			$class = preg_split( '#\s+#', $class );
+		}
 		$classes = array_merge( $classes, $class );
 	} else {
 		// Ensure that we always coerce class to being an array.
@@ -781,7 +816,7 @@
  * @return bool false if a password is not required or the correct password cookie is present, true otherwise.
  */
 function post_password_required( $post = null ) {
-	$post = get_post($post);
+	$post = get_post( $post );
 
 	if ( empty( $post->post_password ) ) {
 		/** This filter is documented in wp-includes/post.php */
@@ -866,7 +901,7 @@
 		'nextpagelink'     => __( 'Next page' ),
 		'previouspagelink' => __( 'Previous page' ),
 		'pagelink'         => '%',
-		'echo'             => 1
+		'echo'             => 1,
 	);
 
 	$params = wp_parse_args( $args, $defaults );
@@ -924,8 +959,8 @@
 				$output .= apply_filters( 'wp_link_pages_link', $link, $next );
 			}
 			$output .= $r['after'];
-		}
-	}
+		}// End if().
+	}// End if().
 
 	/**
 	 * Filters the HTML output of page links for paginated posts.
@@ -962,12 +997,12 @@
 	if ( 1 == $i ) {
 		$url = get_permalink();
 	} else {
-		if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
+		if ( '' == get_option( 'permalink_structure' ) || in_array( $post->post_status, array( 'draft', 'pending' ) ) ) {
 			$url = add_query_arg( 'page', $i, get_permalink() );
-		elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID )
-			$url = trailingslashit(get_permalink()) . user_trailingslashit("$wp_rewrite->pagination_base/" . $i, 'single_paged');
-		else
-			$url = trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged');
+		} elseif ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) {
+			$url = trailingslashit( get_permalink() ) . user_trailingslashit( "$wp_rewrite->pagination_base/" . $i, 'single_paged' );
+		} else { $url = trailingslashit( get_permalink() ) . user_trailingslashit( $i, 'single_paged' );
+		}
 	}
 
 	if ( is_preview() ) {
@@ -998,12 +1033,12 @@
 function post_custom( $key = '' ) {
 	$custom = get_post_custom();
 
-	if ( !isset( $custom[$key] ) )
+	if ( ! isset( $custom[ $key ] ) ) {
 		return false;
-	elseif ( 1 == count($custom[$key]) )
-		return $custom[$key][0];
-	else
-		return $custom[$key];
+	} elseif ( 1 == count( $custom[ $key ] ) ) {
+		return $custom[ $key ][0];
+	} else { return $custom[ $key ];
+	}
 }
 
 /**
@@ -1018,11 +1053,12 @@
 	if ( $keys = get_post_custom_keys() ) {
 		echo "<ul class='post-meta'>\n";
 		foreach ( (array) $keys as $key ) {
-			$keyt = trim($key);
-			if ( is_protected_meta( $keyt, 'post' ) )
+			$keyt = trim( $key );
+			if ( is_protected_meta( $keyt, 'post' ) ) {
 				continue;
-			$values = array_map('trim', get_post_custom_values($key));
-			$value = implode($values,', ');
+			}
+			$values = array_map( 'trim', get_post_custom_values( $key ) );
+			$value = implode( $values,', ' );
 
 			/**
 			 * Filters the HTML output of the li element in the post custom fields list.
@@ -1073,11 +1109,15 @@
  */
 function wp_dropdown_pages( $args = '' ) {
 	$defaults = array(
-		'depth' => 0, 'child_of' => 0,
-		'selected' => 0, 'echo' => 1,
-		'name' => 'page_id', 'id' => '',
+		'depth' => 0,
+	'child_of' => 0,
+		'selected' => 0,
+	'echo' => 1,
+		'name' => 'page_id',
+	'id' => '',
 		'class' => '',
-		'show_option_none' => '', 'show_option_no_change' => '',
+		'show_option_none' => '',
+	'show_option_no_change' => '',
 		'option_none_value' => '',
 		'value_field' => 'ID',
 	);
@@ -1117,7 +1157,7 @@
 	 * @param string $output HTML output for drop down list of pages.
 	 * @param array  $r      The parsed arguments array.
 	 * @param array  $pages  List of WP_Post objects returned by `get_pages()`
- 	 */
+	  */
 	$html = apply_filters( 'wp_dropdown_pages', $output, $r, $pages );
 
 	if ( $r['echo'] ) {
@@ -1330,23 +1370,24 @@
 	$list_args = $args;
 
 	// Show Home in the menu
-	if ( ! empty($args['show_home']) ) {
-		if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] )
-			$text = __('Home');
-		else
-			$text = $args['show_home'];
+	if ( ! empty( $args['show_home'] ) ) {
+		if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] ) {
+			$text = __( 'Home' );
+		} else { $text = $args['show_home'];
+		}
 		$class = '';
-		if ( is_front_page() && !is_paged() )
+		if ( is_front_page() && ! is_paged() ) {
 			$class = 'class="current_page_item"';
+		}
 		$menu .= '<li ' . $class . '><a href="' . home_url( '/' ) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
 		// If the front page is a page, add it to the exclude list
-		if (get_option('show_on_front') == 'page') {
-			if ( !empty( $list_args['exclude'] ) ) {
+		if ( get_option( 'show_on_front' ) == 'page' ) {
+			if ( ! empty( $list_args['exclude'] ) ) {
 				$list_args['exclude'] .= ',';
 			} else {
 				$list_args['exclude'] = '';
 			}
-			$list_args['exclude'] .= get_option('page_on_front');
+			$list_args['exclude'] .= get_option( 'page_on_front' );
 		}
 	}
 
@@ -1396,10 +1437,10 @@
 	 * @param array  $args An array of arguments.
 	 */
 	$menu = apply_filters( 'wp_page_menu', $menu, $args );
-	if ( $args['echo'] )
+	if ( $args['echo'] ) {
 		echo $menu;
-	else
-		return $menu;
+	} else { return $menu;
+	}
 }
 
 //
@@ -1419,18 +1460,19 @@
  * @return string
  */
 function walk_page_tree( $pages, $depth, $current_page, $r ) {
-	if ( empty($r['walker']) )
+	if ( empty( $r['walker'] ) ) {
 		$walker = new Walker_Page;
-	else
-		$walker = $r['walker'];
+	} else { $walker = $r['walker'];
+	}
 
 	foreach ( (array) $pages as $page ) {
-		if ( $page->post_parent )
+		if ( $page->post_parent ) {
 			$r['pages_with_children'][ $page->post_parent ] = true;
+		}
 	}
 
-	$args = array($pages, $depth, $r, $current_page);
-	return call_user_func_array(array($walker, 'walk'), $args);
+	$args = array( $pages, $depth, $r, $current_page );
+	return call_user_func_array( array( $walker, 'walk' ), $args );
 }
 
 /**
@@ -1444,12 +1486,12 @@
  */
 function walk_page_dropdown_tree() {
 	$args = func_get_args();
-	if ( empty($args[2]['walker']) ) // the user's options are the third parameter
+	if ( empty( $args[2]['walker'] ) ) { // the user's options are the third parameter
 		$walker = new Walker_PageDropdown;
-	else
-		$walker = $args[2]['walker'];
+	} else { $walker = $args[2]['walker'];
+	}
 
-	return call_user_func_array(array($walker, 'walk'), $args);
+	return call_user_func_array( array( $walker, 'walk' ), $args );
 }
 
 //
@@ -1467,13 +1509,14 @@
  * @param bool        $permalink    Optional, default is false. Whether to include permalink.
  */
 function the_attachment_link( $id = 0, $fullsize = false, $deprecated = false, $permalink = false ) {
-	if ( !empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '2.5.0' );
+	}
 
-	if ( $fullsize )
-		echo wp_get_attachment_link($id, 'full', $permalink);
-	else
-		echo wp_get_attachment_link($id, 'thumbnail', $permalink);
+	if ( $fullsize ) {
+		echo wp_get_attachment_link( $id, 'full', $permalink );
+	} else { echo wp_get_attachment_link( $id, 'thumbnail', $permalink );
+	}
 }
 
 /**
@@ -1543,11 +1586,12 @@
  * @param string $content
  * @return string
  */
-function prepend_attachment($content) {
+function prepend_attachment( $content ) {
 	$post = get_post();
 
-	if ( empty($post->post_type) || $post->post_type != 'attachment' )
+	if ( empty( $post->post_type ) || $post->post_type != 'attachment' ) {
 		return $content;
+	}
 
 	if ( wp_attachment_is( 'video', $post ) ) {
 		$meta = wp_get_attachment_metadata( get_the_ID() );
@@ -1565,7 +1609,7 @@
 	} else {
 		$p = '<p class="attachment">';
 		// show the medium sized image representation of the attachment if available, and link to the raw file
-		$p .= wp_get_attachment_link(0, 'medium', false);
+		$p .= wp_get_attachment_link( 0, 'medium', false );
 		$p .= '</p>';
 	}
 
@@ -1597,7 +1641,7 @@
  */
 function get_the_password_form( $post = 0 ) {
 	$post = get_post( $post );
-	$label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID );
+	$label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID );
 	$output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post">
 	<p>' . __( 'This content is password protected. To view it please enter your password below:' ) . '</p>
 	<p><label for="' . $label . '">' . __( 'Password:' ) . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr_x( 'Enter', 'post password form' ) . '" /></p></form>
@@ -1638,11 +1682,13 @@
 
 	$page_template = get_page_template_slug( get_queried_object_id() );
 
-	if ( empty( $template ) )
+	if ( empty( $template ) ) {
 		return (bool) $page_template;
+	}
 
-	if ( $template == $page_template )
+	if ( $template == $page_template ) {
 		return true;
+	}
 
 	if ( is_array( $template ) ) {
 		if ( ( in_array( 'default', $template, true ) && ! $page_template )
@@ -1691,11 +1737,13 @@
  * @return string|false i18n formatted datetimestamp or localized 'Current Revision'.
  */
 function wp_post_revision_title( $revision, $link = true ) {
-	if ( !$revision = get_post( $revision ) )
+	if ( ! $revision = get_post( $revision ) ) {
 		return $revision;
+	}
 
-	if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) )
+	if ( ! in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) ) {
 		return false;
+	}
 
 	/* translators: revision date format, see https://secure.php.net/date */
 	$datef = _x( 'F j, Y @ H:i:s', 'revision date format' );
@@ -1705,13 +1753,15 @@
 	$currentf  = __( '%s [Current Revision]' );
 
 	$date = date_i18n( $datef, strtotime( $revision->post_modified ) );
-	if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
+	if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) ) {
 		$date = "<a href='$link'>$date</a>";
+	}
 
-	if ( !wp_is_post_revision( $revision ) )
+	if ( ! wp_is_post_revision( $revision ) ) {
 		$date = sprintf( $currentf, $date );
-	elseif ( wp_is_post_autosave( $revision ) )
+	} elseif ( wp_is_post_autosave( $revision ) ) {
 		$date = sprintf( $autosavef, $date );
+	}
 
 	return $date;
 }
@@ -1726,11 +1776,13 @@
  * @return string|false gravatar, user, i18n formatted datetimestamp or localized 'Current Revision'.
  */
 function wp_post_revision_title_expanded( $revision, $link = true ) {
-	if ( !$revision = get_post( $revision ) )
+	if ( ! $revision = get_post( $revision ) ) {
 		return $revision;
+	}
 
-	if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) )
+	if ( ! in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) ) {
 		return false;
+	}
 
 	$author = get_the_author_meta( 'display_name', $revision->post_author );
 	/* translators: revision date format, see https://secure.php.net/date */
@@ -1739,8 +1791,9 @@
 	$gravatar = get_avatar( $revision->post_author, 24 );
 
 	$date = date_i18n( $datef, strtotime( $revision->post_modified ) );
-	if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
+	if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) ) {
 		$date = "<a href='$link'>$date</a>";
+	}
 
 	$revision_date_author = sprintf(
 		/* translators: post revision title: 1: author avatar, 2: author name, 3: time ago, 4: date */
@@ -1756,10 +1809,11 @@
 	/* translators: %s: revision date with author avatar */
 	$currentf  = __( '%s [Current Revision]' );
 
-	if ( !wp_is_post_revision( $revision ) )
+	if ( ! wp_is_post_revision( $revision ) ) {
 		$revision_date_author = sprintf( $currentf, $revision_date_author );
-	elseif ( wp_is_post_autosave( $revision ) )
+	} elseif ( wp_is_post_autosave( $revision ) ) {
 		$revision_date_author = sprintf( $autosavef, $revision_date_author );
+	}
 
 	/**
 	 * Filters the formatted author and date for a revision.
@@ -1786,8 +1840,9 @@
  * @param string      $type    'all' (default), 'revision' or 'autosave'
  */
 function wp_list_post_revisions( $post_id = 0, $type = 'all' ) {
-	if ( ! $post = get_post( $post_id ) )
+	if ( ! $post = get_post( $post_id ) ) {
 		return;
+	}
 
 	// $args array with (parent, format, right, left, type) deprecated since 3.6
 	if ( is_array( $type ) ) {
@@ -1795,17 +1850,20 @@
 		_deprecated_argument( __FUNCTION__, '3.6.0' );
 	}
 
-	if ( ! $revisions = wp_get_post_revisions( $post->ID ) )
+	if ( ! $revisions = wp_get_post_revisions( $post->ID ) ) {
 		return;
+	}
 
 	$rows = '';
 	foreach ( $revisions as $revision ) {
-		if ( ! current_user_can( 'read_post', $revision->ID ) )
+		if ( ! current_user_can( 'read_post', $revision->ID ) ) {
 			continue;
+		}
 
 		$is_autosave = wp_is_post_autosave( $revision );
-		if ( ( 'revision' === $type && $is_autosave ) || ( 'autosave' === $type && ! $is_autosave ) )
+		if ( ( 'revision' === $type && $is_autosave ) || ( 'autosave' === $type && ! $is_autosave ) ) {
 			continue;
+		}
 
 		$rows .= "\t<li>" . wp_post_revision_title_expanded( $revision ) . "</li>\n";
 	}
@@ -1814,5 +1872,5 @@
 
 	echo "<ul class='post-revisions hide-if-no-js'>\n";
 	echo $rows;
-	echo "</ul>";
+	echo '</ul>';
 }
Index: src/wp-includes/post-thumbnail-template.php
===================================================================
--- src/wp-includes/post-thumbnail-template.php	(revision 40901)
+++ src/wp-includes/post-thumbnail-template.php	(working copy)
@@ -72,19 +72,22 @@
  * @param WP_Query $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global.
  */
 function update_post_thumbnail_cache( $wp_query = null ) {
-	if ( ! $wp_query )
+	if ( ! $wp_query ) {
 		$wp_query = $GLOBALS['wp_query'];
+	}
 
-	if ( $wp_query->thumbnails_cached )
+	if ( $wp_query->thumbnails_cached ) {
 		return;
+	}
 
 	$thumb_ids = array();
 	foreach ( $wp_query->posts as $post ) {
-		if ( $id = get_post_thumbnail_id( $post->ID ) )
+		if ( $id = get_post_thumbnail_id( $post->ID ) ) {
 			$thumb_ids[] = $id;
+		}
 	}
 
-	if ( ! empty ( $thumb_ids ) ) {
+	if ( ! empty( $thumb_ids ) ) {
 		_prime_post_caches( $thumb_ids, false, true );
 	}
 
@@ -143,8 +146,9 @@
 		 *                                        and height values (in that order). Default 'post-thumbnail'.
 		 */
 		do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );
-		if ( in_the_loop() )
+		if ( in_the_loop() ) {
 			update_post_thumbnail_cache();
+		}
 		$html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr );
 
 		/**
Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 40901)
+++ src/wp-includes/post.php	(working copy)
@@ -61,11 +61,11 @@
 
 	register_post_type( 'attachment', array(
 		'labels' => array(
-			'name' => _x('Media', 'post type general name'),
+			'name' => _x( 'Media', 'post type general name' ),
 			'name_admin_bar' => _x( 'Media', 'add new from admin bar' ),
 			'add_new' => _x( 'Add New', 'add new media' ),
- 			'edit_item' => __( 'Edit Media' ),
- 			'view_item' => __( 'View Attachment Page' ),
+			 'edit_item' => __( 'Edit Media' ),
+			 'view_item' => __( 'View Attachment Page' ),
 			'attributes' => __( 'Attachment Attributes' ),
 		),
 		'public' => true,
@@ -206,7 +206,7 @@
 		'label'       => _x( 'Scheduled', 'post status' ),
 		'protected'   => true,
 		'_builtin'    => true, /* internal use only. */
-		'label_count' => _n_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>' ),
+		'label_count' => _n_noop( 'Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>' ),
 	) );
 
 	register_post_status( 'draft', array(
@@ -306,8 +306,9 @@
  * @return bool True on success, false on failure.
  */
 function update_attached_file( $attachment_id, $file ) {
-	if ( !get_post( $attachment_id ) )
+	if ( ! get_post( $attachment_id ) ) {
 		return false;
+	}
 
 	/**
 	 * Filters the path to the attached file to update.
@@ -319,10 +320,10 @@
 	 */
 	$file = apply_filters( 'update_attached_file', $file, $attachment_id );
 
-	if ( $file = _wp_relative_upload_path( $file ) )
+	if ( $file = _wp_relative_upload_path( $file ) ) {
 		return update_post_meta( $attachment_id, '_wp_attached_file', $file );
-	else
-		return delete_post_meta( $attachment_id, '_wp_attached_file' );
+	} else { return delete_post_meta( $attachment_id, '_wp_attached_file' );
+	}
 }
 
 /**
@@ -410,48 +411,59 @@
 	$kids = array();
 	if ( empty( $args ) ) {
 		if ( isset( $GLOBALS['post'] ) ) {
-			$args = array('post_parent' => (int) $GLOBALS['post']->post_parent );
+			$args = array(
+				'post_parent' => (int) $GLOBALS['post']->post_parent,
+			);
 		} else {
 			return $kids;
 		}
 	} elseif ( is_object( $args ) ) {
-		$args = array('post_parent' => (int) $args->post_parent );
+		$args = array(
+			'post_parent' => (int) $args->post_parent,
+		);
 	} elseif ( is_numeric( $args ) ) {
-		$args = array('post_parent' => (int) $args);
+		$args = array(
+			'post_parent' => (int) $args,
+		);
 	}
 
 	$defaults = array(
-		'numberposts' => -1, 'post_type' => 'any',
-		'post_status' => 'any', 'post_parent' => 0,
+		'numberposts' => -1,
+	'post_type' => 'any',
+		'post_status' => 'any',
+	'post_parent' => 0,
 	);
 
 	$r = wp_parse_args( $args, $defaults );
 
 	$children = get_posts( $r );
 
-	if ( ! $children )
+	if ( ! $children ) {
 		return $kids;
+	}
 
-	if ( ! empty( $r['fields'] ) )
+	if ( ! empty( $r['fields'] ) ) {
 		return $children;
+	}
 
-	update_post_cache($children);
+	update_post_cache( $children );
 
-	foreach ( $children as $key => $child )
-		$kids[$child->ID] = $children[$key];
+	foreach ( $children as $key => $child ) {
+		$kids[ $child->ID ] = $children[ $key ];
+	}
 
 	if ( $output == OBJECT ) {
 		return $kids;
 	} elseif ( $output == ARRAY_A ) {
 		$weeuns = array();
 		foreach ( (array) $kids as $kid ) {
-			$weeuns[$kid->ID] = get_object_vars($kids[$kid->ID]);
+			$weeuns[ $kid->ID ] = get_object_vars( $kids[ $kid->ID ] );
 		}
 		return $weeuns;
 	} elseif ( $output == ARRAY_N ) {
 		$babes = array();
 		foreach ( (array) $kids as $kid ) {
-			$babes[$kid->ID] = array_values(get_object_vars($kids[$kid->ID]));
+			$babes[ $kid->ID ] = array_values( get_object_vars( $kids[ $kid->ID ] ) );
 		}
 		return $babes;
 	} else {
@@ -477,8 +489,8 @@
  */
 function get_extended( $post ) {
 	//Match the new style more links.
-	if ( preg_match('/<!--more(.*?)?-->/', $post, $matches) ) {
-		list($main, $extended) = explode($matches[0], $post, 2);
+	if ( preg_match( '/<!--more(.*?)?-->/', $post, $matches ) ) {
+		list($main, $extended) = explode( $matches[0], $post, 2 );
 		$more_text = $matches[1];
 	} else {
 		$main = $post;
@@ -487,11 +499,15 @@
 	}
 
 	//  leading and trailing whitespace.
-	$main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $main);
-	$extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $extended);
-	$more_text = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $more_text);
-
-	return array( 'main' => $main, 'extended' => $extended, 'more_text' => $more_text );
+	$main = preg_replace( '/^[\s]*(.*)[\s]*$/', '\\1', $main );
+	$extended = preg_replace( '/^[\s]*(.*)[\s]*$/', '\\1', $extended );
+	$more_text = preg_replace( '/^[\s]*(.*)[\s]*$/', '\\1', $more_text );
+
+	return array(
+		'main' => $main,
+		'extended' => $extended,
+		'more_text' => $more_text,
+	);
 }
 
 /**
@@ -513,8 +529,9 @@
  *                            When $output is OBJECT, a `WP_Post` instance is returned.
  */
 function get_post( $post = null, $output = OBJECT, $filter = 'raw' ) {
-	if ( empty( $post ) && isset( $GLOBALS['post'] ) )
+	if ( empty( $post ) && isset( $GLOBALS['post'] ) ) {
 		$post = $GLOBALS['post'];
+	}
 
 	if ( $post instanceof WP_Post ) {
 		$_post = $post;
@@ -531,15 +548,17 @@
 		$_post = WP_Post::get_instance( $post );
 	}
 
-	if ( ! $_post )
+	if ( ! $_post ) {
 		return null;
+	}
 
 	$_post = $_post->filter( $filter );
 
-	if ( $output == ARRAY_A )
+	if ( $output == ARRAY_A ) {
 		return $_post->to_array();
-	elseif ( $output == ARRAY_N )
+	} elseif ( $output == ARRAY_N ) {
 		return array_values( $_post->to_array() );
+	}
 
 	return $_post;
 }
@@ -555,8 +574,9 @@
 function get_post_ancestors( $post ) {
 	$post = get_post( $post );
 
-	if ( ! $post || empty( $post->post_parent ) || $post->post_parent == $post->ID )
+	if ( ! $post || empty( $post->post_parent ) || $post->post_parent == $post->ID ) {
 		return array();
+	}
 
 	$ancestors = array();
 
@@ -564,8 +584,9 @@
 
 	while ( $ancestor = get_post( $id ) ) {
 		// Loop detection: If the ancestor has been seen before, break.
-		if ( empty( $ancestor->post_parent ) || ( $ancestor->post_parent == $post->ID ) || in_array( $ancestor->post_parent, $ancestors ) )
+		if ( empty( $ancestor->post_parent ) || ( $ancestor->post_parent == $post->ID ) || in_array( $ancestor->post_parent, $ancestors ) ) {
 			break;
+		}
 
 		$id = $ancestors[] = $ancestor->post_parent;
 	}
@@ -596,13 +617,15 @@
 function get_post_field( $field, $post = null, $context = 'display' ) {
 	$post = get_post( $post );
 
-	if ( !$post )
+	if ( ! $post ) {
 		return '';
+	}
 
-	if ( !isset($post->$field) )
+	if ( ! isset( $post->$field ) ) {
 		return '';
+	}
 
-	return sanitize_post_field($field, $post->$field, $post->ID, $context);
+	return sanitize_post_field( $field, $post->$field, $post->ID, $context );
 }
 
 /**
@@ -617,10 +640,11 @@
  * @return string|false The mime type on success, false on failure.
  */
 function get_post_mime_type( $ID = '' ) {
-	$post = get_post($ID);
+	$post = get_post( $ID );
 
-	if ( is_object($post) )
+	if ( is_object( $post ) ) {
 		return $post->post_mime_type;
+	}
 
 	return false;
 }
@@ -637,18 +661,21 @@
  * @return string|false Post status on success, false on failure.
  */
 function get_post_status( $ID = '' ) {
-	$post = get_post($ID);
+	$post = get_post( $ID );
 
-	if ( !is_object($post) )
+	if ( ! is_object( $post ) ) {
 		return false;
+	}
 
 	if ( 'attachment' == $post->post_type ) {
-		if ( 'private' == $post->post_status )
+		if ( 'private' == $post->post_status ) {
 			return 'private';
+		}
 
 		// Unattached attachments are assumed to be published.
-		if ( ( 'inherit' == $post->post_status ) && ( 0 == $post->post_parent) )
+		if ( ( 'inherit' == $post->post_status ) && ( 0 == $post->post_parent) ) {
 			return 'publish';
+		}
 
 		// Inherit status from the parent.
 		if ( $post->post_parent && ( $post->ID != $post->post_parent ) ) {
@@ -659,7 +686,6 @@
 				return $parent_post_status;
 			}
 		}
-
 	}
 
 	/**
@@ -688,7 +714,7 @@
 		'draft'   => __( 'Draft' ),
 		'pending' => __( 'Pending Review' ),
 		'private' => __( 'Private' ),
-		'publish' => __( 'Published' )
+		'publish' => __( 'Published' ),
 	);
 
 	return $status;
@@ -708,7 +734,7 @@
 	$status = array(
 		'draft'   => __( 'Draft' ),
 		'private' => __( 'Private' ),
-		'publish' => __( 'Published' )
+		'publish' => __( 'Published' ),
 	);
 
 	return $status;
@@ -760,8 +786,9 @@
 function register_post_status( $post_status, $args = array() ) {
 	global $wp_post_statuses;
 
-	if (!is_array($wp_post_statuses))
+	if ( ! is_array( $wp_post_statuses ) ) {
 		$wp_post_statuses = array();
+	}
 
 	// Args prefixed with an underscore are reserved for internal use.
 	$defaults = array(
@@ -777,47 +804,58 @@
 		'show_in_admin_status_list' => null,
 		'show_in_admin_all_list' => null,
 	);
-	$args = wp_parse_args($args, $defaults);
+	$args = wp_parse_args( $args, $defaults );
 	$args = (object) $args;
 
-	$post_status = sanitize_key($post_status);
+	$post_status = sanitize_key( $post_status );
 	$args->name = $post_status;
 
 	// Set various defaults.
-	if ( null === $args->public && null === $args->internal && null === $args->protected && null === $args->private )
+	if ( null === $args->public && null === $args->internal && null === $args->protected && null === $args->private ) {
 		$args->internal = true;
+	}
 
-	if ( null === $args->public  )
+	if ( null === $args->public ) {
 		$args->public = false;
+	}
 
-	if ( null === $args->private  )
+	if ( null === $args->private ) {
 		$args->private = false;
+	}
 
-	if ( null === $args->protected  )
+	if ( null === $args->protected ) {
 		$args->protected = false;
+	}
 
-	if ( null === $args->internal  )
+	if ( null === $args->internal ) {
 		$args->internal = false;
+	}
 
-	if ( null === $args->publicly_queryable )
+	if ( null === $args->publicly_queryable ) {
 		$args->publicly_queryable = $args->public;
+	}
 
-	if ( null === $args->exclude_from_search )
+	if ( null === $args->exclude_from_search ) {
 		$args->exclude_from_search = $args->internal;
+	}
 
-	if ( null === $args->show_in_admin_all_list )
-		$args->show_in_admin_all_list = !$args->internal;
+	if ( null === $args->show_in_admin_all_list ) {
+		$args->show_in_admin_all_list = ! $args->internal;
+	}
 
-	if ( null === $args->show_in_admin_status_list )
-		$args->show_in_admin_status_list = !$args->internal;
+	if ( null === $args->show_in_admin_status_list ) {
+		$args->show_in_admin_status_list = ! $args->internal;
+	}
 
-	if ( false === $args->label )
+	if ( false === $args->label ) {
 		$args->label = $post_status;
+	}
 
-	if ( false === $args->label_count )
+	if ( false === $args->label_count ) {
 		$args->label_count = _n_noop( $args->label, $args->label );
+	}
 
-	$wp_post_statuses[$post_status] = $args;
+	$wp_post_statuses[ $post_status ] = $args;
 
 	return $args;
 }
@@ -837,10 +875,11 @@
 function get_post_status_object( $post_status ) {
 	global $wp_post_statuses;
 
-	if ( empty($wp_post_statuses[$post_status]) )
+	if ( empty( $wp_post_statuses[ $post_status ] ) ) {
 		return null;
+	}
 
-	return $wp_post_statuses[$post_status];
+	return $wp_post_statuses[ $post_status ];
 }
 
 /**
@@ -865,7 +904,7 @@
 
 	$field = ('names' == $output) ? 'name' : false;
 
-	return wp_filter_object_list($wp_post_statuses, $args, $operator, $field);
+	return wp_filter_object_list( $wp_post_statuses, $args, $operator, $field );
 }
 
 /**
@@ -881,8 +920,9 @@
  * @return bool Whether post type is hierarchical.
  */
 function is_post_type_hierarchical( $post_type ) {
-	if ( ! post_type_exists( $post_type ) )
+	if ( ! post_type_exists( $post_type ) ) {
 		return false;
+	}
 
 	$post_type = get_post_type_object( $post_type );
 	return $post_type->hierarchical;
@@ -911,8 +951,9 @@
  * @return string|false          Post type on success, false on failure.
  */
 function get_post_type( $post = null ) {
-	if ( $post = get_post( $post ) )
+	if ( $post = get_post( $post ) ) {
 		return $post->post_type;
+	}
 
 	return false;
 }
@@ -963,7 +1004,7 @@
 
 	$field = ('names' == $output) ? 'name' : false;
 
-	return wp_filter_object_list($wp_post_types, $args, $operator, $field);
+	return wp_filter_object_list( $wp_post_types, $args, $operator, $field );
 }
 
 /**
@@ -1243,21 +1284,22 @@
  * @return object object with all the capabilities as member variables.
  */
 function get_post_type_capabilities( $args ) {
-	if ( ! is_array( $args->capability_type ) )
+	if ( ! is_array( $args->capability_type ) ) {
 		$args->capability_type = array( $args->capability_type, $args->capability_type . 's' );
+	}
 
 	// Singular base for meta capabilities, plural base for primitive capabilities.
 	list( $singular_base, $plural_base ) = $args->capability_type;
 
 	$default_capabilities = array(
 		// Meta capabilities
-		'edit_post'          => 'edit_'         . $singular_base,
-		'read_post'          => 'read_'         . $singular_base,
-		'delete_post'        => 'delete_'       . $singular_base,
+		'edit_post'          => 'edit_' . $singular_base,
+		'read_post'          => 'read_' . $singular_base,
+		'delete_post'        => 'delete_' . $singular_base,
 		// Primitive capabilities used outside of map_meta_cap():
-		'edit_posts'         => 'edit_'         . $plural_base,
-		'edit_others_posts'  => 'edit_others_'  . $plural_base,
-		'publish_posts'      => 'publish_'      . $plural_base,
+		'edit_posts'         => 'edit_' . $plural_base,
+		'edit_others_posts'  => 'edit_others_' . $plural_base,
+		'publish_posts'      => 'publish_' . $plural_base,
 		'read_private_posts' => 'read_private_' . $plural_base,
 	);
 
@@ -1265,12 +1307,12 @@
 	if ( $args->map_meta_cap ) {
 		$default_capabilities_for_mapping = array(
 			'read'                   => 'read',
-			'delete_posts'           => 'delete_'           . $plural_base,
-			'delete_private_posts'   => 'delete_private_'   . $plural_base,
+			'delete_posts'           => 'delete_' . $plural_base,
+			'delete_private_posts'   => 'delete_private_' . $plural_base,
 			'delete_published_posts' => 'delete_published_' . $plural_base,
-			'delete_others_posts'    => 'delete_others_'    . $plural_base,
-			'edit_private_posts'     => 'edit_private_'     . $plural_base,
-			'edit_published_posts'   => 'edit_published_'   . $plural_base,
+			'delete_others_posts'    => 'delete_others_' . $plural_base,
+			'edit_private_posts'     => 'edit_private_' . $plural_base,
+			'edit_published_posts'   => 'edit_published_' . $plural_base,
 		);
 		$default_capabilities = array_merge( $default_capabilities, $default_capabilities_for_mapping );
 	}
@@ -1278,12 +1320,14 @@
 	$capabilities = array_merge( $default_capabilities, $args->capabilities );
 
 	// Post creation capability simply maps to edit_posts by default:
-	if ( ! isset( $capabilities['create_posts'] ) )
+	if ( ! isset( $capabilities['create_posts'] ) ) {
 		$capabilities['create_posts'] = $capabilities['edit_posts'];
+	}
 
 	// Remember meta capabilities for future reference.
-	if ( $args->map_meta_cap )
+	if ( $args->map_meta_cap ) {
 		_post_type_meta_capabilities( $capabilities );
+	}
 
 	return (object) $capabilities;
 }
@@ -1367,18 +1411,18 @@
  */
 function get_post_type_labels( $post_type_object ) {
 	$nohier_vs_hier_defaults = array(
-		'name' => array( _x('Posts', 'post type general name'), _x('Pages', 'post type general name') ),
-		'singular_name' => array( _x('Post', 'post type singular name'), _x('Page', 'post type singular name') ),
-		'add_new' => array( _x('Add New', 'post'), _x('Add New', 'page') ),
-		'add_new_item' => array( __('Add New Post'), __('Add New Page') ),
-		'edit_item' => array( __('Edit Post'), __('Edit Page') ),
-		'new_item' => array( __('New Post'), __('New Page') ),
-		'view_item' => array( __('View Post'), __('View Page') ),
-		'view_items' => array( __('View Posts'), __('View Pages') ),
-		'search_items' => array( __('Search Posts'), __('Search Pages') ),
-		'not_found' => array( __('No posts found.'), __('No pages found.') ),
-		'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ),
-		'parent_item_colon' => array( null, __('Parent Page:') ),
+		'name' => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ),
+		'singular_name' => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ),
+		'add_new' => array( _x( 'Add New', 'post' ), _x( 'Add New', 'page' ) ),
+		'add_new_item' => array( __( 'Add New Post' ), __( 'Add New Page' ) ),
+		'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ),
+		'new_item' => array( __( 'New Post' ), __( 'New Page' ) ),
+		'view_item' => array( __( 'View Post' ), __( 'View Page' ) ),
+		'view_items' => array( __( 'View Posts' ), __( 'View Pages' ) ),
+		'search_items' => array( __( 'Search Posts' ), __( 'Search Pages' ) ),
+		'not_found' => array( __( 'No posts found.' ), __( 'No pages found.' ) ),
+		'not_found_in_trash' => array( __( 'No posts found in Trash.' ), __( 'No pages found in Trash.' ) ),
+		'parent_item_colon' => array( null, __( 'Parent Page:' ) ),
 		'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ),
 		'archives' => array( __( 'Post Archives' ), __( 'Page Archives' ) ),
 		'attributes' => array( __( 'Post Attributes' ), __( 'Page Attributes' ) ),
@@ -1434,28 +1478,33 @@
 function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
 	$object->labels = (array) $object->labels;
 
-	if ( isset( $object->label ) && empty( $object->labels['name'] ) )
+	if ( isset( $object->label ) && empty( $object->labels['name'] ) ) {
 		$object->labels['name'] = $object->label;
+	}
 
-	if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) )
+	if ( ! isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) {
 		$object->labels['singular_name'] = $object->labels['name'];
+	}
 
-	if ( ! isset( $object->labels['name_admin_bar'] ) )
+	if ( ! isset( $object->labels['name_admin_bar'] ) ) {
 		$object->labels['name_admin_bar'] = isset( $object->labels['singular_name'] ) ? $object->labels['singular_name'] : $object->name;
+	}
 
-	if ( !isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) )
+	if ( ! isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) ) {
 		$object->labels['menu_name'] = $object->labels['name'];
+	}
 
-	if ( !isset( $object->labels['all_items'] ) && isset( $object->labels['menu_name'] ) )
+	if ( ! isset( $object->labels['all_items'] ) && isset( $object->labels['menu_name'] ) ) {
 		$object->labels['all_items'] = $object->labels['menu_name'];
+	}
 
-	if ( !isset( $object->labels['archives'] ) && isset( $object->labels['all_items'] ) ) {
+	if ( ! isset( $object->labels['archives'] ) && isset( $object->labels['all_items'] ) ) {
 		$object->labels['archives'] = $object->labels['all_items'];
 	}
 
 	$defaults = array();
 	foreach ( $nohier_vs_hier_defaults as $key => $value ) {
-		$defaults[$key] = $object->hierarchical ? $value[1] : $value[0];
+		$defaults[ $key ] = $object->hierarchical ? $value[1] : $value[0];
 	}
 	$labels = array_merge( $defaults, $object->labels );
 	$object->labels = (object) $object->labels;
@@ -1473,8 +1522,9 @@
 	foreach ( get_post_types( array( 'show_ui' => true ) ) as $ptype ) {
 		$ptype_obj = get_post_type_object( $ptype );
 		// Sub-menus only.
-		if ( ! $ptype_obj->show_in_menu || $ptype_obj->show_in_menu === true )
+		if ( ! $ptype_obj->show_in_menu || $ptype_obj->show_in_menu === true ) {
 			continue;
+		}
 		add_submenu_page( $ptype_obj->show_in_menu, $ptype_obj->labels->name, $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype" );
 	}
 }
@@ -1503,11 +1553,11 @@
 	global $_wp_post_type_features;
 
 	$features = (array) $feature;
-	foreach ($features as $feature) {
-		if ( func_num_args() == 2 )
-			$_wp_post_type_features[$post_type][$feature] = true;
-		else
-			$_wp_post_type_features[$post_type][$feature] = array_slice( func_get_args(), 2 );
+	foreach ( $features as $feature ) {
+		if ( func_num_args() == 2 ) {
+			$_wp_post_type_features[ $post_type ][ $feature ] = true;
+		} else { $_wp_post_type_features[ $post_type ][ $feature ] = array_slice( func_get_args(), 2 );
+		}
 	}
 }
 
@@ -1540,8 +1590,9 @@
 function get_all_post_type_supports( $post_type ) {
 	global $_wp_post_type_features;
 
-	if ( isset( $_wp_post_type_features[$post_type] ) )
-		return $_wp_post_type_features[$post_type];
+	if ( isset( $_wp_post_type_features[ $post_type ] ) ) {
+		return $_wp_post_type_features[ $post_type ];
+	}
 
 	return array();
 }
@@ -1560,7 +1611,7 @@
 function post_type_supports( $post_type, $feature ) {
 	global $_wp_post_type_features;
 
-	return ( isset( $_wp_post_type_features[$post_type][$feature] ) );
+	return ( isset( $_wp_post_type_features[ $post_type ][ $feature ] ) );
 }
 
 /**
@@ -1602,8 +1653,8 @@
 function set_post_type( $post_id = 0, $post_type = 'post' ) {
 	global $wpdb;
 
-	$post_type = sanitize_post_field('post_type', $post_type, $post_id, 'db');
-	$return = $wpdb->update( $wpdb->posts, array('post_type' => $post_type), array('ID' => $post_id) );
+	$post_type = sanitize_post_field( 'post_type', $post_type, $post_id, 'db' );
+	$return = $wpdb->update( $wpdb->posts, array( 'post_type' => $post_type ), array( 'ID' => $post_id ) );
 
 	clean_post_cache( $post_id );
 
@@ -1661,32 +1712,40 @@
 function get_posts( $args = null ) {
 	$defaults = array(
 		'numberposts' => 5,
-		'category' => 0, 'orderby' => 'date',
-		'order' => 'DESC', 'include' => array(),
-		'exclude' => array(), 'meta_key' => '',
-		'meta_value' =>'', 'post_type' => 'post',
-		'suppress_filters' => true
+		'category' => 0,
+	'orderby' => 'date',
+		'order' => 'DESC',
+	'include' => array(),
+		'exclude' => array(),
+	'meta_key' => '',
+		'meta_value' => '',
+	'post_type' => 'post',
+		'suppress_filters' => true,
 	);
 
 	$r = wp_parse_args( $args, $defaults );
-	if ( empty( $r['post_status'] ) )
+	if ( empty( $r['post_status'] ) ) {
 		$r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish';
-	if ( ! empty($r['numberposts']) && empty($r['posts_per_page']) )
+	}
+	if ( ! empty( $r['numberposts'] ) && empty( $r['posts_per_page'] ) ) {
 		$r['posts_per_page'] = $r['numberposts'];
-	if ( ! empty($r['category']) )
+	}
+	if ( ! empty( $r['category'] ) ) {
 		$r['cat'] = $r['category'];
-	if ( ! empty($r['include']) ) {
+	}
+	if ( ! empty( $r['include'] ) ) {
 		$incposts = wp_parse_id_list( $r['include'] );
-		$r['posts_per_page'] = count($incposts);  // only the number of posts included
+		$r['posts_per_page'] = count( $incposts );  // only the number of posts included
 		$r['post__in'] = $incposts;
-	} elseif ( ! empty($r['exclude']) )
+	} elseif ( ! empty( $r['exclude'] ) ) {
 		$r['post__not_in'] = wp_parse_id_list( $r['exclude'] );
+	}
 
 	$r['ignore_sticky_posts'] = true;
 	$r['no_found_rows'] = true;
 
 	$get_posts = new WP_Query;
-	return $get_posts->query($r);
+	return $get_posts->query( $r );
 
 }
 
@@ -1710,10 +1769,11 @@
  */
 function add_post_meta( $post_id, $meta_key, $meta_value, $unique = false ) {
 	// Make sure meta is added to the post, not a revision.
-	if ( $the_post = wp_is_post_revision($post_id) )
+	if ( $the_post = wp_is_post_revision( $post_id ) ) {
 		$post_id = $the_post;
+	}
 
-	return add_metadata('post', $post_id, $meta_key, $meta_value, $unique);
+	return add_metadata( 'post', $post_id, $meta_key, $meta_value, $unique );
 }
 
 /**
@@ -1733,10 +1793,11 @@
  */
 function delete_post_meta( $post_id, $meta_key, $meta_value = '' ) {
 	// Make sure meta is added to the post, not a revision.
-	if ( $the_post = wp_is_post_revision($post_id) )
+	if ( $the_post = wp_is_post_revision( $post_id ) ) {
 		$post_id = $the_post;
+	}
 
-	return delete_metadata('post', $post_id, $meta_key, $meta_value);
+	return delete_metadata( 'post', $post_id, $meta_key, $meta_value );
 }
 
 /**
@@ -1752,7 +1813,7 @@
  *               field if $single is true.
  */
 function get_post_meta( $post_id, $key = '', $single = false ) {
-	return get_metadata('post', $post_id, $key, $single);
+	return get_metadata( 'post', $post_id, $key, $single );
 }
 
 /**
@@ -1775,10 +1836,11 @@
  */
 function update_post_meta( $post_id, $meta_key, $meta_value, $prev_value = '' ) {
 	// Make sure meta is added to the post, not a revision.
-	if ( $the_post = wp_is_post_revision($post_id) )
+	if ( $the_post = wp_is_post_revision( $post_id ) ) {
 		$post_id = $the_post;
+	}
 
-	return update_metadata('post', $post_id, $meta_key, $meta_value, $prev_value);
+	return update_metadata( 'post', $post_id, $meta_key, $meta_value, $prev_value );
 }
 
 /**
@@ -1806,8 +1868,9 @@
  */
 function get_post_custom( $post_id = 0 ) {
 	$post_id = absint( $post_id );
-	if ( ! $post_id )
+	if ( ! $post_id ) {
 		$post_id = get_the_ID();
+	}
 
 	return get_post_meta( $post_id );
 }
@@ -1825,11 +1888,13 @@
 function get_post_custom_keys( $post_id = 0 ) {
 	$custom = get_post_custom( $post_id );
 
-	if ( !is_array($custom) )
+	if ( ! is_array( $custom ) ) {
 		return;
+	}
 
-	if ( $keys = array_keys($custom) )
+	if ( $keys = array_keys( $custom ) ) {
 		return $keys;
+	}
 }
 
 /**
@@ -1845,12 +1910,13 @@
  * @return array|null Meta field values.
  */
 function get_post_custom_values( $key = '', $post_id = 0 ) {
-	if ( !$key )
+	if ( ! $key ) {
 		return null;
+	}
 
-	$custom = get_post_custom($post_id);
+	$custom = get_post_custom( $post_id );
 
-	return isset($custom[$key]) ? $custom[$key] : null;
+	return isset( $custom[ $key ] ) ? $custom[ $key ] : null;
 }
 
 /**
@@ -1867,16 +1933,19 @@
 function is_sticky( $post_id = 0 ) {
 	$post_id = absint( $post_id );
 
-	if ( ! $post_id )
+	if ( ! $post_id ) {
 		$post_id = get_the_ID();
+	}
 
 	$stickies = get_option( 'sticky_posts' );
 
-	if ( ! is_array( $stickies ) )
+	if ( ! is_array( $stickies ) ) {
 		return false;
+	}
 
-	if ( in_array( $post_id, $stickies ) )
+	if ( in_array( $post_id, $stickies ) ) {
 		return true;
+	}
 
 	return false;
 }
@@ -1899,23 +1968,29 @@
  *                              same type as $post).
  */
 function sanitize_post( $post, $context = 'display' ) {
-	if ( is_object($post) ) {
+	if ( is_object( $post ) ) {
 		// Check if post already filtered for this context.
-		if ( isset($post->filter) && $context == $post->filter )
+		if ( isset( $post->filter ) && $context == $post->filter ) {
 			return $post;
-		if ( !isset($post->ID) )
+		}
+		if ( ! isset( $post->ID ) ) {
 			$post->ID = 0;
-		foreach ( array_keys(get_object_vars($post)) as $field )
-			$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
+		}
+		foreach ( array_keys( get_object_vars( $post ) ) as $field ) {
+			$post->$field = sanitize_post_field( $field, $post->$field, $post->ID, $context );
+		}
 		$post->filter = $context;
 	} elseif ( is_array( $post ) ) {
 		// Check if post already filtered for this context.
-		if ( isset($post['filter']) && $context == $post['filter'] )
+		if ( isset( $post['filter'] ) && $context == $post['filter'] ) {
 			return $post;
-		if ( !isset($post['ID']) )
+		}
+		if ( ! isset( $post['ID'] ) ) {
 			$post['ID'] = 0;
-		foreach ( array_keys($post) as $field )
-			$post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context);
+		}
+		foreach ( array_keys( $post ) as $field ) {
+			$post[ $field ] = sanitize_post_field( $field, $post[ $field ], $post['ID'], $context );
+		}
 		$post['filter'] = $context;
 	}
 	return $post;
@@ -1939,28 +2014,30 @@
  * @return mixed Sanitized value.
  */
 function sanitize_post_field( $field, $value, $post_id, $context = 'display' ) {
-	$int_fields = array('ID', 'post_parent', 'menu_order');
-	if ( in_array($field, $int_fields) )
+	$int_fields = array( 'ID', 'post_parent', 'menu_order' );
+	if ( in_array( $field, $int_fields ) ) {
 		$value = (int) $value;
+	}
 
 	// Fields which contain arrays of integers.
 	$array_int_fields = array( 'ancestors' );
-	if ( in_array($field, $array_int_fields) ) {
-		$value = array_map( 'absint', $value);
+	if ( in_array( $field, $array_int_fields ) ) {
+		$value = array_map( 'absint', $value );
 		return $value;
 	}
 
-	if ( 'raw' == $context )
+	if ( 'raw' == $context ) {
 		return $value;
+	}
 
 	$prefixed = false;
-	if ( false !== strpos($field, 'post_') ) {
+	if ( false !== strpos( $field, 'post_' ) ) {
 		$prefixed = true;
-		$field_no_prefix = str_replace('post_', '', $field);
+		$field_no_prefix = str_replace( 'post_', '', $field );
 	}
 
 	if ( 'edit' == $context ) {
-		$format_to_edit = array('post_content', 'post_excerpt', 'post_title', 'post_password');
+		$format_to_edit = array( 'post_content', 'post_excerpt', 'post_title', 'post_password' );
 
 		if ( $prefixed ) {
 
@@ -1993,13 +2070,13 @@
 			$value = apply_filters( "edit_post_{$field}", $value, $post_id );
 		}
 
-		if ( in_array($field, $format_to_edit) ) {
-			if ( 'post_content' == $field )
-				$value = format_to_edit($value, user_can_richedit());
-			else
-				$value = format_to_edit($value);
+		if ( in_array( $field, $format_to_edit ) ) {
+			if ( 'post_content' == $field ) {
+				$value = format_to_edit( $value, user_can_richedit() );
+			} else { $value = format_to_edit( $value );
+			}
 		} else {
-			$value = esc_attr($value);
+			$value = esc_attr( $value );
 		}
 	} elseif ( 'db' == $context ) {
 		if ( $prefixed ) {
@@ -2041,7 +2118,7 @@
 			 * @param mixed $value Value of the post field.
 			 */
 			$value = apply_filters( "{$field}_pre", $value );
-		}
+		}// End if().
 	} else {
 
 		// Use display filters by default.
@@ -2071,7 +2148,7 @@
 		} elseif ( 'js' == $context ) {
 			$value = esc_js( $value );
 		}
-	}
+	}// End if().
 
 	return $value;
 }
@@ -2086,13 +2163,15 @@
  * @param int $post_id Post ID.
  */
 function stick_post( $post_id ) {
-	$stickies = get_option('sticky_posts');
+	$stickies = get_option( 'sticky_posts' );
 
-	if ( !is_array($stickies) )
-		$stickies = array($post_id);
+	if ( ! is_array( $stickies ) ) {
+		$stickies = array( $post_id );
+	}
 
-	if ( ! in_array($post_id, $stickies) )
+	if ( ! in_array( $post_id, $stickies ) ) {
 		$stickies[] = $post_id;
+	}
 
 	$updated = update_option( 'sticky_posts', $stickies );
 
@@ -2118,19 +2197,22 @@
  * @param int $post_id Post ID.
  */
 function unstick_post( $post_id ) {
-	$stickies = get_option('sticky_posts');
+	$stickies = get_option( 'sticky_posts' );
 
-	if ( !is_array($stickies) )
+	if ( ! is_array( $stickies ) ) {
 		return;
+	}
 
-	if ( ! in_array($post_id, $stickies) )
+	if ( ! in_array( $post_id, $stickies ) ) {
 		return;
+	}
 
-	$offset = array_search($post_id, $stickies);
-	if ( false === $offset )
+	$offset = array_search( $post_id, $stickies );
+	if ( false === $offset ) {
 		return;
+	}
 
-	array_splice($stickies, $offset, 1);
+	array_splice( $stickies, $offset, 1 );
 
 	$updated = update_option( 'sticky_posts', $stickies );
 
@@ -2188,8 +2270,9 @@
 function wp_count_posts( $type = 'post', $perm = '' ) {
 	global $wpdb;
 
-	if ( ! post_type_exists( $type ) )
+	if ( ! post_type_exists( $type ) ) {
 		return new stdClass;
+	}
 
 	$cache_key = _count_posts_cache_key( $type, $perm );
 
@@ -2201,7 +2284,7 @@
 
 	$query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s";
 	if ( 'readable' == $perm && is_user_logged_in() ) {
-		$post_type_object = get_post_type_object($type);
+		$post_type_object = get_post_type_object( $type );
 		if ( ! current_user_can( $post_type_object->cap->read_private_posts ) ) {
 			$query .= $wpdb->prepare( " AND (post_status != 'private' OR ( post_author = %d AND post_status = 'private' ))",
 				get_current_user_id()
@@ -2260,7 +2343,7 @@
 	foreach ( (array) $count as $row ) {
 		$counts[ $row['post_mime_type'] ] = $row['num_posts'];
 	}
-	$counts['trash'] = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and");
+	$counts['trash'] = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and" );
 
 	/**
 	 * Modify returned attachment counts by mime type.
@@ -2284,9 +2367,9 @@
  */
 function get_post_mime_types() {
 	$post_mime_types = array(	//	array( adj, noun )
-		'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
-		'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
-		'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
+		'image' => array( __( 'Images' ), __( 'Manage Images' ), _n_noop( 'Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>' ) ),
+		'audio' => array( __( 'Audio' ), __( 'Manage Audio' ), _n_noop( 'Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>' ) ),
+		'video' => array( __( 'Video' ), __( 'Manage Video' ), _n_noop( 'Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>' ) ),
 	);
 
 	/**
@@ -2329,10 +2412,10 @@
 		$mimes = array_map( 'trim', explode( ',', $type ) );
 		foreach ( $mimes as $mime ) {
 			$regex = str_replace( '__wildcard__', $wild, preg_quote( str_replace( '*', '__wildcard__', $mime ) ) );
-			$patternses[][$type] = "^$regex$";
+			$patternses[][ $type ] = "^$regex$";
 			if ( false === strpos( $mime, '/' ) ) {
-				$patternses[][$type] = "^$regex/";
-				$patternses[][$type] = $regex;
+				$patternses[][ $type ] = "^$regex/";
+				$patternses[][ $type ] = $regex;
 			}
 		}
 	}
@@ -2341,8 +2424,8 @@
 	foreach ( $patternses as $patterns ) {
 		foreach ( $patterns as $type => $pattern ) {
 			foreach ( (array) $real_mime_types as $real ) {
-				if ( preg_match( "#$pattern#", $real ) && ( empty( $matches[$type] ) || false === array_search( $real, $matches[$type] ) ) ) {
-					$matches[$type][] = $real;
+				if ( preg_match( "#$pattern#", $real ) && ( empty( $matches[ $type ] ) || false === array_search( $real, $matches[ $type ] ) ) ) {
+					$matches[ $type ][] = $real;
 				}
 			}
 		}
@@ -2363,41 +2446,45 @@
  */
 function wp_post_mime_type_where( $post_mime_types, $table_alias = '' ) {
 	$where = '';
-	$wildcards = array('', '%', '%/%');
-	if ( is_string($post_mime_types) )
-		$post_mime_types = array_map('trim', explode(',', $post_mime_types));
+	$wildcards = array( '', '%', '%/%' );
+	if ( is_string( $post_mime_types ) ) {
+		$post_mime_types = array_map( 'trim', explode( ',', $post_mime_types ) );
+	}
 
 	$wheres = array();
 
 	foreach ( (array) $post_mime_types as $mime_type ) {
-		$mime_type = preg_replace('/\s/', '', $mime_type);
-		$slashpos = strpos($mime_type, '/');
+		$mime_type = preg_replace( '/\s/', '', $mime_type );
+		$slashpos = strpos( $mime_type, '/' );
 		if ( false !== $slashpos ) {
-			$mime_group = preg_replace('/[^-*.a-zA-Z0-9]/', '', substr($mime_type, 0, $slashpos));
-			$mime_subgroup = preg_replace('/[^-*.+a-zA-Z0-9]/', '', substr($mime_type, $slashpos + 1));
-			if ( empty($mime_subgroup) )
+			$mime_group = preg_replace( '/[^-*.a-zA-Z0-9]/', '', substr( $mime_type, 0, $slashpos ) );
+			$mime_subgroup = preg_replace( '/[^-*.+a-zA-Z0-9]/', '', substr( $mime_type, $slashpos + 1 ) );
+			if ( empty( $mime_subgroup ) ) {
 				$mime_subgroup = '*';
-			else
-				$mime_subgroup = str_replace('/', '', $mime_subgroup);
+			} else { $mime_subgroup = str_replace( '/', '', $mime_subgroup );
+			}
 			$mime_pattern = "$mime_group/$mime_subgroup";
 		} else {
-			$mime_pattern = preg_replace('/[^-*.a-zA-Z0-9]/', '', $mime_type);
-			if ( false === strpos($mime_pattern, '*') )
+			$mime_pattern = preg_replace( '/[^-*.a-zA-Z0-9]/', '', $mime_type );
+			if ( false === strpos( $mime_pattern, '*' ) ) {
 				$mime_pattern .= '/*';
+			}
 		}
 
-		$mime_pattern = preg_replace('/\*+/', '%', $mime_pattern);
+		$mime_pattern = preg_replace( '/\*+/', '%', $mime_pattern );
 
-		if ( in_array( $mime_type, $wildcards ) )
+		if ( in_array( $mime_type, $wildcards ) ) {
 			return '';
+		}
 
-		if ( false !== strpos($mime_pattern, '%') )
-			$wheres[] = empty($table_alias) ? "post_mime_type LIKE '$mime_pattern'" : "$table_alias.post_mime_type LIKE '$mime_pattern'";
-		else
-			$wheres[] = empty($table_alias) ? "post_mime_type = '$mime_pattern'" : "$table_alias.post_mime_type = '$mime_pattern'";
+		if ( false !== strpos( $mime_pattern, '%' ) ) {
+			$wheres[] = empty( $table_alias ) ? "post_mime_type LIKE '$mime_pattern'" : "$table_alias.post_mime_type LIKE '$mime_pattern'";
+		} else { $wheres[] = empty( $table_alias ) ? "post_mime_type = '$mime_pattern'" : "$table_alias.post_mime_type = '$mime_pattern'";
+		}
+	}
+	if ( ! empty( $wheres ) ) {
+		$where = ' AND (' . join( ' OR ', $wheres ) . ') ';
 	}
-	if ( !empty($wheres) )
-		$where = ' AND (' . join(' OR ', $wheres) . ') ';
 	return $where;
 }
 
@@ -2425,14 +2512,17 @@
 function wp_delete_post( $postid = 0, $force_delete = false ) {
 	global $wpdb;
 
-	if ( !$post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) )
+	if ( ! $post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", $postid ) ) ) {
 		return $post;
+	}
 
-	if ( !$force_delete && ( $post->post_type == 'post' || $post->post_type == 'page') && get_post_status( $postid ) != 'trash' && EMPTY_TRASH_DAYS )
+	if ( ! $force_delete && ( $post->post_type == 'post' || $post->post_type == 'page') && get_post_status( $postid ) != 'trash' && EMPTY_TRASH_DAYS ) {
 		return wp_trash_post( $postid );
+	}
 
-	if ( $post->post_type == 'attachment' )
+	if ( $post->post_type == 'attachment' ) {
 		return wp_delete_attachment( $postid, $force_delete );
+	}
 
 	/**
 	 * Filters whether a post deletion should take place.
@@ -2459,10 +2549,10 @@
 	 */
 	do_action( 'before_delete_post', $postid );
 
-	delete_post_meta($postid,'_wp_trash_meta_status');
-	delete_post_meta($postid,'_wp_trash_meta_time');
+	delete_post_meta( $postid,'_wp_trash_meta_status' );
+	delete_post_meta( $postid,'_wp_trash_meta_time' );
 
-	wp_delete_object_term_relationships($postid, get_object_taxonomies($post->post_type));
+	wp_delete_object_term_relationships( $postid, get_object_taxonomies( $post->post_type ) );
 
 	$parent_data = array( 'post_parent' => $post->post_parent );
 	$parent_where = array( 'post_parent' => $postid );
@@ -2479,24 +2569,26 @@
 	// Do raw query. wp_get_post_revisions() is filtered.
 	$revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $postid ) );
 	// Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up.
-	foreach ( $revision_ids as $revision_id )
+	foreach ( $revision_ids as $revision_id ) {
 		wp_delete_post_revision( $revision_id );
+	}
 
 	// Point all attachments to this post up one level.
 	$wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) );
 
 	wp_defer_comment_counting( true );
 
-	$comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $postid ));
+	$comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $postid ) );
 	foreach ( $comment_ids as $comment_id ) {
 		wp_delete_comment( $comment_id, true );
 	}
 
 	wp_defer_comment_counting( false );
 
-	$post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $postid ));
-	foreach ( $post_meta_ids as $mid )
+	$post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $postid ) );
+	foreach ( $post_meta_ids as $mid ) {
 		delete_metadata_by_mid( 'post', $mid );
+	}
 
 	/**
 	 * Fires immediately before a post is deleted from the database.
@@ -2523,11 +2615,12 @@
 	clean_post_cache( $post );
 
 	if ( is_post_type_hierarchical( $post->post_type ) && $children ) {
-		foreach ( $children as $child )
+		foreach ( $children as $child ) {
 			clean_post_cache( $child );
+		}
 	}
 
-	wp_clear_scheduled_hook('publish_future_post', array( $postid ) );
+	wp_clear_scheduled_hook( 'publish_future_post', array( $postid ) );
 
 	/**
 	 * Fires after a post is deleted, at the conclusion of wp_delete_post().
@@ -2557,7 +2650,7 @@
 function _reset_front_page_settings_for_post( $post_id ) {
 	$post = get_post( $post_id );
 	if ( 'page' == $post->post_type ) {
-	 	/*
+		 /*
 	 	 * If the page is defined in option page_on_front or post_for_posts,
 	 	 * adjust the corresponding options.
 	 	 */
@@ -2586,14 +2679,17 @@
  * @return false|array|WP_Post|null Post data array, otherwise false.
  */
 function wp_trash_post( $post_id = 0 ) {
-	if ( !EMPTY_TRASH_DAYS )
-		return wp_delete_post($post_id, true);
+	if ( ! EMPTY_TRASH_DAYS ) {
+		return wp_delete_post( $post_id, true );
+	}
 
-	if ( !$post = get_post($post_id, ARRAY_A) )
+	if ( ! $post = get_post( $post_id, ARRAY_A ) ) {
 		return $post;
+	}
 
-	if ( $post['post_status'] == 'trash' )
+	if ( $post['post_status'] == 'trash' ) {
 		return false;
+	}
 
 	/**
 	 * Fires before a post is sent to the trash.
@@ -2604,13 +2700,13 @@
 	 */
 	do_action( 'wp_trash_post', $post_id );
 
-	add_post_meta($post_id,'_wp_trash_meta_status', $post['post_status']);
-	add_post_meta($post_id,'_wp_trash_meta_time', time());
+	add_post_meta( $post_id,'_wp_trash_meta_status', $post['post_status'] );
+	add_post_meta( $post_id,'_wp_trash_meta_time', time() );
 
 	$post['post_status'] = 'trash';
 	wp_insert_post( wp_slash( $post ) );
 
-	wp_trash_post_comments($post_id);
+	wp_trash_post_comments( $post_id );
 
 	/**
 	 * Fires after a post is sent to the trash.
@@ -2633,11 +2729,13 @@
  * @return WP_Post|false WP_Post object. False on failure.
  */
 function wp_untrash_post( $post_id = 0 ) {
-	if ( !$post = get_post($post_id, ARRAY_A) )
+	if ( ! $post = get_post( $post_id, ARRAY_A ) ) {
 		return $post;
+	}
 
-	if ( $post['post_status'] != 'trash' )
+	if ( $post['post_status'] != 'trash' ) {
 		return false;
+	}
 
 	/**
 	 * Fires before a post is restored from the trash.
@@ -2648,16 +2746,16 @@
 	 */
 	do_action( 'untrash_post', $post_id );
 
-	$post_status = get_post_meta($post_id, '_wp_trash_meta_status', true);
+	$post_status = get_post_meta( $post_id, '_wp_trash_meta_status', true );
 
 	$post['post_status'] = $post_status;
 
-	delete_post_meta($post_id, '_wp_trash_meta_status');
-	delete_post_meta($post_id, '_wp_trash_meta_time');
+	delete_post_meta( $post_id, '_wp_trash_meta_status' );
+	delete_post_meta( $post_id, '_wp_trash_meta_time' );
 
 	wp_insert_post( wp_slash( $post ) );
 
-	wp_untrash_post_comments($post_id);
+	wp_untrash_post_comments( $post_id );
 
 	/**
 	 * Fires after a post is restored from the trash.
@@ -2684,9 +2782,10 @@
 function wp_trash_post_comments( $post = null ) {
 	global $wpdb;
 
-	$post = get_post($post);
-	if ( empty($post) )
+	$post = get_post( $post );
+	if ( empty( $post ) ) {
 		return;
+	}
 
 	$post_id = $post->ID;
 
@@ -2699,20 +2798,22 @@
 	 */
 	do_action( 'trash_post_comments', $post_id );
 
-	$comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_ID, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id) );
-	if ( empty($comments) )
+	$comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_ID, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) );
+	if ( empty( $comments ) ) {
 		return;
+	}
 
 	// Cache current status for each comment.
 	$statuses = array();
-	foreach ( $comments as $comment )
-		$statuses[$comment->comment_ID] = $comment->comment_approved;
-	add_post_meta($post_id, '_wp_trash_meta_comments_status', $statuses);
+	foreach ( $comments as $comment ) {
+		$statuses[ $comment->comment_ID ] = $comment->comment_approved;
+	}
+	add_post_meta( $post_id, '_wp_trash_meta_comments_status', $statuses );
 
 	// Set status for all comments to post-trashed.
-	$result = $wpdb->update($wpdb->comments, array('comment_approved' => 'post-trashed'), array('comment_post_ID' => $post_id));
+	$result = $wpdb->update( $wpdb->comments, array( 'comment_approved' => 'post-trashed' ), array( 'comment_post_ID' => $post_id ) );
 
-	clean_comment_cache( array_keys($statuses) );
+	clean_comment_cache( array_keys( $statuses ) );
 
 	/**
 	 * Fires after comments are sent to the trash.
@@ -2740,16 +2841,18 @@
 function wp_untrash_post_comments( $post = null ) {
 	global $wpdb;
 
-	$post = get_post($post);
-	if ( empty($post) )
+	$post = get_post( $post );
+	if ( empty( $post ) ) {
 		return;
+	}
 
 	$post_id = $post->ID;
 
-	$statuses = get_post_meta($post_id, '_wp_trash_meta_comments_status', true);
+	$statuses = get_post_meta( $post_id, '_wp_trash_meta_comments_status', true );
 
-	if ( empty($statuses) )
+	if ( empty( $statuses ) ) {
 		return true;
+	}
 
 	/**
 	 * Fires before comments are restored for a post from the trash.
@@ -2762,8 +2865,9 @@
 
 	// Restore each comment to its original status.
 	$group_by_status = array();
-	foreach ( $statuses as $comment_id => $comment_status )
-		$group_by_status[$comment_status][] = $comment_id;
+	foreach ( $statuses as $comment_id => $comment_status ) {
+		$group_by_status[ $comment_status ][] = $comment_id;
+	}
 
 	foreach ( $group_by_status as $status => $comments ) {
 		// Sanity check. This shouldn't happen.
@@ -2774,9 +2878,9 @@
 		$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->comments SET comment_approved = %s WHERE comment_ID IN ($comments_in)", $status ) );
 	}
 
-	clean_comment_cache( array_keys($statuses) );
+	clean_comment_cache( array_keys( $statuses ) );
 
-	delete_post_meta($post_id, '_wp_trash_meta_comments_status');
+	delete_post_meta( $post_id, '_wp_trash_meta_comments_status' );
 
 	/**
 	 * Fires after comments are restored for a post from the trash.
@@ -2810,10 +2914,10 @@
 function wp_get_post_categories( $post_id = 0, $args = array() ) {
 	$post_id = (int) $post_id;
 
-	$defaults = array('fields' => 'ids');
+	$defaults = array( 'fields' => 'ids' );
 	$args = wp_parse_args( $args, $defaults );
 
-	$cats = wp_get_object_terms($post_id, 'category', $args);
+	$cats = wp_get_object_terms( $post_id, 'category', $args );
 	return $cats;
 }
 
@@ -2834,7 +2938,7 @@
  *                        WP_Error object if 'post_tag' taxonomy doesn't exist.
  */
 function wp_get_post_tags( $post_id = 0, $args = array() ) {
-	return wp_get_post_terms( $post_id, 'post_tag', $args);
+	return wp_get_post_terms( $post_id, 'post_tag', $args );
 }
 
 /**
@@ -2857,10 +2961,10 @@
 function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) {
 	$post_id = (int) $post_id;
 
-	$defaults = array('fields' => 'all');
+	$defaults = array( 'fields' => 'all' );
 	$args = wp_parse_args( $args, $defaults );
 
-	$tags = wp_get_object_terms($post_id, $taxonomy, $args);
+	$tags = wp_get_object_terms( $post_id, $taxonomy, $args );
 
 	return $tags;
 }
@@ -2887,12 +2991,18 @@
 
 	// Set default arguments.
 	$defaults = array(
-		'numberposts' => 10, 'offset' => 0,
-		'category' => 0, 'orderby' => 'post_date',
-		'order' => 'DESC', 'include' => '',
-		'exclude' => '', 'meta_key' => '',
-		'meta_value' =>'', 'post_type' => 'post', 'post_status' => 'draft, publish, future, pending, private',
-		'suppress_filters' => true
+		'numberposts' => 10,
+	'offset' => 0,
+		'category' => 0,
+	'orderby' => 'post_date',
+		'order' => 'DESC',
+	'include' => '',
+		'exclude' => '',
+	'meta_key' => '',
+		'meta_value' => '',
+	'post_type' => 'post',
+	'post_status' => 'draft, publish, future, pending, private',
+		'suppress_filters' => true,
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -2900,9 +3010,9 @@
 	$results = get_posts( $r );
 
 	// Backward compatibility. Prior to 3.1 expected posts to be returned in array.
-	if ( ARRAY_A == $output ){
+	if ( ARRAY_A == $output ) {
 		foreach ( $results as $key => $result ) {
-			$results[$key] = get_object_vars( $result );
+			$results[ $key ] = get_object_vars( $result );
 		}
 		return $results ? $results : array();
 	}
@@ -2986,7 +3096,7 @@
 		'comment_status' => '',
 		'ping_status' => '',
 		'post_password' => '',
-		'to_ping' =>  '',
+		'to_ping' => '',
 		'pinged' => '',
 		'post_parent' => 0,
 		'menu_order' => 0,
@@ -2995,11 +3105,11 @@
 		'context' => '',
 	);
 
-	$postarr = wp_parse_args($postarr, $defaults);
+	$postarr = wp_parse_args( $postarr, $defaults );
 
-	unset( $postarr[ 'filter' ] );
+	unset( $postarr['filter'] );
 
-	$postarr = sanitize_post($postarr, 'db');
+	$postarr = sanitize_post( $postarr, 'db' );
 
 	// Are we updating or creating?
 	$post_ID = 0;
@@ -3020,7 +3130,7 @@
 		}
 
 		$guid = get_post_field( 'guid', $post_ID );
-		$previous_status = get_post_field('post_status', $post_ID );
+		$previous_status = get_post_field( 'post_status', $post_ID );
 	} else {
 		$previous_status = 'new';
 	}
@@ -3081,14 +3191,14 @@
 	if ( empty( $post_category ) || 0 == count( $post_category ) || ! is_array( $post_category ) ) {
 		// 'post' requires at least one category.
 		if ( 'post' == $post_type && 'auto-draft' != $post_status ) {
-			$post_category = array( get_option('default_category') );
+			$post_category = array( get_option( 'default_category' ) );
 		} else {
 			$post_category = array();
 		}
 	}
 
 	// Don't allow contributors to set the post slug for pending review posts.
-	if ( 'pending' == $post_status && !current_user_can( 'publish_posts' ) ) {
+	if ( 'pending' == $post_status && ! current_user_can( 'publish_posts' ) ) {
 		$post_name = '';
 	}
 
@@ -3096,9 +3206,9 @@
 	 * Create a valid post name. Drafts and pending posts are allowed to have
 	 * an empty post name.
 	 */
-	if ( empty($post_name) ) {
-		if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) {
-			$post_name = sanitize_title($post_title);
+	if ( empty( $post_name ) ) {
+		if ( ! in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) {
+			$post_name = sanitize_title( $post_title );
 		} else {
 			$post_name = '';
 		}
@@ -3108,7 +3218,7 @@
 		if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID ) == $check_name ) {
 			$post_name = $check_name;
 		} else { // new post, or slug has changed.
-			$post_name = sanitize_title($post_name);
+			$post_name = sanitize_title( $post_name );
 		}
 	}
 
@@ -3159,13 +3269,13 @@
 
 	if ( 'attachment' !== $post_type ) {
 		if ( 'publish' == $post_status ) {
-			$now = gmdate('Y-m-d H:i:59');
-			if ( mysql2date('U', $post_date_gmt, false) > mysql2date('U', $now, false) ) {
+			$now = gmdate( 'Y-m-d H:i:59' );
+			if ( mysql2date( 'U', $post_date_gmt, false ) > mysql2date( 'U', $now, false ) ) {
 				$post_status = 'future';
 			}
 		} elseif ( 'future' == $post_status ) {
-			$now = gmdate('Y-m-d H:i:59');
-			if ( mysql2date('U', $post_date_gmt, false) <= mysql2date('U', $now, false) ) {
+			$now = gmdate( 'Y-m-d H:i:59' );
+			if ( mysql2date( 'U', $post_date_gmt, false ) <= mysql2date( 'U', $now, false ) ) {
 				$post_status = 'publish';
 			}
 		}
@@ -3300,7 +3410,7 @@
 		do_action( 'pre_post_update', $post_ID, $data );
 		if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {
 			if ( $wp_error ) {
-				return new WP_Error('db_update_error', __('Could not update post in the database'), $wpdb->last_error);
+				return new WP_Error( 'db_update_error', __( 'Could not update post in the database' ), $wpdb->last_error );
 			} else {
 				return 0;
 			}
@@ -3309,13 +3419,13 @@
 		// If there is a suggested ID, use it if not already present.
 		if ( ! empty( $import_id ) ) {
 			$import_id = (int) $import_id;
-			if ( ! $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE ID = %d", $import_id) ) ) {
+			if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE ID = %d", $import_id ) ) ) {
 				$data['ID'] = $import_id;
 			}
 		}
 		if ( false === $wpdb->insert( $wpdb->posts, $data ) ) {
 			if ( $wp_error ) {
-				return new WP_Error('db_insert_error', __('Could not insert post into the database'), $wpdb->last_error);
+				return new WP_Error( 'db_insert_error', __( 'Could not insert post into the database' ), $wpdb->last_error );
 			} else {
 				return 0;
 			}
@@ -3324,7 +3434,7 @@
 
 		// Use the newly generated $post_ID.
 		$where = array( 'ID' => $post_ID );
-	}
+	}// End if().
 
 	if ( empty( $data['post_name'] ) && ! in_array( $data['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) ) {
 		$data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'], $post_ID ), $post_ID, $data['post_status'], $post_type, $post_parent );
@@ -3343,7 +3453,7 @@
 	// New-style support for all custom taxonomies.
 	if ( ! empty( $postarr['tax_input'] ) ) {
 		foreach ( $postarr['tax_input'] as $taxonomy => $tags ) {
-			$taxonomy_obj = get_taxonomy($taxonomy);
+			$taxonomy_obj = get_taxonomy( $taxonomy );
 			if ( ! $taxonomy_obj ) {
 				/* translators: %s: taxonomy name */
 				_doing_it_wrong( __FUNCTION__, sprintf( __( 'Invalid taxonomy: %s.' ), $taxonomy ), '4.4.0' );
@@ -3352,7 +3462,7 @@
 
 			// array = hierarchical, string = non-hierarchical.
 			if ( is_array( $tags ) ) {
-				$tags = array_filter($tags);
+				$tags = array_filter( $tags );
 			}
 			if ( current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
 				wp_set_post_terms( $post_ID, $tags, $taxonomy );
@@ -3458,7 +3568,7 @@
 		}
 
 		return $post_ID;
-	}
+	}// End if().
 
 	if ( $update ) {
 		/**
@@ -3470,7 +3580,7 @@
 		 * @param WP_Post $post    Post object.
 		 */
 		do_action( 'edit_post', $post_ID, $post );
-		$post_after = get_post($post_ID);
+		$post_after = get_post( $post_ID );
 
 		/**
 		 * Fires once an existing post has been updated.
@@ -3481,7 +3591,7 @@
 		 * @param WP_Post $post_after   Post object following the update.
 		 * @param WP_Post $post_before  Post object before the update.
 		 */
-		do_action( 'post_updated', $post_ID, $post_after, $post_before);
+		do_action( 'post_updated', $post_ID, $post_after, $post_before );
 	}
 
 	/**
@@ -3537,48 +3647,50 @@
  * @return int|WP_Error The value 0 or WP_Error on failure. The post ID on success.
  */
 function wp_update_post( $postarr = array(), $wp_error = false ) {
-	if ( is_object($postarr) ) {
+	if ( is_object( $postarr ) ) {
 		// Non-escaped post was passed.
-		$postarr = get_object_vars($postarr);
-		$postarr = wp_slash($postarr);
+		$postarr = get_object_vars( $postarr );
+		$postarr = wp_slash( $postarr );
 	}
 
 	// First, get all of the original fields.
-	$post = get_post($postarr['ID'], ARRAY_A);
+	$post = get_post( $postarr['ID'], ARRAY_A );
 
 	if ( is_null( $post ) ) {
-		if ( $wp_error )
+		if ( $wp_error ) {
 			return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) );
+		}
 		return 0;
 	}
 
 	// Escape data pulled from DB.
-	$post = wp_slash($post);
+	$post = wp_slash( $post );
 
 	// Passed post category list overwrites existing category list if not empty.
-	if ( isset($postarr['post_category']) && is_array($postarr['post_category'])
-			 && 0 != count($postarr['post_category']) )
+	if ( isset( $postarr['post_category'] ) && is_array( $postarr['post_category'] )
+			 && 0 != count( $postarr['post_category'] ) ) {
 		$post_cats = $postarr['post_category'];
-	else
-		$post_cats = $post['post_category'];
+	} else { $post_cats = $post['post_category'];
+	}
 
 	// Drafts shouldn't be assigned a date unless explicitly done so by the user.
-	if ( isset( $post['post_status'] ) && in_array($post['post_status'], array('draft', 'pending', 'auto-draft')) && empty($postarr['edit_date']) &&
-			 ('0000-00-00 00:00:00' == $post['post_date_gmt']) )
+	if ( isset( $post['post_status'] ) && in_array( $post['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) && empty( $postarr['edit_date'] ) &&
+			 ('0000-00-00 00:00:00' == $post['post_date_gmt']) ) {
 		$clear_date = true;
-	else
-		$clear_date = false;
+	} else { $clear_date = false;
+	}
 
 	// Merge old and new fields with new fields overwriting old ones.
-	$postarr = array_merge($post, $postarr);
+	$postarr = array_merge( $post, $postarr );
 	$postarr['post_category'] = $post_cats;
 	if ( $clear_date ) {
-		$postarr['post_date'] = current_time('mysql');
+		$postarr['post_date'] = current_time( 'mysql' );
 		$postarr['post_date_gmt'] = '';
 	}
 
-	if ($postarr['post_type'] == 'attachment')
-		return wp_insert_attachment($postarr);
+	if ( $postarr['post_type'] == 'attachment' ) {
+		return wp_insert_attachment( $postarr );
+	}
 
 	return wp_insert_post( $postarr, $wp_error );
 }
@@ -3595,11 +3707,13 @@
 function wp_publish_post( $post ) {
 	global $wpdb;
 
-	if ( ! $post = get_post( $post ) )
+	if ( ! $post = get_post( $post ) ) {
 		return;
+	}
 
-	if ( 'publish' == $post->post_status )
+	if ( 'publish' == $post->post_status ) {
 		return;
+	}
 
 	$wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $post->ID ) );
 
@@ -3633,13 +3747,15 @@
  * @param int|WP_Post $post_id Post ID or post object.
  */
 function check_and_publish_future_post( $post_id ) {
-	$post = get_post($post_id);
+	$post = get_post( $post_id );
 
-	if ( empty($post) )
+	if ( empty( $post ) ) {
 		return;
+	}
 
-	if ( 'future' != $post->post_status )
+	if ( 'future' != $post->post_status ) {
 		return;
+	}
 
 	$time = strtotime( $post->post_date_gmt . ' GMT' );
 
@@ -3670,16 +3786,18 @@
  * @return string Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)
  */
 function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) {
-	if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) || ( 'inherit' == $post_status && 'revision' == $post_type ) )
+	if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) || ( 'inherit' == $post_status && 'revision' == $post_type ) ) {
 		return $slug;
+	}
 
 	global $wpdb, $wp_rewrite;
 
 	$original_slug = $slug;
 
 	$feeds = $wp_rewrite->feeds;
-	if ( ! is_array( $feeds ) )
+	if ( ! is_array( $feeds ) ) {
 		$feeds = array();
+	}
 
 	if ( 'attachment' == $post_type ) {
 		// Attachment slugs must be unique across all types.
@@ -3704,8 +3822,9 @@
 			$slug = $alt_post_name;
 		}
 	} elseif ( is_post_type_hierarchical( $post_type ) ) {
-		if ( 'nav_menu_item' == $post_type )
+		if ( 'nav_menu_item' == $post_type ) {
 			return $slug;
+		}
 
 		/*
 		 * Page slugs must be unique within their own trees. Pages are in a separate
@@ -3778,7 +3897,7 @@
 			} while ( $post_name_check );
 			$slug = $alt_post_name;
 		}
-	}
+	}// End if().
 
 	/**
 	 * Filters the unique post slug.
@@ -3810,10 +3929,10 @@
 function _truncate_post_slug( $slug, $length = 200 ) {
 	if ( strlen( $slug ) > $length ) {
 		$decoded_slug = urldecode( $slug );
-		if ( $decoded_slug === $slug )
+		if ( $decoded_slug === $slug ) {
 			$slug = substr( $slug, 0, $length );
-		else
-			$slug = utf8_uri_encode( $decoded_slug, $length );
+		} else { $slug = utf8_uri_encode( $decoded_slug, $length );
+		}
 	}
 
 	return rtrim( $slug, '-' );
@@ -3832,7 +3951,7 @@
  * @return array|false|WP_Error Array of affected term IDs. WP_Error or false on failure.
  */
 function wp_add_post_tags( $post_id = 0, $tags = '' ) {
-	return wp_set_post_tags($post_id, $tags, true);
+	return wp_set_post_tags( $post_id, $tags, true );
 }
 
 /**
@@ -3850,7 +3969,7 @@
  * @return array|false|WP_Error Array of term taxonomy IDs of affected terms. WP_Error or false on failure.
  */
 function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) {
-	return wp_set_post_terms( $post_id, $tags, 'post_tag', $append);
+	return wp_set_post_terms( $post_id, $tags, 'post_tag', $append );
 }
 
 /**
@@ -3871,16 +3990,19 @@
 function wp_set_post_terms( $post_id = 0, $tags = '', $taxonomy = 'post_tag', $append = false ) {
 	$post_id = (int) $post_id;
 
-	if ( !$post_id )
+	if ( ! $post_id ) {
 		return false;
+	}
 
-	if ( empty($tags) )
+	if ( empty( $tags ) ) {
 		$tags = array();
+	}
 
 	if ( ! is_array( $tags ) ) {
 		$comma = _x( ',', 'tag delimiter' );
-		if ( ',' !== $comma )
+		if ( ',' !== $comma ) {
 			$tags = str_replace( $comma, ',', $tags );
+		}
 		$tags = explode( ',', trim( $tags, " \n\t\r\0\x0B," ) );
 	}
 
@@ -3919,7 +4041,7 @@
 	$post_categories = (array) $post_categories;
 	if ( empty( $post_categories ) ) {
 		if ( 'post' == $post_type && 'auto-draft' != $post_status ) {
-			$post_categories = array( get_option('default_category') );
+			$post_categories = array( get_option( 'default_category' ) );
 			$append = false;
 		} else {
 			$post_categories = array();
@@ -4028,11 +4150,10 @@
 
 	if ( is_array( $uri ) ) {
 		$pung = array_merge( $pung, $uri );
-	}
-	else {
+	} else {
 		$pung[] = $uri;
 	}
-	$new = implode("\n", $pung);
+	$new = implode( "\n", $pung );
 
 	/**
 	 * Filters the new ping URL to add for the given post.
@@ -4059,15 +4180,17 @@
 function get_enclosed( $post_id ) {
 	$custom_fields = get_post_custom( $post_id );
 	$pung = array();
-	if ( !is_array( $custom_fields ) )
+	if ( ! is_array( $custom_fields ) ) {
 		return $pung;
+	}
 
 	foreach ( $custom_fields as $key => $val ) {
-		if ( 'enclosure' != $key || !is_array( $val ) )
+		if ( 'enclosure' != $key || ! is_array( $val ) ) {
 			continue;
+		}
 		foreach ( $val as $enc ) {
 			$enclosure = explode( "\n", $enc );
-			$pung[] = trim( $enclosure[ 0 ] );
+			$pung[] = trim( $enclosure[0] );
 		}
 	}
 
@@ -4128,7 +4251,7 @@
 	}
 
 	$to_ping = sanitize_trackback_urls( $post->to_ping );
-	$to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
+	$to_ping = preg_split( '/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY );
 
 	/**
 	 * Filters the list of URLs yet to ping for the given post.
@@ -4184,10 +4307,10 @@
 function get_all_page_ids() {
 	global $wpdb;
 
-	$page_ids = wp_cache_get('all_page_ids', 'posts');
+	$page_ids = wp_cache_get( 'all_page_ids', 'posts' );
 	if ( ! is_array( $page_ids ) ) {
-		$page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'page'");
-		wp_cache_add('all_page_ids', $page_ids, 'posts');
+		$page_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type = 'page'" );
+		wp_cache_add( 'all_page_ids', $page_ids, 'posts' );
 	}
 
 	return $page_ids;
@@ -4208,7 +4331,7 @@
  *                       'edit', 'db', 'display'. Default 'raw'.
  * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
  */
-function get_page( $page, $output = OBJECT, $filter = 'raw') {
+function get_page( $page, $output = OBJECT, $filter = 'raw' ) {
 	return get_post( $page, $output, $filter );
 }
 
@@ -4242,9 +4365,9 @@
 		}
 	}
 
-	$page_path = rawurlencode(urldecode($page_path));
-	$page_path = str_replace('%2F', '/', $page_path);
-	$page_path = str_replace('%20', ' ', $page_path);
+	$page_path = rawurlencode( urldecode( $page_path ) );
+	$page_path = str_replace( '%2F', '/', $page_path );
+	$page_path = str_replace( '%20', ' ', $page_path );
 	$parts = explode( '/', trim( $page_path, '/' ) );
 	$parts = esc_sql( $parts );
 	$parts = array_map( 'sanitize_title_for_query', $parts );
@@ -4283,15 +4406,17 @@
 			while ( $p->post_parent != 0 && isset( $pages[ $p->post_parent ] ) ) {
 				$count++;
 				$parent = $pages[ $p->post_parent ];
-				if ( ! isset( $revparts[ $count ] ) || $parent->post_name != $revparts[ $count ] )
+				if ( ! isset( $revparts[ $count ] ) || $parent->post_name != $revparts[ $count ] ) {
 					break;
+				}
 				$p = $parent;
 			}
 
-			if ( $p->post_parent == 0 && $count+1 == count( $revparts ) && $p->post_name == $revparts[ $count ] ) {
+			if ( $p->post_parent == 0 && $count + 1 == count( $revparts ) && $p->post_name == $revparts[ $count ] ) {
 				$foundid = $page->ID;
-				if ( $page->post_type == $post_type )
+				if ( $page->post_type == $post_type ) {
 					break;
+				}
 			}
 		}
 	}
@@ -4427,9 +4552,9 @@
  * @param array $children  Parent-children relations, passed by reference.
  * @param array $result    Result, passed by reference.
  */
-function _page_traverse_name( $page_id, &$children, &$result ){
-	if ( isset( $children[ $page_id ] ) ){
-		foreach ( (array)$children[ $page_id ] as $child ) {
+function _page_traverse_name( $page_id, &$children, &$result ) {
+	if ( isset( $children[ $page_id ] ) ) {
+		foreach ( (array) $children[ $page_id ] as $child ) {
 			$result[ $child->ID ] = $child->post_name;
 			_page_traverse_name( $child->ID, $children, $result );
 		}
@@ -4452,8 +4577,9 @@
 		$page = get_post( $page );
 	}
 
-	if ( ! $page )
+	if ( ! $page ) {
 		return false;
+	}
 
 	$uri = $page->post_name;
 
@@ -4591,7 +4717,7 @@
 		$hierarchical = false;
 		$incpages = wp_parse_id_list( $r['include'] );
 		if ( ! empty( $incpages ) ) {
-			$inclusions = ' AND ID IN (' . implode( ',', $incpages ) .  ')';
+			$inclusions = ' AND ID IN (' . implode( ',', $incpages ) . ')';
 		}
 	}
 
@@ -4599,7 +4725,7 @@
 	if ( ! empty( $exclude ) ) {
 		$expages = wp_parse_id_list( $exclude );
 		if ( ! empty( $expages ) ) {
-			$exclusions = ' AND ID NOT IN (' . implode( ',', $expages ) .  ')';
+			$exclusions = ' AND ID NOT IN (' . implode( ',', $expages ) . ')';
 		}
 	}
 
@@ -4610,8 +4736,8 @@
 		if ( ! empty( $post_authors ) ) {
 			foreach ( $post_authors as $post_author ) {
 				//Do we have an author id or an author login?
-				if ( 0 == intval($post_author) ) {
-					$post_author = get_user_by('login', $post_author);
+				if ( 0 == intval( $post_author ) ) {
+					$post_author = get_user_by( 'login', $post_author );
 					if ( empty( $post_author ) ) {
 						continue;
 					}
@@ -4622,9 +4748,9 @@
 				}
 
 				if ( '' == $author_query ) {
-					$author_query = $wpdb->prepare(' post_author = %d ', $post_author);
+					$author_query = $wpdb->prepare( ' post_author = %d ', $post_author );
 				} else {
-					$author_query .= $wpdb->prepare(' OR post_author = %d ', $post_author);
+					$author_query .= $wpdb->prepare( ' OR post_author = %d ', $post_author );
 				}
 			}
 			if ( '' != $author_query ) {
@@ -4639,15 +4765,14 @@
 		$join = " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )";
 
 		// meta_key and meta_value might be slashed
-		$meta_key = wp_unslash($meta_key);
-		$meta_value = wp_unslash($meta_value);
+		$meta_key = wp_unslash( $meta_key );
+		$meta_value = wp_unslash( $meta_value );
 		if ( '' !== $meta_key ) {
-			$where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_key = %s", $meta_key);
+			$where .= $wpdb->prepare( " AND $wpdb->postmeta.meta_key = %s", $meta_key );
 		}
 		if ( '' !== $meta_value ) {
-			$where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_value = %s", $meta_value);
+			$where .= $wpdb->prepare( " AND $wpdb->postmeta.meta_value = %s", $meta_value );
 		}
-
 	}
 
 	if ( is_array( $parent ) ) {
@@ -4656,20 +4781,37 @@
 			$where .= " AND post_parent IN ($post_parent__in)";
 		}
 	} elseif ( $parent >= 0 ) {
-		$where .= $wpdb->prepare(' AND post_parent = %d ', $parent);
+		$where .= $wpdb->prepare( ' AND post_parent = %d ', $parent );
 	}
 
 	if ( 1 == count( $post_status ) ) {
-		$where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $r['post_type'], reset( $post_status ) );
+		$where_post_type = $wpdb->prepare( 'post_type = %s AND post_status = %s', $r['post_type'], reset( $post_status ) );
 	} else {
 		$post_status = implode( "', '", $post_status );
 		$where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $r['post_type'] );
 	}
 
 	$orderby_array = array();
-	$allowed_keys = array( 'author', 'post_author', 'date', 'post_date', 'title', 'post_title', 'name', 'post_name', 'modified',
-		'post_modified', 'modified_gmt', 'post_modified_gmt', 'menu_order', 'parent', 'post_parent',
-		'ID', 'rand', 'comment_count' );
+	$allowed_keys = array(
+	'author',
+	'post_author',
+	'date',
+	'post_date',
+	'title',
+	'post_title',
+	'name',
+	'post_name',
+	'modified',
+		'post_modified',
+	'modified_gmt',
+	'post_modified_gmt',
+	'menu_order',
+	'parent',
+	'post_parent',
+		'ID',
+	'rand',
+	'comment_count',
+	);
 
 	foreach ( explode( ',', $r['sort_column'] ) as $orderby ) {
 		$orderby = trim( $orderby );
@@ -4709,31 +4851,31 @@
 
 	$query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where ";
 	$query .= $author_query;
-	$query .= " ORDER BY " . $sort_column . " " . $sort_order ;
+	$query .= ' ORDER BY ' . $sort_column . ' ' . $sort_order ;
 
 	if ( ! empty( $number ) ) {
 		$query .= ' LIMIT ' . $offset . ',' . $number;
 	}
 
-	$pages = $wpdb->get_results($query);
+	$pages = $wpdb->get_results( $query );
 
-	if ( empty($pages) ) {
+	if ( empty( $pages ) ) {
 		/** This filter is documented in wp-includes/post.php */
 		$pages = apply_filters( 'get_pages', array(), $r );
 		return $pages;
 	}
 
 	// Sanitize before caching so it'll only get done once.
-	$num_pages = count($pages);
-	for ($i = 0; $i < $num_pages; $i++) {
-		$pages[$i] = sanitize_post($pages[$i], 'raw');
+	$num_pages = count( $pages );
+	for ( $i = 0; $i < $num_pages; $i++ ) {
+		$pages[ $i ] = sanitize_post( $pages[ $i ], 'raw' );
 	}
 
 	// Update cache.
 	update_post_cache( $pages );
 
 	if ( $child_of || $hierarchical ) {
-		$pages = get_page_children($child_of, $pages);
+		$pages = get_page_children( $child_of, $pages );
 	}
 
 	if ( ! empty( $r['exclude_tree'] ) ) {
@@ -4747,8 +4889,8 @@
 
 		$num_pages = count( $pages );
 		for ( $i = 0; $i < $num_pages; $i++ ) {
-			if ( in_array( $pages[$i]->ID, $exclude ) ) {
-				unset( $pages[$i] );
+			if ( in_array( $pages[ $i ]->ID, $exclude ) ) {
+				unset( $pages[ $i ] );
 			}
 		}
 	}
@@ -4786,15 +4928,18 @@
  * @param string $url URL to check
  * @return bool True on success, false on failure.
  */
-function is_local_attachment($url) {
-	if (strpos($url, home_url()) === false)
+function is_local_attachment( $url ) {
+	if ( strpos( $url, home_url() ) === false ) {
 		return false;
-	if (strpos($url, home_url('/?attachment_id=')) !== false)
+	}
+	if ( strpos( $url, home_url( '/?attachment_id=' ) ) !== false ) {
 		return true;
-	if ( $id = url_to_postid($url) ) {
-		$post = get_post($id);
-		if ( 'attachment' == $post->post_type )
+	}
+	if ( $id = url_to_postid( $url ) ) {
+		$post = get_post( $id );
+		if ( 'attachment' == $post->post_type ) {
 			return true;
+		}
 	}
 	return false;
 }
@@ -4827,7 +4972,7 @@
 function wp_insert_attachment( $args, $file = false, $parent = 0, $wp_error = false ) {
 	$defaults = array(
 		'file'        => $file,
-		'post_parent' => 0
+		'post_parent' => 0,
 	);
 
 	$data = wp_parse_args( $args, $defaults );
@@ -4863,24 +5008,28 @@
 function wp_delete_attachment( $post_id, $force_delete = false ) {
 	global $wpdb;
 
-	if ( !$post = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $post_id) ) )
+	if ( ! $post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", $post_id ) ) ) {
 		return $post;
+	}
 
-	if ( 'attachment' != $post->post_type )
+	if ( 'attachment' != $post->post_type ) {
 		return false;
+	}
 
-	if ( !$force_delete && EMPTY_TRASH_DAYS && MEDIA_TRASH && 'trash' != $post->post_status )
+	if ( ! $force_delete && EMPTY_TRASH_DAYS && MEDIA_TRASH && 'trash' != $post->post_status ) {
 		return wp_trash_post( $post_id );
+	}
 
-	delete_post_meta($post_id, '_wp_trash_meta_status');
-	delete_post_meta($post_id, '_wp_trash_meta_time');
+	delete_post_meta( $post_id, '_wp_trash_meta_status' );
+	delete_post_meta( $post_id, '_wp_trash_meta_time' );
 
 	$meta = wp_get_attachment_metadata( $post_id );
 	$backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true );
 	$file = get_attached_file( $post_id );
 
-	if ( is_multisite() )
+	if ( is_multisite() ) {
 		delete_transient( 'dirsize_cache' );
+	}
 
 	/**
 	 * Fires before an attachment is deleted, at the start of wp_delete_attachment().
@@ -4891,24 +5040,25 @@
 	 */
 	do_action( 'delete_attachment', $post_id );
 
-	wp_delete_object_term_relationships($post_id, array('category', 'post_tag'));
-	wp_delete_object_term_relationships($post_id, get_object_taxonomies($post->post_type));
+	wp_delete_object_term_relationships( $post_id, array( 'category', 'post_tag' ) );
+	wp_delete_object_term_relationships( $post_id, get_object_taxonomies( $post->post_type ) );
 
 	// Delete all for any posts.
 	delete_metadata( 'post', null, '_thumbnail_id', $post_id, true );
 
 	wp_defer_comment_counting( true );
 
-	$comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ));
+	$comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) );
 	foreach ( $comment_ids as $comment_id ) {
 		wp_delete_comment( $comment_id, true );
 	}
 
 	wp_defer_comment_counting( false );
 
-	$post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $post_id ));
-	foreach ( $post_meta_ids as $mid )
+	$post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $post_id ) );
+	foreach ( $post_meta_ids as $mid ) {
 		delete_metadata_by_mid( 'post', $mid );
+	}
 
 	/** This action is documented in wp-includes/post.php */
 	do_action( 'delete_post', $post_id );
@@ -4921,13 +5071,13 @@
 
 	$uploadpath = wp_get_upload_dir();
 
-	if ( ! empty($meta['thumb']) ) {
+	if ( ! empty( $meta['thumb'] ) ) {
 		// Don't delete the thumb if another attachment uses it.
-		if (! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $wpdb->esc_like( $meta['thumb'] ) . '%', $post_id)) ) {
-			$thumbfile = str_replace(basename($file), $meta['thumb'], $file);
+		if ( ! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $wpdb->esc_like( $meta['thumb'] ) . '%', $post_id ) ) ) {
+			$thumbfile = str_replace( basename( $file ), $meta['thumb'], $file );
 			/** This filter is documented in wp-includes/functions.php */
 			$thumbfile = apply_filters( 'wp_delete_file', $thumbfile );
-			@ unlink( path_join($uploadpath['basedir'], $thumbfile) );
+			@ unlink( path_join( $uploadpath['basedir'], $thumbfile ) );
 		}
 	}
 
@@ -4941,12 +5091,12 @@
 		}
 	}
 
-	if ( is_array($backup_sizes) ) {
+	if ( is_array( $backup_sizes ) ) {
 		foreach ( $backup_sizes as $size ) {
-			$del_file = path_join( dirname($meta['file']), $size['file'] );
+			$del_file = path_join( dirname( $meta['file'] ), $size['file'] );
 			/** This filter is documented in wp-includes/functions.php */
 			$del_file = apply_filters( 'wp_delete_file', $del_file );
-			@ unlink( path_join($uploadpath['basedir'], $del_file) );
+			@ unlink( path_join( $uploadpath['basedir'], $del_file ) );
 		}
 	}
 
@@ -4968,13 +5118,15 @@
  */
 function wp_get_attachment_metadata( $post_id = 0, $unfiltered = false ) {
 	$post_id = (int) $post_id;
-	if ( !$post = get_post( $post_id ) )
+	if ( ! $post = get_post( $post_id ) ) {
 		return false;
+	}
 
 	$data = get_post_meta( $post->ID, '_wp_attachment_metadata', true );
 
-	if ( $unfiltered )
+	if ( $unfiltered ) {
 		return $data;
+	}
 
 	/**
 	 * Filters the attachment meta data.
@@ -4999,8 +5151,9 @@
  */
 function wp_update_attachment_metadata( $post_id, $data ) {
 	$post_id = (int) $post_id;
-	if ( !$post = get_post( $post_id ) )
+	if ( ! $post = get_post( $post_id ) ) {
 		return false;
+	}
 
 	/**
 	 * Filters the updated attachment meta data.
@@ -5010,10 +5163,10 @@
 	 * @param array $data    Array of updated attachment meta data.
 	 * @param int   $post_id Attachment ID.
 	 */
-	if ( $data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID ) )
+	if ( $data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID ) ) {
 		return update_post_meta( $post->ID, '_wp_attachment_metadata', $data );
-	else
-		return delete_post_meta( $post->ID, '_wp_attachment_metadata' );
+	} else { return delete_post_meta( $post->ID, '_wp_attachment_metadata' );
+	}
 }
 
 /**
@@ -5028,11 +5181,13 @@
  */
 function wp_get_attachment_url( $post_id = 0 ) {
 	$post_id = (int) $post_id;
-	if ( !$post = get_post( $post_id ) )
+	if ( ! $post = get_post( $post_id ) ) {
 		return false;
+	}
 
-	if ( 'attachment' != $post->post_type )
+	if ( 'attachment' != $post->post_type ) {
 		return false;
+	}
 
 	$url = '';
 	// Get attached file.
@@ -5042,8 +5197,8 @@
 			// Check that the upload base exists in the file location.
 			if ( 0 === strpos( $file, $uploads['basedir'] ) ) {
 				// Replace file location with url location.
-				$url = str_replace($uploads['basedir'], $uploads['baseurl'], $file);
-			} elseif ( false !== strpos($file, 'wp-content/uploads') ) {
+				$url = str_replace( $uploads['basedir'], $uploads['baseurl'], $file );
+			} elseif ( false !== strpos( $file, 'wp-content/uploads' ) ) {
 				// Get the directory name relative to the basedir (back compat for pre-2.7 uploads)
 				$url = trailingslashit( $uploads['baseurl'] . '/' . _wp_get_attachment_relative_path( $file ) ) . basename( $file );
 			} else {
@@ -5057,7 +5212,7 @@
 	 * If any of the above options failed, Fallback on the GUID as used pre-2.7,
 	 * not recommended to rely upon this.
 	 */
-	if ( empty($url) ) {
+	if ( empty( $url ) ) {
 		$url = get_the_guid( $post->ID );
 	}
 
@@ -5076,8 +5231,9 @@
 	 */
 	$url = apply_filters( 'wp_get_attachment_url', $url, $post->ID );
 
-	if ( empty( $url ) )
+	if ( empty( $url ) ) {
 		return false;
+	}
 
 	return $url;
 }
@@ -5123,14 +5279,16 @@
  */
 function wp_get_attachment_thumb_file( $post_id = 0 ) {
 	$post_id = (int) $post_id;
-	if ( !$post = get_post( $post_id ) )
+	if ( ! $post = get_post( $post_id ) ) {
 		return false;
-	if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) )
+	}
+	if ( ! is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) ) {
 		return false;
+	}
 
 	$file = get_attached_file( $post->ID );
 
-	if ( !empty($imagedata['thumb']) && ($thumbfile = str_replace(basename($file), $imagedata['thumb'], $file)) && file_exists($thumbfile) ) {
+	if ( ! empty( $imagedata['thumb'] ) && ($thumbfile = str_replace( basename( $file ), $imagedata['thumb'], $file )) && file_exists( $thumbfile ) ) {
 		/**
 		 * Filters the attachment thumbnail file path.
 		 *
@@ -5154,19 +5312,23 @@
  */
 function wp_get_attachment_thumb_url( $post_id = 0 ) {
 	$post_id = (int) $post_id;
-	if ( !$post = get_post( $post_id ) )
+	if ( ! $post = get_post( $post_id ) ) {
 		return false;
-	if ( !$url = wp_get_attachment_url( $post->ID ) )
+	}
+	if ( ! $url = wp_get_attachment_url( $post->ID ) ) {
 		return false;
+	}
 
 	$sized = image_downsize( $post_id, 'thumbnail' );
-	if ( $sized )
+	if ( $sized ) {
 		return $sized[0];
+	}
 
-	if ( !$thumb = wp_get_attachment_thumb_file( $post->ID ) )
+	if ( ! $thumb = wp_get_attachment_thumb_file( $post->ID ) ) {
 		return false;
+	}
 
-	$url = str_replace(basename($url), basename($thumb), $url);
+	$url = str_replace( basename( $url ), basename( $thumb ), $url );
 
 	/**
 	 * Filters the attachment thumbnail URL.
@@ -5213,17 +5375,17 @@
 	}
 
 	switch ( $type ) {
-	case 'image':
-		$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
+		case 'image':
+			$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
 		return in_array( $ext, $image_exts );
 
-	case 'audio':
+		case 'audio':
 		return in_array( $ext, wp_get_audio_extensions() );
 
-	case 'video':
+		case 'video':
 		return in_array( $ext, wp_get_video_extensions() );
 
-	default:
+		default:
 		return $type === $ext;
 	}
 }
@@ -5251,22 +5413,24 @@
  * @return string|false Icon, false otherwise.
  */
 function wp_mime_type_icon( $mime = 0 ) {
-	if ( !is_numeric($mime) )
-		$icon = wp_cache_get("mime_type_icon_$mime");
+	if ( ! is_numeric( $mime ) ) {
+		$icon = wp_cache_get( "mime_type_icon_$mime" );
+	}
 
 	$post_id = 0;
-	if ( empty($icon) ) {
+	if ( empty( $icon ) ) {
 		$post_mimes = array();
-		if ( is_numeric($mime) ) {
+		if ( is_numeric( $mime ) ) {
 			$mime = (int) $mime;
 			if ( $post = get_post( $mime ) ) {
 				$post_id = (int) $post->ID;
 				$file = get_attached_file( $post_id );
-				$ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $file);
-				if ( !empty($ext) ) {
+				$ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $file );
+				if ( ! empty( $ext ) ) {
 					$post_mimes[] = $ext;
-					if ( $ext_type = wp_ext2type( $ext ) )
+					if ( $ext_type = wp_ext2type( $ext ) ) {
 						$post_mimes[] = $ext_type;
+					}
 				}
 				$mime = $post->post_mime_type;
 			} else {
@@ -5276,9 +5440,9 @@
 			$post_mimes[] = $mime;
 		}
 
-		$icon_files = wp_cache_get('icon_files');
+		$icon_files = wp_cache_get( 'icon_files' );
 
-		if ( !is_array($icon_files) ) {
+		if ( ! is_array( $icon_files ) ) {
 			/**
 			 * Filters the icon directory path.
 			 *
@@ -5309,38 +5473,41 @@
 			while ( $dirs ) {
 				$keys = array_keys( $dirs );
 				$dir = array_shift( $keys );
-				$uri = array_shift($dirs);
-				if ( $dh = opendir($dir) ) {
-					while ( false !== $file = readdir($dh) ) {
-						$file = basename($file);
-						if ( substr($file, 0, 1) == '.' )
+				$uri = array_shift( $dirs );
+				if ( $dh = opendir( $dir ) ) {
+					while ( false !== $file = readdir( $dh ) ) {
+						$file = basename( $file );
+						if ( substr( $file, 0, 1 ) == '.' ) {
 							continue;
-						if ( !in_array(strtolower(substr($file, -4)), array('.png', '.gif', '.jpg') ) ) {
-							if ( is_dir("$dir/$file") )
-								$dirs["$dir/$file"] = "$uri/$file";
+						}
+						if ( ! in_array( strtolower( substr( $file, -4 ) ), array( '.png', '.gif', '.jpg' ) ) ) {
+							if ( is_dir( "$dir/$file" ) ) {
+								$dirs[ "$dir/$file" ] = "$uri/$file";
+							}
 							continue;
 						}
-						$icon_files["$dir/$file"] = "$uri/$file";
+						$icon_files[ "$dir/$file" ] = "$uri/$file";
 					}
-					closedir($dh);
+					closedir( $dh );
 				}
 			}
 			wp_cache_add( 'icon_files', $icon_files, 'default', 600 );
-		}
+		}// End if().
 
 		$types = array();
 		// Icon basename - extension = MIME wildcard.
-		foreach ( $icon_files as $file => $uri )
-			$types[ preg_replace('/^([^.]*).*$/', '$1', basename($file)) ] =& $icon_files[$file];
+		foreach ( $icon_files as $file => $uri ) {
+			$types[ preg_replace( '/^([^.]*).*$/', '$1', basename( $file ) ) ] =& $icon_files[ $file ];
+		}
 
-		if ( ! empty($mime) ) {
-			$post_mimes[] = substr($mime, 0, strpos($mime, '/'));
-			$post_mimes[] = substr($mime, strpos($mime, '/') + 1);
-			$post_mimes[] = str_replace('/', '_', $mime);
+		if ( ! empty( $mime ) ) {
+			$post_mimes[] = substr( $mime, 0, strpos( $mime, '/' ) );
+			$post_mimes[] = substr( $mime, strpos( $mime, '/' ) + 1 );
+			$post_mimes[] = str_replace( '/', '_', $mime );
 		}
 
-		$matches = wp_match_mime_types(array_keys($types), $post_mimes);
-		$matches['default'] = array('default');
+		$matches = wp_match_mime_types( array_keys( $types ), $post_mimes );
+		$matches['default'] = array( 'default' );
 
 		foreach ( $matches as $match => $wilds ) {
 			foreach ( $wilds as $wild ) {
@@ -5355,7 +5522,7 @@
 				break 2;
 			}
 		}
-	}
+	}// End if().
 
 	/**
 	 * Filters the mime type icon.
@@ -5490,18 +5657,18 @@
 					$post_status_sql .= " OR post_status = 'private' AND post_author = $id";
 				} elseif ( $id == (int) $post_author ) {
 					$post_status_sql .= " OR post_status = 'private'";
-				} // else none
-			} // else none
+				} // End if().
+			} // End if().
 		}
 
 		$post_type_clauses[] = "( post_type = '" . $post_type . "' AND ( $post_status_sql ) )";
-	}
+	}// End foreach().
 
 	if ( empty( $post_type_clauses ) ) {
 		return $full ? 'WHERE 1 = 0' : '1 = 0';
 	}
 
-	$sql = '( '. implode( ' OR ', $post_type_clauses ) . ' )';
+	$sql = '( ' . implode( ' OR ', $post_type_clauses ) . ' )';
 
 	if ( null !== $post_author ) {
 		$sql .= $wpdb->prepare( ' AND post_author = %d', $post_author );
@@ -5580,7 +5747,7 @@
 
 	$lastpostmodified = _get_last_post_time( $timezone, 'modified', $post_type );
 
-	$lastpostdate = get_lastpostdate($timezone);
+	$lastpostdate = get_lastpostdate( $timezone );
 	if ( $lastpostdate > $lastpostmodified ) {
 		$lastpostmodified = $lastpostdate;
 	}
@@ -5641,14 +5808,14 @@
 
 	switch ( $timezone ) {
 		case 'gmt':
-			$date = $wpdb->get_var("SELECT post_{$field}_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1");
+			$date = $wpdb->get_var( "SELECT post_{$field}_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1" );
 			break;
 		case 'blog':
-			$date = $wpdb->get_var("SELECT post_{$field} FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1");
+			$date = $wpdb->get_var( "SELECT post_{$field} FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1" );
 			break;
 		case 'server':
 			$add_seconds_server = date( 'Z' );
-			$date = $wpdb->get_var("SELECT DATE_ADD(post_{$field}_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1");
+			$date = $wpdb->get_var( "SELECT DATE_ADD(post_{$field}_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1" );
 			break;
 	}
 
@@ -5669,11 +5836,13 @@
  * @param array $posts Array of post objects, passed by reference.
  */
 function update_post_cache( &$posts ) {
-	if ( ! $posts )
+	if ( ! $posts ) {
 		return;
+	}
 
-	foreach ( $posts as $post )
+	foreach ( $posts as $post ) {
 		wp_cache_add( $post->ID, $post, 'posts' );
+	}
 }
 
 /**
@@ -5694,12 +5863,14 @@
 function clean_post_cache( $post ) {
 	global $_wp_suspend_cache_invalidation;
 
-	if ( ! empty( $_wp_suspend_cache_invalidation ) )
+	if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
 		return;
+	}
 
 	$post = get_post( $post );
-	if ( empty( $post ) )
+	if ( empty( $post ) ) {
 		return;
+	}
 
 	wp_cache_delete( $post->ID, 'posts' );
 	wp_cache_delete( $post->ID, 'post_meta' );
@@ -5746,20 +5917,23 @@
  */
 function update_post_caches( &$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true ) {
 	// No point in doing all this work if we didn't match any posts.
-	if ( !$posts )
+	if ( ! $posts ) {
 		return;
+	}
 
-	update_post_cache($posts);
+	update_post_cache( $posts );
 
 	$post_ids = array();
-	foreach ( $posts as $post )
+	foreach ( $posts as $post ) {
 		$post_ids[] = $post->ID;
+	}
 
-	if ( ! $post_type )
+	if ( ! $post_type ) {
 		$post_type = 'any';
+	}
 
 	if ( $update_term_cache ) {
-		if ( is_array($post_type) ) {
+		if ( is_array( $post_type ) ) {
 			$ptypes = $post_type;
 		} elseif ( 'any' == $post_type ) {
 			$ptypes = array();
@@ -5767,17 +5941,19 @@
 			foreach ( $posts as $post ) {
 				$ptypes[] = $post->post_type;
 			}
-			$ptypes = array_unique($ptypes);
+			$ptypes = array_unique( $ptypes );
 		} else {
-			$ptypes = array($post_type);
+			$ptypes = array( $post_type );
 		}
 
-		if ( ! empty($ptypes) )
-			update_object_term_cache($post_ids, $ptypes);
+		if ( ! empty( $ptypes ) ) {
+			update_object_term_cache( $post_ids, $ptypes );
+		}
 	}
 
-	if ( $update_meta_cache )
-		update_postmeta_cache($post_ids);
+	if ( $update_meta_cache ) {
+		update_postmeta_cache( $post_ids );
+	}
 }
 
 /**
@@ -5794,7 +5970,7 @@
  *                     of metadata.
  */
 function update_postmeta_cache( $post_ids ) {
-	return update_meta_cache('post', $post_ids);
+	return update_meta_cache( 'post', $post_ids );
 }
 
 /**
@@ -5815,16 +5991,18 @@
 function clean_attachment_cache( $id, $clean_terms = false ) {
 	global $_wp_suspend_cache_invalidation;
 
-	if ( !empty($_wp_suspend_cache_invalidation) )
+	if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
 		return;
+	}
 
 	$id = (int) $id;
 
-	wp_cache_delete($id, 'posts');
-	wp_cache_delete($id, 'post_meta');
+	wp_cache_delete( $id, 'posts' );
+	wp_cache_delete( $id, 'post_meta' );
 
-	if ( $clean_terms )
-		clean_object_term_cache($id, 'attachment');
+	if ( $clean_terms ) {
+		clean_object_term_cache( $id, 'attachment' );
+	}
 
 	/**
 	 * Fires after the given attachment's cache is cleaned.
@@ -5858,8 +6036,9 @@
 
 	if ( $old_status != 'publish' && $new_status == 'publish' ) {
 		// Reset GUID if transitioning to publish and it is empty.
-		if ( '' == get_the_guid($post->ID) )
+		if ( '' == get_the_guid( $post->ID ) ) {
 			$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) );
+		}
 
 		/**
 		 * Fires when a post's status is transitioned from private to published.
@@ -5869,11 +6048,11 @@
 		 *
 		 * @param int $post_id Post ID.
 		 */
-		do_action('private_to_published', $post->ID);
+		do_action( 'private_to_published', $post->ID );
 	}
 
 	// If published posts changed clear the lastpostmodified cache.
-	if ( 'publish' == $new_status || 'publish' == $old_status) {
+	if ( 'publish' == $new_status || 'publish' == $old_status ) {
 		foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {
 			wp_cache_delete( "lastpostmodified:$timezone", 'timeinfo' );
 			wp_cache_delete( "lastpostdate:$timezone", 'timeinfo' );
@@ -5887,7 +6066,7 @@
 	}
 
 	// Always clears the hook in case the post status bounced from future to draft.
-	wp_clear_scheduled_hook('publish_future_post', array( $post->ID ) );
+	wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) );
 }
 
 /**
@@ -5905,7 +6084,7 @@
  */
 function _future_post_hook( $deprecated, $post ) {
 	wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) );
-	wp_schedule_single_event( strtotime( get_gmt_from_date( $post->post_date ) . ' GMT') , 'publish_future_post', array( $post->ID ) );
+	wp_schedule_single_event( strtotime( get_gmt_from_date( $post->post_date ) . ' GMT' ) , 'publish_future_post', array( $post->ID ) );
 }
 
 /**
@@ -5930,11 +6109,13 @@
 		do_action( 'xmlrpc_publish_post', $post_id );
 	}
 
-	if ( defined('WP_IMPORTING') )
+	if ( defined( 'WP_IMPORTING' ) ) {
 		return;
+	}
 
-	if ( get_option('default_pingback_flag') )
+	if ( get_option( 'default_pingback_flag' ) ) {
 		add_post_meta( $post_id, '_pingme', '1' );
+	}
 	add_post_meta( $post_id, '_encloseme', '1' );
 
 	if ( ! wp_next_scheduled( 'do_pings' ) ) {
@@ -5953,8 +6134,9 @@
  */
 function wp_get_post_parent_id( $post_ID ) {
 	$post = get_post( $post_ID );
-	if ( !$post || is_wp_error( $post ) )
+	if ( ! $post || is_wp_error( $post ) ) {
 		return false;
+	}
 	return (int) $post->post_parent;
 }
 
@@ -5974,28 +6156,34 @@
  */
 function wp_check_post_hierarchy_for_loops( $post_parent, $post_ID ) {
 	// Nothing fancy here - bail.
-	if ( !$post_parent )
+	if ( ! $post_parent ) {
 		return 0;
+	}
 
 	// New post can't cause a loop.
-	if ( empty( $post_ID ) )
+	if ( empty( $post_ID ) ) {
 		return $post_parent;
+	}
 
 	// Can't be its own parent.
-	if ( $post_parent == $post_ID )
+	if ( $post_parent == $post_ID ) {
 		return 0;
+	}
 
 	// Now look for larger loops.
-	if ( !$loop = wp_find_hierarchy_loop( 'wp_get_post_parent_id', $post_ID, $post_parent ) )
+	if ( ! $loop = wp_find_hierarchy_loop( 'wp_get_post_parent_id', $post_ID, $post_parent ) ) {
 		return $post_parent; // No loop
+	}
 
 	// Setting $post_parent to the given value causes a loop.
-	if ( isset( $loop[$post_ID] ) )
+	if ( isset( $loop[ $post_ID ] ) ) {
 		return 0;
+	}
 
 	// There's a loop, but it doesn't contain $post_ID. Break the loop.
-	foreach ( array_keys( $loop ) as $loop_member )
+	foreach ( array_keys( $loop ) as $loop_member ) {
 		wp_update_post( array( 'ID' => $loop_member, 'post_parent' => 0 ) );
+	}
 
 	return $post_parent;
 }
@@ -6013,10 +6201,10 @@
 	$post = get_post( $post );
 	$thumbnail_id = absint( $thumbnail_id );
 	if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) {
-		if ( wp_get_attachment_image( $thumbnail_id, 'thumbnail' ) )
+		if ( wp_get_attachment_image( $thumbnail_id, 'thumbnail' ) ) {
 			return update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id );
-		else
-			return delete_post_meta( $post->ID, '_thumbnail_id' );
+		} else { return delete_post_meta( $post->ID, '_thumbnail_id' );
+		}
 	}
 	return false;
 }
@@ -6031,8 +6219,9 @@
  */
 function delete_post_thumbnail( $post ) {
 	$post = get_post( $post );
-	if ( $post )
+	if ( $post ) {
 		return delete_post_meta( $post->ID, '_thumbnail_id' );
+	}
 	return false;
 }
 
@@ -6130,8 +6319,8 @@
 	global $wpdb;
 
 	$non_cached_ids = _get_non_cached_ids( $ids, 'posts' );
-	if ( !empty( $non_cached_ids ) ) {
-		$fresh_posts = $wpdb->get_results( sprintf( "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE ID IN (%s)", join( ",", $non_cached_ids ) ) );
+	if ( ! empty( $non_cached_ids ) ) {
+		$fresh_posts = $wpdb->get_results( sprintf( "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE ID IN (%s)", join( ',', $non_cached_ids ) ) );
 
 		update_post_caches( $fresh_posts, 'any', $update_term_cache, $update_meta_cache );
 	}
@@ -6157,7 +6346,7 @@
 		'post_status' => 'trash',
 		'post_type' => 'any',
 		'nopaging' => true,
-		'post__not_in' => array( $post_ID )
+		'post__not_in' => array( $post_ID ),
 	) );
 
 	if ( ! empty( $trashed_posts_with_desired_slug ) ) {
@@ -6219,8 +6408,8 @@
 
 	$clauses['where'] = preg_replace(
 		"/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",
-		"$0 OR ( sq1.meta_value $1 $2 )",
-		$clauses['where'] );
+		'$0 OR ( sq1.meta_value $1 $2 )',
+	$clauses['where'] );
 
 	return $clauses;
 }
Index: src/wp-includes/query.php
===================================================================
--- src/wp-includes/query.php	(revision 40901)
+++ src/wp-includes/query.php	(working copy)
@@ -94,9 +94,9 @@
  * @param array|string $query Array or string of WP_Query arguments.
  * @return array List of post objects.
  */
-function query_posts($query) {
+function query_posts( $query ) {
 	$GLOBALS['wp_query'] = new WP_Query();
-	return $GLOBALS['wp_query']->query($query);
+	return $GLOBALS['wp_query']->query( $query );
 }
 
 /**
@@ -874,18 +874,18 @@
 			return;
 		}
 
-		$query = $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, get_query_var( 'name' ) );
+		$query = $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, get_query_var( 'name' ) );
 
 		// if year, monthnum, or day have been specified, make our query more precise
 		// just in case there are multiple identical _wp_old_slug values
 		if ( get_query_var( 'year' ) ) {
-			$query .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var( 'year' ) );
+			$query .= $wpdb->prepare( ' AND YEAR(post_date) = %d', get_query_var( 'year' ) );
 		}
 		if ( get_query_var( 'monthnum' ) ) {
-			$query .= $wpdb->prepare(" AND MONTH(post_date) = %d", get_query_var( 'monthnum' ) );
+			$query .= $wpdb->prepare( ' AND MONTH(post_date) = %d', get_query_var( 'monthnum' ) );
 		}
 		if ( get_query_var( 'day' ) ) {
-			$query .= $wpdb->prepare(" AND DAYOFMONTH(post_date) = %d", get_query_var( 'day' ) );
+			$query .= $wpdb->prepare( ' AND DAYOFMONTH(post_date) = %d', get_query_var( 'day' ) );
 		}
 
 		$id = (int) $wpdb->get_var( $query );
@@ -898,7 +898,7 @@
 
 		if ( get_query_var( 'paged' ) > 1 ) {
 			$link = user_trailingslashit( trailingslashit( $link ) . 'page/' . get_query_var( 'paged' ) );
-		} elseif( is_embed() ) {
+		} elseif ( is_embed() ) {
 			$link = user_trailingslashit( trailingslashit( $link ) . 'embed' );
 		}
 
@@ -917,7 +917,7 @@
 
 		wp_redirect( $link, 301 ); // Permanent redirect
 		exit;
-	}
+	}// End if().
 }
 
 /**
Index: src/wp-includes/registration-functions.php
===================================================================
--- src/wp-includes/registration-functions.php	(revision 40901)
+++ src/wp-includes/registration-functions.php	(working copy)
@@ -4,4 +4,4 @@
  *
  * @package WordPress
  */
-_deprecated_file( basename(__FILE__), '2.1.0', null, __( 'This file no longer needs to be included.' ) );
+_deprecated_file( basename( __FILE__ ), '2.1.0', null, __( 'This file no longer needs to be included.' ) );
Index: src/wp-includes/registration.php
===================================================================
--- src/wp-includes/registration.php	(revision 40901)
+++ src/wp-includes/registration.php	(working copy)
@@ -4,4 +4,4 @@
  *
  * @package WordPress
  */
-_deprecated_file( basename(__FILE__), '3.1.0', null, __( 'This file no longer needs to be included.' ) );
+_deprecated_file( basename( __FILE__ ), '3.1.0', null, __( 'This file no longer needs to be included.' ) );
Index: src/wp-includes/rest-api/class-wp-rest-response.php
===================================================================
--- src/wp-includes/rest-api/class-wp-rest-response.php	(revision 40901)
+++ src/wp-includes/rest-api/class-wp-rest-response.php	(working copy)
@@ -91,7 +91,9 @@
 		}
 
 		if ( $href ) {
-			$this->links[ $rel ] = wp_list_filter( $this->links[ $rel ], array( 'href' => $href ), 'NOT' );
+			$this->links[ $rel ] = wp_list_filter( $this->links[ $rel ], array(
+				'href' => $href,
+			), 'NOT' );
 		} else {
 			$this->links[ $rel ] = array();
 		}
@@ -246,7 +248,7 @@
 			$data = $this->get_data();
 			$error->add( $data['code'], $data['message'], $data['data'] );
 			if ( ! empty( $data['additional_errors'] ) ) {
-				foreach( $data['additional_errors'] as $err ) {
+				foreach ( $data['additional_errors'] as $err ) {
 					$error->add( $err['code'], $err['message'], $err['data'] );
 				}
 			}
Index: src/wp-includes/rest-api/class-wp-rest-server.php
===================================================================
--- src/wp-includes/rest-api/class-wp-rest-server.php	(revision 40901)
+++ src/wp-includes/rest-api/class-wp-rest-server.php	(working copy)
@@ -592,7 +592,7 @@
 			if ( $has_links ) {
 				$embedded[ $rel ] = $embeds;
 			}
-		}
+		}// End foreach().
 
 		if ( ! empty( $embedded ) ) {
 			$data['_embedded'] = $embedded;
@@ -761,7 +761,7 @@
 					$handler['methods'][ $method ] = true;
 				}
 			}
-		}
+		}// End foreach().
 
 		return $endpoints;
 	}
@@ -966,8 +966,8 @@
 				$response->set_matched_handler( $handler );
 
 				return $response;
-			}
-		}
+			}// End foreach().
+		}// End foreach().
 
 		return $this->error_to_response( new WP_Error( 'rest_no_route', __( 'No route was found matching the URL and request method' ), array( 'status' => 404 ) ) );
 	}
@@ -1209,7 +1209,7 @@
 					'self' => rest_url( $route ),
 				);
 			}
-		}
+		}// End foreach().
 
 		if ( empty( $data['methods'] ) ) {
 			// No methods supported, hide the route.
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php	(revision 40901)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php	(working copy)
@@ -74,7 +74,9 @@
 				'callback' => array( $this, 'get_item' ),
 				'permission_callback' => array( $this, 'get_item_permissions_check' ),
 				'args'     => array(
-					'context'          => $this->get_context_param( array( 'default' => 'view' ) ),
+					'context'          => $this->get_context_param( array(
+						'default' => 'view',
+					) ),
 					'password' => array(
 						'description' => __( 'The password for the parent post of the comment (if the post is password protected).' ),
 						'type'        => 'string',
@@ -640,7 +642,6 @@
 		$response->set_status( 201 );
 		$response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $comment_id ) ) );
 
-
 		return $response;
 	}
 
@@ -970,12 +971,12 @@
 		// Only grab one comment to verify the comment has children.
 		$comment_children = $comment->get_children( array(
 			'number' => 1,
-			'count'  => true
+			'count'  => true,
 		) );
 
 		if ( ! empty( $comment_children ) ) {
 			$args = array(
-				'parent' => $comment->comment_ID
+				'parent' => $comment->comment_ID,
 			);
 
 			$rest_url = add_query_arg( $args, rest_url( $this->namespace . '/' . $this->rest_base ) );
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php	(revision 40901)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php	(working copy)
@@ -52,7 +52,9 @@
 	 * @return WP_Error|bool True if the request has read access, WP_Error object otherwise.
 	 */
 	public function get_items_permissions_check( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -65,7 +67,9 @@
 	 * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
 	 */
 	public function get_items( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -78,7 +82,9 @@
 	 * @return WP_Error|bool True if the request has read access for the item, WP_Error object otherwise.
 	 */
 	public function get_item_permissions_check( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -91,7 +97,9 @@
 	 * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
 	 */
 	public function get_item( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -104,7 +112,9 @@
 	 * @return WP_Error|bool True if the request has access to create items, WP_Error object otherwise.
 	 */
 	public function create_item_permissions_check( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -117,7 +127,9 @@
 	 * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
 	 */
 	public function create_item( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -130,7 +142,9 @@
 	 * @return WP_Error|bool True if the request has access to update the item, WP_Error object otherwise.
 	 */
 	public function update_item_permissions_check( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -143,7 +157,9 @@
 	 * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
 	 */
 	public function update_item( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -156,7 +172,9 @@
 	 * @return WP_Error|bool True if the request has access to delete the item, WP_Error object otherwise.
 	 */
 	public function delete_item_permissions_check( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -169,7 +187,9 @@
 	 * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
 	 */
 	public function delete_item( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -182,7 +202,9 @@
 	 * @return WP_Error|object The prepared item, or WP_Error object on failure.
 	 */
 	protected function prepare_item_for_database( $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -196,7 +218,9 @@
 	 * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
 	 */
 	public function prepare_item_for_response( $item, $request ) {
-		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) );
+		return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
+			'status' => 405,
+		) );
 	}
 
 	/**
@@ -570,12 +594,15 @@
 
 				// Only use required / default from arg_options on CREATABLE endpoints.
 				if ( WP_REST_Server::CREATABLE !== $method ) {
-					$params['arg_options'] = array_diff_key( $params['arg_options'], array( 'required' => '', 'default' => '' ) );
+					$params['arg_options'] = array_diff_key( $params['arg_options'], array(
+						'required' => '',
+						'default' => '',
+					) );
 				}
 
 				$endpoint_args[ $field_id ] = array_merge( $endpoint_args[ $field_id ], $params['arg_options'] );
 			}
-		}
+		}// End foreach().
 
 		return $endpoint_args;
 	}
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php	(revision 40901)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php	(working copy)
@@ -59,7 +59,9 @@
 				'callback'            => array( $this, 'get_item' ),
 				'permission_callback' => array( $this, 'get_item_permissions_check' ),
 				'args'                => array(
-					'context' => $this->get_context_param( array( 'default' => 'view' ) ),
+					'context' => $this->get_context_param( array(
+						'default' => 'view',
+					) ),
 				),
 			),
 			'schema' => array( $this, 'get_public_item_schema' ),
@@ -77,14 +79,18 @@
 	 */
 	public function get_items_permissions_check( $request ) {
 		if ( 'edit' === $request['context'] ) {
-			$types = get_post_types( array( 'show_in_rest' => true ), 'objects' );
+			$types = get_post_types( array(
+				'show_in_rest' => true,
+			), 'objects' );
 
 			foreach ( $types as $type ) {
 				if ( current_user_can( $type->cap->edit_posts ) ) {
 					return true;
 				}
 			}
-			return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		return true;
@@ -101,7 +107,9 @@
 	 */
 	public function get_items( $request ) {
 		$data = array();
-		$statuses = get_post_stati( array( 'internal' => false ), 'object' );
+		$statuses = get_post_stati( array(
+			'internal' => false,
+		), 'object' );
 		$statuses['trash'] = get_post_status_object( 'trash' );
 
 		foreach ( $statuses as $slug => $obj ) {
@@ -131,13 +139,17 @@
 		$status = get_post_status_object( $request['status'] );
 
 		if ( empty( $status ) ) {
-			return new WP_Error( 'rest_status_invalid', __( 'Invalid status.' ), array( 'status' => 404 ) );
+			return new WP_Error( 'rest_status_invalid', __( 'Invalid status.' ), array(
+				'status' => 404,
+			) );
 		}
 
 		$check = $this->check_read_permission( $status );
 
 		if ( ! $check ) {
-			return new WP_Error( 'rest_cannot_read_status', __( 'Cannot view status.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_cannot_read_status', __( 'Cannot view status.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		return true;
@@ -158,7 +170,9 @@
 		}
 
 		if ( false === $status->internal || 'trash' === $status->name ) {
-			$types = get_post_types( array( 'show_in_rest' => true ), 'objects' );
+			$types = get_post_types( array(
+				'show_in_rest' => true,
+			), 'objects' );
 
 			foreach ( $types as $type ) {
 				if ( current_user_can( $type->cap->edit_posts ) ) {
@@ -183,7 +197,9 @@
 		$obj = get_post_status_object( $request['status'] );
 
 		if ( empty( $obj ) ) {
-			return new WP_Error( 'rest_status_invalid', __( 'Invalid status.' ), array( 'status' => 404 ) );
+			return new WP_Error( 'rest_status_invalid', __( 'Invalid status.' ), array(
+				'status' => 404,
+			) );
 		}
 
 		$data = $this->prepare_item_for_response( $obj, $request );
@@ -311,7 +327,9 @@
 	 */
 	public function get_collection_params() {
 		return array(
-			'context' => $this->get_context_param( array( 'default' => 'view' ) ),
+			'context' => $this->get_context_param( array(
+				'default' => 'view',
+			) ),
 		);
 	}
 
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php	(revision 40901)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php	(working copy)
@@ -79,7 +79,9 @@
 
 		$schema = $this->get_item_schema();
 		$get_item_args = array(
-			'context'  => $this->get_context_param( array( 'default' => 'view' ) ),
+			'context'  => $this->get_context_param( array(
+				'default' => 'view',
+			) ),
 		);
 		if ( isset( $schema['properties']['password'] ) ) {
 			$get_item_args['password'] = array(
@@ -810,7 +812,6 @@
 
 		$request->set_param( 'context', 'edit' );
 
-
 		// If we're forcing, then delete permanently.
 		if ( $force ) {
 			$previous = $this->prepare_item_for_response( $post, $request );
@@ -2009,8 +2010,8 @@
 					$schema['properties']['meta'] = $this->meta->get_field_schema();
 					break;
 
-			}
-		}
+			}// End switch().
+		}// End foreach().
 
 		if ( 'post' === $this->post_type ) {
 			$schema['properties']['sticky'] = array(
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php	(revision 40901)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php	(working copy)
@@ -208,7 +208,7 @@
 			} else {
 				update_option( $args['option_name'], $request[ $name ] );
 			}
-		}
+		}// End foreach().
 
 		return $this->get_item( $request );
 	}
@@ -265,7 +265,7 @@
 			}
 
 			$rest_options[ $rest_args['name'] ] = $rest_args;
-		}
+		}// End foreach().
 
 		return $rest_options;
 	}
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php	(revision 40901)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php	(working copy)
@@ -233,7 +233,7 @@
 		 */
 		$prepared_args = apply_filters( "rest_{$this->taxonomy}_query", $prepared_args, $request );
 
-		if ( ! empty( $prepared_args['post'] )  ) {
+		if ( ! empty( $prepared_args['post'] ) ) {
 			$query_result = wp_get_object_terms( $prepared_args['post'], $this->taxonomy, $prepared_args );
 
 			// Used when calling wp_count_terms() below.
@@ -980,7 +980,7 @@
 			'description'       => __( 'Limit result set to terms with one or more specific slugs.' ),
 			'type'              => 'array',
 			'items'             => array(
-				'type'          => 'string'
+				'type'          => 'string',
 			),
 		);
 
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php	(revision 40901)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php	(working copy)
@@ -76,7 +76,9 @@
 				'callback'            => array( $this, 'get_item' ),
 				'permission_callback' => array( $this, 'get_item_permissions_check' ),
 				'args'                => array(
-					'context' => $this->get_context_param( array( 'default' => 'view' ) ),
+					'context' => $this->get_context_param( array(
+						'default' => 'view',
+					) ),
 				),
 			),
 			array(
@@ -111,7 +113,9 @@
 				'methods'             => WP_REST_Server::READABLE,
 				'callback'            => array( $this, 'get_current_item' ),
 				'args'                => array(
-					'context' => $this->get_context_param( array( 'default' => 'view' ) ),
+					'context' => $this->get_context_param( array(
+						'default' => 'view',
+					) ),
 				),
 			),
 			array(
@@ -165,7 +169,9 @@
 			return false;
 		}
 
-		return new WP_Error( 'rest_invalid_param', __( 'Invalid user parameter(s).' ), array( 'status' => 400 ) );
+		return new WP_Error( 'rest_invalid_param', __( 'Invalid user parameter(s).' ), array(
+			'status' => 400,
+		) );
 	}
 
 	/**
@@ -180,15 +186,21 @@
 	public function get_items_permissions_check( $request ) {
 		// Check if roles is specified in GET request and if user can list users.
 		if ( ! empty( $request['roles'] ) && ! current_user_can( 'list_users' ) ) {
-			return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to filter users by role.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to filter users by role.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) {
-			return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to list users.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to list users.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		if ( in_array( $request['orderby'], array( 'email', 'registered_date' ), true ) && ! current_user_can( 'list_users' ) ) {
-			return new WP_Error( 'rest_forbidden_orderby', __( 'Sorry, you are not allowed to order users by this parameter.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_forbidden_orderby', __( 'Sorry, you are not allowed to order users by this parameter.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		return true;
@@ -256,7 +268,9 @@
 		}
 
 		if ( ! current_user_can( 'list_users' ) ) {
-			$prepared_args['has_published_posts'] = get_post_types( array( 'show_in_rest' => true ), 'names' );
+			$prepared_args['has_published_posts'] = get_post_types( array(
+				'show_in_rest' => true,
+			), 'names' );
 		}
 
 		if ( ! empty( $prepared_args['search'] ) ) {
@@ -336,7 +350,9 @@
 	 * @return WP_User|WP_Error True if ID is valid, WP_Error otherwise.
 	 */
 	protected function get_user( $id ) {
-		$error = new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.' ), array( 'status' => 404 ) );
+		$error = new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.' ), array(
+			'status' => 404,
+		) );
 		if ( (int) $id <= 0 ) {
 			return $error;
 		}
@@ -368,16 +384,22 @@
 			return $user;
 		}
 
-		$types = get_post_types( array( 'show_in_rest' => true ), 'names' );
+		$types = get_post_types( array(
+			'show_in_rest' => true,
+		), 'names' );
 
 		if ( get_current_user_id() === $user->ID ) {
 			return true;
 		}
 
 		if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) {
-			return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to list users.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to list users.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		} elseif ( ! count_user_posts( $user->ID, $types ) && ! current_user_can( 'edit_user', $user->ID ) && ! current_user_can( 'list_users' ) ) {
-			return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to list users.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to list users.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		return true;
@@ -417,14 +439,15 @@
 		$current_user_id = get_current_user_id();
 
 		if ( empty( $current_user_id ) ) {
-			return new WP_Error( 'rest_not_logged_in', __( 'You are not currently logged in.' ), array( 'status' => 401 ) );
+			return new WP_Error( 'rest_not_logged_in', __( 'You are not currently logged in.' ), array(
+				'status' => 401,
+			) );
 		}
 
 		$user     = wp_get_current_user();
 		$response = $this->prepare_item_for_response( $user, $request );
 		$response = rest_ensure_response( $response );
 
-
 		return $response;
 	}
 
@@ -440,7 +463,9 @@
 	public function create_item_permissions_check( $request ) {
 
 		if ( ! current_user_can( 'create_users' ) ) {
-			return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create new users.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create new users.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		return true;
@@ -457,7 +482,9 @@
 	 */
 	public function create_item( $request ) {
 		if ( ! empty( $request['id'] ) ) {
-			return new WP_Error( 'rest_user_exists', __( 'Cannot create existing user.' ), array( 'status' => 400 ) );
+			return new WP_Error( 'rest_user_exists', __( 'Cannot create existing user.' ), array(
+				'status' => 400,
+			) );
 		}
 
 		$schema = $this->get_item_schema();
@@ -476,7 +503,9 @@
 			$ret = wpmu_validate_user_signup( $user->user_login, $user->user_email );
 
 			if ( is_wp_error( $ret['errors'] ) && ! empty( $ret['errors']->errors ) ) {
-				$error = new WP_Error( 'rest_invalid_param', __( 'Invalid user parameter(s).' ), array( 'status' => 400 ) );
+				$error = new WP_Error( 'rest_invalid_param', __( 'Invalid user parameter(s).' ), array(
+					'status' => 400,
+				) );
 				foreach ( $ret['errors']->errors as $code => $messages ) {
 					foreach ( $messages as $message ) {
 						$error->add( $code, $message );
@@ -493,7 +522,9 @@
 			$user_id = wpmu_create_user( $user->user_login, $user->user_pass, $user->user_email );
 
 			if ( ! $user_id ) {
-				return new WP_Error( 'rest_user_create', __( 'Error creating new user.' ), array( 'status' => 500 ) );
+				return new WP_Error( 'rest_user_create', __( 'Error creating new user.' ), array(
+					'status' => 500,
+				) );
 			}
 
 			$user->ID = $user_id;
@@ -571,11 +602,15 @@
 		}
 
 		if ( ! current_user_can( 'edit_user', $user->ID ) ) {
-			return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this user.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this user.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		if ( ! empty( $request['roles'] ) && ! current_user_can( 'edit_users' ) ) {
-			return new WP_Error( 'rest_cannot_edit_roles', __( 'Sorry, you are not allowed to edit roles of this user.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_cannot_edit_roles', __( 'Sorry, you are not allowed to edit roles of this user.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		return true;
@@ -599,19 +634,27 @@
 		$id = $user->ID;
 
 		if ( ! $user ) {
-			return new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.' ), array( 'status' => 404 ) );
+			return new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.' ), array(
+				'status' => 404,
+			) );
 		}
 
 		if ( email_exists( $request['email'] ) && $request['email'] !== $user->user_email ) {
-			return new WP_Error( 'rest_user_invalid_email', __( 'Invalid email address.' ), array( 'status' => 400 ) );
+			return new WP_Error( 'rest_user_invalid_email', __( 'Invalid email address.' ), array(
+				'status' => 400,
+			) );
 		}
 
 		if ( ! empty( $request['username'] ) && $request['username'] !== $user->user_login ) {
-			return new WP_Error( 'rest_user_invalid_argument', __( "Username isn't editable." ), array( 'status' => 400 ) );
+			return new WP_Error( 'rest_user_invalid_argument', __( "Username isn't editable." ), array(
+				'status' => 400,
+			) );
 		}
 
 		if ( ! empty( $request['slug'] ) && $request['slug'] !== $user->user_nicename && get_user_by( 'slug', $request['slug'] ) ) {
-			return new WP_Error( 'rest_user_invalid_slug', __( 'Invalid slug.' ), array( 'status' => 400 ) );
+			return new WP_Error( 'rest_user_invalid_slug', __( 'Invalid slug.' ), array(
+				'status' => 400,
+			) );
 		}
 
 		if ( ! empty( $request['roles'] ) ) {
@@ -713,7 +756,9 @@
 		}
 
 		if ( ! current_user_can( 'delete_user', $user->ID ) ) {
-			return new WP_Error( 'rest_user_cannot_delete', __( 'Sorry, you are not allowed to delete this user.' ), array( 'status' => rest_authorization_required_code() ) );
+			return new WP_Error( 'rest_user_cannot_delete', __( 'Sorry, you are not allowed to delete this user.' ), array(
+				'status' => rest_authorization_required_code(),
+			) );
 		}
 
 		return true;
@@ -731,7 +776,9 @@
 	public function delete_item( $request ) {
 		// We don't support delete requests in multisite.
 		if ( is_multisite() ) {
-			return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array( 'status' => 501 ) );
+			return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array(
+				'status' => 501,
+			) );
 		}
 		$user = $this->get_user( $request['id'] );
 		if ( is_wp_error( $user ) ) {
@@ -744,12 +791,16 @@
 
 		// We don't support trashing for users.
 		if ( ! $force ) {
-			return new WP_Error( 'rest_trash_not_supported', __( 'Users do not support trashing. Set force=true to delete.' ), array( 'status' => 501 ) );
+			return new WP_Error( 'rest_trash_not_supported', __( 'Users do not support trashing. Set force=true to delete.' ), array(
+				'status' => 501,
+			) );
 		}
 
 		if ( ! empty( $reassign ) ) {
 			if ( $reassign === $id || ! get_userdata( $reassign ) ) {
-				return new WP_Error( 'rest_user_invalid_reassign', __( 'Invalid user ID for reassignment.' ), array( 'status' => 400 ) );
+				return new WP_Error( 'rest_user_invalid_reassign', __( 'Invalid user ID for reassignment.' ), array(
+					'status' => 400,
+				) );
 			}
 		}
 
@@ -763,11 +814,16 @@
 		$result = wp_delete_user( $id, $reassign );
 
 		if ( ! $result ) {
-			return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array( 'status' => 500 ) );
+			return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array(
+				'status' => 500,
+			) );
 		}
 
 		$response = new WP_REST_Response();
-		$response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data() ) );
+		$response->set_data( array(
+			'deleted' => true,
+			'previous' => $previous->get_data(),
+		) );
 
 		/**
 		 * Fires immediately after a user is deleted via the REST API.
@@ -1043,7 +1099,9 @@
 
 			if ( ! isset( $wp_roles->role_objects[ $role ] ) ) {
 				/* translators: %s: role key */
-				return new WP_Error( 'rest_user_invalid_role', sprintf( __( 'The role %s does not exist.' ), $role ), array( 'status' => 400 ) );
+				return new WP_Error( 'rest_user_invalid_role', sprintf( __( 'The role %s does not exist.' ), $role ), array(
+					'status' => 400,
+				) );
 			}
 
 			$potential_role = $wp_roles->role_objects[ $role ];
@@ -1057,7 +1115,9 @@
 				&& get_current_user_id() === $user_id
 				&& ! $potential_role->has_cap( 'edit_users' )
 			) {
-				return new WP_Error( 'rest_user_invalid_role', __( 'Sorry, you are not allowed to give users that role.' ), array( 'status' => rest_authorization_required_code() ) );
+				return new WP_Error( 'rest_user_invalid_role', __( 'Sorry, you are not allowed to give users that role.' ), array(
+					'status' => rest_authorization_required_code(),
+				) );
 			}
 
 			/** Include admin functions to get access to get_editable_roles() */
@@ -1067,9 +1127,11 @@
 			$editable_roles = get_editable_roles();
 
 			if ( empty( $editable_roles[ $role ] ) ) {
-				return new WP_Error( 'rest_user_invalid_role', __( 'Sorry, you are not allowed to give users that role.' ), array( 'status' => 403 ) );
+				return new WP_Error( 'rest_user_invalid_role', __( 'Sorry, you are not allowed to give users that role.' ), array(
+					'status' => 403,
+				) );
 			}
-		}
+		}// End foreach().
 
 		return true;
 	}
@@ -1091,14 +1153,18 @@
 		$username = (string) $value;
 
 		if ( ! validate_username( $username ) ) {
-			return new WP_Error( 'rest_user_invalid_username', __( 'Username contains invalid characters.' ), array( 'status' => 400 ) );
+			return new WP_Error( 'rest_user_invalid_username', __( 'Username contains invalid characters.' ), array(
+				'status' => 400,
+			) );
 		}
 
 		/** This filter is documented in wp-includes/user.php */
 		$illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
 
 		if ( in_array( strtolower( $username ), array_map( 'strtolower', $illegal_logins ) ) ) {
-			return new WP_Error( 'rest_user_invalid_username', __( 'Sorry, that username is not allowed.' ), array( 'status' => 400 ) );
+			return new WP_Error( 'rest_user_invalid_username', __( 'Sorry, that username is not allowed.' ), array(
+				'status' => 400,
+			) );
 		}
 
 		return $username;
@@ -1121,11 +1187,15 @@
 		$password = (string) $value;
 
 		if ( empty( $password ) ) {
-			return new WP_Error( 'rest_user_invalid_password', __( 'Passwords cannot be empty.' ), array( 'status' => 400 ) );
+			return new WP_Error( 'rest_user_invalid_password', __( 'Passwords cannot be empty.' ), array(
+				'status' => 400,
+			) );
 		}
 
-		if ( false !== strpos( $password, "\\" ) ) {
-			return new WP_Error( 'rest_user_invalid_password', __( 'Passwords cannot contain the "\\" character.' ), array( 'status' => 400 ) );
+		if ( false !== strpos( $password, '\\' ) ) {
+			return new WP_Error( 'rest_user_invalid_password', __( 'Passwords cannot contain the "\\" character.' ), array(
+				'status' => 400,
+			) );
 		}
 
 		return $password;
Index: src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
===================================================================
--- src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php	(revision 40901)
+++ src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php	(working copy)
@@ -158,7 +158,7 @@
 			if ( is_wp_error( $result ) ) {
 				return $result;
 			}
-		}
+		}// End foreach().
 
 		return null;
 	}
@@ -284,7 +284,7 @@
 	 */
 	protected function update_meta_value( $object_id, $meta_key, $name, $value ) {
 		$meta_type = $this->get_meta_type();
-		if ( ! current_user_can(  "edit_{$meta_type}_meta", $object_id, $meta_key ) ) {
+		if ( ! current_user_can( "edit_{$meta_type}_meta", $object_id, $meta_key ) ) {
 			return new WP_Error(
 				'rest_cannot_update',
 				/* translators: %s: custom field key */
@@ -370,7 +370,7 @@
 			}
 
 			$registered[ $name ] = $rest_args;
-		}
+		}// End foreach().
 
 		return $registered;
 	}
Index: src/wp-includes/rest-api.php
===================================================================
--- src/wp-includes/rest-api.php	(revision 40901)
+++ src/wp-includes/rest-api.php	(working copy)
@@ -41,7 +41,7 @@
 		 */
 		_doing_it_wrong( 'register_rest_route', __( 'Routes must be namespaced with plugin or theme name and version.' ), '4.4.0' );
 		return false;
-	} else if ( empty( $route ) ) {
+	} elseif ( empty( $route ) ) {
 		_doing_it_wrong( 'register_rest_route', __( 'Route must be specified.' ), '4.4.0' );
 		return false;
 	}
@@ -180,7 +180,9 @@
  * @since 4.7.0
  */
 function create_initial_rest_routes() {
-	foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) {
+	foreach ( get_post_types( array(
+		'show_in_rest' => true,
+	), 'objects' ) as $post_type ) {
 		$class = ! empty( $post_type->rest_controller_class ) ? $post_type->rest_controller_class : 'WP_REST_Posts_Controller';
 
 		if ( ! class_exists( $class ) ) {
@@ -212,7 +214,9 @@
 	$controller->register_routes();
 
 	// Terms.
-	foreach ( get_taxonomies( array( 'show_in_rest' => true ), 'object' ) as $taxonomy ) {
+	foreach ( get_taxonomies( array(
+		'show_in_rest' => true,
+	), 'object' ) as $taxonomy ) {
 		$class = ! empty( $taxonomy->rest_controller_class ) ? $taxonomy->rest_controller_class : 'WP_REST_Terms_Controller';
 
 		if ( ! class_exists( $class ) ) {
@@ -741,7 +745,9 @@
 	$result = wp_verify_nonce( $nonce, 'wp_rest' );
 
 	if ( ! $result ) {
-		return new WP_Error( 'rest_cookie_invalid_nonce', __( 'Cookie nonce is invalid' ), array( 'status' => 403 ) );
+		return new WP_Error( 'rest_cookie_invalid_nonce', __( 'Cookie nonce is invalid' ), array(
+			'status' => 403,
+		) );
 	}
 
 	// Send a refreshed nonce in header.
@@ -942,7 +948,7 @@
  */
 function rest_sanitize_boolean( $value ) {
 	// String values are translated to `true`; make sure 'false' is false.
-	if ( is_string( $value )  ) {
+	if ( is_string( $value ) ) {
 		$value = strtolower( $value );
 		if ( in_array( $value, array( 'false', '0' ), true ) ) {
 			$value = false;
@@ -1143,8 +1149,8 @@
 					return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (inclusive) and %3$d (inclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
 				}
 			}
-		}
-	}
+		}// End if().
+	}// End if().
 
 	return true;
 }
Index: src/wp-includes/revision.php
===================================================================
--- src/wp-includes/revision.php	(revision 40901)
+++ src/wp-includes/revision.php	(working copy)
@@ -60,7 +60,6 @@
 		unset( $fields[ $protect ] );
 	}
 
-
 	return $fields;
 }
 
@@ -110,20 +109,25 @@
  * @return int|WP_Error|void Void or 0 if error, new revision ID, if success.
  */
 function wp_save_post_revision( $post_id ) {
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
+	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
 		return;
+	}
 
-	if ( ! $post = get_post( $post_id ) )
+	if ( ! $post = get_post( $post_id ) ) {
 		return;
+	}
 
-	if ( ! post_type_supports( $post->post_type, 'revisions' ) )
+	if ( ! post_type_supports( $post->post_type, 'revisions' ) ) {
 		return;
+	}
 
-	if ( 'auto-draft' == $post->post_status )
+	if ( 'auto-draft' == $post->post_status ) {
 		return;
+	}
 
-	if ( ! wp_revisions_enabled( $post ) )
+	if ( ! wp_revisions_enabled( $post ) ) {
 		return;
+	}
 
 	// Compare the proposed update with the last stored revision verifying that
 	// they are different, unless a plugin tells us to always save regardless.
@@ -181,7 +185,7 @@
 				return;
 			}
 		}
-	}
+	}// End if().
 
 	$return = _wp_put_post_revision( $post );
 
@@ -189,21 +193,26 @@
 	// delete the oldest ones.
 	$revisions_to_keep = wp_revisions_to_keep( $post );
 
-	if ( $revisions_to_keep < 0 )
+	if ( $revisions_to_keep < 0 ) {
 		return $return;
+	}
 
-	$revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) );
+	$revisions = wp_get_post_revisions( $post_id, array(
+		'order' => 'ASC',
+	) );
 
-	$delete = count($revisions) - $revisions_to_keep;
+	$delete = count( $revisions ) - $revisions_to_keep;
 
-	if ( $delete < 1 )
+	if ( $delete < 1 ) {
 		return $return;
+	}
 
 	$revisions = array_slice( $revisions, 0, $delete );
 
-	for ( $i = 0; isset( $revisions[$i] ); $i++ ) {
-		if ( false !== strpos( $revisions[ $i ]->post_name, 'autosave' ) )
+	for ( $i = 0; isset( $revisions[ $i ] ); $i++ ) {
+		if ( false !== strpos( $revisions[ $i ]->post_name, 'autosave' ) ) {
 			continue;
+		}
 
 		wp_delete_post_revision( $revisions[ $i ]->ID );
 	}
@@ -225,12 +234,15 @@
  * @return WP_Post|false The autosaved data or false on failure or when no autosave exists.
  */
 function wp_get_post_autosave( $post_id, $user_id = 0 ) {
-	$revisions = wp_get_post_revisions( $post_id, array( 'check_enabled' => false ) );
+	$revisions = wp_get_post_revisions( $post_id, array(
+		'check_enabled' => false,
+	) );
 
 	foreach ( $revisions as $revision ) {
 		if ( false !== strpos( $revision->post_name, "{$post_id}-autosave" ) ) {
-			if ( $user_id && $user_id != $revision->post_author )
+			if ( $user_id && $user_id != $revision->post_author ) {
 				continue;
+			}
 
 			return $revision;
 		}
@@ -248,8 +260,9 @@
  * @return false|int False if not a revision, ID of revision's parent otherwise.
  */
 function wp_is_post_revision( $post ) {
-	if ( !$post = wp_get_post_revision( $post ) )
+	if ( ! $post = wp_get_post_revision( $post ) ) {
 		return false;
+	}
 
 	return (int) $post->post_parent;
 }
@@ -263,11 +276,13 @@
  * @return false|int False if not a revision, ID of autosave's parent otherwise
  */
 function wp_is_post_autosave( $post ) {
-	if ( !$post = wp_get_post_revision( $post ) )
+	if ( ! $post = wp_get_post_revision( $post ) ) {
 		return false;
+	}
 
-	if ( false !== strpos( $post->post_name, "{$post->post_parent}-autosave" ) )
+	if ( false !== strpos( $post->post_name, "{$post->post_parent}-autosave" ) ) {
 		return (int) $post->post_parent;
+	}
 
 	return false;
 }
@@ -283,23 +298,27 @@
  * @return int|WP_Error WP_Error or 0 if error, new revision ID if success.
  */
 function _wp_put_post_revision( $post = null, $autosave = false ) {
-	if ( is_object($post) )
+	if ( is_object( $post ) ) {
 		$post = get_object_vars( $post );
-	elseif ( !is_array($post) )
-		$post = get_post($post, ARRAY_A);
+	} elseif ( ! is_array( $post ) ) {
+		$post = get_post( $post, ARRAY_A );
+	}
 
-	if ( ! $post || empty($post['ID']) )
+	if ( ! $post || empty( $post['ID'] ) ) {
 		return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) );
+	}
 
-	if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
+	if ( isset( $post['post_type'] ) && 'revision' == $post['post_type'] ) {
 		return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
+	}
 
 	$post = _wp_post_revision_data( $post, $autosave );
-	$post = wp_slash($post); //since data is from db
+	$post = wp_slash( $post ); //since data is from db
 
 	$revision_id = wp_insert_post( $post );
-	if ( is_wp_error($revision_id) )
+	if ( is_wp_error( $revision_id ) ) {
 		return $revision_id;
+	}
 
 	if ( $revision_id ) {
 		/**
@@ -326,19 +345,21 @@
  * @param string      $filter Optional sanitation filter. See sanitize_post().
  * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
  */
-function wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') {
-	if ( !$revision = get_post( $post, OBJECT, $filter ) )
+function wp_get_post_revision( &$post, $output = OBJECT, $filter = 'raw' ) {
+	if ( ! $revision = get_post( $post, OBJECT, $filter ) ) {
 		return $revision;
-	if ( 'revision' !== $revision->post_type )
+	}
+	if ( 'revision' !== $revision->post_type ) {
 		return null;
+	}
 
 	if ( $output == OBJECT ) {
 		return $revision;
 	} elseif ( $output == ARRAY_A ) {
-		$_revision = get_object_vars($revision);
+		$_revision = get_object_vars( $revision );
 		return $_revision;
 	} elseif ( $output == ARRAY_N ) {
-		$_revision = array_values(get_object_vars($revision));
+		$_revision = array_values( get_object_vars( $revision ) );
 		return $_revision;
 	}
 
@@ -357,27 +378,31 @@
  * @return int|false|null Null if error, false if no fields to restore, (int) post ID if success.
  */
 function wp_restore_post_revision( $revision_id, $fields = null ) {
-	if ( !$revision = wp_get_post_revision( $revision_id, ARRAY_A ) )
+	if ( ! $revision = wp_get_post_revision( $revision_id, ARRAY_A ) ) {
 		return $revision;
+	}
 
-	if ( !is_array( $fields ) )
+	if ( ! is_array( $fields ) ) {
 		$fields = array_keys( _wp_post_revision_fields( $revision ) );
+	}
 
 	$update = array();
 	foreach ( array_intersect( array_keys( $revision ), $fields ) as $field ) {
-		$update[$field] = $revision[$field];
+		$update[ $field ] = $revision[ $field ];
 	}
 
-	if ( !$update )
+	if ( ! $update ) {
 		return false;
+	}
 
 	$update['ID'] = $revision['post_parent'];
 
 	$update = wp_slash( $update ); //since data is from db
 
 	$post_id = wp_update_post( $update );
-	if ( ! $post_id || is_wp_error( $post_id ) )
+	if ( ! $post_id || is_wp_error( $post_id ) ) {
 		return $post_id;
+	}
 
 	// Update last edit user
 	update_post_meta( $post_id, '_edit_last', get_current_user_id() );
@@ -439,19 +464,30 @@
  */
 function wp_get_post_revisions( $post_id = 0, $args = null ) {
 	$post = get_post( $post_id );
-	if ( ! $post || empty( $post->ID ) )
+	if ( ! $post || empty( $post->ID ) ) {
 		return array();
+	}
 
-	$defaults = array( 'order' => 'DESC', 'orderby' => 'date ID', 'check_enabled' => true );
+	$defaults = array(
+		'order' => 'DESC',
+		'orderby' => 'date ID',
+		'check_enabled' => true,
+	);
 	$args = wp_parse_args( $args, $defaults );
 
-	if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) )
+	if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) ) {
 		return array();
+	}
 
-	$args = array_merge( $args, array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ) );
+	$args = array_merge( $args, array(
+		'post_parent' => $post->ID,
+		'post_type' => 'revision',
+		'post_status' => 'inherit',
+	) );
 
-	if ( ! $revisions = get_children( $args ) )
+	if ( ! $revisions = get_children( $args ) ) {
 		return array();
+	}
 
 	return $revisions;
 }
@@ -484,13 +520,14 @@
 function wp_revisions_to_keep( $post ) {
 	$num = WP_POST_REVISIONS;
 
-	if ( true === $num )
+	if ( true === $num ) {
 		$num = -1;
-	else
-		$num = intval( $num );
+	} else { $num = intval( $num );
+	}
 
-	if ( ! post_type_supports( $post->post_type, 'revisions' ) )
+	if ( ! post_type_supports( $post->post_type, 'revisions' ) ) {
 		$num = 0;
+	}
 
 	/**
 	 * Filters the number of revisions to save for the given post.
@@ -543,13 +580,14 @@
  * @access private
  */
 function _show_post_preview() {
-	if ( isset($_GET['preview_id']) && isset($_GET['preview_nonce']) ) {
+	if ( isset( $_GET['preview_id'] ) && isset( $_GET['preview_nonce'] ) ) {
 		$id = (int) $_GET['preview_id'];
 
-		if ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) )
-			wp_die( __('Sorry, you are not allowed to preview drafts.') );
+		if ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) ) {
+			wp_die( __( 'Sorry, you are not allowed to preview drafts.' ) );
+		}
 
-		add_filter('the_preview', '_set_preview');
+		add_filter( 'the_preview', '_set_preview' );
 	}
 }
 
@@ -565,16 +603,19 @@
  * @return array
  */
 function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) {
-	if ( ! $post = get_post() )
+	if ( ! $post = get_post() ) {
 		return $terms;
+	}
 
-	if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id || 'post_format' != $taxonomy || 'revision' == $post->post_type )
+	if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id || 'post_format' != $taxonomy || 'revision' == $post->post_type ) {
 		return $terms;
+	}
 
-	if ( 'standard' == $_REQUEST['post_format'] )
+	if ( 'standard' == $_REQUEST['post_format'] ) {
 		$terms = array();
-	elseif ( $term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' ) )
+	} elseif ( $term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' ) ) {
 		$terms = array( $term ); // Can only have one post format
+	}
 
 	return $terms;
 }
@@ -596,11 +637,11 @@
 	}
 
 	if ( empty( $_REQUEST['_thumbnail_id'] ) ||
-	     empty( $_REQUEST['preview_id'] ) ||
-	     $post->ID != $post_id ||
-	     '_thumbnail_id' != $meta_key ||
-	     'revision' == $post->post_type ||
-	     $post_id != $_REQUEST['preview_id']
+		 empty( $_REQUEST['preview_id'] ) ||
+		 $post->ID != $post_id ||
+		 '_thumbnail_id' != $meta_key ||
+		 'revision' == $post->post_type ||
+		 $post_id != $_REQUEST['preview_id']
 	) {
 		return $value;
 	}
@@ -623,13 +664,15 @@
  * @return int|false
  */
 function _wp_get_post_revision_version( $revision ) {
-	if ( is_object( $revision ) )
+	if ( is_object( $revision ) ) {
 		$revision = get_object_vars( $revision );
-	elseif ( !is_array( $revision ) )
+	} elseif ( ! is_array( $revision ) ) {
 		return false;
+	}
 
-	if ( preg_match( '/^\d+-(?:autosave|revision)-v(\d+)$/', $revision['post_name'], $matches ) )
+	if ( preg_match( '/^\d+-(?:autosave|revision)-v(\d+)$/', $revision['post_name'], $matches ) ) {
 		return (int) $matches[1];
+	}
 
 	return 0;
 }
@@ -666,8 +709,6 @@
 			// Lock is not too old: some other process may be upgrading this post.  Bail.
 			return false;
 		}
-
-		// Lock is too old - update it (below) and continue
 	}
 
 	// If we could get a lock, re-"add" the option to fire all the correct filters.
@@ -683,8 +724,9 @@
 		$this_revision_version = _wp_get_post_revision_version( $this_revision );
 
 		// Something terrible happened
-		if ( false === $this_revision_version )
+		if ( false === $this_revision_version ) {
 			continue;
+		}
 
 		// 1 is the latest revision version, so we're already up to date.
 		// No need to add a copy of the post as latest revision.
@@ -705,23 +747,27 @@
 			$prev_revision_version = _wp_get_post_revision_version( $prev_revision );
 
 			// If the previous revision is already up to date, it no longer has the information we need :(
-			if ( $prev_revision_version < 1 )
+			if ( $prev_revision_version < 1 ) {
 				$update['post_author'] = $prev_revision->post_author;
+			}
 		}
 
 		// Upgrade this revision
-		$result = $wpdb->update( $wpdb->posts, $update, array( 'ID' => $this_revision->ID ) );
+		$result = $wpdb->update( $wpdb->posts, $update, array(
+			'ID' => $this_revision->ID,
+		) );
 
-		if ( $result )
+		if ( $result ) {
 			wp_cache_delete( $this_revision->ID, 'posts' );
-
+		}
 	} while ( $prev_revision );
 
 	delete_option( $lock );
 
 	// Add a copy of the post as latest revision.
-	if ( $add_last )
+	if ( $add_last ) {
 		wp_save_post_revision( $post->ID );
+	}
 
 	return true;
 }
Index: src/wp-includes/rewrite.php
===================================================================
--- src/wp-includes/rewrite.php	(revision 40901)
+++ src/wp-includes/rewrite.php	(working copy)
@@ -11,98 +11,98 @@
  *
  * @since 2.1.0
  */
-define('EP_NONE', 0);
+define( 'EP_NONE', 0 );
 
 /**
  * Endpoint Mask for Permalink.
  *
  * @since 2.1.0
  */
-define('EP_PERMALINK', 1);
+define( 'EP_PERMALINK', 1 );
 
 /**
  * Endpoint Mask for Attachment.
  *
  * @since 2.1.0
  */
-define('EP_ATTACHMENT', 2);
+define( 'EP_ATTACHMENT', 2 );
 
 /**
  * Endpoint Mask for date.
  *
  * @since 2.1.0
  */
-define('EP_DATE', 4);
+define( 'EP_DATE', 4 );
 
 /**
  * Endpoint Mask for year
  *
  * @since 2.1.0
  */
-define('EP_YEAR', 8);
+define( 'EP_YEAR', 8 );
 
 /**
  * Endpoint Mask for month.
  *
  * @since 2.1.0
  */
-define('EP_MONTH', 16);
+define( 'EP_MONTH', 16 );
 
 /**
  * Endpoint Mask for day.
  *
  * @since 2.1.0
  */
-define('EP_DAY', 32);
+define( 'EP_DAY', 32 );
 
 /**
  * Endpoint Mask for root.
  *
  * @since 2.1.0
  */
-define('EP_ROOT', 64);
+define( 'EP_ROOT', 64 );
 
 /**
  * Endpoint Mask for comments.
  *
  * @since 2.1.0
  */
-define('EP_COMMENTS', 128);
+define( 'EP_COMMENTS', 128 );
 
 /**
  * Endpoint Mask for searches.
  *
  * @since 2.1.0
  */
-define('EP_SEARCH', 256);
+define( 'EP_SEARCH', 256 );
 
 /**
  * Endpoint Mask for categories.
  *
  * @since 2.1.0
  */
-define('EP_CATEGORIES', 512);
+define( 'EP_CATEGORIES', 512 );
 
 /**
  * Endpoint Mask for tags.
  *
  * @since 2.3.0
  */
-define('EP_TAGS', 1024);
+define( 'EP_TAGS', 1024 );
 
 /**
  * Endpoint Mask for authors.
  *
  * @since 2.1.0
  */
-define('EP_AUTHORS', 2048);
+define( 'EP_AUTHORS', 2048 );
 
 /**
  * Endpoint Mask for pages.
  *
  * @since 2.1.0
  */
-define('EP_PAGES', 4096);
+define( 'EP_PAGES', 4096 );
 
 /**
  * Endpoint Mask for all archive views.
@@ -158,8 +158,9 @@
  */
 function add_rewrite_tag( $tag, $regex, $query = '' ) {
 	// validate the tag's name
-	if ( strlen( $tag ) < 3 || $tag[0] != '%' || $tag[ strlen($tag) - 1 ] != '%' )
+	if ( strlen( $tag ) < 3 || $tag[0] != '%' || $tag[ strlen( $tag ) - 1 ] != '%' ) {
 		return;
+	}
 
 	global $wp_rewrite, $wp;
 
@@ -203,10 +204,14 @@
 	global $wp_rewrite;
 
 	// Back-compat for the old parameters: $with_front and $ep_mask.
-	if ( ! is_array( $args ) )
-		$args = array( 'with_front' => $args );
-	if ( func_num_args() == 4 )
+	if ( ! is_array( $args ) ) {
+		$args = array(
+			'with_front' => $args,
+		);
+	}
+	if ( func_num_args() == 4 ) {
 		$args['ep_mask'] = func_get_arg( 3 );
+	}
 
 	$wp_rewrite->add_permastruct( $name, $struct, $args );
 }
@@ -322,7 +327,7 @@
  * @return string
  */
 function _wp_filter_taxonomy_base( $base ) {
-	if ( !empty( $base ) ) {
+	if ( ! empty( $base ) ) {
 		$base = preg_replace( '|^/index\.php/|', '', $base );
 		$base = trim( $base, '/' );
 	}
@@ -472,18 +477,19 @@
 	$url = apply_filters( 'url_to_postid', $url );
 
 	// First, check to see if there is a 'p=N' or 'page_id=N' to match against
-	if ( preg_match('#[?&](p|page_id|attachment_id)=(\d+)#', $url, $values) )	{
-		$id = absint($values[2]);
-		if ( $id )
+	if ( preg_match( '#[?&](p|page_id|attachment_id)=(\d+)#', $url, $values ) ) {
+		$id = absint( $values[2] );
+		if ( $id ) {
 			return $id;
+		}
 	}
 
 	// Get rid of the #anchor
-	$url_split = explode('#', $url);
+	$url_split = explode( '#', $url );
 	$url = $url_split[0];
 
 	// Get rid of URL ?query=string
-	$url_split = explode('?', $url);
+	$url_split = explode( '?', $url );
 	$url = $url_split[0];
 
 	// Set the correct URL scheme.
@@ -491,12 +497,14 @@
 	$url = set_url_scheme( $url, $scheme );
 
 	// Add 'www.' if it is absent and should be there
-	if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') )
-		$url = str_replace('://', '://www.', $url);
+	if ( false !== strpos( home_url(), '://www.' ) && false === strpos( $url, '://www.' ) ) {
+		$url = str_replace( '://', '://www.', $url );
+	}
 
 	// Strip 'www.' if it is present and shouldn't be
-	if ( false === strpos(home_url(), '://www.') )
-		$url = str_replace('://www.', '://', $url);
+	if ( false === strpos( home_url(), '://www.' ) ) {
+		$url = str_replace( '://www.', '://', $url );
+	}
 
 	if ( trim( $url, '/' ) === home_url() && 'page' == get_option( 'show_on_front' ) ) {
 		$page_on_front = get_option( 'page_on_front' );
@@ -510,16 +518,18 @@
 	$rewrite = $wp_rewrite->wp_rewrite_rules();
 
 	// Not using rewrite rules, and 'p=N' and 'page_id=N' methods failed, so we're out of options
-	if ( empty($rewrite) )
+	if ( empty( $rewrite ) ) {
 		return 0;
+	}
 
 	// Strip 'index.php/' if we're not using path info permalinks
-	if ( !$wp_rewrite->using_index_permalinks() )
+	if ( ! $wp_rewrite->using_index_permalinks() ) {
 		$url = str_replace( $wp_rewrite->index . '/', '', $url );
+	}
 
 	if ( false !== strpos( trailingslashit( $url ), home_url( '/' ) ) ) {
 		// Chop off http://domain.com/[path]
-		$url = str_replace(home_url(), '', $url);
+		$url = str_replace( home_url(), '', $url );
 	} else {
 		// Chop off /path/to/blog
 		$home_path = parse_url( home_url( '/' ) );
@@ -528,26 +538,28 @@
 	}
 
 	// Trim leading and lagging slashes
-	$url = trim($url, '/');
+	$url = trim( $url, '/' );
 
 	$request = $url;
 	$post_type_query_vars = array();
 
 	foreach ( get_post_types( array() , 'objects' ) as $post_type => $t ) {
-		if ( ! empty( $t->query_var ) )
+		if ( ! empty( $t->query_var ) ) {
 			$post_type_query_vars[ $t->query_var ] = $post_type;
+		}
 	}
 
 	// Look for matches.
 	$request_match = $request;
-	foreach ( (array)$rewrite as $match => $query) {
+	foreach ( (array) $rewrite as $match => $query ) {
 
 		// If the requesting file is the anchor of the match, prepend it
 		// to the path info.
-		if ( !empty($url) && ($url != $request) && (strpos($match, $url) === 0) )
+		if ( ! empty( $url ) && ($url != $request) && (strpos( $match, $url ) === 0) ) {
 			$request_match = $url . '/' . $request;
+		}
 
-		if ( preg_match("#^$match#", $request_match, $matches) ) {
+		if ( preg_match( "#^$match#", $request_match, $matches ) ) {
 
 			if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$matches\[([0-9]+)\]/', $query, $varmatch ) ) {
 				// This is a verbose page match, let's check to be sure about it.
@@ -565,20 +577,20 @@
 
 			// Got a match.
 			// Trim the query of everything up to the '?'.
-			$query = preg_replace("!^.+\?!", '', $query);
+			$query = preg_replace( '!^.+\?!', '', $query );
 
 			// Substitute the substring matches into the query.
-			$query = addslashes(WP_MatchesMapRegex::apply($query, $matches));
+			$query = addslashes( WP_MatchesMapRegex::apply( $query, $matches ) );
 
 			// Filter out non-public query vars
 			global $wp;
 			parse_str( $query, $query_vars );
 			$query = array();
 			foreach ( (array) $query_vars as $key => $value ) {
-				if ( in_array( $key, $wp->public_query_vars ) ){
-					$query[$key] = $value;
-					if ( isset( $post_type_query_vars[$key] ) ) {
-						$query['post_type'] = $post_type_query_vars[$key];
+				if ( in_array( $key, $wp->public_query_vars ) ) {
+					$query[ $key ] = $value;
+					if ( isset( $post_type_query_vars[ $key ] ) ) {
+						$query['post_type'] = $post_type_query_vars[ $key ];
 						$query['name'] = $value;
 					}
 				}
@@ -589,11 +601,11 @@
 
 			// Do the query
 			$query = new WP_Query( $query );
-			if ( ! empty( $query->posts ) && $query->is_singular )
+			if ( ! empty( $query->posts ) && $query->is_singular ) {
 				return $query->post->ID;
-			else
-				return 0;
-		}
-	}
+			} else { return 0;
+			}
+		}// End if().
+	}// End foreach().
 	return 0;
 }
Index: src/wp-includes/rss-functions.php
===================================================================
--- src/wp-includes/rss-functions.php	(revision 40901)
+++ src/wp-includes/rss-functions.php	(working copy)
@@ -5,5 +5,5 @@
  * @package WordPress
  */
 
-_deprecated_file( basename(__FILE__), '2.1.0', WPINC . '/rss.php' );
+_deprecated_file( basename( __FILE__ ), '2.1.0', WPINC . '/rss.php' );
 require_once( ABSPATH . WPINC . '/rss.php' );
Index: src/wp-includes/script-loader.php
===================================================================
--- src/wp-includes/script-loader.php	(revision 40901)
+++ src/wp-includes/script-loader.php	(working copy)
@@ -60,9 +60,9 @@
 	}
 
 	$scripts->base_url = $guessurl;
-	$scripts->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';
+	$scripts->content_url = defined( 'WP_CONTENT_URL' )? WP_CONTENT_URL : '';
 	$scripts->default_version = get_bloginfo( 'version' );
-	$scripts->default_dirs = array('/wp-admin/js/', '/wp-includes/js/');
+	$scripts->default_dirs = array( '/wp-admin/js/', '/wp-includes/js/' );
 
 	$suffix = SCRIPT_DEBUG ? '' : '.min';
 	$dev_suffix = $develop_src ? '' : '.min';
@@ -75,7 +75,7 @@
 		'secure' => (string) ( 'https' === parse_url( site_url(), PHP_URL_SCHEME ) ),
 	) );
 
-	$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 );
+	$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array( 'jquery', 'hoverIntent', 'utils' ), false, 1 );
 	did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array(
 		'warnDelete'   => __( "You are about to permanently delete these items from your site.\nThis action cannot be undone.\n 'Cancel' to stop, 'OK' to delete." ),
 		'dismiss'      => __( 'Dismiss this notice.' ),
@@ -120,27 +120,27 @@
 		'more'            => __( 'Insert Read More tag' ),
 	) );
 
-	$scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m' );
+	$scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array( 'prototype' ), '3517m' );
 
-	$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), false, 1 );
+	$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array( 'utils', 'jquery' ), false, 1 );
 
 	// Back-compat for old DFW. To-do: remove at the end of 2016.
 	$scripts->add( 'wp-fullscreen-stub', "/wp-admin/js/wp-fullscreen-stub$suffix.js", array(), false, 1 );
 
-	$scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), false, 1 );
+	$scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array( 'jquery' ), false, 1 );
 	did_action( 'init' ) && $scripts->localize( 'wp-ajax-response', 'wpAjax', array(
-		'noPerm' => __('Sorry, you are not allowed to do that.'),
-		'broken' => __('An unidentified error has occurred.')
+		'noPerm' => __( 'Sorry, you are not allowed to do that.' ),
+		'broken' => __( 'An unidentified error has occurred.' ),
 	) );
 
 	$scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111129a', 1 );
 	did_action( 'init' ) && $scripts->localize( 'wp-pointer', 'wpPointerL10n', array(
-		'dismiss' => __('Dismiss'),
+		'dismiss' => __( 'Dismiss' ),
 	) );
 
-	$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('heartbeat'), false, 1 );
+	$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array( 'heartbeat' ), false, 1 );
 
-	$scripts->add( 'heartbeat', "/wp-includes/js/heartbeat$suffix.js", array('jquery'), false, 1 );
+	$scripts->add( 'heartbeat', "/wp-includes/js/heartbeat$suffix.js", array( 'jquery' ), false, 1 );
 	did_action( 'init' ) && $scripts->localize( 'heartbeat', 'heartbeatSettings',
 		/**
 		 * Filters the Heartbeat settings.
@@ -152,9 +152,9 @@
 		apply_filters( 'heartbeat_settings', array() )
 	);
 
-	$scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array('heartbeat'), false, 1 );
+	$scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array( 'heartbeat' ), false, 1 );
 	did_action( 'init' ) && $scripts->localize( 'wp-auth-check', 'authcheckL10n', array(
-		'beforeunload' => __('Your session has expired. You can log in again from this page or go to the login page.'),
+		'beforeunload' => __( 'Your session has expired. You can log in again from this page or go to the login page.' ),
 
 		/**
 		 * Filters the authentication check interval.
@@ -170,18 +170,18 @@
 	$scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array( 'wp-ajax-response', 'jquery-color' ), false, 1 );
 
 	// WordPress no longer uses or bundles Prototype or script.aculo.us. These are now pulled from an external source.
-	$scripts->add( 'prototype', 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1');
-	$scripts->add( 'scriptaculous-root', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array('prototype'), '1.9.0');
-	$scripts->add( 'scriptaculous-builder', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array('scriptaculous-root'), '1.9.0');
-	$scripts->add( 'scriptaculous-dragdrop', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.9.0');
-	$scripts->add( 'scriptaculous-effects', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array('scriptaculous-root'), '1.9.0');
-	$scripts->add( 'scriptaculous-slider', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array('scriptaculous-effects'), '1.9.0');
+	$scripts->add( 'prototype', 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1' );
+	$scripts->add( 'scriptaculous-root', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array( 'prototype' ), '1.9.0' );
+	$scripts->add( 'scriptaculous-builder', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array( 'scriptaculous-root' ), '1.9.0' );
+	$scripts->add( 'scriptaculous-dragdrop', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array( 'scriptaculous-builder', 'scriptaculous-effects' ), '1.9.0' );
+	$scripts->add( 'scriptaculous-effects', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array( 'scriptaculous-root' ), '1.9.0' );
+	$scripts->add( 'scriptaculous-slider', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array( 'scriptaculous-effects' ), '1.9.0' );
 	$scripts->add( 'scriptaculous-sound', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js', array( 'scriptaculous-root' ), '1.9.0' );
-	$scripts->add( 'scriptaculous-controls', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array('scriptaculous-root'), '1.9.0');
-	$scripts->add( 'scriptaculous', false, array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls') );
+	$scripts->add( 'scriptaculous-controls', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array( 'scriptaculous-root' ), '1.9.0' );
+	$scripts->add( 'scriptaculous', false, array( 'scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls' ) );
 
 	// not used in core, replaced by Jcrop.js
-	$scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop') );
+	$scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array( 'scriptaculous-dragdrop' ) );
 
 	// jQuery
 	$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.12.4' );
@@ -189,45 +189,45 @@
 	$scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.4.1' );
 
 	// full jQuery UI
-	$scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array('jquery'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-core', "/wp-includes/js/jquery/ui/effect$dev_suffix.js", array('jquery'), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-core', "/wp-includes/js/jquery/ui/effect$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 );
 
-	$scripts->add( 'jquery-effects-blind', "/wp-includes/js/jquery/ui/effect-blind$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-bounce', "/wp-includes/js/jquery/ui/effect-bounce$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-clip', "/wp-includes/js/jquery/ui/effect-clip$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-drop', "/wp-includes/js/jquery/ui/effect-drop$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-explode', "/wp-includes/js/jquery/ui/effect-explode$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-fade', "/wp-includes/js/jquery/ui/effect-fade$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-fold', "/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-highlight', "/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-scale'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-pulsate', "/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-size'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-shake', "/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-size', "/wp-includes/js/jquery/ui/effect-size$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-slide', "/wp-includes/js/jquery/ui/effect-slide$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-effects-transfer', "/wp-includes/js/jquery/ui/effect-transfer$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-blind', "/wp-includes/js/jquery/ui/effect-blind$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-bounce', "/wp-includes/js/jquery/ui/effect-bounce$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-clip', "/wp-includes/js/jquery/ui/effect-clip$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-drop', "/wp-includes/js/jquery/ui/effect-drop$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-explode', "/wp-includes/js/jquery/ui/effect-explode$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-fade', "/wp-includes/js/jquery/ui/effect-fade$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-fold', "/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-highlight', "/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array( 'jquery-effects-core', 'jquery-effects-scale' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-pulsate', "/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array( 'jquery-effects-core', 'jquery-effects-size' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-shake', "/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-size', "/wp-includes/js/jquery/ui/effect-size$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-slide', "/wp-includes/js/jquery/ui/effect-slide$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-effects-transfer', "/wp-includes/js/jquery/ui/effect-transfer$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
-	$scripts->add( 'jquery-ui-accordion', "/wp-includes/js/jquery/ui/accordion$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-accordion', "/wp-includes/js/jquery/ui/accordion$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
 	$scripts->add( 'jquery-ui-autocomplete', "/wp-includes/js/jquery/ui/autocomplete$dev_suffix.js", array( 'jquery-ui-menu', 'wp-a11y' ), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-button', "/wp-includes/js/jquery/ui/button$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-datepicker', "/wp-includes/js/jquery/ui/datepicker$dev_suffix.js", array('jquery-ui-core'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog$dev_suffix.js", array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-draggable', "/wp-includes/js/jquery/ui/draggable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-droppable', "/wp-includes/js/jquery/ui/droppable$dev_suffix.js", array('jquery-ui-draggable'), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-button', "/wp-includes/js/jquery/ui/button$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-datepicker', "/wp-includes/js/jquery/ui/datepicker$dev_suffix.js", array( 'jquery-ui-core' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog$dev_suffix.js", array( 'jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-draggable', "/wp-includes/js/jquery/ui/draggable$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-droppable', "/wp-includes/js/jquery/ui/droppable$dev_suffix.js", array( 'jquery-ui-draggable' ), '1.11.4', 1 );
 	$scripts->add( 'jquery-ui-menu', "/wp-includes/js/jquery/ui/menu$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.4', 1 );
 	$scripts->add( 'jquery-ui-mouse', "/wp-includes/js/jquery/ui/mouse$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-position', "/wp-includes/js/jquery/ui/position$dev_suffix.js", array('jquery'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-progressbar', "/wp-includes/js/jquery/ui/progressbar$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-resizable', "/wp-includes/js/jquery/ui/resizable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-selectable', "/wp-includes/js/jquery/ui/selectable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-selectmenu', "/wp-includes/js/jquery/ui/selectmenu$dev_suffix.js", array('jquery-ui-menu'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-slider', "/wp-includes/js/jquery/ui/slider$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-sortable', "/wp-includes/js/jquery/ui/sortable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-position', "/wp-includes/js/jquery/ui/position$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-progressbar', "/wp-includes/js/jquery/ui/progressbar$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-resizable', "/wp-includes/js/jquery/ui/resizable$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-selectable', "/wp-includes/js/jquery/ui/selectable$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-selectmenu', "/wp-includes/js/jquery/ui/selectmenu$dev_suffix.js", array( 'jquery-ui-menu' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-slider', "/wp-includes/js/jquery/ui/slider$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-sortable', "/wp-includes/js/jquery/ui/sortable$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
 	$scripts->add( 'jquery-ui-spinner', "/wp-includes/js/jquery/ui/spinner$dev_suffix.js", array( 'jquery-ui-button' ), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-tabs', "/wp-includes/js/jquery/ui/tabs$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-tabs', "/wp-includes/js/jquery/ui/tabs$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
 	$scripts->add( 'jquery-ui-tooltip', "/wp-includes/js/jquery/ui/tooltip$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.4', 1 );
-	$scripts->add( 'jquery-ui-widget', "/wp-includes/js/jquery/ui/widget$dev_suffix.js", array('jquery'), '1.11.4', 1 );
+	$scripts->add( 'jquery-ui-widget', "/wp-includes/js/jquery/ui/widget$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 );
 
 	// Strings for 'jquery-ui-autocomplete' live region messages
 	did_action( 'init' ) && $scripts->localize( 'jquery-ui-autocomplete', 'uiAutocompleteL10n', array(
@@ -240,66 +240,66 @@
 	) );
 
 	// deprecated, not used in core, most functionality is included in jQuery 1.3
-	$scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '3.37.0', 1 );
+	$scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array( 'jquery' ), '3.37.0', 1 );
 
 	// jQuery plugins
-	$scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color.min.js", array('jquery'), '2.1.1', 1 );
-	$scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20m', 1 );
-	$scripts->add( 'jquery-query', "/wp-includes/js/jquery/jquery.query.js", array('jquery'), '2.1.7', 1 );
-	$scripts->add( 'jquery-serialize-object', "/wp-includes/js/jquery/jquery.serialize-object.js", array('jquery'), '0.2', 1 );
-	$scripts->add( 'jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array('jquery'), '0.0.2m', 1 );
-	$scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), false, 1 );
-	$scripts->add( 'jquery-touch-punch', "/wp-includes/js/jquery/jquery.ui.touch-punch.js", array('jquery-ui-widget', 'jquery-ui-mouse'), '0.2.2', 1 );
+	$scripts->add( 'jquery-color', '/wp-includes/js/jquery/jquery.color.min.js', array( 'jquery' ), '2.1.1', 1 );
+	$scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array( 'jquery' ), '20m', 1 );
+	$scripts->add( 'jquery-query', '/wp-includes/js/jquery/jquery.query.js', array( 'jquery' ), '2.1.7', 1 );
+	$scripts->add( 'jquery-serialize-object', '/wp-includes/js/jquery/jquery.serialize-object.js', array( 'jquery' ), '0.2', 1 );
+	$scripts->add( 'jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array( 'jquery' ), '0.0.2m', 1 );
+	$scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array( 'jquery', 'jquery-hotkeys' ), false, 1 );
+	$scripts->add( 'jquery-touch-punch', '/wp-includes/js/jquery/jquery.ui.touch-punch.js', array( 'jquery-ui-widget', 'jquery-ui-mouse' ), '0.2.2', 1 );
 
 	// Not used any more, registered for backwards compatibility.
-	$scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20110113', 1 );
+	$scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array( 'jquery' ), '1.1-20110113', 1 );
 
 	// Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv.
 	// It sets jQuery as a dependency, as the theme may have been implicitly loading it this way.
-	$scripts->add( 'imagesloaded', "/wp-includes/js/imagesloaded.min.js", array(), '3.2.0', 1 );
-	$scripts->add( 'masonry', "/wp-includes/js/masonry.min.js", array( 'imagesloaded' ), '3.3.2', 1 );
+	$scripts->add( 'imagesloaded', '/wp-includes/js/imagesloaded.min.js', array(), '3.2.0', 1 );
+	$scripts->add( 'masonry', '/wp-includes/js/masonry.min.js', array( 'imagesloaded' ), '3.3.2', 1 );
 	$scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array( 'jquery', 'masonry' ), '3.1.2b', 1 );
 
-	$scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20121105', 1 );
+	$scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array( 'jquery' ), '3.1-20121105', 1 );
 	did_action( 'init' ) && $scripts->localize( 'thickbox', 'thickboxL10n', array(
-		'next' => __('Next &gt;'),
-		'prev' => __('&lt; Prev'),
-		'image' => __('Image'),
-		'of' => __('of'),
-		'close' => __('Close'),
-		'noiframes' => __('This feature requires inline frames. You have iframes disabled or your browser does not support them.'),
-		'loadingAnimation' => includes_url('js/thickbox/loadingAnimation.gif'),
+		'next' => __( 'Next &gt;' ),
+		'prev' => __( '&lt; Prev' ),
+		'image' => __( 'Image' ),
+		'of' => __( 'of' ),
+		'close' => __( 'Close' ),
+		'noiframes' => __( 'This feature requires inline frames. You have iframes disabled or your browser does not support them.' ),
+		'loadingAnimation' => includes_url( 'js/thickbox/loadingAnimation.gif' ),
 	) );
 
-	$scripts->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop.min.js", array('jquery'), '0.9.12');
+	$scripts->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.min.js', array( 'jquery' ), '0.9.12' );
 
-	$scripts->add( 'swfobject', "/wp-includes/js/swfobject.js", array(), '2.2-20120417');
+	$scripts->add( 'swfobject', '/wp-includes/js/swfobject.js', array(), '2.2-20120417' );
 
 	// error message for both plupload and swfupload
 	$uploader_l10n = array(
-		'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
-		'file_exceeds_size_limit' => __('%s exceeds the maximum upload size for this site.'),
-		'zero_byte_file' => __('This file is empty. Please try another.'),
-		'invalid_filetype' => __('Sorry, this file type is not permitted for security reasons.'),
-		'not_an_image' => __('This file is not an image. Please try another.'),
-		'image_memory_exceeded' => __('Memory exceeded. Please try another smaller file.'),
-		'image_dimensions_exceeded' => __('This is larger than the maximum size. Please try another.'),
-		'default_error' => __('An error occurred in the upload. Please try again later.'),
-		'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'),
-		'upload_limit_exceeded' => __('You may only upload 1 file.'),
-		'http_error' => __('HTTP error.'),
-		'upload_failed' => __('Upload failed.'),
+		'queue_limit_exceeded' => __( 'You have attempted to queue too many files.' ),
+		'file_exceeds_size_limit' => __( '%s exceeds the maximum upload size for this site.' ),
+		'zero_byte_file' => __( 'This file is empty. Please try another.' ),
+		'invalid_filetype' => __( 'Sorry, this file type is not permitted for security reasons.' ),
+		'not_an_image' => __( 'This file is not an image. Please try another.' ),
+		'image_memory_exceeded' => __( 'Memory exceeded. Please try another smaller file.' ),
+		'image_dimensions_exceeded' => __( 'This is larger than the maximum size. Please try another.' ),
+		'default_error' => __( 'An error occurred in the upload. Please try again later.' ),
+		'missing_upload_url' => __( 'There was a configuration error. Please contact the server administrator.' ),
+		'upload_limit_exceeded' => __( 'You may only upload 1 file.' ),
+		'http_error' => __( 'HTTP error.' ),
+		'upload_failed' => __( 'Upload failed.' ),
 		/* translators: 1: Opening link tag, 2: Closing link tag */
-		'big_upload_failed' => __('Please try uploading this file with the %1$sbrowser uploader%2$s.'),
-		'big_upload_queued' => __('%s exceeds the maximum upload size for the multi-file uploader when used in your browser.'),
-		'io_error' => __('IO error.'),
-		'security_error' => __('Security error.'),
-		'file_cancelled' => __('File canceled.'),
-		'upload_stopped' => __('Upload stopped.'),
-		'dismiss' => __('Dismiss'),
-		'crunching' => __('Crunching&hellip;'),
-		'deleted' => __('moved to the trash.'),
-		'error_uploading' => __('&#8220;%s&#8221; has failed to upload.')
+		'big_upload_failed' => __( 'Please try uploading this file with the %1$sbrowser uploader%2$s.' ),
+		'big_upload_queued' => __( '%s exceeds the maximum upload size for the multi-file uploader when used in your browser.' ),
+		'io_error' => __( 'IO error.' ),
+		'security_error' => __( 'Security error.' ),
+		'file_cancelled' => __( 'File canceled.' ),
+		'upload_stopped' => __( 'Upload stopped.' ),
+		'dismiss' => __( 'Dismiss' ),
+		'crunching' => __( 'Crunching&hellip;' ),
+		'deleted' => __( 'moved to the trash.' ),
+		'error_uploading' => __( '&#8220;%s&#8221; has failed to upload.' ),
 	);
 
 	$scripts->add( 'plupload', '/wp-includes/js/plupload/plupload.full.min.js', array(), '2.1.8' );
@@ -315,12 +315,12 @@
 	did_action( 'init' ) && $scripts->localize( 'wp-plupload', 'pluploadL10n', $uploader_l10n );
 
 	// keep 'swfupload' for back-compat.
-	$scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113');
-	$scripts->add( 'swfupload-swfobject', '/wp-includes/js/swfupload/plugins/swfupload.swfobject.js', array('swfupload', 'swfobject'), '2201a');
-	$scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2201');
-	$scripts->add( 'swfupload-speed', '/wp-includes/js/swfupload/plugins/swfupload.speed.js', array('swfupload'), '2201');
-	$scripts->add( 'swfupload-all', false, array('swfupload', 'swfupload-swfobject', 'swfupload-queue'), '2201');
-	$scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20110524');
+	$scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113' );
+	$scripts->add( 'swfupload-swfobject', '/wp-includes/js/swfupload/plugins/swfupload.swfobject.js', array( 'swfupload', 'swfobject' ), '2201a' );
+	$scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array( 'swfupload' ), '2201' );
+	$scripts->add( 'swfupload-speed', '/wp-includes/js/swfupload/plugins/swfupload.speed.js', array( 'swfupload' ), '2201' );
+	$scripts->add( 'swfupload-all', false, array( 'swfupload', 'swfupload-swfobject', 'swfupload-queue' ), '2201' );
+	$scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array( 'swfupload-all', 'jquery' ), '2201-20110524' );
 	did_action( 'init' ) && $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );
 
 	$scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", array(), false, 1 );
@@ -329,22 +329,22 @@
 	did_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', 'lt IE 8' );
 
 	$scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.8.3', 1 );
-	$scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore','jquery' ), '1.2.3', 1 );
+	$scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore', 'jquery' ), '1.2.3', 1 );
 
-	$scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array('underscore', 'jquery'), false, 1 );
+	$scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array( 'underscore', 'jquery' ), false, 1 );
 	did_action( 'init' ) && $scripts->localize( 'wp-util', '_wpUtilSettings', array(
 		'ajax' => array(
 			'url' => admin_url( 'admin-ajax.php', 'relative' ),
 		),
 	) );
 
-	$scripts->add( 'wp-backbone', "/wp-includes/js/wp-backbone$suffix.js", array('backbone', 'wp-util'), false, 1 );
+	$scripts->add( 'wp-backbone', "/wp-includes/js/wp-backbone$suffix.js", array( 'backbone', 'wp-util' ), false, 1 );
 
 	$scripts->add( 'revisions', "/wp-admin/js/revisions$suffix.js", array( 'wp-backbone', 'jquery-ui-slider', 'hoverIntent' ), false, 1 );
 
-	$scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), false, 1 );
+	$scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array( 'jquery' ), false, 1 );
 
-	$scripts->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player.min.js", array('jquery'), '2.22.0', 1 );
+	$scripts->add( 'mediaelement', '/wp-includes/js/mediaelement/mediaelement-and-player.min.js', array( 'jquery' ), '2.22.0', 1 );
 	did_action( 'init' ) && $scripts->localize( 'mediaelement', 'mejsL10n', array(
 		'language' => get_bloginfo( 'language' ),
 		'strings'  => array(
@@ -372,8 +372,7 @@
 		),
 	) );
 
-
-	$scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement$suffix.js", array('mediaelement'), false, 1 );
+	$scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement$suffix.js", array( 'mediaelement' ), false, 1 );
 	$mejs_settings = array(
 		'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ),
 	);
@@ -388,7 +387,7 @@
 		apply_filters( 'mejs_settings', $mejs_settings )
 	);
 
-	$scripts->add( 'froogaloop',  "/wp-includes/js/mediaelement/froogaloop.min.js", array(), '2.0' );
+	$scripts->add( 'froogaloop',  '/wp-includes/js/mediaelement/froogaloop.min.js', array(), '2.0' );
 	$scripts->add( 'wp-playlist', "/wp-includes/js/mediaelement/wp-playlist$suffix.js", array( 'wp-util', 'backbone', 'mediaelement' ), false, 1 );
 
 	$scripts->add( 'zxcvbn-async', "/wp-includes/js/zxcvbn-async$suffix.js", array(), '1.0' );
@@ -425,11 +424,11 @@
 
 	$scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
 	did_action( 'init' ) && $scripts->localize( 'wplink', 'wpLinkL10n', array(
-		'title' => __('Insert/edit link'),
-		'update' => __('Update'),
-		'save' => __('Add Link'),
-		'noTitle' => __('(no title)'),
-		'noMatchesFound' => __('No results found.'),
+		'title' => __( 'Insert/edit link' ),
+		'update' => __( 'Update' ),
+		'save' => __( 'Add Link' ),
+		'noTitle' => __( '(no title)' ),
+		'noMatchesFound' => __( 'No results found.' ),
 		'linkSelected' => __( 'Link selected.' ),
 		'linkInserted' => __( 'Link inserted.' ),
 	) );
@@ -444,18 +443,18 @@
 		 * Do not translate into your own language.
 		 */
 		'type' => _x( 'words', 'Word count type. Do not translate!' ),
-		'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array()
+		'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array(),
 	) );
 
 	$scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'shortcode' ), false, 1 );
 
-	$scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '1.8.1', 1 );
+	$scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array( 'jquery' ), '1.8.1', 1 );
 
 	$scripts->add( 'customize-base',     "/wp-includes/js/customize-base$suffix.js",     array( 'jquery', 'json2', 'underscore' ), false, 1 );
 	$scripts->add( 'customize-loader',   "/wp-includes/js/customize-loader$suffix.js",   array( 'customize-base' ), false, 1 );
 	$scripts->add( 'customize-preview',  "/wp-includes/js/customize-preview$suffix.js",  array( 'wp-a11y', 'customize-base' ), false, 1 );
-	$scripts->add( 'customize-models',   "/wp-includes/js/customize-models.js", array( 'underscore', 'backbone' ), false, 1 );
-	$scripts->add( 'customize-views',    "/wp-includes/js/customize-views.js",  array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );
+	$scripts->add( 'customize-models',   '/wp-includes/js/customize-models.js', array( 'underscore', 'backbone' ), false, 1 );
+	$scripts->add( 'customize-views',    '/wp-includes/js/customize-views.js',  array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );
 	$scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util' ), false, 1 );
 	did_action( 'init' ) && $scripts->localize( 'customize-controls', '_wpCustomizeControlsL10n', array(
 		'activate'           => __( 'Save &amp; Activate' ),
@@ -491,7 +490,9 @@
 	did_action( 'init' ) && $scripts->localize( 'media-models', '_wpMediaModelsL10n', array(
 		'settings' => array(
 			'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
-			'post' => array( 'id' => 0 ),
+			'post' => array(
+				'id' => 0,
+			),
 		),
 	) );
 
@@ -514,14 +515,14 @@
 	if ( is_admin() ) {
 		$scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response' ), false, 1 );
 		did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array(
-			'noPerm' => __('Sorry, you are not allowed to do that.'),
-			'broken' => __('An unidentified error has occurred.')
+			'noPerm' => __( 'Sorry, you are not allowed to do that.' ),
+			'broken' => __( 'An unidentified error has occurred.' ),
 		));
 
-		$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'quicktags', 'jquery-query'), false, 1 );
+		$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array( 'wp-lists', 'quicktags', 'jquery-query' ), false, 1 );
 		did_action( 'init' ) && $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
-			'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
-			'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']),
+			'hotkeys_highlight_first' => isset( $_GET['hotkeys_highlight_first'] ),
+			'hotkeys_highlight_last' => isset( $_GET['hotkeys_highlight_last'] ),
 			'replyApprove' => __( 'Approve and Reply' ),
 			'reply' => __( 'Reply' ),
 			'warnQuickEdit' => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ),
@@ -531,9 +532,9 @@
 			'docTitleCommentsCount' => __( 'Comments (%s)' ),
 		) );
 
-		$scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array('jquery'), false, 1 );
+		$scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array( 'jquery' ), false, 1 );
 
-		$scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), false, 1 );
+		$scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array( 'jquery-ui-sortable' ), false, 1 );
 		did_action( 'init' ) && $scripts->localize( 'postbox', 'postBoxL10n', array(
 			'postBoxEmptyString' => __( 'Drag boxes here' ),
 		) );
@@ -551,28 +552,28 @@
 
 		$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count', 'wp-a11y' ), false, 1 );
 		did_action( 'init' ) && $scripts->localize( 'post', 'postL10n', array(
-			'ok' => __('OK'),
-			'cancel' => __('Cancel'),
-			'publishOn' => __('Publish on:'),
-			'publishOnFuture' =>  __('Schedule for:'),
-			'publishOnPast' => __('Published on:'),
+			'ok' => __( 'OK' ),
+			'cancel' => __( 'Cancel' ),
+			'publishOn' => __( 'Publish on:' ),
+			'publishOnFuture' => __( 'Schedule for:' ),
+			'publishOnPast' => __( 'Published on:' ),
 			/* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
-			'dateFormat' => __('%1$s %2$s, %3$s @ %4$s:%5$s'),
-			'showcomm' => __('Show more comments'),
-			'endcomm' => __('No more comments found.'),
-			'publish' => __('Publish'),
-			'schedule' => __('Schedule'),
-			'update' => __('Update'),
-			'savePending' => __('Save as Pending'),
-			'saveDraft' => __('Save Draft'),
-			'private' => __('Private'),
-			'public' => __('Public'),
-			'publicSticky' => __('Public, Sticky'),
-			'password' => __('Password Protected'),
-			'privatelyPublished' => __('Privately Published'),
-			'published' => __('Published'),
-			'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
-			'savingText' => __('Saving Draft&#8230;'),
+			'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s:%5$s' ),
+			'showcomm' => __( 'Show more comments' ),
+			'endcomm' => __( 'No more comments found.' ),
+			'publish' => __( 'Publish' ),
+			'schedule' => __( 'Schedule' ),
+			'update' => __( 'Update' ),
+			'savePending' => __( 'Save as Pending' ),
+			'saveDraft' => __( 'Save Draft' ),
+			'private' => __( 'Private' ),
+			'public' => __( 'Public' ),
+			'publicSticky' => __( 'Public, Sticky' ),
+			'password' => __( 'Password Protected' ),
+			'privatelyPublished' => __( 'Privately Published' ),
+			'published' => __( 'Published' ),
+			'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
+			'savingText' => __( 'Saving Draft&#8230;' ),
 			'permalinkSaved' => __( 'Permalink saved' ),
 		) );
 
@@ -596,7 +597,7 @@
 		did_action( 'init' ) && $scripts->localize( 'comment', 'commentL10n', array(
 			'submittedOn' => __( 'Submitted on:' ),
 			/* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
-			'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s:%5$s' )
+			'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s:%5$s' ),
 		) );
 
 		$scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ) );
@@ -632,7 +633,7 @@
 		did_action( 'init' ) && $scripts->localize( 'plugin-install', 'plugininstallL10n', array(
 			'plugin_information' => __( 'Plugin:' ),
 			'plugin_modal_label' => __( 'Plugin details' ),
-			'ays' => __('Are you sure you want to install this plugin?')
+			'ays' => __( 'Are you sure you want to install this plugin?' ),
 		) );
 
 		$scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ), false, 1 );
@@ -721,7 +722,7 @@
 			),
 		) );
 
-		$scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
+		$scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array( 'jquery' ), '1.2' );
 
 		$scripts->add( 'iris', '/wp-admin/js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), '1.0.7', 1 );
 		$scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array( 'iris' ), false, 1 );
@@ -742,9 +743,9 @@
 			'error' => __( 'An error has occurred. Please reload the page and try again.' ),
 		));
 
-		$scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), false, 1 );
+		$scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array( 'jquery', 'json2', 'imgareaselect' ), false, 1 );
 		did_action( 'init' ) && $scripts->localize( 'image-edit', 'imageEditL10n', array(
-			'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
+			'error' => __( 'Could not load the preview image. Please reload the page and try again.' ),
 		));
 
 		$scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 );
@@ -752,7 +753,7 @@
 			'setThumbnail' => __( 'Use as featured image' ),
 			'saving' => __( 'Saving...' ), // no ellipsis
 			'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
-			'done' => __( 'Done' )
+			'done' => __( 'Done' ),
 		) );
 
 		// Navigation Menus
@@ -761,15 +762,15 @@
 			'noResultsFound' => __( 'No results found.' ),
 			'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
 			'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
-			'untitled' => _x( '(no label)', 'missing menu item navigation label' )
+			'untitled' => _x( '(no label)', 'missing menu item navigation label' ),
 		) );
 
-		$scripts->add( 'custom-header', "/wp-admin/js/custom-header.js", array( 'jquery-masonry' ), false, 1 );
+		$scripts->add( 'custom-header', '/wp-admin/js/custom-header.js', array( 'jquery-masonry' ), false, 1 );
 		$scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array( 'wp-color-picker', 'media-views' ), false, 1 );
-		$scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array('jquery'), false, 1 );
+		$scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array( 'jquery' ), false, 1 );
 
 		$scripts->add( 'svg-painter', '/wp-admin/js/svg-painter.js', array( 'jquery' ), false, 1 );
-	}
+	}// End if().
 }
 
 /**
@@ -790,17 +791,19 @@
 function wp_default_styles( &$styles ) {
 	include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
 
-	if ( ! defined( 'SCRIPT_DEBUG' ) )
+	if ( ! defined( 'SCRIPT_DEBUG' ) ) {
 		define( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ) );
+	}
 
-	if ( ! $guessurl = site_url() )
+	if ( ! $guessurl = site_url() ) {
 		$guessurl = wp_guess_url();
+	}
 
 	$styles->base_url = $guessurl;
-	$styles->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';
+	$styles->content_url = defined( 'WP_CONTENT_URL' )? WP_CONTENT_URL : '';
 	$styles->default_version = get_bloginfo( 'version' );
 	$styles->text_direction = function_exists( 'is_rtl' ) && is_rtl() ? 'rtl' : 'ltr';
-	$styles->default_dirs = array('/wp-admin/', '/wp-includes/css/');
+	$styles->default_dirs = array( '/wp-admin/', '/wp-includes/css/' );
 
 	// Open Sans is no longer used by core, but may be relied upon by themes and plugins.
 	$open_sans_font_url = '';
@@ -879,28 +882,54 @@
 	// External libraries and friends
 	$styles->add( 'imgareaselect',       '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' );
 	$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array( 'dashicons' ) );
-	$styles->add( 'mediaelement',        "/wp-includes/js/mediaelement/mediaelementplayer.min.css", array(), '2.22.0' );
+	$styles->add( 'mediaelement',        '/wp-includes/js/mediaelement/mediaelementplayer.min.css', array(), '2.22.0' );
 	$styles->add( 'wp-mediaelement',     "/wp-includes/js/mediaelement/wp-mediaelement$suffix.css", array( 'mediaelement' ) );
 	$styles->add( 'thickbox',            '/wp-includes/js/thickbox/thickbox.css', array( 'dashicons' ) );
 
 	// Deprecated CSS
 	$styles->add( 'deprecated-media', "/wp-admin/css/deprecated-media$suffix.css" );
 	$styles->add( 'farbtastic',       "/wp-admin/css/farbtastic$suffix.css", array(), '1.3u1' );
-	$styles->add( 'jcrop',            "/wp-includes/js/jcrop/jquery.Jcrop.min.css", array(), '0.9.12' );
+	$styles->add( 'jcrop',            '/wp-includes/js/jcrop/jquery.Jcrop.min.css', array(), '0.9.12' );
 	$styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); // Old handle.
 	$styles->add( 'open-sans', $open_sans_font_url ); // No longer used in core as of 4.6
 
 	// RTL CSS
 	$rtl_styles = array(
 		// wp-admin
-		'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus',
-		'widgets', 'site-icon', 'l10n', 'install', 'wp-color-picker', 'customize-controls', 'customize-widgets', 'customize-nav-menus', 'customize-preview',
-		'ie', 'login', 'press-this',
+		'common',
+	'forms',
+	'admin-menu',
+	'dashboard',
+	'list-tables',
+	'edit',
+	'revisions',
+	'media',
+	'themes',
+	'about',
+	'nav-menus',
+		'widgets',
+	'site-icon',
+	'l10n',
+	'install',
+	'wp-color-picker',
+	'customize-controls',
+	'customize-widgets',
+	'customize-nav-menus',
+	'customize-preview',
+		'ie',
+	'login',
+	'press-this',
 		// wp-includes
-		'buttons', 'admin-bar', 'wp-auth-check', 'editor-buttons', 'media-views', 'wp-pointer',
+		'buttons',
+	'admin-bar',
+	'wp-auth-check',
+	'editor-buttons',
+	'media-views',
+	'wp-pointer',
 		'wp-jquery-ui-dialog',
 		// deprecated
-		'deprecated-media', 'farbtastic',
+		'deprecated-media',
+	'farbtastic',
 	);
 
 	foreach ( $rtl_styles as $rtl_style ) {
@@ -920,16 +949,19 @@
  * @return array Reordered array, if needed.
  */
 function wp_prototype_before_jquery( $js_array ) {
-	if ( false === $prototype = array_search( 'prototype', $js_array, true ) )
+	if ( false === $prototype = array_search( 'prototype', $js_array, true ) ) {
 		return $js_array;
+	}
 
-	if ( false === $jquery = array_search( 'jquery', $js_array, true ) )
+	if ( false === $jquery = array_search( 'jquery', $js_array, true ) ) {
 		return $js_array;
+	}
 
-	if ( $prototype < $jquery )
+	if ( $prototype < $jquery ) {
 		return $js_array;
+	}
 
-	unset($js_array[$prototype]);
+	unset( $js_array[ $prototype ] );
 
 	array_splice( $js_array, $jquery, 0, 'prototype' );
 
@@ -970,14 +1002,28 @@
 	// Convert the PHP date format into jQuery UI's format.
 	$datepicker_date_format = str_replace(
 		array(
-			'd', 'j', 'l', 'z', // Day.
-			'F', 'M', 'n', 'm', // Month.
-			'Y', 'y'            // Year.
+			'd',
+		'j',
+		'l',
+		'z', // Day.
+			'F',
+		'M',
+		'n',
+		'm', // Month.
+			'Y',
+		'y',            // Year.
 		),
 		array(
-			'dd', 'd', 'DD', 'o',
-			'MM', 'M', 'm', 'mm',
-			'yy', 'y'
+			'dd',
+		'd',
+		'DD',
+		'o',
+			'MM',
+		'M',
+		'm',
+		'mm',
+			'yy',
+		'y',
 		),
 		get_option( 'date_format' )
 	);
@@ -1060,7 +1106,7 @@
 			// This one is only used with wp.a11y.speak(), so it can/should be more brief.
 			/* translators: %s is the name of a city. */
 			'city_updated' => __( 'City updated. Listing events near %s.' ),
-		)
+		),
 	) );
 }
 
@@ -1087,16 +1133,18 @@
 function wp_style_loader_src( $src, $handle ) {
 	global $_wp_admin_css_colors;
 
-	if ( wp_installing() )
+	if ( wp_installing() ) {
 		return preg_replace( '#^wp-admin/#', './', $src );
+	}
 
 	if ( 'colors' == $handle ) {
-		$color = get_user_option('admin_color');
+		$color = get_user_option( 'admin_color' );
 
-		if ( empty($color) || !isset($_wp_admin_css_colors[$color]) )
+		if ( empty( $color ) || ! isset( $_wp_admin_css_colors[ $color ] ) ) {
 			$color = 'fresh';
+		}
 
-		$color = $_wp_admin_css_colors[$color];
+		$color = $_wp_admin_css_colors[ $color ];
 		$url = $color->url;
 
 		if ( ! $url ) {
@@ -1104,7 +1152,7 @@
 		}
 
 		$parsed = parse_url( $src );
-		if ( isset($parsed['query']) && $parsed['query'] ) {
+		if ( isset( $parsed['query'] ) && $parsed['query'] ) {
 			wp_parse_str( $parsed['query'], $qv );
 			$url = add_query_arg( $qv, $url );
 		}
@@ -1132,7 +1180,7 @@
 function print_head_scripts() {
 	global $concatenate_scripts;
 
-	if ( ! did_action('wp_print_scripts') ) {
+	if ( ! did_action( 'wp_print_scripts' ) ) {
 		/** This action is documented in wp-includes/functions.wp-scripts.php */
 		do_action( 'wp_print_scripts' );
 	}
@@ -1205,12 +1253,13 @@
 	global $wp_scripts, $compress_scripts;
 
 	$zip = $compress_scripts ? 1 : 0;
-	if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP )
+	if ( $zip && defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP ) {
 		$zip = 'gzip';
+	}
 
 	if ( $concat = trim( $wp_scripts->concat, ', ' ) ) {
 
-		if ( !empty($wp_scripts->print_code) ) {
+		if ( ! empty( $wp_scripts->print_code ) ) {
 			echo "\n<script type='text/javascript'>\n";
 			echo "/* <![CDATA[ */\n"; // not needed in HTML 5
 			echo $wp_scripts->print_code;
@@ -1222,11 +1271,12 @@
 		$concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
 
 		$src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&" . $concat . '&ver=' . $wp_scripts->default_version;
-		echo "<script type='text/javascript' src='" . esc_attr($src) . "'></script>\n";
+		echo "<script type='text/javascript' src='" . esc_attr( $src ) . "'></script>\n";
 	}
 
-	if ( !empty($wp_scripts->print_html) )
+	if ( ! empty( $wp_scripts->print_html ) ) {
 		echo $wp_scripts->print_html;
+	}
 }
 
 /**
@@ -1242,7 +1292,7 @@
  * @return array
  */
 function wp_print_head_scripts() {
-	if ( ! did_action('wp_print_scripts') ) {
+	if ( ! did_action( 'wp_print_scripts' ) ) {
 		/** This action is documented in wp-includes/functions.wp-scripts.php */
 		do_action( 'wp_print_scripts' );
 	}
@@ -1312,7 +1362,7 @@
 
 	script_concat_settings();
 	$wp_styles->do_concat = $concatenate_scripts;
-	$wp_styles->do_items(false);
+	$wp_styles->do_items( false );
 
 	/**
 	 * Filters whether to print the admin styles.
@@ -1379,8 +1429,9 @@
 	$wp_styles = wp_styles();
 
 	$zip = $compress_css ? 1 : 0;
-	if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP )
+	if ( $zip && defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP ) {
 		$zip = 'gzip';
+	}
 
 	if ( $concat = trim( $wp_styles->concat, ', ' ) ) {
 		$dir = $wp_styles->text_direction;
@@ -1390,17 +1441,18 @@
 		$concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
 
 		$href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&" . $concat . '&ver=' . $ver;
-		echo "<link rel='stylesheet' href='" . esc_attr($href) . "' type='text/css' media='all' />\n";
+		echo "<link rel='stylesheet' href='" . esc_attr( $href ) . "' type='text/css' media='all' />\n";
 
-		if ( !empty($wp_styles->print_code) ) {
+		if ( ! empty( $wp_styles->print_code ) ) {
 			echo "<style type='text/css'>\n";
 			echo $wp_styles->print_code;
 			echo "\n</style>\n";
 		}
 	}
 
-	if ( !empty($wp_styles->print_html) )
+	if ( ! empty( $wp_styles->print_html ) ) {
 		echo $wp_styles->print_html;
+	}
 }
 
 /**
@@ -1415,23 +1467,26 @@
 function script_concat_settings() {
 	global $concatenate_scripts, $compress_scripts, $compress_css;
 
-	$compressed_output = ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') );
+	$compressed_output = ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' == ini_get( 'output_handler' ) );
 
-	if ( ! isset($concatenate_scripts) ) {
-		$concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;
-		if ( ( ! is_admin() && ! did_action( 'login_init' ) ) || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )
+	if ( ! isset( $concatenate_scripts ) ) {
+		$concatenate_scripts = defined( 'CONCATENATE_SCRIPTS' ) ? CONCATENATE_SCRIPTS : true;
+		if ( ( ! is_admin() && ! did_action( 'login_init' ) ) || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) {
 			$concatenate_scripts = false;
+		}
 	}
 
-	if ( ! isset($compress_scripts) ) {
-		$compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;
-		if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
+	if ( ! isset( $compress_scripts ) ) {
+		$compress_scripts = defined( 'COMPRESS_SCRIPTS' ) ? COMPRESS_SCRIPTS : true;
+		if ( $compress_scripts && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {
 			$compress_scripts = false;
+		}
 	}
 
-	if ( ! isset($compress_css) ) {
-		$compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true;
-		if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
+	if ( ! isset( $compress_css ) ) {
+		$compress_css = defined( 'COMPRESS_CSS' ) ? COMPRESS_CSS : true;
+		if ( $compress_css && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {
 			$compress_css = false;
+		}
 	}
 }
Index: src/wp-includes/session.php
===================================================================
--- src/wp-includes/session.php	(revision 40901)
+++ src/wp-includes/session.php	(working copy)
@@ -8,4 +8,4 @@
 _deprecated_file( basename( __FILE__ ), '4.7.0' );
 
 require_once( ABSPATH . WPINC . '/class-wp-session-tokens.php' );
-require_once( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' );
\ No newline at end of file
+require_once( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' );
Index: src/wp-includes/shortcodes.php
===================================================================
--- src/wp-includes/shortcodes.php	(revision 40901)
+++ src/wp-includes/shortcodes.php	(working copy)
@@ -86,7 +86,7 @@
  * @param string   $tag  Shortcode tag to be searched in post content.
  * @param callable $func Hook to run when shortcode is found.
  */
-function add_shortcode($tag, $func) {
+function add_shortcode( $tag, $func ) {
 	global $shortcode_tags;
 
 	if ( '' == trim( $tag ) ) {
@@ -114,10 +114,10 @@
  *
  * @param string $tag Shortcode tag to remove hook for.
  */
-function remove_shortcode($tag) {
+function remove_shortcode( $tag ) {
 	global $shortcode_tags;
 
-	unset($shortcode_tags[$tag]);
+	unset( $shortcode_tags[ $tag ] );
 }
 
 /**
@@ -170,8 +170,9 @@
 
 	if ( shortcode_exists( $tag ) ) {
 		preg_match_all( '/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER );
-		if ( empty( $matches ) )
+		if ( empty( $matches ) ) {
 			return false;
+		}
 
 		foreach ( $matches as $shortcode ) {
 			if ( $tag === $shortcode[2] ) {
@@ -206,8 +207,9 @@
 		return $content;
 	}
 
-	if (empty($shortcode_tags) || !is_array($shortcode_tags))
+	if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {
 		return $content;
+	}
 
 	// Find all registered tag names in $content.
 	preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
@@ -257,7 +259,7 @@
 	if ( empty( $tagnames ) ) {
 		$tagnames = array_keys( $shortcode_tags );
 	}
-	$tagregexp = join( '|', array_map('preg_quote', $tagnames) );
+	$tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
 
 	// WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag()
 	// Also, see shortcode_unautop() and shortcode.js.
@@ -267,27 +269,27 @@
 		. "($tagregexp)"                     // 2: Shortcode name
 		. '(?![\\w-])'                       // Not followed by word character or hyphen
 		. '('                                // 3: Unroll the loop: Inside the opening shortcode tag
-		.     '[^\\]\\/]*'                   // Not a closing bracket or forward slash
-		.     '(?:'
-		.         '\\/(?!\\])'               // A forward slash not followed by a closing bracket
-		.         '[^\\]\\/]*'               // Not a closing bracket or forward slash
-		.     ')*?'
+		. '[^\\]\\/]*'                   // Not a closing bracket or forward slash
+		. '(?:'
+		. '\\/(?!\\])'               // A forward slash not followed by a closing bracket
+		. '[^\\]\\/]*'               // Not a closing bracket or forward slash
+		. ')*?'
 		. ')'
 		. '(?:'
-		.     '(\\/)'                        // 4: Self closing tag ...
-		.     '\\]'                          // ... and closing bracket
+		. '(\\/)'                        // 4: Self closing tag ...
+		. '\\]'                          // ... and closing bracket
 		. '|'
-		.     '\\]'                          // Closing bracket
-		.     '(?:'
-		.         '('                        // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags
-		.             '[^\\[]*+'             // Not an opening bracket
-		.             '(?:'
-		.                 '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
-		.                 '[^\\[]*+'         // Not an opening bracket
-		.             ')*+'
-		.         ')'
-		.         '\\[\\/\\2\\]'             // Closing shortcode tag
-		.     ')?'
+		. '\\]'                          // Closing bracket
+		. '(?:'
+		. '('                        // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags
+		. '[^\\[]*+'             // Not an opening bracket
+		. '(?:'
+		. '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
+		. '[^\\[]*+'         // Not an opening bracket
+		. ')*+'
+		. ')'
+		. '\\[\\/\\2\\]'             // Closing shortcode tag
+		. ')?'
 		. ')'
 		. '(\\]?)';                          // 6: Optional second closing brocket for escaping shortcodes: [[tag]]
 }
@@ -309,7 +311,7 @@
 
 	// allow [[foo]] syntax for escaping a tag
 	if ( $m[1] == '[' && $m[6] == ']' ) {
-		return substr($m[0], 1, -1);
+		return substr( $m[0], 1, -1 );
 	}
 
 	$tag = $m[2];
@@ -374,9 +376,15 @@
  */
 function do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames ) {
 	// Normalize entities in unfiltered HTML before adding placeholders.
-	$trans = array( '&#91;' => '&#091;', '&#93;' => '&#093;' );
+	$trans = array(
+		'&#91;' => '&#091;',
+		'&#93;' => '&#093;',
+	);
 	$content = strtr( $content, $trans );
-	$trans = array( '[' => '&#91;', ']' => '&#93;' );
+	$trans = array(
+		'[' => '&#91;',
+		']' => '&#93;',
+	);
 
 	$pattern = get_shortcode_regex( $tagnames );
 	$textarr = wp_html_split( $content );
@@ -419,7 +427,7 @@
 		$front = array_shift( $attributes );
 		$back = array_pop( $attributes );
 		$matches = array();
-		preg_match('%[a-zA-Z0-9]+%', $front, $matches);
+		preg_match( '%[a-zA-Z0-9]+%', $front, $matches );
 		$elname = $matches[0];
 
 		// Look for shortcodes in each attribute separately.
@@ -456,7 +464,7 @@
 
 		// Now encode any remaining [ or ] chars.
 		$element = strtr( $element, $trans );
-	}
+	}// End foreach().
 
 	$content = implode( '', $textarr );
 
@@ -472,11 +480,14 @@
  * @return string Content with placeholders removed.
  */
 function unescape_invalid_shortcodes( $content ) {
-        // Clean up entire string, avoids re-parsing HTML.
-        $trans = array( '&#91;' => '[', '&#93;' => ']' );
-        $content = strtr( $content, $trans );
+		// Clean up entire string, avoids re-parsing HTML.
+		$trans = array(
+			'&#91;' => '[',
+			'&#93;' => ']',
+		);
+		$content = strtr( $content, $trans );
 
-        return $content;
+		return $content;
 }
 
 /**
@@ -505,26 +516,27 @@
  *                      Returns empty string if trim( $text ) == ''.
  *                      All other matches are checked for not empty().
  */
-function shortcode_parse_atts($text) {
+function shortcode_parse_atts( $text ) {
 	$atts = array();
 	$pattern = get_shortcode_atts_regex();
-	$text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
-	if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {
-		foreach ($match as $m) {
-			if (!empty($m[1]))
-				$atts[strtolower($m[1])] = stripcslashes($m[2]);
-			elseif (!empty($m[3]))
-				$atts[strtolower($m[3])] = stripcslashes($m[4]);
-			elseif (!empty($m[5]))
-				$atts[strtolower($m[5])] = stripcslashes($m[6]);
-			elseif (isset($m[7]) && strlen($m[7]))
-				$atts[] = stripcslashes($m[7]);
-			elseif (isset($m[8]))
-				$atts[] = stripcslashes($m[8]);
+	$text = preg_replace( "/[\x{00a0}\x{200b}]+/u", ' ', $text );
+	if ( preg_match_all( $pattern, $text, $match, PREG_SET_ORDER ) ) {
+		foreach ( $match as $m ) {
+			if ( ! empty( $m[1] ) ) {
+				$atts[ strtolower( $m[1] ) ] = stripcslashes( $m[2] );
+			} elseif ( ! empty( $m[3] ) ) {
+				$atts[ strtolower( $m[3] ) ] = stripcslashes( $m[4] );
+			} elseif ( ! empty( $m[5] ) ) {
+				$atts[ strtolower( $m[5] ) ] = stripcslashes( $m[6] );
+			} elseif ( isset( $m[7] ) && strlen( $m[7] ) ) {
+				$atts[] = stripcslashes( $m[7] );
+			} elseif ( isset( $m[8] ) ) {
+				$atts[] = stripcslashes( $m[8] );
+			}
 		}
 
 		// Reject any unclosed HTML elements
-		foreach( $atts as &$value ) {
+		foreach ( $atts as &$value ) {
 			if ( false !== strpos( $value, '<' ) ) {
 				if ( 1 !== preg_match( '/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value ) ) {
 					$value = '';
@@ -532,7 +544,7 @@
 			}
 		}
 	} else {
-		$atts = ltrim($text);
+		$atts = ltrim( $text );
 	}
 	return $atts;
 }
@@ -555,13 +567,13 @@
  * @return array Combined and filtered attribute list.
  */
 function shortcode_atts( $pairs, $atts, $shortcode = '' ) {
-	$atts = (array)$atts;
+	$atts = (array) $atts;
 	$out = array();
-	foreach ($pairs as $name => $default) {
-		if ( array_key_exists($name, $atts) )
-			$out[$name] = $atts[$name];
-		else
-			$out[$name] = $default;
+	foreach ( $pairs as $name => $default ) {
+		if ( array_key_exists( $name, $atts ) ) {
+			$out[ $name ] = $atts[ $name ];
+		} else { $out[ $name ] = $default;
+		}
 	}
 	/**
 	 * Filters a shortcode's default attributes.
@@ -601,8 +613,9 @@
 		return $content;
 	}
 
-	if (empty($shortcode_tags) || !is_array($shortcode_tags))
+	if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {
 		return $content;
+	}
 
 	// Find all registered tag names in $content.
 	preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
@@ -647,7 +660,7 @@
 function strip_shortcode_tag( $m ) {
 	// allow [[foo]] syntax for escaping a tag
 	if ( $m[1] == '[' && $m[6] == ']' ) {
-		return substr($m[0], 1, -1);
+		return substr( $m[0], 1, -1 );
 	}
 
 	return $m[1] . $m[6];
Index: src/wp-includes/taxonomy.php
===================================================================
--- src/wp-includes/taxonomy.php	(revision 40901)
+++ src/wp-includes/taxonomy.php	(working copy)
@@ -25,7 +25,11 @@
 	global $wp_rewrite;
 
 	if ( ! did_action( 'init' ) ) {
-		$rewrite = array( 'category' => false, 'post_tag' => false, 'post_format' => false );
+		$rewrite = array(
+			'category' => false,
+			'post_tag' => false,
+			'post_format' => false,
+		);
 	} else {
 
 		/**
@@ -39,17 +43,19 @@
 		$rewrite = array(
 			'category' => array(
 				'hierarchical' => true,
-				'slug' => get_option('category_base') ? get_option('category_base') : 'category',
-				'with_front' => ! get_option('category_base') || $wp_rewrite->using_index_permalinks(),
+				'slug' => get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category',
+				'with_front' => ! get_option( 'category_base' ) || $wp_rewrite->using_index_permalinks(),
 				'ep_mask' => EP_CATEGORIES,
 			),
 			'post_tag' => array(
 				'hierarchical' => false,
-				'slug' => get_option('tag_base') ? get_option('tag_base') : 'tag',
-				'with_front' => ! get_option('tag_base') || $wp_rewrite->using_index_permalinks(),
+				'slug' => get_option( 'tag_base' ) ? get_option( 'tag_base' ) : 'tag',
+				'with_front' => ! get_option( 'tag_base' ) || $wp_rewrite->using_index_permalinks(),
 				'ep_mask' => EP_TAGS,
 			),
-			'post_format' => $post_format_base ? array( 'slug' => $post_format_base ) : false,
+			'post_format' => $post_format_base ? array(
+				'slug' => $post_format_base,
+			) : false,
 		);
 	}
 
@@ -73,7 +79,7 @@
 	) );
 
 	register_taxonomy( 'post_tag', 'post', array(
-	 	'hierarchical' => false,
+		 'hierarchical' => false,
 		'query_var' => 'tag',
 		'rewrite' => $rewrite['post_tag'],
 		'public' => true,
@@ -170,7 +176,7 @@
 
 	$field = ('names' == $output) ? 'name' : false;
 
-	return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
+	return wp_filter_object_list( $wp_taxonomies, $args, $operator, $field );
 }
 
 /**
@@ -197,9 +203,10 @@
 function get_object_taxonomies( $object, $output = 'names' ) {
 	global $wp_taxonomies;
 
-	if ( is_object($object) ) {
-		if ( $object->post_type == 'attachment' )
+	if ( is_object( $object ) ) {
+		if ( $object->post_type == 'attachment' ) {
 			return get_attachment_taxonomies( $object, $output );
+		}
 		$object = $object->post_type;
 	}
 
@@ -207,11 +214,11 @@
 
 	$taxonomies = array();
 	foreach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) {
-		if ( array_intersect($object, (array) $tax_obj->object_type) ) {
-			if ( 'names' == $output )
+		if ( array_intersect( $object, (array) $tax_obj->object_type ) ) {
+			if ( 'names' == $output ) {
 				$taxonomies[] = $tax_name;
-			else
-				$taxonomies[ $tax_name ] = $tax_obj;
+			} else { $taxonomies[ $tax_name ] = $tax_obj;
+			}
 		}
 	}
 
@@ -234,10 +241,11 @@
 function get_taxonomy( $taxonomy ) {
 	global $wp_taxonomies;
 
-	if ( ! taxonomy_exists( $taxonomy ) )
+	if ( ! taxonomy_exists( $taxonomy ) ) {
 		return false;
+	}
 
-	return $wp_taxonomies[$taxonomy];
+	return $wp_taxonomies[ $taxonomy ];
 }
 
 /**
@@ -255,7 +263,7 @@
 function taxonomy_exists( $taxonomy ) {
 	global $wp_taxonomies;
 
-	return isset( $wp_taxonomies[$taxonomy] );
+	return isset( $wp_taxonomies[ $taxonomy ] );
 }
 
 /**
@@ -271,11 +279,12 @@
  * @param string $taxonomy Name of taxonomy object.
  * @return bool Whether the taxonomy is hierarchical.
  */
-function is_taxonomy_hierarchical($taxonomy) {
-	if ( ! taxonomy_exists($taxonomy) )
+function is_taxonomy_hierarchical( $taxonomy ) {
+	if ( ! taxonomy_exists( $taxonomy ) ) {
 		return false;
+	}
 
-	$taxonomy = get_taxonomy($taxonomy);
+	$taxonomy = get_taxonomy( $taxonomy );
 	return $taxonomy->hierarchical;
 }
 
@@ -371,8 +380,9 @@
 function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
 	global $wp_taxonomies;
 
-	if ( ! is_array( $wp_taxonomies ) )
+	if ( ! is_array( $wp_taxonomies ) ) {
 		$wp_taxonomies = array();
+	}
 
 	$args = wp_parse_args( $args );
 
@@ -388,7 +398,6 @@
 
 	$taxonomy_object->add_hooks();
 
-
 	/**
 	 * Fires after a taxonomy is registered.
 	 *
@@ -485,11 +494,13 @@
 function get_taxonomy_labels( $tax ) {
 	$tax->labels = (array) $tax->labels;
 
-	if ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) )
+	if ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) ) {
 		$tax->labels['separate_items_with_commas'] = $tax->helps;
+	}
 
-	if ( isset( $tax->no_tagcloud ) && empty( $tax->labels['not_found'] ) )
+	if ( isset( $tax->no_tagcloud ) && empty( $tax->labels['not_found'] ) ) {
 		$tax->labels['not_found'] = $tax->no_tagcloud;
+	}
 
 	$nohier_vs_hier_defaults = array(
 		'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),
@@ -550,17 +561,20 @@
  * @param string $object_type Name of the object type.
  * @return bool True if successful, false if not.
  */
-function register_taxonomy_for_object_type( $taxonomy, $object_type) {
+function register_taxonomy_for_object_type( $taxonomy, $object_type ) {
 	global $wp_taxonomies;
 
-	if ( !isset($wp_taxonomies[$taxonomy]) )
+	if ( ! isset( $wp_taxonomies[ $taxonomy ] ) ) {
 		return false;
+	}
 
-	if ( ! get_post_type_object($object_type) )
+	if ( ! get_post_type_object( $object_type ) ) {
 		return false;
+	}
 
-	if ( ! in_array( $object_type, $wp_taxonomies[$taxonomy]->object_type ) )
-		$wp_taxonomies[$taxonomy]->object_type[] = $object_type;
+	if ( ! in_array( $object_type, $wp_taxonomies[ $taxonomy ]->object_type ) ) {
+		$wp_taxonomies[ $taxonomy ]->object_type[] = $object_type;
+	}
 
 	// Filter out empties.
 	$wp_taxonomies[ $taxonomy ]->object_type = array_filter( $wp_taxonomies[ $taxonomy ]->object_type );
@@ -582,15 +596,18 @@
 function unregister_taxonomy_for_object_type( $taxonomy, $object_type ) {
 	global $wp_taxonomies;
 
-	if ( ! isset( $wp_taxonomies[ $taxonomy ] ) )
+	if ( ! isset( $wp_taxonomies[ $taxonomy ] ) ) {
 		return false;
+	}
 
-	if ( ! get_post_type_object( $object_type ) )
+	if ( ! get_post_type_object( $object_type ) ) {
 		return false;
+	}
 
 	$key = array_search( $object_type, $wp_taxonomies[ $taxonomy ]->object_type, true );
-	if ( false === $key )
+	if ( false === $key ) {
 		return false;
+	}
 
 	unset( $wp_taxonomies[ $taxonomy ]->object_type[ $key ] );
 	return true;
@@ -640,19 +657,21 @@
 		}
 	}
 
-	$defaults = array( 'order' => 'ASC' );
+	$defaults = array(
+		'order' => 'ASC',
+	);
 	$args = wp_parse_args( $args, $defaults );
 
 	$order = ( 'desc' == strtolower( $args['order'] ) ) ? 'DESC' : 'ASC';
 
-	$term_ids = array_map('intval', $term_ids );
+	$term_ids = array_map( 'intval', $term_ids );
 
 	$taxonomies = "'" . implode( "', '", array_map( 'esc_sql', $taxonomies ) ) . "'";
 	$term_ids = "'" . implode( "', '", $term_ids ) . "'";
 
-	$object_ids = $wpdb->get_col("SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tt.term_id IN ($term_ids) ORDER BY tr.object_id $order");
+	$object_ids = $wpdb->get_col( "SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tt.term_id IN ($term_ids) ORDER BY tr.object_id $order" );
 
-	if ( ! $object_ids ){
+	if ( ! $object_ids ) {
 		return array();
 	}
 	return $object_ids;
@@ -870,7 +889,7 @@
 			break;
 		case 'term_taxonomy_id' :
 			$args['term_taxonomy_id'] = $value;
-			unset( $args[ 'taxonomy' ] );
+			unset( $args['taxonomy'] );
 			break;
 		default :
 			return false;
@@ -912,20 +931,22 @@
 
 	$term_id = intval( $term_id );
 
-	$terms = _get_term_hierarchy($taxonomy);
+	$terms = _get_term_hierarchy( $taxonomy );
 
-	if ( ! isset($terms[$term_id]) )
+	if ( ! isset( $terms[ $term_id ] ) ) {
 		return array();
+	}
 
-	$children = $terms[$term_id];
+	$children = $terms[ $term_id ];
 
-	foreach ( (array) $terms[$term_id] as $child ) {
+	foreach ( (array) $terms[ $term_id ] as $child ) {
 		if ( $term_id == $child ) {
 			continue;
 		}
 
-		if ( isset($terms[$child]) )
-			$children = array_merge($children, get_term_children($child, $taxonomy));
+		if ( isset( $terms[ $child ] ) ) {
+			$children = array_merge( $children, get_term_children( $child, $taxonomy ) );
+		}
 	}
 
 	return $children;
@@ -949,14 +970,17 @@
  */
 function get_term_field( $field, $term, $taxonomy = '', $context = 'display' ) {
 	$term = get_term( $term, $taxonomy );
-	if ( is_wp_error($term) )
+	if ( is_wp_error( $term ) ) {
 		return $term;
+	}
 
-	if ( !is_object($term) )
+	if ( ! is_object( $term ) ) {
 		return '';
+	}
 
-	if ( !isset($term->$field) )
+	if ( ! isset( $term->$field ) ) {
 		return '';
+	}
 
 	return sanitize_term_field( $field, $term->$field, $term->term_id, $term->taxonomy, $context );
 }
@@ -976,13 +1000,15 @@
 function get_term_to_edit( $id, $taxonomy ) {
 	$term = get_term( $id, $taxonomy );
 
-	if ( is_wp_error($term) )
+	if ( is_wp_error( $term ) ) {
 		return $term;
+	}
 
-	if ( !is_object($term) )
+	if ( ! is_object( $term ) ) {
 		return '';
+	}
 
-	return sanitize_term($term, $taxonomy, 'edit');
+	return sanitize_term( $term, $taxonomy, 'edit' );
 }
 
 /**
@@ -1125,7 +1151,7 @@
 	}
 
 	if ( wp_term_is_shared( $term_id ) ) {
-		return new WP_Error( 'ambiguous_term_id', __( 'Term meta cannot be added to terms that are shared between taxonomies.'), $term_id );
+		return new WP_Error( 'ambiguous_term_id', __( 'Term meta cannot be added to terms that are shared between taxonomies.' ), $term_id );
 	}
 
 	$added = add_metadata( 'term', $term_id, $meta_key, $meta_value, $unique );
@@ -1207,7 +1233,7 @@
 	}
 
 	if ( wp_term_is_shared( $term_id ) ) {
-		return new WP_Error( 'ambiguous_term_id', __( 'Term meta cannot be added to terms that are shared between taxonomies.'), $term_id );
+		return new WP_Error( 'ambiguous_term_id', __( 'Term meta cannot be added to terms that are shared between taxonomies.' ), $term_id );
 	}
 
 	$updated = update_metadata( 'term', $term_id, $meta_key, $meta_value, $prev_value );
@@ -1263,14 +1289,15 @@
 	$select = "SELECT term_id FROM $wpdb->terms as t WHERE ";
 	$tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE ";
 
-	if ( is_int($term) ) {
-		if ( 0 == $term )
+	if ( is_int( $term ) ) {
+		if ( 0 == $term ) {
 			return 0;
+		}
 		$where = 't.term_id = %d';
-		if ( !empty($taxonomy) )
-			return $wpdb->get_row( $wpdb->prepare( $tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy ), ARRAY_A );
-		else
-			return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) );
+		if ( ! empty( $taxonomy ) ) {
+			return $wpdb->get_row( $wpdb->prepare( $tax_select . $where . ' AND tt.taxonomy = %s', $term, $taxonomy ), ARRAY_A );
+		} else { return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) );
+		}
 	}
 
 	$term = trim( wp_unslash( $term ) );
@@ -1278,11 +1305,11 @@
 
 	$where = 't.slug = %s';
 	$else_where = 't.name = %s';
-	$where_fields = array($slug);
-	$else_where_fields = array($term);
+	$where_fields = array( $slug );
+	$else_where_fields = array( $term );
 	$orderby = 'ORDER BY t.term_id ASC';
 	$limit = 'LIMIT 1';
-	if ( !empty($taxonomy) ) {
+	if ( ! empty( $taxonomy ) ) {
 		if ( is_numeric( $parent ) ) {
 			$parent = (int) $parent;
 			$where_fields[] = $parent;
@@ -1294,16 +1321,18 @@
 		$where_fields[] = $taxonomy;
 		$else_where_fields[] = $taxonomy;
 
-		if ( $result = $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s $orderby $limit", $where_fields), ARRAY_A) )
+		if ( $result = $wpdb->get_row( $wpdb->prepare( "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s $orderby $limit", $where_fields ), ARRAY_A ) ) {
 			return $result;
+		}
 
-		return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $else_where AND tt.taxonomy = %s $orderby $limit", $else_where_fields), ARRAY_A);
+		return $wpdb->get_row( $wpdb->prepare( "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $else_where AND tt.taxonomy = %s $orderby $limit", $else_where_fields ), ARRAY_A );
 	}
 
-	if ( $result = $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where $orderby $limit", $where_fields) ) )
+	if ( $result = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms as t WHERE $where $orderby $limit", $where_fields ) ) ) {
 		return $result;
+	}
 
-	return $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $else_where $orderby $limit", $else_where_fields) );
+	return $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms as t WHERE $else_where $orderby $limit", $else_where_fields ) );
 }
 
 /**
@@ -1319,15 +1348,19 @@
  * @return bool Whether `$term2` is a child of `$term1`.
  */
 function term_is_ancestor_of( $term1, $term2, $taxonomy ) {
-	if ( ! isset( $term1->term_id ) )
+	if ( ! isset( $term1->term_id ) ) {
 		$term1 = get_term( $term1, $taxonomy );
-	if ( ! isset( $term2->parent ) )
+	}
+	if ( ! isset( $term2->parent ) ) {
 		$term2 = get_term( $term2, $taxonomy );
+	}
 
-	if ( empty( $term1->term_id ) || empty( $term2->parent ) )
+	if ( empty( $term1->term_id ) || empty( $term2->parent ) ) {
 		return false;
-	if ( $term2->parent == $term1->term_id )
+	}
+	if ( $term2->parent == $term1->term_id ) {
 		return true;
+	}
 
 	return term_is_ancestor_of( $term1, get_term( $term2->parent, $taxonomy ), $taxonomy );
 }
@@ -1349,27 +1382,29 @@
  *                               'display', 'attribute', or 'js'. Default 'display'.
  * @return array|object Term with all fields sanitized.
  */
-function sanitize_term($term, $taxonomy, $context = 'display') {
+function sanitize_term( $term, $taxonomy, $context = 'display' ) {
 	$fields = array( 'term_id', 'name', 'description', 'slug', 'count', 'parent', 'term_group', 'term_taxonomy_id', 'object_id' );
 
 	$do_object = is_object( $term );
 
-	$term_id = $do_object ? $term->term_id : (isset($term['term_id']) ? $term['term_id'] : 0);
+	$term_id = $do_object ? $term->term_id : (isset( $term['term_id'] ) ? $term['term_id'] : 0);
 
 	foreach ( (array) $fields as $field ) {
 		if ( $do_object ) {
-			if ( isset($term->$field) )
-				$term->$field = sanitize_term_field($field, $term->$field, $term_id, $taxonomy, $context);
+			if ( isset( $term->$field ) ) {
+				$term->$field = sanitize_term_field( $field, $term->$field, $term_id, $taxonomy, $context );
+			}
 		} else {
-			if ( isset($term[$field]) )
-				$term[$field] = sanitize_term_field($field, $term[$field], $term_id, $taxonomy, $context);
+			if ( isset( $term[ $field ] ) ) {
+				$term[ $field ] = sanitize_term_field( $field, $term[ $field ], $term_id, $taxonomy, $context );
+			}
 		}
 	}
 
-	if ( $do_object )
+	if ( $do_object ) {
 		$term->filter = $context;
-	else
-		$term['filter'] = $context;
+	} else { $term['filter'] = $context;
+	}
 
 	return $term;
 }
@@ -1397,16 +1432,18 @@
  *                         'attribute', or 'js'.
  * @return mixed Sanitized field.
  */
-function sanitize_term_field($field, $value, $term_id, $taxonomy, $context) {
+function sanitize_term_field( $field, $value, $term_id, $taxonomy, $context ) {
 	$int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' );
 	if ( in_array( $field, $int_fields ) ) {
 		$value = (int) $value;
-		if ( $value < 0 )
+		if ( $value < 0 ) {
 			$value = 0;
+		}
 	}
 
-	if ( 'raw' == $context )
+	if ( 'raw' == $context ) {
 		return $value;
+	}
 
 	if ( 'edit' == $context ) {
 
@@ -1436,10 +1473,10 @@
 		 */
 		$value = apply_filters( "edit_{$taxonomy}_{$field}", $value, $term_id );
 
-		if ( 'description' == $field )
-			$value = esc_html($value); // textarea_escaped
-		else
-			$value = esc_attr($value);
+		if ( 'description' == $field ) {
+			$value = esc_html( $value ); // textarea_escaped
+		} else { $value = esc_attr( $value );
+		}
 	} elseif ( 'db' == $context ) {
 
 		/**
@@ -1479,7 +1516,6 @@
 			 */
 			$value = apply_filters( 'pre_category_nicename', $value );
 		}
-
 	} elseif ( 'rss' == $context ) {
 
 		/**
@@ -1535,12 +1571,12 @@
 		 * @param string $context Context to retrieve the taxonomy field value.
 		 */
 		$value = apply_filters( "{$taxonomy}_{$field}", $value, $term_id, $context );
-	}
+	}// End if().
 
 	if ( 'attribute' == $context ) {
-		$value = esc_attr($value);
+		$value = esc_attr( $value );
 	} elseif ( 'js' == $context ) {
-		$value = esc_js($value);
+		$value = esc_js( $value );
 	}
 	return $value;
 }
@@ -1558,18 +1594,18 @@
  * @return array|int|WP_Error Number of terms in that taxonomy or WP_Error if the taxonomy does not exist.
  */
 function wp_count_terms( $taxonomy, $args = array() ) {
-	$defaults = array('hide_empty' => false);
-	$args = wp_parse_args($args, $defaults);
+	$defaults = array( 'hide_empty' => false );
+	$args = wp_parse_args( $args, $defaults );
 
 	// backward compatibility
-	if ( isset($args['ignore_empty']) ) {
+	if ( isset( $args['ignore_empty'] ) ) {
 		$args['hide_empty'] = $args['ignore_empty'];
-		unset($args['ignore_empty']);
+		unset( $args['ignore_empty'] );
 	}
 
 	$args['fields'] = 'count';
 
-	return get_terms($taxonomy, $args);
+	return get_terms( $taxonomy, $args );
 }
 
 /**
@@ -1587,8 +1623,9 @@
 function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
 	$object_id = (int) $object_id;
 
-	if ( !is_array($taxonomies) )
-		$taxonomies = array($taxonomies);
+	if ( ! is_array( $taxonomies ) ) {
+		$taxonomies = array( $taxonomies );
+	}
 
 	foreach ( (array) $taxonomies as $taxonomy ) {
 		$term_ids = wp_get_object_terms( $object_id, $taxonomy, array( 'fields' => 'ids' ) );
@@ -1629,10 +1666,12 @@
 
 	$term = (int) $term;
 
-	if ( ! $ids = term_exists($term, $taxonomy) )
+	if ( ! $ids = term_exists( $term, $taxonomy ) ) {
 		return false;
-	if ( is_wp_error( $ids ) )
+	}
+	if ( is_wp_error( $ids ) ) {
 		return $ids;
+	}
 
 	$tt_id = $ids['term_taxonomy_id'];
 
@@ -1640,11 +1679,12 @@
 
 	if ( 'category' == $taxonomy ) {
 		$defaults['default'] = get_option( 'default_category' );
-		if ( $defaults['default'] == $term )
+		if ( $defaults['default'] == $term ) {
 			return 0; // Don't delete the default category
+		}
 	}
 
-	$args = wp_parse_args($args, $defaults);
+	$args = wp_parse_args( $args, $defaults );
 
 	if ( isset( $args['default'] ) ) {
 		$default = (int) $args['default'];
@@ -1668,13 +1708,14 @@
 	do_action( 'pre_delete_term', $term, $taxonomy );
 
 	// Update children to point to new parent
-	if ( is_taxonomy_hierarchical($taxonomy) ) {
-		$term_obj = get_term($term, $taxonomy);
-		if ( is_wp_error( $term_obj ) )
+	if ( is_taxonomy_hierarchical( $taxonomy ) ) {
+		$term_obj = get_term( $term, $taxonomy );
+		if ( is_wp_error( $term_obj ) ) {
 			return $term_obj;
+		}
 		$parent = $term_obj->parent;
 
-		$edit_ids = $wpdb->get_results( "SELECT term_id, term_taxonomy_id FROM $wpdb->term_taxonomy WHERE `parent` = " . (int)$term_obj->term_id );
+		$edit_ids = $wpdb->get_results( "SELECT term_id, term_taxonomy_id FROM $wpdb->term_taxonomy WHERE `parent` = " . (int) $term_obj->term_id );
 		$edit_tt_ids = wp_list_pluck( $edit_ids, 'term_taxonomy_id' );
 
 		/**
@@ -1686,7 +1727,7 @@
 		 */
 		do_action( 'edit_term_taxonomies', $edit_tt_ids );
 
-		$wpdb->update( $wpdb->term_taxonomy, compact( 'parent' ), array( 'parent' => $term_obj->term_id) + compact( 'taxonomy' ) );
+		$wpdb->update( $wpdb->term_taxonomy, compact( 'parent' ), array( 'parent' => $term_obj->term_id ) + compact( 'taxonomy' ) );
 
 		// Clean the cache for all child terms.
 		$edit_term_ids = wp_list_pluck( $edit_ids, 'term_id' );
@@ -1709,21 +1750,23 @@
 
 	foreach ( $object_ids as $object_id ) {
 		$terms = wp_get_object_terms( $object_id, $taxonomy, array( 'fields' => 'ids', 'orderby' => 'none' ) );
-		if ( 1 == count($terms) && isset($default) ) {
-			$terms = array($default);
+		if ( 1 == count( $terms ) && isset( $default ) ) {
+			$terms = array( $default );
 		} else {
-			$terms = array_diff($terms, array($term));
-			if (isset($default) && isset($force_default) && $force_default)
-				$terms = array_merge($terms, array($default));
+			$terms = array_diff( $terms, array( $term ) );
+			if ( isset( $default ) && isset( $force_default ) && $force_default ) {
+				$terms = array_merge( $terms, array( $default ) );
+			}
 		}
-		$terms = array_map('intval', $terms);
+		$terms = array_map( 'intval', $terms );
 		wp_set_object_terms( $object_id, $terms, $taxonomy );
 	}
 
 	// Clean the relationship caches for all object types using this term.
 	$tax_object = get_taxonomy( $taxonomy );
-	foreach ( $tax_object->object_type as $object_type )
+	foreach ( $tax_object->object_type as $object_type ) {
 		clean_object_term_cache( $object_ids, $object_type );
+	}
 
 	$term_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->termmeta WHERE term_id = %d ", $term ) );
 	foreach ( $term_meta_ids as $mid ) {
@@ -1750,10 +1793,11 @@
 	do_action( 'deleted_term_taxonomy', $tt_id );
 
 	// Delete the term if no taxonomies use it.
-	if ( !$wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term) ) )
+	if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term ) ) ) {
 		$wpdb->delete( $wpdb->terms, array( 'term_id' => $term ) );
+	}
 
-	clean_term_cache($term, $taxonomy);
+	clean_term_cache( $term, $taxonomy );
 
 	/**
 	 * Fires after a term is deleted from the database and the cache is cleaned.
@@ -1821,23 +1865,27 @@
  * @return array|WP_Error The requested term data or empty array if no terms found.
  *                        WP_Error if any of the $taxonomies don't exist.
  */
-function wp_get_object_terms($object_ids, $taxonomies, $args = array()) {
+function wp_get_object_terms( $object_ids, $taxonomies, $args = array() ) {
 	global $wpdb;
 
-	if ( empty( $object_ids ) || empty( $taxonomies ) )
+	if ( empty( $object_ids ) || empty( $taxonomies ) ) {
 		return array();
+	}
 
-	if ( !is_array($taxonomies) )
-		$taxonomies = array($taxonomies);
+	if ( ! is_array( $taxonomies ) ) {
+		$taxonomies = array( $taxonomies );
+	}
 
 	foreach ( $taxonomies as $taxonomy ) {
-		if ( ! taxonomy_exists($taxonomy) )
+		if ( ! taxonomy_exists( $taxonomy ) ) {
 			return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
+		}
 	}
 
-	if ( !is_array($object_ids) )
-		$object_ids = array($object_ids);
-	$object_ids = array_map('intval', $object_ids);
+	if ( ! is_array( $object_ids ) ) {
+		$object_ids = array( $object_ids );
+	}
+	$object_ids = array_map( 'intval', $object_ids );
 
 	$args = wp_parse_args( $args );
 
@@ -1945,7 +1993,7 @@
 function wp_insert_term( $term, $taxonomy, $args = array() ) {
 	global $wpdb;
 
-	if ( ! taxonomy_exists($taxonomy) ) {
+	if ( ! taxonomy_exists( $taxonomy ) ) {
 		return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
 	}
 	/**
@@ -1966,7 +2014,7 @@
 	if ( '' == trim( $term ) ) {
 		return new WP_Error( 'empty_term_name', __( 'A name is required for this term.' ) );
 	}
-	$defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
+	$defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '' );
 	$args = wp_parse_args( $args, $defaults );
 
 	if ( $args['parent'] > 0 && ! term_exists( (int) $args['parent'] ) ) {
@@ -1979,7 +2027,7 @@
 	// Coerce null description to strings, to avoid database errors.
 	$args['description'] = (string) $args['description'];
 
-	$args = sanitize_term($args, $taxonomy, 'db');
+	$args = sanitize_term( $args, $taxonomy, 'db' );
 
 	// expected_slashed ($name)
 	$name = wp_unslash( $args['name'] );
@@ -2004,7 +2052,7 @@
 			 * The alias is not in a group, so we create a new one
 			 * and add the alias to it.
 			 */
-			$term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1;
+			$term_group = $wpdb->get_var( "SELECT MAX(term_group) FROM $wpdb->terms" ) + 1;
 
 			wp_update_term( $alias->term_id, $taxonomy, array(
 				'term_group' => $term_group,
@@ -2080,8 +2128,8 @@
 	$term_id = (int) $wpdb->insert_id;
 
 	// Seems unreachable, However, Is used in the case that a term name is provided, which sanitizes to an empty string.
-	if ( empty($slug) ) {
-		$slug = sanitize_title($slug, $term_id);
+	if ( empty( $slug ) ) {
+		$slug = sanitize_title( $slug, $term_id );
 
 		/** This action is documented in wp-includes/taxonomy.php */
 		do_action( 'edit_terms', $term_id, $taxonomy );
@@ -2093,10 +2141,10 @@
 
 	$tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id ) );
 
-	if ( !empty($tt_id) ) {
-		return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id);
+	if ( ! empty( $tt_id ) ) {
+		return array( 'term_id' => $term_id, 'term_taxonomy_id' => $tt_id );
 	}
-	$wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent') + array( 'count' => 0 ) );
+	$wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent' ) + array( 'count' => 0 ) );
 	$tt_id = (int) $wpdb->insert_id;
 
 	/*
@@ -2126,7 +2174,7 @@
 	 * @param int    $tt_id    Term taxonomy ID.
 	 * @param string $taxonomy Taxonomy slug.
 	 */
-	do_action( "create_term", $term_id, $tt_id, $taxonomy );
+	do_action( 'create_term', $term_id, $tt_id, $taxonomy );
 
 	/**
 	 * Fires after a new term is created for a specific taxonomy.
@@ -2151,7 +2199,7 @@
 	 */
 	$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );
 
-	clean_term_cache($term_id, $taxonomy);
+	clean_term_cache( $term_id, $taxonomy );
 
 	/**
 	 * Fires after a new term is created, and after the term cache has been cleaned.
@@ -2177,7 +2225,7 @@
 	 */
 	do_action( "created_{$taxonomy}", $term_id, $tt_id );
 
-	return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id);
+	return array( 'term_id' => $term_id, 'term_taxonomy_id' => $tt_id );
 }
 
 /**
@@ -2212,36 +2260,41 @@
 		return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
 	}
 
-	if ( !is_array($terms) )
-		$terms = array($terms);
+	if ( ! is_array( $terms ) ) {
+		$terms = array( $terms );
+	}
 
-	if ( ! $append )
-		$old_tt_ids =  wp_get_object_terms($object_id, $taxonomy, array('fields' => 'tt_ids', 'orderby' => 'none'));
-	else
-		$old_tt_ids = array();
+	if ( ! $append ) {
+		$old_tt_ids = wp_get_object_terms( $object_id, $taxonomy, array( 'fields' => 'tt_ids', 'orderby' => 'none' ) );
+	} else { $old_tt_ids = array();
+	}
 
 	$tt_ids = array();
 	$term_ids = array();
 	$new_tt_ids = array();
 
-	foreach ( (array) $terms as $term) {
-		if ( !strlen(trim($term)) )
+	foreach ( (array) $terms as $term ) {
+		if ( ! strlen( trim( $term ) ) ) {
 			continue;
+		}
 
-		if ( !$term_info = term_exists($term, $taxonomy) ) {
+		if ( ! $term_info = term_exists( $term, $taxonomy ) ) {
 			// Skip if a non-existent term ID is passed.
-			if ( is_int($term) )
+			if ( is_int( $term ) ) {
 				continue;
-			$term_info = wp_insert_term($term, $taxonomy);
+			}
+			$term_info = wp_insert_term( $term, $taxonomy );
 		}
-		if ( is_wp_error($term_info) )
+		if ( is_wp_error( $term_info ) ) {
 			return $term_info;
+		}
 		$term_ids[] = $term_info['term_id'];
 		$tt_id = $term_info['term_taxonomy_id'];
 		$tt_ids[] = $tt_id;
 
-		if ( $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id = %d", $object_id, $tt_id ) ) )
+		if ( $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id = %d", $object_id, $tt_id ) ) ) {
 			continue;
+		}
 
 		/**
 		 * Fires immediately before an object-term relationship is added.
@@ -2268,10 +2321,11 @@
 		 */
 		do_action( 'added_term_relationship', $object_id, $tt_id, $taxonomy );
 		$new_tt_ids[] = $tt_id;
-	}
+	}// End foreach().
 
-	if ( $new_tt_ids )
+	if ( $new_tt_ids ) {
 		wp_update_term_count( $new_tt_ids, $taxonomy );
+	}
 
 	if ( ! $append ) {
 		$delete_tt_ids = array_diff( $old_tt_ids, $tt_ids );
@@ -2288,17 +2342,21 @@
 		}
 	}
 
-	$t = get_taxonomy($taxonomy);
-	if ( ! $append && isset($t->sort) && $t->sort ) {
+	$t = get_taxonomy( $taxonomy );
+	if ( ! $append && isset( $t->sort ) && $t->sort ) {
 		$values = array();
 		$term_order = 0;
-		$final_tt_ids = wp_get_object_terms($object_id, $taxonomy, array('fields' => 'tt_ids'));
-		foreach ( $tt_ids as $tt_id )
-			if ( in_array($tt_id, $final_tt_ids) )
-				$values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order);
-		if ( $values )
-			if ( false === $wpdb->query( "INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join( ',', $values ) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)" ) )
+		$final_tt_ids = wp_get_object_terms( $object_id, $taxonomy, array( 'fields' => 'tt_ids' ) );
+		foreach ( $tt_ids as $tt_id ) {
+			if ( in_array( $tt_id, $final_tt_ids ) ) {
+				$values[] = $wpdb->prepare( '(%d, %d, %d)', $object_id, $tt_id, ++$term_order );
+			}
+		}
+		if ( $values ) {
+			if ( false === $wpdb->query( "INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join( ',', $values ) . ' ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)' ) ) {
 				return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database' ), $wpdb->last_error );
+			}
+		}
 	}
 
 	wp_cache_delete( $object_id, $taxonomy . '_relationships' );
@@ -2460,17 +2518,19 @@
 	$parent_suffix = '';
 	if ( $needs_suffix && is_taxonomy_hierarchical( $term->taxonomy ) && ! empty( $term->parent ) ) {
 		$the_parent = $term->parent;
-		while ( ! empty($the_parent) ) {
-			$parent_term = get_term($the_parent, $term->taxonomy);
-			if ( is_wp_error($parent_term) || empty($parent_term) )
+		while ( ! empty( $the_parent ) ) {
+			$parent_term = get_term( $the_parent, $term->taxonomy );
+			if ( is_wp_error( $parent_term ) || empty( $parent_term ) ) {
 				break;
+			}
 			$parent_suffix .= '-' . $parent_term->slug;
 			if ( ! term_exists( $slug . $parent_suffix ) ) {
 				break;
 			}
 
-			if ( empty($parent_term->parent) )
+			if ( empty( $parent_term->parent ) ) {
 				break;
+			}
 			$the_parent = $parent_term->parent;
 		}
 	}
@@ -2490,10 +2550,10 @@
 		if ( $parent_suffix ) {
 			$slug .= $parent_suffix;
 		} else {
-			if ( ! empty( $term->term_id ) )
+			if ( ! empty( $term->term_id ) ) {
 				$query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $term->term_id );
-			else
-				$query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug );
+			} else { $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug );
+			}
 
 			if ( $wpdb->get_var( $query ) ) {
 				$num = 2;
@@ -2575,11 +2635,11 @@
 	$term = wp_slash( $term );
 
 	// Merge old and new args with new args overwriting old ones.
-	$args = array_merge($term, $args);
+	$args = array_merge( $term, $args );
 
-	$defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
-	$args = wp_parse_args($args, $defaults);
-	$args = sanitize_term($args, $taxonomy, 'db');
+	$defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '' );
+	$args = wp_parse_args( $args, $defaults );
+	$args = sanitize_term( $args, $taxonomy, 'db' );
 	$parsed_args = $args;
 
 	// expected_slashed ($name)
@@ -2600,7 +2660,7 @@
 	$empty_slug = false;
 	if ( empty( $args['slug'] ) ) {
 		$empty_slug = true;
-		$slug = sanitize_title($name);
+		$slug = sanitize_title( $name );
 	} else {
 		$slug = $args['slug'];
 	}
@@ -2618,7 +2678,7 @@
 			 * The alias is not in a group, so we create a new one
 			 * and add the alias to it.
 			 */
-			$term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1;
+			$term_group = $wpdb->get_var( "SELECT MAX(term_group) FROM $wpdb->terms" ) + 1;
 
 			wp_update_term( $alias->term_id, $taxonomy, array(
 				'term_group' => $term_group,
@@ -2649,14 +2709,14 @@
 		// If an empty slug was passed or the parent changed, reset the slug to something unique.
 		// Otherwise, bail.
 		if ( $empty_slug || ( $parent != $term['parent']) ) {
-			$slug = wp_unique_term_slug($slug, (object) $args);
+			$slug = wp_unique_term_slug( $slug, (object) $args );
 		} else {
 			/* translators: 1: Taxonomy term slug */
-			return new WP_Error('duplicate_term_slug', sprintf(__('The slug &#8220;%s&#8221; is already in use by another term'), $slug));
+			return new WP_Error( 'duplicate_term_slug', sprintf( __( 'The slug &#8220;%s&#8221; is already in use by another term' ), $slug ) );
 		}
 	}
 
-	$tt_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id) );
+	$tt_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id ) );
 
 	// Check whether this is a shared term that needs splitting.
 	$_term_id = _split_shared_term( $term_id, $tt_id );
@@ -2689,8 +2749,8 @@
 	$data = apply_filters( 'wp_update_term_data', $data, $term_id, $taxonomy, $args );
 
 	$wpdb->update( $wpdb->terms, $data, compact( 'term_id' ) );
-	if ( empty($slug) ) {
-		$slug = sanitize_title($name, $term_id);
+	if ( empty( $slug ) ) {
+		$slug = sanitize_title( $name, $term_id );
 		$wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );
 	}
 
@@ -2735,7 +2795,7 @@
 	 * @param int    $tt_id    Term taxonomy ID.
 	 * @param string $taxonomy Taxonomy slug.
 	 */
-	do_action( "edit_term", $term_id, $tt_id, $taxonomy );
+	do_action( 'edit_term', $term_id, $tt_id, $taxonomy );
 
 	/**
 	 * Fires after a term in a specific taxonomy has been updated, but before the term
@@ -2753,7 +2813,7 @@
 	/** This filter is documented in wp-includes/taxonomy.php */
 	$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );
 
-	clean_term_cache($term_id, $taxonomy);
+	clean_term_cache( $term_id, $taxonomy );
 
 	/**
 	 * Fires after a term has been updated, and the term cache has been cleaned.
@@ -2764,7 +2824,7 @@
 	 * @param int    $tt_id    Term taxonomy ID.
 	 * @param string $taxonomy Taxonomy slug.
 	 */
-	do_action( "edited_term", $term_id, $tt_id, $taxonomy );
+	do_action( 'edited_term', $term_id, $tt_id, $taxonomy );
 
 	/**
 	 * Fires after a term for a specific taxonomy has been updated, and the term
@@ -2779,7 +2839,7 @@
 	 */
 	do_action( "edited_{$taxonomy}", $term_id, $tt_id );
 
-	return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id);
+	return array( 'term_id' => $term_id, 'term_taxonomy_id' => $tt_id );
 }
 
 /**
@@ -2792,14 +2852,15 @@
  * @param bool $defer Optional. Enable if true, disable if false.
  * @return bool Whether term counting is enabled or disabled.
  */
-function wp_defer_term_counting($defer=null) {
+function wp_defer_term_counting( $defer = null ) {
 	static $_defer = false;
 
-	if ( is_bool($defer) ) {
+	if ( is_bool( $defer ) ) {
 		$_defer = $defer;
 		// flush any deferred counts
-		if ( !$defer )
+		if ( ! $defer ) {
 			wp_update_term_count( null, null, true );
+		}
 	}
 
 	return $_defer;
@@ -2827,22 +2888,25 @@
 	static $_deferred = array();
 
 	if ( $do_deferred ) {
-		foreach ( (array) array_keys($_deferred) as $tax ) {
-			wp_update_term_count_now( $_deferred[$tax], $tax );
-			unset( $_deferred[$tax] );
+		foreach ( (array) array_keys( $_deferred ) as $tax ) {
+			wp_update_term_count_now( $_deferred[ $tax ], $tax );
+			unset( $_deferred[ $tax ] );
 		}
 	}
 
-	if ( empty($terms) )
+	if ( empty( $terms ) ) {
 		return false;
+	}
 
-	if ( !is_array($terms) )
-		$terms = array($terms);
+	if ( ! is_array( $terms ) ) {
+		$terms = array( $terms );
+	}
 
 	if ( wp_defer_term_counting() ) {
-		if ( !isset($_deferred[$taxonomy]) )
-			$_deferred[$taxonomy] = array();
-		$_deferred[$taxonomy] = array_unique( array_merge($_deferred[$taxonomy], $terms) );
+		if ( ! isset( $_deferred[ $taxonomy ] ) ) {
+			$_deferred[ $taxonomy ] = array();
+		}
+		$_deferred[ $taxonomy ] = array_unique( array_merge( $_deferred[ $taxonomy ], $terms ) );
 		return true;
 	}
 
@@ -2859,16 +2923,17 @@
  * @return true Always true when complete.
  */
 function wp_update_term_count_now( $terms, $taxonomy ) {
-	$terms = array_map('intval', $terms);
+	$terms = array_map( 'intval', $terms );
 
-	$taxonomy = get_taxonomy($taxonomy);
-	if ( !empty($taxonomy->update_count_callback) ) {
-		call_user_func($taxonomy->update_count_callback, $terms, $taxonomy);
+	$taxonomy = get_taxonomy( $taxonomy );
+	if ( ! empty( $taxonomy->update_count_callback ) ) {
+		call_user_func( $taxonomy->update_count_callback, $terms, $taxonomy );
 	} else {
 		$object_types = (array) $taxonomy->object_type;
 		foreach ( $object_types as &$object_type ) {
-			if ( 0 === strpos( $object_type, 'attachment:' ) )
+			if ( 0 === strpos( $object_type, 'attachment:' ) ) {
 				list( $object_type ) = explode( ':', $object_type );
+			}
 		}
 
 		if ( $object_types == array_filter( $object_types, 'post_type_exists' ) ) {
@@ -2880,7 +2945,7 @@
 		}
 	}
 
-	clean_term_cache($terms, '', false);
+	clean_term_cache( $terms, '', false );
 
 	return true;
 }
@@ -2905,21 +2970,22 @@
  * @param int|array    $object_ids  Single or list of term object ID(s).
  * @param array|string $object_type The taxonomy object type.
  */
-function clean_object_term_cache($object_ids, $object_type) {
+function clean_object_term_cache( $object_ids, $object_type ) {
 	global $_wp_suspend_cache_invalidation;
 
 	if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
 		return;
 	}
 
-	if ( !is_array($object_ids) )
-		$object_ids = array($object_ids);
+	if ( ! is_array( $object_ids ) ) {
+		$object_ids = array( $object_ids );
+	}
 
 	$taxonomies = get_object_taxonomies( $object_type );
 
 	foreach ( $object_ids as $id ) {
 		foreach ( $taxonomies as $taxonomy ) {
-			wp_cache_delete($id, "{$taxonomy}_relationships");
+			wp_cache_delete( $id, "{$taxonomy}_relationships" );
 		}
 	}
 
@@ -2948,31 +3014,32 @@
  * @param bool      $clean_taxonomy Optional. Whether to clean taxonomy wide caches (true), or just individual
  *                                  term object caches (false). Default true.
  */
-function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) {
+function clean_term_cache( $ids, $taxonomy = '', $clean_taxonomy = true ) {
 	global $wpdb, $_wp_suspend_cache_invalidation;
 
 	if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
 		return;
 	}
 
-	if ( !is_array($ids) )
-		$ids = array($ids);
+	if ( ! is_array( $ids ) ) {
+		$ids = array( $ids );
+	}
 
 	$taxonomies = array();
 	// If no taxonomy, assume tt_ids.
-	if ( empty($taxonomy) ) {
-		$tt_ids = array_map('intval', $ids);
-		$tt_ids = implode(', ', $tt_ids);
-		$terms = $wpdb->get_results("SELECT term_id, taxonomy FROM $wpdb->term_taxonomy WHERE term_taxonomy_id IN ($tt_ids)");
+	if ( empty( $taxonomy ) ) {
+		$tt_ids = array_map( 'intval', $ids );
+		$tt_ids = implode( ', ', $tt_ids );
+		$terms = $wpdb->get_results( "SELECT term_id, taxonomy FROM $wpdb->term_taxonomy WHERE term_taxonomy_id IN ($tt_ids)" );
 		$ids = array();
 		foreach ( (array) $terms as $term ) {
 			$taxonomies[] = $term->taxonomy;
 			$ids[] = $term->term_id;
 			wp_cache_delete( $term->term_id, 'terms' );
 		}
-		$taxonomies = array_unique($taxonomies);
+		$taxonomies = array_unique( $taxonomies );
 	} else {
-		$taxonomies = array($taxonomy);
+		$taxonomies = array( $taxonomy );
 		foreach ( $taxonomies as $taxonomy ) {
 			foreach ( $ids as $id ) {
 				wp_cache_delete( $id, 'terms' );
@@ -2982,11 +3049,11 @@
 
 	foreach ( $taxonomies as $taxonomy ) {
 		if ( $clean_taxonomy ) {
-			wp_cache_delete('all_ids', $taxonomy);
-			wp_cache_delete('get', $taxonomy);
-			delete_option("{$taxonomy}_children");
+			wp_cache_delete( 'all_ids', $taxonomy );
+			wp_cache_delete( 'get', $taxonomy );
+			delete_option( "{$taxonomy}_children" );
 			// Regenerate {$taxonomy}_children
-			_get_term_hierarchy($taxonomy);
+			_get_term_hierarchy( $taxonomy );
 		}
 
 		/**
@@ -3072,29 +3139,32 @@
  * @param array|string $object_type The taxonomy object type.
  * @return void|false False if all of the terms in `$object_ids` are already cached.
  */
-function update_object_term_cache($object_ids, $object_type) {
-	if ( empty($object_ids) )
+function update_object_term_cache( $object_ids, $object_type ) {
+	if ( empty( $object_ids ) ) {
 		return;
+	}
 
-	if ( !is_array($object_ids) )
-		$object_ids = explode(',', $object_ids);
+	if ( ! is_array( $object_ids ) ) {
+		$object_ids = explode( ',', $object_ids );
+	}
 
-	$object_ids = array_map('intval', $object_ids);
+	$object_ids = array_map( 'intval', $object_ids );
 
-	$taxonomies = get_object_taxonomies($object_type);
+	$taxonomies = get_object_taxonomies( $object_type );
 
 	$ids = array();
 	foreach ( (array) $object_ids as $id ) {
 		foreach ( $taxonomies as $taxonomy ) {
-			if ( false === wp_cache_get($id, "{$taxonomy}_relationships") ) {
+			if ( false === wp_cache_get( $id, "{$taxonomy}_relationships" ) ) {
 				$ids[] = $id;
 				break;
 			}
 		}
 	}
 
-	if ( empty( $ids ) )
+	if ( empty( $ids ) ) {
 		return false;
+	}
 
 	$terms = wp_get_object_terms( $ids, $taxonomies, array(
 		'fields' => 'all_with_object_id',
@@ -3109,10 +3179,11 @@
 
 	foreach ( $ids as $id ) {
 		foreach ( $taxonomies as $taxonomy ) {
-			if ( ! isset($object_terms[$id][$taxonomy]) ) {
-				if ( !isset($object_terms[$id]) )
-					$object_terms[$id] = array();
-				$object_terms[$id][$taxonomy] = array();
+			if ( ! isset( $object_terms[ $id ][ $taxonomy ] ) ) {
+				if ( ! isset( $object_terms[ $id ] ) ) {
+					$object_terms[ $id ] = array();
+				}
+				$object_terms[ $id ][ $taxonomy ] = array();
 			}
 		}
 	}
@@ -3158,19 +3229,22 @@
  * @return array Empty if $taxonomy isn't hierarchical or returns children as Term IDs.
  */
 function _get_term_hierarchy( $taxonomy ) {
-	if ( !is_taxonomy_hierarchical($taxonomy) )
+	if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
 		return array();
-	$children = get_option("{$taxonomy}_children");
+	}
+	$children = get_option( "{$taxonomy}_children" );
 
-	if ( is_array($children) )
+	if ( is_array( $children ) ) {
 		return $children;
+	}
 	$children = array();
-	$terms = get_terms($taxonomy, array('get' => 'all', 'orderby' => 'id', 'fields' => 'id=>parent'));
+	$terms = get_terms( $taxonomy, array( 'get' => 'all', 'orderby' => 'id', 'fields' => 'id=>parent' ) );
 	foreach ( $terms as $term_id => $parent ) {
-		if ( $parent > 0 )
-			$children[$parent][] = $term_id;
+		if ( $parent > 0 ) {
+			$children[ $parent ][] = $term_id;
+		}
 	}
-	update_option("{$taxonomy}_children", $children);
+	update_option( "{$taxonomy}_children", $children );
 
 	return $children;
 }
@@ -3196,14 +3270,16 @@
  */
 function _get_term_children( $term_id, $terms, $taxonomy, &$ancestors = array() ) {
 	$empty_array = array();
-	if ( empty($terms) )
+	if ( empty( $terms ) ) {
 		return $empty_array;
+	}
 
 	$term_list = array();
-	$has_children = _get_term_hierarchy($taxonomy);
+	$has_children = _get_term_hierarchy( $taxonomy );
 
-	if  ( ( 0 != $term_id ) && ! isset($has_children[$term_id]) )
+	if ( ( 0 != $term_id ) && ! isset( $has_children[ $term_id ] ) ) {
 		return $empty_array;
+	}
 
 	// Include the term itself in the ancestors array, so we can properly detect when a loop has occurred.
 	if ( empty( $ancestors ) ) {
@@ -3212,10 +3288,11 @@
 
 	foreach ( (array) $terms as $term ) {
 		$use_id = false;
-		if ( !is_object($term) ) {
-			$term = get_term($term, $taxonomy);
-			if ( is_wp_error( $term ) )
+		if ( ! is_object( $term ) ) {
+			$term = get_term( $term, $taxonomy );
+			if ( is_wp_error( $term ) ) {
 				return $term;
+			}
 			$use_id = true;
 		}
 
@@ -3225,18 +3302,20 @@
 		}
 
 		if ( $term->parent == $term_id ) {
-			if ( $use_id )
+			if ( $use_id ) {
 				$term_list[] = $term->term_id;
-			else
-				$term_list[] = $term;
+			} else { $term_list[] = $term;
+			}
 
-			if ( !isset($has_children[$term->term_id]) )
+			if ( ! isset( $has_children[ $term->term_id ] ) ) {
 				continue;
+			}
 
 			$ancestors[ $term->term_id ] = 1;
 
-			if ( $children = _get_term_children( $term->term_id, $terms, $taxonomy, $ancestors) )
-				$term_list = array_merge($term_list, $children);
+			if ( $children = _get_term_children( $term->term_id, $terms, $taxonomy, $ancestors ) ) {
+				$term_list = array_merge( $term_list, $children );
+			}
 		}
 	}
 
@@ -3261,42 +3340,45 @@
 	global $wpdb;
 
 	// This function only works for hierarchical taxonomies like post categories.
-	if ( !is_taxonomy_hierarchical( $taxonomy ) )
+	if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
 		return;
+	}
 
-	$term_hier = _get_term_hierarchy($taxonomy);
+	$term_hier = _get_term_hierarchy( $taxonomy );
 
-	if ( empty($term_hier) )
+	if ( empty( $term_hier ) ) {
 		return;
+	}
 
 	$term_items = array();
 	$terms_by_id = array();
 	$term_ids = array();
 
 	foreach ( (array) $terms as $key => $term ) {
-		$terms_by_id[$term->term_id] = & $terms[$key];
-		$term_ids[$term->term_taxonomy_id] = $term->term_id;
+		$terms_by_id[ $term->term_id ] = & $terms[ $key ];
+		$term_ids[ $term->term_taxonomy_id ] = $term->term_id;
 	}
 
 	// Get the object and term ids and stick them in a lookup table.
-	$tax_obj = get_taxonomy($taxonomy);
-	$object_types = esc_sql($tax_obj->object_type);
-	$results = $wpdb->get_results("SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (" . implode(',', array_keys($term_ids)) . ") AND post_type IN ('" . implode("', '", $object_types) . "') AND post_status = 'publish'");
+	$tax_obj = get_taxonomy( $taxonomy );
+	$object_types = esc_sql( $tax_obj->object_type );
+	$results = $wpdb->get_results( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (" . implode( ',', array_keys( $term_ids ) ) . ") AND post_type IN ('" . implode( "', '", $object_types ) . "') AND post_status = 'publish'" );
 	foreach ( $results as $row ) {
-		$id = $term_ids[$row->term_taxonomy_id];
-		$term_items[$id][$row->object_id] = isset($term_items[$id][$row->object_id]) ? ++$term_items[$id][$row->object_id] : 1;
+		$id = $term_ids[ $row->term_taxonomy_id ];
+		$term_items[ $id ][ $row->object_id ] = isset( $term_items[ $id ][ $row->object_id ] ) ? ++$term_items[ $id ][ $row->object_id ] : 1;
 	}
 
 	// Touch every ancestor's lookup row for each post in each term.
 	foreach ( $term_ids as $term_id ) {
 		$child = $term_id;
 		$ancestors = array();
-		while ( !empty( $terms_by_id[$child] ) && $parent = $terms_by_id[$child]->parent ) {
+		while ( ! empty( $terms_by_id[ $child ] ) && $parent = $terms_by_id[ $child ]->parent ) {
 			$ancestors[] = $child;
-			if ( !empty( $term_items[$term_id] ) )
-				foreach ( $term_items[$term_id] as $item_id => $touches ) {
-					$term_items[$parent][$item_id] = isset($term_items[$parent][$item_id]) ? ++$term_items[$parent][$item_id]: 1;
+			if ( ! empty( $term_items[ $term_id ] ) ) {
+				foreach ( $term_items[ $term_id ] as $item_id => $touches ) {
+					$term_items[ $parent ][ $item_id ] = isset( $term_items[ $parent ][ $item_id ] ) ? ++$term_items[ $parent ][ $item_id ]: 1;
 				}
+			}
 			$child = $parent;
 
 			if ( in_array( $parent, $ancestors ) ) {
@@ -3306,9 +3388,11 @@
 	}
 
 	// Transfer the touched cells.
-	foreach ( (array) $term_items as $id => $items )
-		if ( isset($terms_by_id[$id]) )
-			$terms_by_id[$id]->count = count($items);
+	foreach ( (array) $term_items as $id => $items ) {
+		if ( isset( $terms_by_id[ $id ] ) ) {
+			$terms_by_id[ $id ]->count = count( $items );
+		}
+	}
 }
 
 /**
@@ -3327,7 +3411,7 @@
 
 	$non_cached_ids = _get_non_cached_ids( $term_ids, 'terms' );
 	if ( ! empty( $non_cached_ids ) ) {
-		$fresh_terms = $wpdb->get_results( sprintf( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id IN (%s)", join( ",", array_map( 'intval', $non_cached_ids ) ) ) );
+		$fresh_terms = $wpdb->get_results( sprintf( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) );
 
 		update_term_cache( $fresh_terms, $update_meta_cache );
 
@@ -3360,8 +3444,9 @@
 
 	$object_types = (array) $taxonomy->object_type;
 
-	foreach ( $object_types as &$object_type )
+	foreach ( $object_types as &$object_type ) {
 		list( $object_type ) = explode( ':', $object_type );
+	}
 
 	$object_types = array_unique( $object_types );
 
@@ -3370,18 +3455,21 @@
 		$check_attachments = true;
 	}
 
-	if ( $object_types )
+	if ( $object_types ) {
 		$object_types = esc_sql( array_filter( $object_types, 'post_type_exists' ) );
+	}
 
 	foreach ( (array) $terms as $term ) {
 		$count = 0;
 
 		// Attachments can be 'inherit' status, we need to base count off the parent's status if so.
-		if ( $check_attachments )
+		if ( $check_attachments ) {
 			$count += (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts p1 WHERE p1.ID = $wpdb->term_relationships.object_id AND ( post_status = 'publish' OR ( post_status = 'inherit' AND post_parent > 0 AND ( SELECT post_status FROM $wpdb->posts WHERE ID = p1.post_parent ) = 'publish' ) ) AND post_type = 'attachment' AND term_taxonomy_id = %d", $term ) );
+		}
 
-		if ( $object_types )
-			$count += (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type IN ('" . implode("', '", $object_types ) . "') AND term_taxonomy_id = %d", $term ) );
+		if ( $object_types ) {
+			$count += (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type IN ('" . implode( "', '", $object_types ) . "') AND term_taxonomy_id = %d", $term ) );
+		}
 
 		/** This action is documented in wp-includes/taxonomy.php */
 		do_action( 'edit_term_taxonomy', $term, $taxonomy->name );
@@ -3828,7 +3916,7 @@
 function get_term_link( $term, $taxonomy = '' ) {
 	global $wp_rewrite;
 
-	if ( !is_object($term) ) {
+	if ( ! is_object( $term ) ) {
 		if ( is_int( $term ) ) {
 			$term = get_term( $term, $taxonomy );
 		} else {
@@ -3836,42 +3924,44 @@
 		}
 	}
 
-	if ( !is_object($term) )
-		$term = new WP_Error('invalid_term', __('Empty Term'));
+	if ( ! is_object( $term ) ) {
+		$term = new WP_Error( 'invalid_term', __( 'Empty Term' ) );
+	}
 
-	if ( is_wp_error( $term ) )
+	if ( is_wp_error( $term ) ) {
 		return $term;
+	}
 
 	$taxonomy = $term->taxonomy;
 
-	$termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
+	$termlink = $wp_rewrite->get_extra_permastruct( $taxonomy );
 
 	$slug = $term->slug;
-	$t = get_taxonomy($taxonomy);
+	$t = get_taxonomy( $taxonomy );
 
-	if ( empty($termlink) ) {
-		if ( 'category' == $taxonomy )
+	if ( empty( $termlink ) ) {
+		if ( 'category' == $taxonomy ) {
 			$termlink = '?cat=' . $term->term_id;
-		elseif ( $t->query_var )
+		} elseif ( $t->query_var ) {
 			$termlink = "?$t->query_var=$slug";
-		else
-			$termlink = "?taxonomy=$taxonomy&term=$slug";
-		$termlink = home_url($termlink);
+		} else { $termlink = "?taxonomy=$taxonomy&term=$slug";
+		}
+		$termlink = home_url( $termlink );
 	} else {
 		if ( $t->rewrite['hierarchical'] ) {
 			$hierarchical_slugs = array();
 			$ancestors = get_ancestors( $term->term_id, $taxonomy, 'taxonomy' );
-			foreach ( (array)$ancestors as $ancestor ) {
-				$ancestor_term = get_term($ancestor, $taxonomy);
+			foreach ( (array) $ancestors as $ancestor ) {
+				$ancestor_term = get_term( $ancestor, $taxonomy );
 				$hierarchical_slugs[] = $ancestor_term->slug;
 			}
-			$hierarchical_slugs = array_reverse($hierarchical_slugs);
+			$hierarchical_slugs = array_reverse( $hierarchical_slugs );
 			$hierarchical_slugs[] = $slug;
-			$termlink = str_replace("%$taxonomy%", implode('/', $hierarchical_slugs), $termlink);
+			$termlink = str_replace( "%$taxonomy%", implode( '/', $hierarchical_slugs ), $termlink );
 		} else {
-			$termlink = str_replace("%$taxonomy%", $slug, $termlink);
+			$termlink = str_replace( "%$taxonomy%", $slug, $termlink );
 		}
-		$termlink = home_url( user_trailingslashit($termlink, 'category') );
+		$termlink = home_url( user_trailingslashit( $termlink, 'category' ) );
 	}
 	// Back Compat filters.
 	if ( 'post_tag' == $taxonomy ) {
@@ -4003,7 +4093,7 @@
 			$links[] = wp_sprintf( $t['term_template'], esc_attr( get_term_link( $term ) ), $term->name );
 		}
 		if ( $links ) {
-			$taxonomies[$taxonomy] = wp_sprintf( $t['template'], $t['label'], $links, $terms );
+			$taxonomies[ $taxonomy ] = wp_sprintf( $t['template'], $t['label'], $links, $terms );
 		}
 	}
 	return $taxonomies;
@@ -4020,7 +4110,7 @@
 function get_post_taxonomies( $post = 0 ) {
 	$post = get_post( $post );
 
-	return get_object_taxonomies($post);
+	return get_object_taxonomies( $post );
 }
 
 /**
@@ -4038,8 +4128,9 @@
  * @return bool|WP_Error WP_Error on input error.
  */
 function is_object_in_term( $object_id, $taxonomy, $terms = null ) {
-	if ( !$object_id = (int) $object_id )
+	if ( ! $object_id = (int) $object_id ) {
 		return new WP_Error( 'invalid_object', __( 'Invalid object ID' ) );
+	}
 
 	$object_terms = get_object_term_cache( $object_id, $taxonomy );
 	if ( false === $object_terms ) {
@@ -4051,19 +4142,22 @@
 		wp_cache_set( $object_id, wp_list_pluck( $object_terms, 'term_id' ), "{$taxonomy}_relationships" );
 	}
 
-	if ( is_wp_error( $object_terms ) )
+	if ( is_wp_error( $object_terms ) ) {
 		return $object_terms;
-	if ( empty( $object_terms ) )
+	}
+	if ( empty( $object_terms ) ) {
 		return false;
-	if ( empty( $terms ) )
-		return ( !empty( $object_terms ) );
+	}
+	if ( empty( $terms ) ) {
+		return ( ! empty( $object_terms ) );
+	}
 
 	$terms = (array) $terms;
 
-	if ( $ints = array_filter( $terms, 'is_int' ) )
+	if ( $ints = array_filter( $terms, 'is_int' ) ) {
 		$strs = array_diff( $terms, $ints );
-	else
-		$strs =& $terms;
+	} else { $strs =& $terms;
+	}
 
 	foreach ( $object_terms as $object_term ) {
 		// If term is an int, check against term_ids only.
@@ -4078,8 +4172,10 @@
 				return true;
 			}
 
-			if ( in_array( $object_term->name, $strs ) ) return true;
-			if ( in_array( $object_term->slug, $strs ) ) return true;
+			if ( in_array( $object_term->name, $strs ) ) { return true;
+			}
+			if ( in_array( $object_term->slug, $strs ) ) { return true;
+			}
 		}
 	}
 
@@ -4136,13 +4232,13 @@
 	}
 
 	if ( 'taxonomy' === $resource_type ) {
-		$term = get_term($object_id, $object_type);
-		while ( ! is_wp_error($term) && ! empty( $term->parent ) && ! in_array( $term->parent, $ancestors ) ) {
+		$term = get_term( $object_id, $object_type );
+		while ( ! is_wp_error( $term ) && ! empty( $term->parent ) && ! in_array( $term->parent, $ancestors ) ) {
 			$ancestors[] = (int) $term->parent;
-			$term = get_term($term->parent, $object_type);
+			$term = get_term( $term->parent, $object_type );
 		}
 	} elseif ( 'post_type' === $resource_type ) {
-		$ancestors = get_post_ancestors($object_id);
+		$ancestors = get_post_ancestors( $object_id );
 	}
 
 	/**
@@ -4192,24 +4288,29 @@
  */
 function wp_check_term_hierarchy_for_loops( $parent, $term_id, $taxonomy ) {
 	// Nothing fancy here - bail
-	if ( !$parent )
+	if ( ! $parent ) {
 		return 0;
+	}
 
 	// Can't be its own parent.
-	if ( $parent == $term_id )
+	if ( $parent == $term_id ) {
 		return 0;
+	}
 
 	// Now look for larger loops.
-	if ( !$loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent, array( $taxonomy ) ) )
+	if ( ! $loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent, array( $taxonomy ) ) ) {
 		return $parent; // No loop
+	}
 
 	// Setting $parent to the given value causes a loop.
-	if ( isset( $loop[$term_id] ) )
+	if ( isset( $loop[ $term_id ] ) ) {
 		return 0;
+	}
 
 	// There's a loop, but it doesn't contain $term_id. Break the loop.
-	foreach ( array_keys( $loop ) as $loop_member )
+	foreach ( array_keys( $loop ) as $loop_member ) {
 		wp_update_term( $loop_member, $taxonomy, array( 'parent' => 0 ) );
+	}
 
 	return $parent;
 }
Index: src/wp-includes/template-loader.php
===================================================================
--- src/wp-includes/template-loader.php	(revision 40901)
+++ src/wp-includes/template-loader.php	(working copy)
@@ -3,13 +3,14 @@
  * Loads the correct template based on the visitor's url
  * @package WordPress
  */
-if ( defined('WP_USE_THEMES') && WP_USE_THEMES )
+if ( defined( 'WP_USE_THEMES' ) && WP_USE_THEMES ) {
 	/**
 	 * Fires before determining which template to load.
 	 *
 	 * @since 1.5.0
 	 */
 	do_action( 'template_redirect' );
+}
 
 /**
  * Filters whether to allow 'HEAD' requests to generate content.
@@ -21,8 +22,9 @@
  *
  * @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.
  */
-if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) )
+if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {
 	exit();
+}
 
 // Process feeds and trackbacks even if not using themes.
 if ( is_robots() ) :
@@ -41,25 +43,25 @@
 	return;
 endif;
 
-if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) :
+if ( defined( 'WP_USE_THEMES' ) && WP_USE_THEMES ) :
 	$template = false;
-	if     ( is_embed()          && $template = get_embed_template()          ) :
-	elseif ( is_404()            && $template = get_404_template()            ) :
-	elseif ( is_search()         && $template = get_search_template()         ) :
-	elseif ( is_front_page()     && $template = get_front_page_template()     ) :
-	elseif ( is_home()           && $template = get_home_template()           ) :
+	if ( is_embed()          && $template = get_embed_template() ) :
+	elseif ( is_404()            && $template = get_404_template() ) :
+	elseif ( is_search()         && $template = get_search_template() ) :
+	elseif ( is_front_page()     && $template = get_front_page_template() ) :
+	elseif ( is_home()           && $template = get_home_template() ) :
 	elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
-	elseif ( is_tax()            && $template = get_taxonomy_template()       ) :
-	elseif ( is_attachment()     && $template = get_attachment_template()     ) :
-		remove_filter('the_content', 'prepend_attachment');
-	elseif ( is_single()         && $template = get_single_template()         ) :
-	elseif ( is_page()           && $template = get_page_template()           ) :
-	elseif ( is_singular()       && $template = get_singular_template()       ) :
-	elseif ( is_category()       && $template = get_category_template()       ) :
-	elseif ( is_tag()            && $template = get_tag_template()            ) :
-	elseif ( is_author()         && $template = get_author_template()         ) :
-	elseif ( is_date()           && $template = get_date_template()           ) :
-	elseif ( is_archive()        && $template = get_archive_template()        ) :
+	elseif ( is_tax()            && $template = get_taxonomy_template() ) :
+	elseif ( is_attachment()     && $template = get_attachment_template() ) :
+		remove_filter( 'the_content', 'prepend_attachment' );
+	elseif ( is_single()         && $template = get_single_template() ) :
+	elseif ( is_page()           && $template = get_page_template() ) :
+	elseif ( is_singular()       && $template = get_singular_template() ) :
+	elseif ( is_category()       && $template = get_category_template() ) :
+	elseif ( is_tag()            && $template = get_tag_template() ) :
+	elseif ( is_author()         && $template = get_author_template() ) :
+	elseif ( is_date()           && $template = get_date_template() ) :
+	elseif ( is_archive()        && $template = get_archive_template() ) :
 	else :
 		$template = get_index_template();
 	endif;
Index: src/wp-includes/template.php
===================================================================
--- src/wp-includes/template.php	(revision 40901)
+++ src/wp-includes/template.php	(working copy)
@@ -23,8 +23,9 @@
 function get_query_template( $type, $templates = array() ) {
 	$type = preg_replace( '|[^a-z0-9-]+|', '', $type );
 
-	if ( empty( $templates ) )
-		$templates = array("{$type}.php");
+	if ( empty( $templates ) ) {
+		$templates = array( "{$type}.php" );
+	}
 
 	/**
 	 * Filters the list of template filenames that are searched for when retrieving a template to use.
@@ -75,7 +76,7 @@
  * @return string Full path to index template file.
  */
 function get_index_template() {
-	return get_query_template('index');
+	return get_query_template( 'index' );
 }
 
 /**
@@ -91,7 +92,7 @@
  * @return string Full path to 404 template file.
  */
 function get_404_template() {
-	return get_query_template('404');
+	return get_query_template( '404' );
 }
 
 /**
@@ -134,8 +135,9 @@
  */
 function get_post_type_archive_template() {
 	$post_type = get_query_var( 'post_type' );
-	if ( is_array( $post_type ) )
+	if ( is_array( $post_type ) ) {
 		$post_type = reset( $post_type );
+	}
 
 	$obj = get_post_type_object( $post_type );
 	if ( ! ( $obj instanceof WP_Post_Type ) || ! $obj->has_archive ) {
@@ -335,7 +337,7 @@
  * @return string Full path to date template file.
  */
 function get_date_template() {
-	return get_query_template('date');
+	return get_query_template( 'date' );
 }
 
 /**
@@ -369,7 +371,7 @@
  * @return string Full path to front page template file.
  */
 function get_front_page_template() {
-	$templates = array('front-page.php');
+	$templates = array( 'front-page.php' );
 
 	return get_query_template( 'front_page', $templates );
 }
@@ -405,18 +407,20 @@
 function get_page_template() {
 	$id = get_queried_object_id();
 	$template = get_page_template_slug();
-	$pagename = get_query_var('pagename');
+	$pagename = get_query_var( 'pagename' );
 
 	if ( ! $pagename && $id ) {
 		// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
 		$post = get_queried_object();
-		if ( $post )
+		if ( $post ) {
 			$pagename = $post->post_name;
+		}
 	}
 
 	$templates = array();
-	if ( $template && 0 === validate_file( $template ) )
+	if ( $template && 0 === validate_file( $template ) ) {
 		$templates[] = $template;
+	}
 	if ( $pagename ) {
 		$pagename_decoded = urldecode( $pagename );
 		if ( $pagename_decoded !== $pagename ) {
@@ -424,8 +428,9 @@
 		}
 		$templates[] = "page-{$pagename}.php";
 	}
-	if ( $id )
+	if ( $id ) {
 		$templates[] = "page-{$id}.php";
+	}
 	$templates[] = 'page.php';
 
 	return get_query_template( 'page', $templates );
@@ -444,7 +449,7 @@
  * @return string Full path to search template file.
  */
 function get_search_template() {
-	return get_query_template('search');
+	return get_query_template( 'search' );
 }
 
 /**
@@ -498,7 +503,7 @@
 		$templates[] = "single-{$object->post_type}.php";
 	}
 
-	$templates[] = "single.php";
+	$templates[] = 'single.php';
 
 	return get_query_template( 'single', $templates );
 }
@@ -540,7 +545,7 @@
 		$templates[] = "embed-{$object->post_type}.php";
 	}
 
-	$templates[] = "embed.php";
+	$templates[] = 'embed.php';
 
 	return get_query_template( 'embed', $templates );
 }
@@ -626,15 +631,16 @@
  * @param bool         $require_once   Whether to require_once or require. Default true. Has no effect if $load is false.
  * @return string The template filename if one is located.
  */
-function locate_template($template_names, $load = false, $require_once = true ) {
+function locate_template( $template_names, $load = false, $require_once = true ) {
 	$located = '';
 	foreach ( (array) $template_names as $template_name ) {
-		if ( !$template_name )
+		if ( ! $template_name ) {
 			continue;
-		if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
+		}
+		if ( file_exists( STYLESHEETPATH . '/' . $template_name ) ) {
 			$located = STYLESHEETPATH . '/' . $template_name;
 			break;
-		} elseif ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
+		} elseif ( file_exists( TEMPLATEPATH . '/' . $template_name ) ) {
 			$located = TEMPLATEPATH . '/' . $template_name;
 			break;
 		} elseif ( file_exists( ABSPATH . WPINC . '/theme-compat/' . $template_name ) ) {
@@ -643,8 +649,9 @@
 		}
 	}
 
-	if ( $load && '' != $located )
+	if ( $load && '' != $located ) {
 		load_template( $located, $require_once );
+	}
 
 	return $located;
 }
Index: src/wp-includes/theme-compat/comments.php
===================================================================
--- src/wp-includes/theme-compat/comments.php	(revision 40901)
+++ src/wp-includes/theme-compat/comments.php	(working copy)
@@ -17,14 +17,15 @@
 );
 
 // Do not delete these lines
-	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
-		die ('Please do not load this page directly. Thanks!');
+if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && 'comments.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
+	die( 'Please do not load this page directly. Thanks!' );
+}
 
-	if ( post_password_required() ) { ?>
-		<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.'); ?></p>
+if ( post_password_required() ) { ?>
+		<p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view comments.' ); ?></p>
 	<?php
-		return;
-	}
+	return;
+}
 ?>
 
 <!-- You can start editing here. -->
@@ -32,14 +33,14 @@
 <?php if ( have_comments() ) : ?>
 	<h3 id="comments">
 		<?php
-			if ( 1 == get_comments_number() ) {
-				/* translators: %s: post title */
-				printf( __( 'One response to %s' ),  '&#8220;' . get_the_title() . '&#8221;' );
-			} else {
-				/* translators: 1: number of comments, 2: post title */
-				printf( _n( '%1$s response to %2$s', '%1$s responses to %2$s', get_comments_number() ),
-					number_format_i18n( get_comments_number() ),  '&#8220;' . get_the_title() . '&#8221;' );
-			}
+		if ( 1 == get_comments_number() ) {
+			/* translators: %s: post title */
+			printf( __( 'One response to %s' ),  '&#8220;' . get_the_title() . '&#8221;' );
+		} else {
+			/* translators: 1: number of comments, 2: post title */
+			printf( _n( '%1$s response to %2$s', '%1$s responses to %2$s', get_comments_number() ),
+			number_format_i18n( get_comments_number() ),  '&#8220;' . get_the_title() . '&#8221;' );
+		}
 		?>
 	</h3>
 
@@ -56,14 +57,14 @@
 		<div class="alignleft"><?php previous_comments_link() ?></div>
 		<div class="alignright"><?php next_comments_link() ?></div>
 	</div>
- <?php else : // this is displayed if there are no comments so far ?>
+	<?php else : // this is displayed if there are no comments so far ?>
 
 	<?php if ( comments_open() ) : ?>
 		<!-- If comments are open, but there are no comments. -->
 
-	 <?php else : // comments are closed ?>
+		<?php else : // comments are closed ?>
 		<!-- If comments are closed. -->
-		<p class="nocomments"><?php _e('Comments are closed.'); ?></p>
+		<p class="nocomments"><?php _e( 'Comments are closed.' ); ?></p>
 
 	<?php endif; ?>
 <?php endif; ?>
Index: src/wp-includes/theme-compat/embed-content.php
===================================================================
--- src/wp-includes/theme-compat/embed-content.php	(revision 40901)
+++ src/wp-includes/theme-compat/embed-content.php	(working copy)
@@ -64,7 +64,7 @@
 			 * @param int    $thumbnail_id Attachment ID.
 			 */
 			$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );
-		}
+		}// End if().
 
 		if ( $thumbnail_id && 'rectangular' === $shape ) : ?>
 			<div class="wp-embed-featured-image rectangular">
@@ -109,7 +109,7 @@
 				 *
 				 * @since 4.4.0
 				 */
-				do_action( 'embed_content_meta');
+				do_action( 'embed_content_meta' );
 				?>
 			</div>
 		</div>
Index: src/wp-includes/theme-compat/footer.php
===================================================================
--- src/wp-includes/theme-compat/footer.php	(revision 40901)
+++ src/wp-includes/theme-compat/footer.php	(working copy)
@@ -24,7 +24,7 @@
 		printf(
 			/* translators: 1: blog name, 2: WordPress */
 			__( '%1$s is proudly powered by %2$s' ),
-			get_bloginfo('name'),
+			get_bloginfo( 'name' ),
 			'<a href="https://wordpress.org/">WordPress</a>'
 		);
 		?>
Index: src/wp-includes/theme-compat/header.php
===================================================================
--- src/wp-includes/theme-compat/header.php	(revision 40901)
+++ src/wp-includes/theme-compat/header.php	(working copy)
@@ -19,29 +19,29 @@
 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
 <head>
 <link rel="profile" href="http://gmpg.org/xfn/11" />
-<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
+<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
 
 <title><?php echo wp_get_document_title(); ?></title>
 
-<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
-<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
+<link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" media="screen" />
+<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
 
 <?php if ( file_exists( get_stylesheet_directory() . '/images/kubrickbgwide.jpg' ) ) { ?>
 <style type="text/css" media="screen">
 
 <?php
 // Checks to see whether it needs a sidebar
-if ( empty($withcomments) && !is_single() ) {
+if ( empty( $withcomments ) && ! is_single() ) {
 ?>
-	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg-<?php bloginfo('text_direction'); ?>.jpg") repeat-y top; border: none; }
+	#page { background: url("<?php bloginfo( 'stylesheet_directory' ); ?>/images/kubrickbg-<?php bloginfo( 'text_direction' ); ?>.jpg") repeat-y top; border: none; }
 <?php } else { // No sidebar ?>
-	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
+	#page { background: url("<?php bloginfo( 'stylesheet_directory' ); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
 <?php } ?>
 
 </style>
 <?php } ?>
 
-<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
+<?php if ( is_singular() ) { wp_enqueue_script( 'comment-reply' );} ?>
 
 <?php wp_head(); ?>
 </head>
@@ -50,8 +50,8 @@
 
 <div id="header" role="banner">
 	<div id="headerimg">
-		<h1><a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a></h1>
-		<div class="description"><?php bloginfo('description'); ?></div>
+		<h1><a href="<?php echo home_url(); ?>/"><?php bloginfo( 'name' ); ?></a></h1>
+		<div class="description"><?php bloginfo( 'description' ); ?></div>
 	</div>
 </div>
 <hr />
Index: src/wp-includes/theme-compat/sidebar.php
===================================================================
--- src/wp-includes/theme-compat/sidebar.php	(revision 40901)
+++ src/wp-includes/theme-compat/sidebar.php	(working copy)
@@ -18,19 +18,19 @@
 	<div id="sidebar" role="complementary">
 		<ul>
 			<?php 	/* Widgetized sidebar, if you have the plugin installed. */
-					if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
+			if ( ! function_exists( 'dynamic_sidebar' ) || ! dynamic_sidebar() ) : ?>
 			<li>
 				<?php get_search_form(); ?>
 			</li>
 
 			<!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
-			<li><h2><?php _e('Author'); ?></h2>
+			<li><h2><?php _e( 'Author' ); ?></h2>
 			<p>A little something about you, the author. Nothing lengthy, just an overview.</p>
 			</li>
 			-->
 
 			<?php if ( is_404() || is_category() || is_day() || is_month() ||
-						is_year() || is_search() || is_paged() ) :
+			is_year() || is_search() || is_paged() ) :
 			?> <li>
 
 			<?php if ( is_404() ) : /* If this is a 404 page */ ?>
@@ -86,21 +86,21 @@
 		<?php endif; ?>
 		</ul>
 		<ul role="navigation">
-			<?php wp_list_pages('title_li=<h2>' . __('Pages') . '</h2>' ); ?>
+			<?php wp_list_pages( 'title_li=<h2>' . __( 'Pages' ) . '</h2>' ); ?>
 
-			<li><h2><?php _e('Archives'); ?></h2>
+			<li><h2><?php _e( 'Archives' ); ?></h2>
 				<ul>
-				<?php wp_get_archives(array('type' => 'monthly')); ?>
+				<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
 				</ul>
 			</li>
 
-			<?php wp_list_categories(array('show_count' => 1, 'title_li' => '<h2>' . __('Categories') . '</h2>')); ?>
+			<?php wp_list_categories( array( 'show_count' => 1, 'title_li' => '<h2>' . __( 'Categories' ) . '</h2>' ) ); ?>
 		</ul>
 		<ul>
 			<?php if ( is_home() || is_page() ) { /* If this is the frontpage */ ?>
 				<?php wp_list_bookmarks(); ?>
 
-				<li><h2><?php _e('Meta'); ?></h2>
+				<li><h2><?php _e( 'Meta' ); ?></h2>
 				<ul>
 					<?php wp_register(); ?>
 					<li><?php wp_loginout(); ?></li>
Index: src/wp-includes/theme.php
===================================================================
--- src/wp-includes/theme.php	(revision 40901)
+++ src/wp-includes/theme.php	(working copy)
@@ -30,7 +30,11 @@
 function wp_get_themes( $args = array() ) {
 	global $wp_theme_directories;
 
-	$defaults = array( 'errors' => false, 'allowed' => null, 'blog_id' => 0 );
+	$defaults = array(
+		'errors' => false,
+		'allowed' => null,
+		'blog_id' => 0,
+	);
 	$args = wp_parse_args( $args, $defaults );
 
 	$theme_directories = search_theme_directories();
@@ -41,41 +45,44 @@
 		$current_theme = get_stylesheet();
 		if ( isset( $theme_directories[ $current_theme ] ) ) {
 			$root_of_current_theme = get_raw_theme_root( $current_theme );
-			if ( ! in_array( $root_of_current_theme, $wp_theme_directories ) )
+			if ( ! in_array( $root_of_current_theme, $wp_theme_directories ) ) {
 				$root_of_current_theme = WP_CONTENT_DIR . $root_of_current_theme;
+			}
 			$theme_directories[ $current_theme ]['theme_root'] = $root_of_current_theme;
 		}
 	}
 
-	if ( empty( $theme_directories ) )
+	if ( empty( $theme_directories ) ) {
 		return array();
+	}
 
 	if ( is_multisite() && null !== $args['allowed'] ) {
 		$allowed = $args['allowed'];
-		if ( 'network' === $allowed )
+		if ( 'network' === $allowed ) {
 			$theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_network() );
-		elseif ( 'site' === $allowed )
+		} elseif ( 'site' === $allowed ) {
 			$theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_site( $args['blog_id'] ) );
-		elseif ( $allowed )
+		} elseif ( $allowed ) {
 			$theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed( $args['blog_id'] ) );
-		else
-			$theme_directories = array_diff_key( $theme_directories, WP_Theme::get_allowed( $args['blog_id'] ) );
+		} else { $theme_directories = array_diff_key( $theme_directories, WP_Theme::get_allowed( $args['blog_id'] ) );
+		}
 	}
 
 	$themes = array();
 	static $_themes = array();
 
 	foreach ( $theme_directories as $theme => $theme_root ) {
-		if ( isset( $_themes[ $theme_root['theme_root'] . '/' . $theme ] ) )
+		if ( isset( $_themes[ $theme_root['theme_root'] . '/' . $theme ] ) ) {
 			$themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ];
-		else
-			$themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] );
+		} else { $themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] );
+		}
 	}
 
 	if ( null !== $args['errors'] ) {
 		foreach ( $themes as $theme => $wp_theme ) {
-			if ( $wp_theme->errors() != $args['errors'] )
+			if ( $wp_theme->errors() != $args['errors'] ) {
 				unset( $themes[ $theme ] );
+			}
 		}
 	}
 
@@ -97,15 +104,17 @@
 function wp_get_theme( $stylesheet = null, $theme_root = null ) {
 	global $wp_theme_directories;
 
-	if ( empty( $stylesheet ) )
+	if ( empty( $stylesheet ) ) {
 		$stylesheet = get_stylesheet();
+	}
 
 	if ( empty( $theme_root ) ) {
 		$theme_root = get_raw_theme_root( $stylesheet );
-		if ( false === $theme_root )
+		if ( false === $theme_root ) {
 			$theme_root = WP_CONTENT_DIR . '/themes';
-		elseif ( ! in_array( $theme_root, (array) $wp_theme_directories ) )
+		} elseif ( ! in_array( $theme_root, (array) $wp_theme_directories ) ) {
 			$theme_root = WP_CONTENT_DIR . $theme_root;
+		}
 	}
 
 	return new WP_Theme( $stylesheet, $theme_root );
@@ -118,11 +127,15 @@
  * @param bool $clear_update_cache Whether to clear the Theme updates cache
  */
 function wp_clean_themes_cache( $clear_update_cache = true ) {
-	if ( $clear_update_cache )
+	if ( $clear_update_cache ) {
 		delete_site_transient( 'update_themes' );
+	}
 	search_theme_directories( true );
-	foreach ( wp_get_themes( array( 'errors' => null ) ) as $theme )
+	foreach ( wp_get_themes( array(
+		'errors' => null,
+	) ) as $theme ) {
 		$theme->cache_delete();
+	}
 }
 
 /**
@@ -258,12 +271,12 @@
 	$stylesheet_dir_uri = get_stylesheet_directory_uri();
 	$dir = get_stylesheet_directory();
 	$locale = get_locale();
-	if ( file_exists("$dir/$locale.css") )
+	if ( file_exists( "$dir/$locale.css" ) ) {
 		$stylesheet_uri = "$stylesheet_dir_uri/$locale.css";
-	elseif ( !empty($wp_locale->text_direction) && file_exists("$dir/{$wp_locale->text_direction}.css") )
+	} elseif ( ! empty( $wp_locale->text_direction ) && file_exists( "$dir/{$wp_locale->text_direction}.css" ) ) {
 		$stylesheet_uri = "$stylesheet_dir_uri/{$wp_locale->text_direction}.css";
-	else
-		$stylesheet_uri = '';
+	} else { $stylesheet_uri = '';
+	}
 	/**
 	 * Filters the localized stylesheet URI.
 	 *
@@ -353,8 +366,9 @@
 function get_theme_roots() {
 	global $wp_theme_directories;
 
-	if ( count($wp_theme_directories) <= 1 )
+	if ( count( $wp_theme_directories ) <= 1 ) {
 		return '/themes';
+	}
 
 	$theme_roots = get_site_transient( 'theme_roots' );
 	if ( false === $theme_roots ) {
@@ -413,11 +427,13 @@
 	global $wp_theme_directories;
 	static $found_themes = null;
 
-	if ( empty( $wp_theme_directories ) )
+	if ( empty( $wp_theme_directories ) ) {
 		return false;
+	}
 
-	if ( ! $force && isset( $found_themes ) )
+	if ( ! $force && isset( $found_themes ) ) {
 		return $found_themes;
+	}
 
 	$found_themes = array();
 
@@ -428,10 +444,10 @@
 	// We always want to return absolute, but we need to cache relative
 	// to use in get_theme_root().
 	foreach ( $wp_theme_directories as $theme_root ) {
-		if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) )
+		if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) ) {
 			$relative_theme_roots[ str_replace( WP_CONTENT_DIR, '', $theme_root ) ] = $theme_root;
-		else
-			$relative_theme_roots[ $theme_root ] = $theme_root;
+		} else { $relative_theme_roots[ $theme_root ] = $theme_root;
+		}
 	}
 
 	/**
@@ -447,8 +463,9 @@
 		if ( is_array( $cached_roots ) ) {
 			foreach ( $cached_roots as $theme_dir => $theme_root ) {
 				// A cached theme root is no longer around, so skip it.
-				if ( ! isset( $relative_theme_roots[ $theme_root ] ) )
+				if ( ! isset( $relative_theme_roots[ $theme_root ] ) ) {
 					continue;
+				}
 				$found_themes[ $theme_dir ] = array(
 					'theme_file' => $theme_dir . '/style.css',
 					'theme_root' => $relative_theme_roots[ $theme_root ], // Convert relative to absolute.
@@ -456,8 +473,9 @@
 			}
 			return $found_themes;
 		}
-		if ( ! is_int( $cache_expiration ) )
+		if ( ! is_int( $cache_expiration ) ) {
 			$cache_expiration = 1800; // half hour
+		}
 	} else {
 		$cache_expiration = 1800; // half hour
 	}
@@ -472,8 +490,9 @@
 			continue;
 		}
 		foreach ( $dirs as $dir ) {
-			if ( ! is_dir( $theme_root . '/' . $dir ) || $dir[0] == '.' || $dir == 'CVS' )
+			if ( ! is_dir( $theme_root . '/' . $dir ) || $dir[0] == '.' || $dir == 'CVS' ) {
 				continue;
+			}
 			if ( file_exists( $theme_root . '/' . $dir . '/style.css' ) ) {
 				// wp-content/themes/a-single-theme
 				// wp-content/themes is $theme_root, a-single-theme is $dir
@@ -491,10 +510,12 @@
 					continue;
 				}
 				foreach ( $sub_dirs as $sub_dir ) {
-					if ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || $dir[0] == '.' || $dir == 'CVS' )
+					if ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || $dir[0] == '.' || $dir == 'CVS' ) {
 						continue;
-					if ( ! file_exists( $theme_root . '/' . $dir . '/' . $sub_dir . '/style.css' ) )
+					}
+					if ( ! file_exists( $theme_root . '/' . $dir . '/' . $sub_dir . '/style.css' ) ) {
 						continue;
+					}
 					$found_themes[ $dir . '/' . $sub_dir ] = array(
 						'theme_file' => $dir . '/' . $sub_dir . '/style.css',
 						'theme_root' => $theme_root,
@@ -503,14 +524,15 @@
 				}
 				// Never mind the above, it's just a theme missing a style.css.
 				// Return it; WP_Theme will catch the error.
-				if ( ! $found_theme )
+				if ( ! $found_theme ) {
 					$found_themes[ $dir ] = array(
 						'theme_file' => $dir . '/style.css',
 						'theme_root' => $theme_root,
 					);
-			}
-		}
-	}
+				}
+			}// End if().
+		}// End foreach().
+	}// End foreach().
 
 	asort( $found_themes );
 
@@ -521,8 +543,9 @@
 		$theme_roots[ $theme_dir ] = $relative_theme_roots[ $theme_data['theme_root'] ]; // Convert absolute to relative.
 	}
 
-	if ( $theme_roots != get_site_transient( 'theme_roots' ) )
+	if ( $theme_roots != get_site_transient( 'theme_roots' ) ) {
 		set_site_transient( 'theme_roots', $theme_roots, $cache_expiration );
+	}
 
 	return $found_themes;
 }
@@ -545,8 +568,9 @@
 	if ( $stylesheet_or_template && $theme_root = get_raw_theme_root( $stylesheet_or_template ) ) {
 		// Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory.
 		// This gives relative theme roots the benefit of the doubt when things go haywire.
-		if ( ! in_array( $theme_root, (array) $wp_theme_directories ) )
+		if ( ! in_array( $theme_root, (array) $wp_theme_directories ) ) {
 			$theme_root = WP_CONTENT_DIR . $theme_root;
+		}
 	} else {
 		$theme_root = WP_CONTENT_DIR . '/themes';
 	}
@@ -579,20 +603,21 @@
 function get_theme_root_uri( $stylesheet_or_template = false, $theme_root = false ) {
 	global $wp_theme_directories;
 
-	if ( $stylesheet_or_template && ! $theme_root )
+	if ( $stylesheet_or_template && ! $theme_root ) {
 		$theme_root = get_raw_theme_root( $stylesheet_or_template );
+	}
 
 	if ( $stylesheet_or_template && $theme_root ) {
 		if ( in_array( $theme_root, (array) $wp_theme_directories ) ) {
 			// Absolute path. Make an educated guess. YMMV -- but note the filter below.
-			if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) )
+			if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) ) {
 				$theme_root_uri = content_url( str_replace( WP_CONTENT_DIR, '', $theme_root ) );
-			elseif ( 0 === strpos( $theme_root, ABSPATH ) )
+			} elseif ( 0 === strpos( $theme_root, ABSPATH ) ) {
 				$theme_root_uri = site_url( str_replace( ABSPATH, '', $theme_root ) );
-			elseif ( 0 === strpos( $theme_root, WP_PLUGIN_DIR ) || 0 === strpos( $theme_root, WPMU_PLUGIN_DIR ) )
+			} elseif ( 0 === strpos( $theme_root, WP_PLUGIN_DIR ) || 0 === strpos( $theme_root, WPMU_PLUGIN_DIR ) ) {
 				$theme_root_uri = plugins_url( basename( $theme_root ), $theme_root );
-			else
-				$theme_root_uri = $theme_root;
+			} else { $theme_root_uri = $theme_root;
+			}
 		} else {
 			$theme_root_uri = content_url( $theme_root );
 		}
@@ -627,23 +652,26 @@
 function get_raw_theme_root( $stylesheet_or_template, $skip_cache = false ) {
 	global $wp_theme_directories;
 
-	if ( count($wp_theme_directories) <= 1 )
+	if ( count( $wp_theme_directories ) <= 1 ) {
 		return '/themes';
+	}
 
 	$theme_root = false;
 
 	// If requesting the root for the current theme, consult options to avoid calling get_theme_roots()
 	if ( ! $skip_cache ) {
-		if ( get_option('stylesheet') == $stylesheet_or_template )
-			$theme_root = get_option('stylesheet_root');
-		elseif ( get_option('template') == $stylesheet_or_template )
-			$theme_root = get_option('template_root');
+		if ( get_option( 'stylesheet' ) == $stylesheet_or_template ) {
+			$theme_root = get_option( 'stylesheet_root' );
+		} elseif ( get_option( 'template' ) == $stylesheet_or_template ) {
+			$theme_root = get_option( 'template_root' );
+		}
 	}
 
-	if ( empty($theme_root) ) {
+	if ( empty( $theme_root ) ) {
 		$theme_roots = get_theme_roots();
-		if ( !empty($theme_roots[$stylesheet_or_template]) )
-			$theme_root = $theme_roots[$stylesheet_or_template];
+		if ( ! empty( $theme_roots[ $stylesheet_or_template ] ) ) {
+			$theme_root = $theme_roots[ $stylesheet_or_template ];
+		}
 	}
 
 	return $theme_root;
@@ -656,8 +684,9 @@
  */
 function locale_stylesheet() {
 	$stylesheet = get_locale_stylesheet_uri();
-	if ( empty($stylesheet) )
+	if ( empty( $stylesheet ) ) {
 		return;
+	}
 	echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />';
 }
 
@@ -686,7 +715,10 @@
 	}
 
 	if ( is_array( $_sidebars_widgets ) ) {
-		set_theme_mod( 'sidebars_widgets', array( 'time' => time(), 'data' => $_sidebars_widgets ) );
+		set_theme_mod( 'sidebars_widgets', array(
+			'time' => time(),
+			'data' => $_sidebars_widgets,
+		) );
 	}
 
 	$nav_menu_locations = get_theme_mod( 'nav_menu_locations' );
@@ -710,7 +742,7 @@
 		delete_option( 'stylesheet_root' );
 	}
 
-	$new_name  = $new_theme->get('Name');
+	$new_name  = $new_theme->get( 'Name' );
 
 	update_option( 'current_theme', $new_name );
 
@@ -777,8 +809,9 @@
 	 *
 	 * @param bool $validate Whether to validate the current theme. Default true.
 	 */
-	if ( wp_installing() || ! apply_filters( 'validate_current_theme', true ) )
+	if ( wp_installing() || ! apply_filters( 'validate_current_theme', true ) ) {
 		return true;
+	}
 
 	if ( ! file_exists( get_template_directory() . '/index.php' ) ) {
 		// Invalid.
@@ -827,8 +860,9 @@
 	$mods = get_option( "theme_mods_$theme_slug" );
 	if ( false === $mods ) {
 		$theme_name = get_option( 'current_theme' );
-		if ( false === $theme_name )
-			$theme_name = wp_get_theme()->get('Name');
+		if ( false === $theme_name ) {
+			$theme_name = wp_get_theme()->get( 'Name' );
+		}
 		$mods = get_option( "mods_$theme_name" ); // Deprecated location.
 		if ( is_admin() && false !== $mods ) {
 			update_option( "theme_mods_$theme_slug", $mods );
@@ -855,7 +889,7 @@
 function get_theme_mod( $name, $default = false ) {
 	$mods = get_theme_mods();
 
-	if ( isset( $mods[$name] ) ) {
+	if ( isset( $mods[ $name ] ) ) {
 		/**
 		 * Filters the theme modification, or 'theme_mod', value.
 		 *
@@ -868,11 +902,12 @@
 		 *
 		 * @param string $current_mod The value of the current theme modification.
 		 */
-		return apply_filters( "theme_mod_{$name}", $mods[$name] );
+		return apply_filters( "theme_mod_{$name}", $mods[ $name ] );
 	}
 
-	if ( is_string( $default ) )
+	if ( is_string( $default ) ) {
 		$default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );
+	}
 
 	/** This filter is documented in wp-includes/theme.php */
 	return apply_filters( "theme_mod_{$name}", $default );
@@ -921,8 +956,9 @@
 function remove_theme_mod( $name ) {
 	$mods = get_theme_mods();
 
-	if ( ! isset( $mods[ $name ] ) )
+	if ( ! isset( $mods[ $name ] ) ) {
 		return;
+	}
 
 	unset( $mods[ $name ] );
 
@@ -944,8 +980,9 @@
 
 	// Old style.
 	$theme_name = get_option( 'current_theme' );
-	if ( false === $theme_name )
-		$theme_name = wp_get_theme()->get('Name');
+	if ( false === $theme_name ) {
+		$theme_name = wp_get_theme()->get( 'Name' );
+	}
 	delete_option( 'mods_' . $theme_name );
 }
 
@@ -957,7 +994,7 @@
  * @return string Header text color in 3- or 6-digit hexadecimal form (minus the hash symbol).
  */
 function get_header_textcolor() {
-	return get_theme_mod('header_textcolor', get_theme_support( 'custom-header', 'default-text-color' ) );
+	return get_theme_mod( 'header_textcolor', get_theme_support( 'custom-header', 'default-text-color' ) );
 }
 
 /**
@@ -977,8 +1014,9 @@
  * @return bool
  */
 function display_header_text() {
-	if ( ! current_theme_supports( 'custom-header', 'header-text' ) )
+	if ( ! current_theme_supports( 'custom-header', 'header-text' ) ) {
 		return false;
+	}
 
 	$text_color = get_theme_mod( 'header_textcolor', get_theme_support( 'custom-header', 'default-text-color' ) );
 	return 'blank' !== $text_color;
@@ -1007,11 +1045,13 @@
 function get_header_image() {
 	$url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );
 
-	if ( 'remove-header' == $url )
+	if ( 'remove-header' == $url ) {
 		return false;
+	}
 
-	if ( is_random_header_image() )
+	if ( is_random_header_image() ) {
 		$url = get_random_header_image();
+	}
 
 	return esc_url_raw( set_url_scheme( $url ) );
 }
@@ -1114,24 +1154,26 @@
 		$header_image_mod = get_theme_mod( 'header_image', '' );
 		$headers = array();
 
-		if ( 'random-uploaded-image' == $header_image_mod )
+		if ( 'random-uploaded-image' == $header_image_mod ) {
 			$headers = get_uploaded_header_images();
-		elseif ( ! empty( $_wp_default_headers ) ) {
+		} elseif ( ! empty( $_wp_default_headers ) ) {
 			if ( 'random-default-image' == $header_image_mod ) {
 				$headers = $_wp_default_headers;
 			} else {
-				if ( current_theme_supports( 'custom-header', 'random-default' ) )
+				if ( current_theme_supports( 'custom-header', 'random-default' ) ) {
 					$headers = $_wp_default_headers;
+				}
 			}
 		}
 
-		if ( empty( $headers ) )
+		if ( empty( $headers ) ) {
 			return new stdClass;
+		}
 
 		$_wp_random_header = (object) $headers[ array_rand( $headers ) ];
 
-		$_wp_random_header->url =  sprintf( $_wp_random_header->url, get_template_directory_uri(), get_stylesheet_directory_uri() );
-		$_wp_random_header->thumbnail_url =  sprintf( $_wp_random_header->thumbnail_url, get_template_directory_uri(), get_stylesheet_directory_uri() );
+		$_wp_random_header->url = sprintf( $_wp_random_header->url, get_template_directory_uri(), get_stylesheet_directory_uri() );
+		$_wp_random_header->thumbnail_url = sprintf( $_wp_random_header->thumbnail_url, get_template_directory_uri(), get_stylesheet_directory_uri() );
 	}
 	return $_wp_random_header;
 }
@@ -1145,8 +1187,9 @@
  */
 function get_random_header_image() {
 	$random_image = _get_random_header_data();
-	if ( empty( $random_image->url ) )
+	if ( empty( $random_image->url ) ) {
 		return '';
+	}
 	return $random_image->url;
 }
 
@@ -1166,13 +1209,15 @@
 	$header_image_mod = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );
 
 	if ( 'any' == $type ) {
-		if ( 'random-default-image' == $header_image_mod || 'random-uploaded-image' == $header_image_mod || ( '' != get_random_header_image() && empty( $header_image_mod ) ) )
+		if ( 'random-default-image' == $header_image_mod || 'random-uploaded-image' == $header_image_mod || ( '' != get_random_header_image() && empty( $header_image_mod ) ) ) {
 			return true;
+		}
 	} else {
-		if ( "random-$type-image" == $header_image_mod )
+		if ( "random-$type-image" == $header_image_mod ) {
 			return true;
-		elseif ( 'default' == $type && empty( $header_image_mod ) && '' != get_random_header_image() )
+		} elseif ( 'default' == $type && empty( $header_image_mod ) && '' != get_random_header_image() ) {
 			return true;
+		}
 	}
 
 	return false;
@@ -1201,26 +1246,29 @@
 	$header_images = array();
 
 	// @todo caching
-	$headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_option('stylesheet'), 'orderby' => 'none', 'nopaging' => true ) );
+	$headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_option( 'stylesheet' ), 'orderby' => 'none', 'nopaging' => true ) );
 
-	if ( empty( $headers ) )
+	if ( empty( $headers ) ) {
 		return array();
+	}
 
 	foreach ( (array) $headers as $header ) {
 		$url = esc_url_raw( wp_get_attachment_url( $header->ID ) );
 		$header_data = wp_get_attachment_metadata( $header->ID );
 		$header_index = $header->ID;
 
-		$header_images[$header_index] = array();
-		$header_images[$header_index]['attachment_id'] = $header->ID;
-		$header_images[$header_index]['url'] =  $url;
-		$header_images[$header_index]['thumbnail_url'] = $url;
-		$header_images[$header_index]['alt_text'] = get_post_meta( $header->ID, '_wp_attachment_image_alt', true );
-
-		if ( isset( $header_data['width'] ) )
-			$header_images[$header_index]['width'] = $header_data['width'];
-		if ( isset( $header_data['height'] ) )
-			$header_images[$header_index]['height'] = $header_data['height'];
+		$header_images[ $header_index ] = array();
+		$header_images[ $header_index ]['attachment_id'] = $header->ID;
+		$header_images[ $header_index ]['url'] = $url;
+		$header_images[ $header_index ]['thumbnail_url'] = $url;
+		$header_images[ $header_index ]['alt_text'] = get_post_meta( $header->ID, '_wp_attachment_image_alt', true );
+
+		if ( isset( $header_data['width'] ) ) {
+			$header_images[ $header_index ]['width'] = $header_data['width'];
+		}
+		if ( isset( $header_data['height'] ) ) {
+			$header_images[ $header_index ]['height'] = $header_data['height'];
+		}
 	}
 
 	return $header_images;
@@ -1394,8 +1442,8 @@
 		'l10n'      => array(
 			'pause'      => __( 'Pause' ),
 			'play'       => __( 'Play' ),
-			'pauseSpeak' => __( 'Video is paused.'),
-			'playSpeak'  => __( 'Video is playing.'),
+			'pauseSpeak' => __( 'Video is paused.' ),
+			'playSpeak'  => __( 'Video is playing.' ),
 		),
 	);
 
@@ -1504,7 +1552,7 @@
  * @return string
  */
 function get_background_image() {
-	return get_theme_mod('background_image', get_theme_support( 'custom-background', 'default-image' ) );
+	return get_theme_mod( 'background_image', get_theme_support( 'custom-background', 'default-image' ) );
 }
 
 /**
@@ -1524,7 +1572,7 @@
  * @return string
  */
 function get_background_color() {
-	return get_theme_mod('background_color', get_theme_support( 'custom-background', 'default-color' ) );
+	return get_theme_mod( 'background_color', get_theme_support( 'custom-background', 'default-color' ) );
 }
 
 /**
@@ -1608,7 +1656,7 @@
 		$attachment = " background-attachment: $attachment;";
 
 		$style .= $image . $position . $size . $repeat . $attachment;
-	}
+	}// End if().
 ?>
 <style type="text/css" id="custom-background-css">
 body.custom-background { <?php echo trim( $style ); ?> }
@@ -1840,14 +1888,15 @@
 function add_editor_style( $stylesheet = 'editor-style.css' ) {
 	add_theme_support( 'editor-style' );
 
-	if ( ! is_admin() )
+	if ( ! is_admin() ) {
 		return;
+	}
 
 	global $editor_styles;
 	$editor_styles = (array) $editor_styles;
 	$stylesheet    = (array) $stylesheet;
 	if ( is_rtl() ) {
-		$rtl_stylesheet = str_replace('.css', '-rtl.css', $stylesheet[0]);
+		$rtl_stylesheet = str_replace( '.css', '-rtl.css', $stylesheet[0] );
 		$stylesheet[] = $rtl_stylesheet;
 	}
 
@@ -1864,11 +1913,13 @@
  * @return bool True on success, false if there were no stylesheets to remove.
  */
 function remove_editor_styles() {
-	if ( ! current_theme_supports( 'editor-style' ) )
+	if ( ! current_theme_supports( 'editor-style' ) ) {
 		return false;
+	}
 	_remove_theme_support( 'editor-style' );
-	if ( is_admin() )
+	if ( is_admin() ) {
 		$GLOBALS['editor_styles'] = array();
+	}
 	return true;
 }
 
@@ -1945,40 +1996,67 @@
 
 	$core_content = array(
 		'widgets' => array(
-			'text_business_info' => array( 'text', array(
+			'text_business_info' => array(
+	'text',
+	array(
 				'title' => _x( 'Find Us', 'Theme starter content' ),
 				'text' => join( '', array(
 					'<p><strong>' . _x( 'Address', 'Theme starter content' ) . '</strong><br />',
 					_x( '123 Main Street', 'Theme starter content' ) . '<br />' . _x( 'New York, NY 10001', 'Theme starter content' ) . '</p>',
 					'<p><strong>' . _x( 'Hours', 'Theme starter content' ) . '</strong><br />',
-					_x( 'Monday&mdash;Friday: 9:00AM&ndash;5:00PM', 'Theme starter content' ) . '<br />' . _x( 'Saturday &amp; Sunday: 11:00AM&ndash;3:00PM', 'Theme starter content' ) . '</p>'
+					_x( 'Monday&mdash;Friday: 9:00AM&ndash;5:00PM', 'Theme starter content' ) . '<br />' . _x( 'Saturday &amp; Sunday: 11:00AM&ndash;3:00PM', 'Theme starter content' ) . '</p>',
 				) ),
-			) ),
-			'text_about' => array( 'text', array(
+			),
+		),
+			'text_about' => array(
+		'text',
+		array(
 				'title' => _x( 'About This Site', 'Theme starter content' ),
 				'text' => _x( 'This may be a good place to introduce yourself and your site or include some credits.', 'Theme starter content' ),
-			) ),
-			'archives' => array( 'archives', array(
+			),
+		),
+			'archives' => array(
+		'archives',
+		array(
 				'title' => _x( 'Archives', 'Theme starter content' ),
-			) ),
-			'calendar' => array( 'calendar', array(
+			),
+		),
+			'calendar' => array(
+		'calendar',
+		array(
 				'title' => _x( 'Calendar', 'Theme starter content' ),
-			) ),
-			'categories' => array( 'categories', array(
+			),
+		),
+			'categories' => array(
+		'categories',
+		array(
 				'title' => _x( 'Categories', 'Theme starter content' ),
-			) ),
-			'meta' => array( 'meta', array(
+			),
+		),
+			'meta' => array(
+		'meta',
+		array(
 				'title' => _x( 'Meta', 'Theme starter content' ),
-			) ),
-			'recent-comments' => array( 'recent-comments', array(
+			),
+		),
+			'recent-comments' => array(
+		'recent-comments',
+		array(
 				'title' => _x( 'Recent Comments', 'Theme starter content' ),
-			) ),
-			'recent-posts' => array( 'recent-posts', array(
+			),
+		),
+			'recent-posts' => array(
+		'recent-posts',
+		array(
 				'title' => _x( 'Recent Posts', 'Theme starter content' ),
-			) ),
-			'search' => array( 'search', array(
+			),
+		),
+			'search' => array(
+		'search',
+		array(
 				'title' => _x( 'Search', 'Theme starter content' ),
-			) ),
+			),
+		),
 		),
 		'nav_menus' => array(
 			'link_home' => array(
@@ -2089,7 +2167,7 @@
 	$content = array();
 
 	foreach ( $config as $type => $args ) {
-		switch( $type ) {
+		switch ( $type ) {
 			// Use options and theme_mods as-is.
 			case 'options' :
 			case 'theme_mods' :
@@ -2184,8 +2262,8 @@
 					}
 				}
 				break;
-		}
-	}
+		}// End switch().
+	}// End foreach().
 
 	/**
 	 * Filters the expanded array of starter content.
@@ -2223,10 +2301,10 @@
 function add_theme_support( $feature ) {
 	global $_wp_theme_features;
 
-	if ( func_num_args() == 1 )
+	if ( func_num_args() == 1 ) {
 		$args = true;
-	else
-		$args = array_slice( func_get_args(), 1 );
+	} else { $args = array_slice( func_get_args(), 1 );
+	}
 
 	switch ( $feature ) {
 		case 'post-thumbnails':
@@ -2265,8 +2343,9 @@
 			}
 
 			// Calling 'html5' again merges, rather than overwrites.
-			if ( isset( $_wp_theme_features['html5'] ) )
+			if ( isset( $_wp_theme_features['html5'] ) ) {
 				$args[0] = array_merge( $_wp_theme_features['html5'][0], $args[0] );
+			}
 			break;
 
 		case 'custom-logo':
@@ -2293,8 +2372,9 @@
 			return add_theme_support( 'custom-header', array( 'uploads' => true ) );
 
 		case 'custom-header' :
-			if ( ! is_array( $args ) )
+			if ( ! is_array( $args ) ) {
 				$args = array( 0 => array() );
+			}
 
 			$defaults = array(
 				'default-image' => '',
@@ -2318,13 +2398,15 @@
 
 			// Merge in data from previous add_theme_support() calls.
 			// The first value registered wins. (A child theme is set up first.)
-			if ( isset( $_wp_theme_features['custom-header'] ) )
+			if ( isset( $_wp_theme_features['custom-header'] ) ) {
 				$args[0] = wp_parse_args( $_wp_theme_features['custom-header'][0], $args[0] );
+			}
 
 			// Load in the defaults at the end, as we need to insure first one wins.
 			// This will cause all constants to be defined, as each arg will then be set to the default.
-			if ( $jit )
+			if ( $jit ) {
 				$args[0] = wp_parse_args( $args[0], $defaults );
+			}
 
 			// If a constant was defined, use that value. Otherwise, define the constant to ensure
 			// the constant is always accurate (and is not defined later,  overriding our value).
@@ -2332,48 +2414,57 @@
 			// Once we get to wp_loaded (just-in-time), define any constants we haven't already.
 			// Constants are lame. Don't reference them. This is just for backward compatibility.
 
-			if ( defined( 'NO_HEADER_TEXT' ) )
+			if ( defined( 'NO_HEADER_TEXT' ) ) {
 				$args[0]['header-text'] = ! NO_HEADER_TEXT;
-			elseif ( isset( $args[0]['header-text'] ) )
+			} elseif ( isset( $args[0]['header-text'] ) ) {
 				define( 'NO_HEADER_TEXT', empty( $args[0]['header-text'] ) );
+			}
 
-			if ( defined( 'HEADER_IMAGE_WIDTH' ) )
+			if ( defined( 'HEADER_IMAGE_WIDTH' ) ) {
 				$args[0]['width'] = (int) HEADER_IMAGE_WIDTH;
-			elseif ( isset( $args[0]['width'] ) )
+			} elseif ( isset( $args[0]['width'] ) ) {
 				define( 'HEADER_IMAGE_WIDTH', (int) $args[0]['width'] );
+			}
 
-			if ( defined( 'HEADER_IMAGE_HEIGHT' ) )
+			if ( defined( 'HEADER_IMAGE_HEIGHT' ) ) {
 				$args[0]['height'] = (int) HEADER_IMAGE_HEIGHT;
-			elseif ( isset( $args[0]['height'] ) )
+			} elseif ( isset( $args[0]['height'] ) ) {
 				define( 'HEADER_IMAGE_HEIGHT', (int) $args[0]['height'] );
+			}
 
-			if ( defined( 'HEADER_TEXTCOLOR' ) )
+			if ( defined( 'HEADER_TEXTCOLOR' ) ) {
 				$args[0]['default-text-color'] = HEADER_TEXTCOLOR;
-			elseif ( isset( $args[0]['default-text-color'] ) )
+			} elseif ( isset( $args[0]['default-text-color'] ) ) {
 				define( 'HEADER_TEXTCOLOR', $args[0]['default-text-color'] );
+			}
 
-			if ( defined( 'HEADER_IMAGE' ) )
+			if ( defined( 'HEADER_IMAGE' ) ) {
 				$args[0]['default-image'] = HEADER_IMAGE;
-			elseif ( isset( $args[0]['default-image'] ) )
+			} elseif ( isset( $args[0]['default-image'] ) ) {
 				define( 'HEADER_IMAGE', $args[0]['default-image'] );
+			}
 
-			if ( $jit && ! empty( $args[0]['default-image'] ) )
+			if ( $jit && ! empty( $args[0]['default-image'] ) ) {
 				$args[0]['random-default'] = false;
+			}
 
 			// If headers are supported, and we still don't have a defined width or height,
 			// we have implicit flex sizes.
 			if ( $jit ) {
-				if ( empty( $args[0]['width'] ) && empty( $args[0]['flex-width'] ) )
+				if ( empty( $args[0]['width'] ) && empty( $args[0]['flex-width'] ) ) {
 					$args[0]['flex-width'] = true;
-				if ( empty( $args[0]['height'] ) && empty( $args[0]['flex-height'] ) )
+				}
+				if ( empty( $args[0]['height'] ) && empty( $args[0]['flex-height'] ) ) {
 					$args[0]['flex-height'] = true;
+				}
 			}
 
 			break;
 
 		case 'custom-background' :
-			if ( ! is_array( $args ) )
+			if ( ! is_array( $args ) ) {
 				$args = array( 0 => array() );
+			}
 
 			$defaults = array(
 				'default-image'          => '',
@@ -2393,21 +2484,25 @@
 			unset( $args[0]['__jit'] );
 
 			// Merge in data from previous add_theme_support() calls. The first value registered wins.
-			if ( isset( $_wp_theme_features['custom-background'] ) )
+			if ( isset( $_wp_theme_features['custom-background'] ) ) {
 				$args[0] = wp_parse_args( $_wp_theme_features['custom-background'][0], $args[0] );
+			}
 
-			if ( $jit )
+			if ( $jit ) {
 				$args[0] = wp_parse_args( $args[0], $defaults );
+			}
 
-			if ( defined( 'BACKGROUND_COLOR' ) )
+			if ( defined( 'BACKGROUND_COLOR' ) ) {
 				$args[0]['default-color'] = BACKGROUND_COLOR;
-			elseif ( isset( $args[0]['default-color'] ) || $jit )
+			} elseif ( isset( $args[0]['default-color'] ) || $jit ) {
 				define( 'BACKGROUND_COLOR', $args[0]['default-color'] );
+			}
 
-			if ( defined( 'BACKGROUND_IMAGE' ) )
+			if ( defined( 'BACKGROUND_IMAGE' ) ) {
 				$args[0]['default-image'] = BACKGROUND_IMAGE;
-			elseif ( isset( $args[0]['default-image'] ) || $jit )
+			} elseif ( isset( $args[0]['default-image'] ) || $jit ) {
 				define( 'BACKGROUND_IMAGE', $args[0]['default-image'] );
+			}
 
 			break;
 
@@ -2417,11 +2512,11 @@
 			if ( did_action( 'wp_loaded' ) ) {
 				/* translators: 1: Theme support 2: hook name */
 				_doing_it_wrong( "add_theme_support( 'title-tag' )", sprintf( __( 'Theme support for %1$s should be registered before the %2$s hook.' ),
-					'<code>title-tag</code>', '<code>wp_loaded</code>' ), '4.1.0' );
+				'<code>title-tag</code>', '<code>wp_loaded</code>' ), '4.1.0' );
 
 				return false;
 			}
-	}
+	}// End switch().
 
 	$_wp_theme_features[ $feature ] = $args;
 }
@@ -2443,8 +2538,9 @@
 		add_theme_support( 'custom-header', array( '__jit' => true ) );
 
 		$args = get_theme_support( 'custom-header' );
-		if ( $args[0]['wp-head-callback'] )
+		if ( $args[0]['wp-head-callback'] ) {
 			add_action( 'wp_head', $args[0]['wp-head-callback'] );
+		}
 
 		if ( is_admin() ) {
 			require_once( ABSPATH . 'wp-admin/custom-header.php' );
@@ -2502,19 +2598,22 @@
  */
 function get_theme_support( $feature ) {
 	global $_wp_theme_features;
-	if ( ! isset( $_wp_theme_features[ $feature ] ) )
+	if ( ! isset( $_wp_theme_features[ $feature ] ) ) {
 		return false;
+	}
 
-	if ( func_num_args() <= 1 )
+	if ( func_num_args() <= 1 ) {
 		return $_wp_theme_features[ $feature ];
+	}
 
 	$args = array_slice( func_get_args(), 1 );
 	switch ( $feature ) {
 		case 'custom-logo' :
 		case 'custom-header' :
 		case 'custom-background' :
-			if ( isset( $_wp_theme_features[ $feature ][0][ $args[0] ] ) )
+			if ( isset( $_wp_theme_features[ $feature ][0][ $args[0] ] ) ) {
 				return $_wp_theme_features[ $feature ][0][ $args[0] ];
+			}
 			return false;
 
 		default :
@@ -2535,8 +2634,9 @@
  */
 function remove_theme_support( $feature ) {
 	// Blacklist: for internal registrations not used directly by themes.
-	if ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ) ) )
+	if ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ) ) ) {
 		return false;
+	}
 
 	return _remove_theme_support( $feature );
 }
@@ -2558,19 +2658,22 @@
 
 	switch ( $feature ) {
 		case 'custom-header-uploads' :
-			if ( ! isset( $_wp_theme_features['custom-header'] ) )
+			if ( ! isset( $_wp_theme_features['custom-header'] ) ) {
 				return false;
+			}
 			add_theme_support( 'custom-header', array( 'uploads' => false ) );
 			return; // Do not continue - custom-header-uploads no longer exists.
 	}
 
-	if ( ! isset( $_wp_theme_features[ $feature ] ) )
+	if ( ! isset( $_wp_theme_features[ $feature ] ) ) {
 		return false;
+	}
 
 	switch ( $feature ) {
 		case 'custom-header' :
-			if ( ! did_action( 'wp_loaded' ) )
+			if ( ! did_action( 'wp_loaded' ) ) {
 				break;
+			}
 			$support = get_theme_support( 'custom-header' );
 			if ( isset( $support[0]['wp-head-callback'] ) ) {
 				remove_action( 'wp_head', $support[0]['wp-head-callback'] );
@@ -2582,8 +2685,9 @@
 			break;
 
 		case 'custom-background' :
-			if ( ! did_action( 'wp_loaded' ) )
+			if ( ! did_action( 'wp_loaded' ) ) {
 				break;
+			}
 			$support = get_theme_support( 'custom-background' );
 			remove_action( 'wp_head', $support[0]['wp-head-callback'] );
 			remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) );
@@ -2608,15 +2712,18 @@
 function current_theme_supports( $feature ) {
 	global $_wp_theme_features;
 
-	if ( 'custom-header-uploads' == $feature )
+	if ( 'custom-header-uploads' == $feature ) {
 		return current_theme_supports( 'custom-header', 'uploads' );
+	}
 
-	if ( !isset( $_wp_theme_features[$feature] ) )
+	if ( ! isset( $_wp_theme_features[ $feature ] ) ) {
 		return false;
+	}
 
 	// If no args passed then no extra checks need be performed
-	if ( func_num_args() <= 1 )
+	if ( func_num_args() <= 1 ) {
 		return true;
+	}
 
 	$args = array_slice( func_get_args(), 1 );
 
@@ -2625,10 +2732,11 @@
 			// post-thumbnails can be registered for only certain content/post types by passing
 			// an array of types to add_theme_support(). If no array was passed, then
 			// any type is accepted
-			if ( true === $_wp_theme_features[$feature] )  // Registered for all types
+			if ( true === $_wp_theme_features[ $feature ] ) {  // Registered for all types
 				return true;
+			}
 			$content_type = $args[0];
-			return in_array( $content_type, $_wp_theme_features[$feature][0] );
+			return in_array( $content_type, $_wp_theme_features[ $feature ][0] );
 
 		case 'html5':
 		case 'post-formats':
@@ -2638,7 +2746,7 @@
 			// Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
 
 			$type = $args[0];
-			return in_array( $type, $_wp_theme_features[$feature][0] );
+			return in_array( $type, $_wp_theme_features[ $feature ][0] );
 
 		case 'custom-logo':
 		case 'custom-header':
@@ -2661,7 +2769,7 @@
 	 * @param array  $args    Array of arguments for the feature.
 	 * @param string $feature The theme feature.
 	 */
-	return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature] );
+	return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] );
 }
 
 /**
@@ -2675,7 +2783,7 @@
  */
 function require_if_theme_supports( $feature, $include ) {
 	if ( current_theme_supports( $feature ) ) {
-		require ( $include );
+		require( $include );
 		return true;
 	}
 	return false;
@@ -2867,7 +2975,7 @@
 		/** This filter is documented in /wp-includes/class-wp-customize-manager.php */
 		do_action( 'customize_register', $wp_customize );
 	}
-	$wp_customize->_publish_changeset_values( $changeset_post->ID ) ;
+	$wp_customize->_publish_changeset_values( $changeset_post->ID );
 
 	/*
 	 * Trash the changeset post if revisions are not enabled. Unpublished
@@ -2920,7 +3028,7 @@
 			/** This action is documented in wp-includes/post.php */
 			do_action( 'trashed_post', $post_id );
 		}
-	}
+	}// End if().
 }
 
 /**
@@ -2955,7 +3063,7 @@
 function _wp_customize_loader_settings() {
 	$admin_origin = parse_url( admin_url() );
 	$home_origin  = parse_url( home_url() );
-	$cross_domain = ( strtolower( $admin_origin[ 'host' ] ) != strtolower( $home_origin[ 'host' ] ) );
+	$cross_domain = ( strtolower( $admin_origin['host'] ) != strtolower( $home_origin['host'] ) );
 
 	$browser = array(
 		'mobile' => wp_is_mobile(),
@@ -2976,8 +3084,9 @@
 
 	$wp_scripts = wp_scripts();
 	$data = $wp_scripts->get_data( 'customize-loader', 'data' );
-	if ( $data )
+	if ( $data ) {
 		$script = "$data\n$script";
+	}
 
 	$wp_scripts->add_data( 'customize-loader', 'data', $script );
 }
@@ -2993,8 +3102,9 @@
  */
 function wp_customize_url( $stylesheet = null ) {
 	$url = admin_url( 'customize.php' );
-	if ( $stylesheet )
+	if ( $stylesheet ) {
 		$url .= '?theme=' . urlencode( $stylesheet );
+	}
 	return esc_url( $url );
 }
 
@@ -3017,7 +3127,7 @@
 function wp_customize_support_script() {
 	$admin_origin = parse_url( admin_url() );
 	$home_origin  = parse_url( home_url() );
-	$cross_domain = ( strtolower( $admin_origin[ 'host' ] ) != strtolower( $home_origin[ 'host' ] ) );
+	$cross_domain = ( strtolower( $admin_origin['host'] ) != strtolower( $home_origin['host'] ) );
 
 	?>
 	<!--[if lte IE 8]>
Index: src/wp-includes/update.php
===================================================================
--- src/wp-includes/update.php	(revision 40901)
+++ src/wp-includes/update.php	(working copy)
@@ -35,17 +35,19 @@
 	$translations = wp_get_installed_translations( 'core' );
 
 	// Invalidate the transient when $wp_version changes
-	if ( is_object( $current ) && $wp_version != $current->version_checked )
+	if ( is_object( $current ) && $wp_version != $current->version_checked ) {
 		$current = false;
+	}
 
-	if ( ! is_object($current) ) {
+	if ( ! is_object( $current ) ) {
 		$current = new stdClass;
 		$current->updates = array();
 		$current->version_checked = $wp_version;
 	}
 
-	if ( ! empty( $extra_stats ) )
+	if ( ! empty( $extra_stats ) ) {
 		$force_check = true;
+	}
 
 	// Wait 60 seconds between multiple version check requests
 	$timeout = 60;
@@ -67,10 +69,10 @@
 	$current->last_checked = time();
 	set_site_transient( 'update_core', $current );
 
-	if ( method_exists( $wpdb, 'db_version' ) )
-		$mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version());
-	else
-		$mysql_version = 'N/A';
+	if ( method_exists( $wpdb, 'db_version' ) ) {
+		$mysql_version = preg_replace( '/[^0-9.].*/', '', $wpdb->db_version() );
+	} else { $mysql_version = 'N/A';
+	}
 
 	if ( is_multisite() ) {
 		$user_count = get_user_count();
@@ -101,12 +103,14 @@
 		'translations' => wp_json_encode( $translations ),
 	);
 
-	if ( is_array( $extra_stats ) )
+	if ( is_array( $extra_stats ) ) {
 		$post_body = array_merge( $post_body, $extra_stats );
+	}
 
 	$url = $http_url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
-	if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
+	if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
 		$url = set_url_scheme( $url, 'https' );
+	}
 
 	$doing_cron = wp_doing_cron();
 
@@ -115,7 +119,7 @@
 		'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
 		'headers' => array(
 			'wp_install' => $wp_install,
-			'wp_blog' => home_url( '/' )
+			'wp_blog' => home_url( '/' ),
 		),
 		'body' => $post_body,
 	);
@@ -148,16 +152,29 @@
 
 	foreach ( $offers as &$offer ) {
 		foreach ( $offer as $offer_key => $value ) {
-			if ( 'packages' == $offer_key )
+			if ( 'packages' == $offer_key ) {
 				$offer['packages'] = (object) array_intersect_key( array_map( 'esc_url', $offer['packages'] ),
-					array_fill_keys( array( 'full', 'no_content', 'new_bundled', 'partial', 'rollback' ), '' ) );
-			elseif ( 'download' == $offer_key )
+				array_fill_keys( array( 'full', 'no_content', 'new_bundled', 'partial', 'rollback' ), '' ) );
+			} elseif ( 'download' == $offer_key ) {
 				$offer['download'] = esc_url( $value );
-			else
-				$offer[ $offer_key ] = esc_html( $value );
+			} else { $offer[ $offer_key ] = esc_html( $value );
+			}
 		}
-		$offer = (object) array_intersect_key( $offer, array_fill_keys( array( 'response', 'download', 'locale',
-			'packages', 'current', 'version', 'php_version', 'mysql_version', 'new_bundled', 'partial_version', 'notify_email', 'support_email', 'new_files' ), '' ) );
+		$offer = (object) array_intersect_key( $offer, array_fill_keys( array(
+			'response',
+			'download',
+			'locale',
+			'packages',
+			'current',
+			'version',
+			'php_version',
+			'mysql_version',
+			'new_bundled',
+			'partial_version',
+			'notify_email',
+			'support_email',
+			'new_files',
+		), '' ) );
 	}
 
 	$updates = new stdClass();
@@ -165,8 +182,9 @@
 	$updates->last_checked = time();
 	$updates->version_checked = $wp_version;
 
-	if ( isset( $body['translations'] ) )
+	if ( isset( $body['translations'] ) ) {
 		$updates->translations = $body['translations'];
+	}
 
 	set_site_transient( 'update_core', $updates );
 
@@ -205,16 +223,18 @@
 	include( ABSPATH . WPINC . '/version.php' );
 
 	// If running blog-side, bail unless we've not checked in the last 12 hours
-	if ( !function_exists( 'get_plugins' ) )
+	if ( ! function_exists( 'get_plugins' ) ) {
 		require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
+	}
 
 	$plugins = get_plugins();
 	$translations = wp_get_installed_translations( 'plugins' );
 
 	$active  = get_option( 'active_plugins', array() );
 	$current = get_site_transient( 'update_plugins' );
-	if ( ! is_object($current) )
+	if ( ! is_object( $current ) ) {
 		$current = new stdClass;
+	}
 
 	$new_option = new stdClass;
 	$new_option->last_checked = time();
@@ -248,13 +268,14 @@
 		foreach ( $plugins as $file => $p ) {
 			$new_option->checked[ $file ] = $p['Version'];
 
-			if ( !isset( $current->checked[ $file ] ) || strval($current->checked[ $file ]) !== strval($p['Version']) )
+			if ( ! isset( $current->checked[ $file ] ) || strval( $current->checked[ $file ] ) !== strval( $p['Version'] ) ) {
 				$plugin_changed = true;
+			}
 		}
 
-		if ( isset ( $current->response ) && is_array( $current->response ) ) {
+		if ( isset( $current->response ) && is_array( $current->response ) ) {
 			foreach ( $current->response as $plugin_file => $update_details ) {
-				if ( ! isset($plugins[ $plugin_file ]) ) {
+				if ( ! isset( $plugins[ $plugin_file ] ) ) {
 					$plugin_changed = true;
 					break;
 				}
@@ -301,7 +322,7 @@
 			'locale'       => wp_json_encode( $locales ),
 			'all'          => wp_json_encode( true ),
 		),
-		'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
+		'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ),
 	);
 
 	if ( $extra_stats ) {
@@ -309,8 +330,9 @@
 	}
 
 	$url = $http_url = 'http://api.wordpress.org/plugins/update-check/1.1/';
-	if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
+	if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
 		$url = set_url_scheme( $url, 'https' );
+	}
 
 	$raw_response = wp_remote_post( $url, $options );
 	if ( $ssl && is_wp_error( $raw_response ) ) {
@@ -382,8 +404,9 @@
 	$translations = wp_get_installed_translations( 'themes' );
 
 	$last_update = get_site_transient( 'update_themes' );
-	if ( ! is_object($last_update) )
+	if ( ! is_object( $last_update ) ) {
 		$last_update = new stdClass;
+	}
 
 	$themes = $checked = $request = array();
 
@@ -391,14 +414,14 @@
 	$request['active'] = get_option( 'stylesheet' );
 
 	foreach ( $installed_themes as $theme ) {
-		$checked[ $theme->get_stylesheet() ] = $theme->get('Version');
+		$checked[ $theme->get_stylesheet() ] = $theme->get( 'Version' );
 
 		$themes[ $theme->get_stylesheet() ] = array(
-			'Name'       => $theme->get('Name'),
-			'Title'      => $theme->get('Name'),
-			'Version'    => $theme->get('Version'),
-			'Author'     => $theme->get('Author'),
-			'Author URI' => $theme->get('AuthorURI'),
+			'Name'       => $theme->get( 'Name' ),
+			'Title'      => $theme->get( 'Name' ),
+			'Version'    => $theme->get( 'Version' ),
+			'Author'     => $theme->get( 'Author' ),
+			'Author URI' => $theme->get( 'AuthorURI' ),
 			'Template'   => $theme->get_template(),
 			'Stylesheet' => $theme->get_stylesheet(),
 		);
@@ -427,13 +450,14 @@
 	if ( $time_not_changed && ! $extra_stats ) {
 		$theme_changed = false;
 		foreach ( $checked as $slug => $v ) {
-			if ( !isset( $last_update->checked[ $slug ] ) || strval($last_update->checked[ $slug ]) !== strval($v) )
+			if ( ! isset( $last_update->checked[ $slug ] ) || strval( $last_update->checked[ $slug ] ) !== strval( $v ) ) {
 				$theme_changed = true;
+			}
 		}
 
-		if ( isset ( $last_update->response ) && is_array( $last_update->response ) ) {
+		if ( isset( $last_update->response ) && is_array( $last_update->response ) ) {
 			foreach ( $last_update->response as $slug => $update_details ) {
-				if ( ! isset($checked[ $slug ]) ) {
+				if ( ! isset( $checked[ $slug ] ) ) {
 					$theme_changed = true;
 					break;
 				}
@@ -479,7 +503,7 @@
 			'translations' => wp_json_encode( $translations ),
 			'locale'       => wp_json_encode( $locales ),
 		),
-		'user-agent'	=> 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
+		'user-agent'	=> 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ),
 	);
 
 	if ( $extra_stats ) {
@@ -487,8 +511,9 @@
 	}
 
 	$url = $http_url = 'http://api.wordpress.org/themes/update-check/1.1/';
-	if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
+	if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
 		$url = set_url_scheme( $url, 'https' );
+	}
 
 	$raw_response = wp_remote_post( $url, $options );
 	if ( $ssl && is_wp_error( $raw_response ) ) {
@@ -543,11 +568,16 @@
  */
 function wp_get_translation_updates() {
 	$updates = array();
-	$transients = array( 'update_core' => 'core', 'update_plugins' => 'plugin', 'update_themes' => 'theme' );
+	$transients = array(
+		'update_core' => 'core',
+		'update_plugins' => 'plugin',
+		'update_themes' => 'theme',
+	);
 	foreach ( $transients as $transient => $type ) {
 		$transient = get_site_transient( $transient );
-		if ( empty( $transient->translations ) )
+		if ( empty( $transient->translations ) ) {
 			continue;
+		}
 
 		foreach ( $transient->translations as $translation ) {
 			$updates[] = (object) $translation;
@@ -564,34 +594,45 @@
  * @return array
  */
 function wp_get_update_data() {
-	$counts = array( 'plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0 );
+	$counts = array(
+		'plugins' => 0,
+		'themes' => 0,
+		'wordpress' => 0,
+		'translations' => 0,
+	);
 
 	if ( $plugins = current_user_can( 'update_plugins' ) ) {
 		$update_plugins = get_site_transient( 'update_plugins' );
-		if ( ! empty( $update_plugins->response ) )
+		if ( ! empty( $update_plugins->response ) ) {
 			$counts['plugins'] = count( $update_plugins->response );
+		}
 	}
 
 	if ( $themes = current_user_can( 'update_themes' ) ) {
 		$update_themes = get_site_transient( 'update_themes' );
-		if ( ! empty( $update_themes->response ) )
+		if ( ! empty( $update_themes->response ) ) {
 			$counts['themes'] = count( $update_themes->response );
+		}
 	}
 
 	if ( ( $core = current_user_can( 'update_core' ) ) && function_exists( 'get_core_updates' ) ) {
-		$update_wordpress = get_core_updates( array('dismissed' => false) );
-		if ( ! empty( $update_wordpress ) && ! in_array( $update_wordpress[0]->response, array('development', 'latest') ) && current_user_can('update_core') )
+		$update_wordpress = get_core_updates( array(
+			'dismissed' => false,
+		) );
+		if ( ! empty( $update_wordpress ) && ! in_array( $update_wordpress[0]->response, array( 'development', 'latest' ) ) && current_user_can( 'update_core' ) ) {
 			$counts['wordpress'] = 1;
+		}
 	}
 
-	if ( ( $core || $plugins || $themes ) && wp_get_translation_updates() )
+	if ( ( $core || $plugins || $themes ) && wp_get_translation_updates() ) {
 		$counts['translations'] = 1;
+	}
 
 	$counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
 	$titles = array();
 	if ( $counts['wordpress'] ) {
 		/* translators: 1: Number of updates available to WordPress */
-		$titles['wordpress'] = sprintf( __( '%d WordPress Update'), $counts['wordpress'] );
+		$titles['wordpress'] = sprintf( __( '%d WordPress Update' ), $counts['wordpress'] );
 	}
 	if ( $counts['plugins'] ) {
 		/* translators: 1: Number of updates available to plugins */
@@ -607,7 +648,10 @@
 
 	$update_title = $titles ? esc_attr( implode( ', ', $titles ) ) : '';
 
-	$update_data = array( 'counts' => $counts, 'title' => $update_title );
+	$update_data = array(
+		'counts' => $counts,
+		'title' => $update_title,
+	);
 	/**
 	 * Filters the returned array of update data for plugins, themes, and WordPress core.
 	 *
@@ -656,8 +700,9 @@
  */
 function _maybe_update_plugins() {
 	$current = get_site_transient( 'update_plugins' );
-	if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) )
+	if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) ) {
 		return;
+	}
 	wp_update_plugins();
 }
 
@@ -672,8 +717,9 @@
  */
 function _maybe_update_themes() {
 	$current = get_site_transient( 'update_themes' );
-	if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) )
+	if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) ) {
 		return;
+	}
 	wp_update_themes();
 }
 
@@ -683,14 +729,17 @@
  * @since 3.1.0
  */
 function wp_schedule_update_checks() {
-	if ( ! wp_next_scheduled( 'wp_version_check' ) && ! wp_installing() )
-		wp_schedule_event(time(), 'twicedaily', 'wp_version_check');
+	if ( ! wp_next_scheduled( 'wp_version_check' ) && ! wp_installing() ) {
+		wp_schedule_event( time(), 'twicedaily', 'wp_version_check' );
+	}
 
-	if ( ! wp_next_scheduled( 'wp_update_plugins' ) && ! wp_installing() )
-		wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins');
+	if ( ! wp_next_scheduled( 'wp_update_plugins' ) && ! wp_installing() ) {
+		wp_schedule_event( time(), 'twicedaily', 'wp_update_plugins' );
+	}
 
-	if ( ! wp_next_scheduled( 'wp_update_themes' ) && ! wp_installing() )
-		wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
+	if ( ! wp_next_scheduled( 'wp_update_themes' ) && ! wp_installing() ) {
+		wp_schedule_event( time(), 'twicedaily', 'wp_update_themes' );
+	}
 }
 
 /**
Index: src/wp-includes/user.php
===================================================================
--- src/wp-includes/user.php	(revision 40901)
+++ src/wp-includes/user.php	(working copy)
@@ -26,21 +26,24 @@
  * @return WP_User|WP_Error WP_User on success, WP_Error on failure.
  */
 function wp_signon( $credentials = array(), $secure_cookie = '' ) {
-	if ( empty($credentials) ) {
+	if ( empty( $credentials ) ) {
 		$credentials = array(); // Back-compat for plugins passing an empty string.
 
-		if ( ! empty($_POST['log']) )
+		if ( ! empty( $_POST['log'] ) ) {
 			$credentials['user_login'] = $_POST['log'];
-		if ( ! empty($_POST['pwd']) )
+		}
+		if ( ! empty( $_POST['pwd'] ) ) {
 			$credentials['user_password'] = $_POST['pwd'];
-		if ( ! empty($_POST['rememberme']) )
+		}
+		if ( ! empty( $_POST['rememberme'] ) ) {
 			$credentials['remember'] = $_POST['rememberme'];
+		}
 	}
 
-	if ( !empty($credentials['remember']) )
+	if ( ! empty( $credentials['remember'] ) ) {
 		$credentials['remember'] = true;
-	else
-		$credentials['remember'] = false;
+	} else { $credentials['remember'] = false;
+	}
 
 	/**
 	 * Fires before the user is authenticated.
@@ -57,8 +60,9 @@
 	 */
 	do_action_ref_array( 'wp_authenticate', array( &$credentials['user_login'], &$credentials['user_password'] ) );
 
-	if ( '' === $secure_cookie )
+	if ( '' === $secure_cookie ) {
 		$secure_cookie = is_ssl();
+	}
 
 	/**
 	 * Filters whether to use a secure sign-on cookie.
@@ -67,32 +71,32 @@
 	 *
 	 * @param bool  $secure_cookie Whether to use a secure sign-on cookie.
 	 * @param array $credentials {
- 	 *     Array of entered sign-on data.
- 	 *
- 	 *     @type string $user_login    Username.
- 	 *     @type string $user_password Password entered.
+	  *     Array of entered sign-on data.
+	  *
+	  *     @type string $user_login    Username.
+	  *     @type string $user_password Password entered.
 	 *     @type bool   $remember      Whether to 'remember' the user. Increases the time
 	 *                                 that the cookie will be kept. Default false.
- 	 * }
+	  * }
 	 */
 	$secure_cookie = apply_filters( 'secure_signon_cookie', $secure_cookie, $credentials );
 
 	global $auth_secure_cookie; // XXX ugly hack to pass this to wp_authenticate_cookie
 	$auth_secure_cookie = $secure_cookie;
 
-	add_filter('authenticate', 'wp_authenticate_cookie', 30, 3);
+	add_filter( 'authenticate', 'wp_authenticate_cookie', 30, 3 );
 
-	$user = wp_authenticate($credentials['user_login'], $credentials['user_password']);
+	$user = wp_authenticate( $credentials['user_login'], $credentials['user_password'] );
 
-	if ( is_wp_error($user) ) {
-		if ( $user->get_error_codes() == array('empty_username', 'empty_password') ) {
-			$user = new WP_Error('', '');
+	if ( is_wp_error( $user ) ) {
+		if ( $user->get_error_codes() == array( 'empty_username', 'empty_password' ) ) {
+			$user = new WP_Error( '', '' );
 		}
 
 		return $user;
 	}
 
-	wp_set_auth_cookie($user->ID, $credentials['remember'], $secure_cookie);
+	wp_set_auth_cookie( $user->ID, $credentials['remember'], $secure_cookie );
 	/**
 	 * Fires after the user has successfully logged in.
 	 *
@@ -115,29 +119,32 @@
  * @param string                $password Password for authentication.
  * @return WP_User|WP_Error WP_User on success, WP_Error on failure.
  */
-function wp_authenticate_username_password($user, $username, $password) {
+function wp_authenticate_username_password( $user, $username, $password ) {
 	if ( $user instanceof WP_User ) {
 		return $user;
 	}
 
-	if ( empty($username) || empty($password) ) {
-		if ( is_wp_error( $user ) )
+	if ( empty( $username ) || empty( $password ) ) {
+		if ( is_wp_error( $user ) ) {
 			return $user;
+		}
 
 		$error = new WP_Error();
 
-		if ( empty($username) )
-			$error->add('empty_username', __('<strong>ERROR</strong>: The username field is empty.'));
+		if ( empty( $username ) ) {
+			$error->add( 'empty_username', __( '<strong>ERROR</strong>: The username field is empty.' ) );
+		}
 
-		if ( empty($password) )
-			$error->add('empty_password', __('<strong>ERROR</strong>: The password field is empty.'));
+		if ( empty( $password ) ) {
+			$error->add( 'empty_password', __( '<strong>ERROR</strong>: The password field is empty.' ) );
+		}
 
 		return $error;
 	}
 
-	$user = get_user_by('login', $username);
+	$user = get_user_by( 'login', $username );
 
-	if ( !$user ) {
+	if ( ! $user ) {
 		return new WP_Error( 'invalid_username',
 			__( '<strong>ERROR</strong>: Invalid username.' ) .
 			' <a href="' . wp_lostpassword_url() . '">' .
@@ -156,8 +163,9 @@
 	 * @param string           $password Password to check against the user.
 	 */
 	$user = apply_filters( 'wp_authenticate_user', $user, $password );
-	if ( is_wp_error($user) )
+	if ( is_wp_error( $user ) ) {
 		return $user;
+	}
 
 	if ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) {
 		return new WP_Error( 'incorrect_password',
@@ -259,27 +267,27 @@
  * @param string                $password Password. If not empty, cancels the cookie authentication.
  * @return WP_User|WP_Error WP_User on success, WP_Error on failure.
  */
-function wp_authenticate_cookie($user, $username, $password) {
+function wp_authenticate_cookie( $user, $username, $password ) {
 	if ( $user instanceof WP_User ) {
 		return $user;
 	}
 
-	if ( empty($username) && empty($password) ) {
+	if ( empty( $username ) && empty( $password ) ) {
 		$user_id = wp_validate_auth_cookie();
-		if ( $user_id )
-			return new WP_User($user_id);
+		if ( $user_id ) {
+			return new WP_User( $user_id );
+		}
 
 		global $auth_secure_cookie;
 
-		if ( $auth_secure_cookie )
+		if ( $auth_secure_cookie ) {
 			$auth_cookie = SECURE_AUTH_COOKIE;
-		else
-			$auth_cookie = AUTH_COOKIE;
-
-		if ( !empty($_COOKIE[$auth_cookie]) )
-			return new WP_Error('expired_session', __('Please log in again.'));
+		} else { $auth_cookie = AUTH_COOKIE;
+		}
 
-		// If the cookie is not set, be silent.
+		if ( ! empty( $_COOKIE[ $auth_cookie ] ) ) {
+			return new WP_Error( 'expired_session', __( 'Please log in again.' ) );
+		}
 	}
 
 	return $user;
@@ -306,8 +314,9 @@
 		 */
 		$spammed = apply_filters( 'check_is_user_spammed', is_user_spammy( $user ), $user );
 
-		if ( $spammed )
+		if ( $spammed ) {
 			return new WP_Error( 'spammer_account', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.' ) );
+		}
 	}
 	return $user;
 }
@@ -332,11 +341,11 @@
 		return $user_id;
 	}
 
-	if ( is_blog_admin() || is_network_admin() || empty( $_COOKIE[LOGGED_IN_COOKIE] ) ) {
+	if ( is_blog_admin() || is_network_admin() || empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
 		return false;
 	}
 
-	return wp_validate_auth_cookie( $_COOKIE[LOGGED_IN_COOKIE], 'logged_in' );
+	return wp_validate_auth_cookie( $_COOKIE[ LOGGED_IN_COOKIE ], 'logged_in' );
 }
 
 /**
@@ -392,8 +401,9 @@
 	global $wpdb;
 
 	$count = array();
-	if ( empty( $users ) || ! is_array( $users ) )
+	if ( empty( $users ) || ! is_array( $users ) ) {
 		return $count;
+	}
 
 	$userlist = implode( ',', array_map( 'absint', $users ) );
 	$where = get_posts_by_author_sql( $post_type, true, null, $public_only );
@@ -404,8 +414,9 @@
 	}
 
 	foreach ( $users as $id ) {
-		if ( ! isset( $count[ $id ] ) )
+		if ( ! isset( $count[ $id ] ) ) {
 			$count[ $id ] = 0;
+		}
 	}
 
 	return $count;
@@ -423,8 +434,9 @@
  * @return int The current user's ID, or 0 if no user is logged in.
  */
 function get_current_user_id() {
-	if ( ! function_exists( 'wp_get_current_user' ) )
+	if ( ! function_exists( 'wp_get_current_user' ) ) {
 		return 0;
+	}
 	$user = wp_get_current_user();
 	return ( isset( $user->ID ) ? (int) $user->ID : 0 );
 }
@@ -451,22 +463,25 @@
 function get_user_option( $option, $user = 0, $deprecated = '' ) {
 	global $wpdb;
 
-	if ( !empty( $deprecated ) )
+	if ( ! empty( $deprecated ) ) {
 		_deprecated_argument( __FUNCTION__, '3.0.0' );
+	}
 
-	if ( empty( $user ) )
+	if ( empty( $user ) ) {
 		$user = get_current_user_id();
+	}
 
-	if ( ! $user = get_userdata( $user ) )
+	if ( ! $user = get_userdata( $user ) ) {
 		return false;
+	}
 
 	$prefix = $wpdb->get_blog_prefix();
-	if ( $user->has_prop( $prefix . $option ) ) // Blog specific
+	if ( $user->has_prop( $prefix . $option ) ) { // Blog specific
 		$result = $user->get( $prefix . $option );
-	elseif ( $user->has_prop( $option ) ) // User specific and cross-blog
+	} elseif ( $user->has_prop( $option ) ) { // User specific and cross-blog
 		$result = $user->get( $option );
-	else
-		$result = false;
+	} else { $result = false;
+	}
 
 	/**
 	 * Filters a specific user option value.
@@ -506,8 +521,9 @@
 function update_user_option( $user_id, $option_name, $newvalue, $global = false ) {
 	global $wpdb;
 
-	if ( !$global )
+	if ( ! $global ) {
 		$option_name = $wpdb->get_blog_prefix() . $option_name;
+	}
 
 	return update_user_meta( $user_id, $option_name, $newvalue );
 }
@@ -532,8 +548,9 @@
 function delete_user_option( $user_id, $option_name, $global = false ) {
 	global $wpdb;
 
-	if ( !$global )
+	if ( ! $global ) {
 		$option_name = $wpdb->get_blog_prefix() . $option_name;
+	}
 	return delete_user_meta( $user_id, $option_name );
 }
 
@@ -553,7 +570,7 @@
 	$args = wp_parse_args( $args );
 	$args['count_total'] = false;
 
-	$user_search = new WP_User_Query($args);
+	$user_search = new WP_User_Query( $args );
 
 	return (array) $user_search->get_results();
 }
@@ -578,8 +595,9 @@
 	$user_id = (int) $user_id;
 
 	// Logged out users can't have sites
-	if ( empty( $user_id ) )
+	if ( empty( $user_id ) ) {
 		return array();
+	}
 
 	/**
 	 * Filters the list of a user's sites before it is populated.
@@ -601,18 +619,21 @@
 	}
 
 	$keys = get_user_meta( $user_id );
-	if ( empty( $keys ) )
+	if ( empty( $keys ) ) {
 		return array();
+	}
 
 	if ( ! is_multisite() ) {
 		$site_id = get_current_blog_id();
-		$sites = array( $site_id => new stdClass );
+		$sites = array(
+			$site_id => new stdClass,
+		);
 		$sites[ $site_id ]->userblog_id = $site_id;
-		$sites[ $site_id ]->blogname = get_option('blogname');
+		$sites[ $site_id ]->blogname = get_option( 'blogname' );
 		$sites[ $site_id ]->domain = '';
 		$sites[ $site_id ]->path = '';
 		$sites[ $site_id ]->site_id = 1;
-		$sites[ $site_id ]->siteurl = get_option('siteurl');
+		$sites[ $site_id ]->siteurl = get_option( 'siteurl' );
 		$sites[ $site_id ]->archived = 0;
 		$sites[ $site_id ]->spam = 0;
 		$sites[ $site_id ]->deleted = 0;
@@ -629,13 +650,16 @@
 	$keys = array_keys( $keys );
 
 	foreach ( $keys as $key ) {
-		if ( 'capabilities' !== substr( $key, -12 ) )
+		if ( 'capabilities' !== substr( $key, -12 ) ) {
 			continue;
-		if ( $wpdb->base_prefix && 0 !== strpos( $key, $wpdb->base_prefix ) )
+		}
+		if ( $wpdb->base_prefix && 0 !== strpos( $key, $wpdb->base_prefix ) ) {
 			continue;
+		}
 		$site_id = str_replace( array( $wpdb->base_prefix, '_capabilities' ), '', $key );
-		if ( ! is_numeric( $site_id ) )
+		if ( ! is_numeric( $site_id ) ) {
 			continue;
+		}
 
 		$site_ids[] = (int) $site_id;
 	}
@@ -762,8 +786,8 @@
  * @param bool   $unique     Optional, default is false. Whether the same key should not be added.
  * @return int|false Meta ID on success, false on failure.
  */
-function add_user_meta($user_id, $meta_key, $meta_value, $unique = false) {
-	return add_metadata('user', $user_id, $meta_key, $meta_value, $unique);
+function add_user_meta( $user_id, $meta_key, $meta_value, $unique = false ) {
+	return add_metadata( 'user', $user_id, $meta_key, $meta_value, $unique );
 }
 
 /**
@@ -781,8 +805,8 @@
  * @param mixed  $meta_value Optional. Metadata value.
  * @return bool True on success, false on failure.
  */
-function delete_user_meta($user_id, $meta_key, $meta_value = '') {
-	return delete_metadata('user', $user_id, $meta_key, $meta_value);
+function delete_user_meta( $user_id, $meta_key, $meta_value = '' ) {
+	return delete_metadata( 'user', $user_id, $meta_key, $meta_value );
 }
 
 /**
@@ -796,8 +820,8 @@
  * @param bool   $single  Whether to return a single value.
  * @return mixed Will be an array if $single is false. Will be value of meta data field if $single is true.
  */
-function get_user_meta($user_id, $key = '', $single = false) {
-	return get_metadata('user', $user_id, $key, $single);
+function get_user_meta( $user_id, $key = '', $single = false ) {
+	return get_metadata( 'user', $user_id, $key, $single );
 }
 
 /**
@@ -817,8 +841,8 @@
  * @param mixed  $prev_value Optional. Previous value to check before removing.
  * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
  */
-function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '') {
-	return update_metadata('user', $user_id, $meta_key, $meta_value, $prev_value);
+function update_user_meta( $user_id, $meta_key, $meta_value, $prev_value = '' ) {
+	return update_metadata( 'user', $user_id, $meta_key, $meta_value, $prev_value );
 }
 
 /**
@@ -837,12 +861,12 @@
  * @param string $strategy 'time' or 'memory'
  * @return array Includes a grand total and an array of counts indexed by role strings.
  */
-function count_users($strategy = 'time') {
+function count_users( $strategy = 'time' ) {
 	global $wpdb;
 
 	// Initialize
 	$id = get_current_blog_id();
-	$blog_prefix = $wpdb->get_blog_prefix($id);
+	$blog_prefix = $wpdb->get_blog_prefix( $id );
 	$result = array();
 
 	if ( 'time' == $strategy ) {
@@ -851,10 +875,10 @@
 		// Build a CPU-intensive query that will return concise information.
 		$select_count = array();
 		foreach ( $avail_roles as $this_role => $name ) {
-			$select_count[] = $wpdb->prepare( "COUNT(NULLIF(`meta_value` LIKE %s, false))", '%' . $wpdb->esc_like( '"' . $this_role . '"' ) . '%');
+			$select_count[] = $wpdb->prepare( 'COUNT(NULLIF(`meta_value` LIKE %s, false))', '%' . $wpdb->esc_like( '"' . $this_role . '"' ) . '%' );
 		}
 		$select_count[] = "COUNT(NULLIF(`meta_value` = 'a:0:{}', false))";
-		$select_count = implode(', ', $select_count);
+		$select_count = implode( ', ', $select_count );
 
 		// Add the meta_value index to the selection list, then run the query.
 		$row = $wpdb->get_row( "
@@ -868,16 +892,16 @@
 		$col = 0;
 		$role_counts = array();
 		foreach ( $avail_roles as $this_role => $name ) {
-			$count = (int) $row[$col++];
-			if ($count > 0) {
-				$role_counts[$this_role] = $count;
+			$count = (int) $row[ $col++ ];
+			if ( $count > 0 ) {
+				$role_counts[ $this_role ] = $count;
 			}
 		}
 
-		$role_counts['none'] = (int) $row[$col++];
+		$role_counts['none'] = (int) $row[ $col++ ];
 
 		// Get the meta_value index from the end of the result set.
-		$total_users = (int) $row[$col];
+		$total_users = (int) $row[ $col ];
 
 		$result['total_users'] = $total_users;
 		$result['avail_roles'] =& $role_counts;
@@ -894,24 +918,25 @@
 		" );
 
 		foreach ( $users_of_blog as $caps_meta ) {
-			$b_roles = maybe_unserialize($caps_meta);
-			if ( ! is_array( $b_roles ) )
+			$b_roles = maybe_unserialize( $caps_meta );
+			if ( ! is_array( $b_roles ) ) {
 				continue;
+			}
 			if ( empty( $b_roles ) ) {
 				$avail_roles['none']++;
 			}
 			foreach ( $b_roles as $b_role => $val ) {
-				if ( isset($avail_roles[$b_role]) ) {
-					$avail_roles[$b_role]++;
+				if ( isset( $avail_roles[ $b_role ] ) ) {
+					$avail_roles[ $b_role ]++;
 				} else {
-					$avail_roles[$b_role] = 1;
+					$avail_roles[ $b_role ] = 1;
 				}
 			}
 		}
 
 		$result['total_users'] = count( $users_of_blog );
 		$result['avail_roles'] =& $avail_roles;
-	}
+	}// End if().
 
 	if ( is_multisite() ) {
 		$result['avail_roles']['none'] = 0;
@@ -941,11 +966,12 @@
  *
  * @param int $for_user_id Optional. User ID to set up global data.
  */
-function setup_userdata($for_user_id = '') {
+function setup_userdata( $for_user_id = '' ) {
 	global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_identity;
 
-	if ( '' == $for_user_id )
+	if ( '' == $for_user_id ) {
 		$for_user_id = get_current_user_id();
+	}
 	$user = get_userdata( $for_user_id );
 
 	if ( ! $user ) {
@@ -1030,12 +1056,23 @@
  */
 function wp_dropdown_users( $args = '' ) {
 	$defaults = array(
-		'show_option_all' => '', 'show_option_none' => '', 'hide_if_only_one_author' => '',
-		'orderby' => 'display_name', 'order' => 'ASC',
-		'include' => '', 'exclude' => '', 'multi' => 0,
-		'show' => 'display_name', 'echo' => 1,
-		'selected' => 0, 'name' => 'user', 'class' => '', 'id' => '',
-		'blog_id' => get_current_blog_id(), 'who' => '', 'include_selected' => false,
+		'show_option_all' => '',
+	'show_option_none' => '',
+	'hide_if_only_one_author' => '',
+		'orderby' => 'display_name',
+	'order' => 'ASC',
+		'include' => '',
+	'exclude' => '',
+	'multi' => 0,
+		'show' => 'display_name',
+	'echo' => 1,
+		'selected' => 0,
+	'name' => 'user',
+	'class' => '',
+	'id' => '',
+		'blog_id' => get_current_blog_id(),
+	'who' => '',
+	'include_selected' => false,
 		'option_none_value' => -1,
 		'role' => '',
 		'role__in' => array(),
@@ -1123,8 +1160,8 @@
 			$output .= "\t<option value='$user->ID'$_selected>" . esc_html( $display ) . "</option>\n";
 		}
 
-		$output .= "</select>";
-	}
+		$output .= '</select>';
+	}// End if().
 
 	/**
 	 * Filters the wp_dropdown_users() HTML output.
@@ -1157,16 +1194,19 @@
  *                        'attribute' and 'js'.
  * @return mixed Sanitized value.
  */
-function sanitize_user_field($field, $value, $user_id, $context) {
-	$int_fields = array('ID');
-	if ( in_array($field, $int_fields) )
+function sanitize_user_field( $field, $value, $user_id, $context ) {
+	$int_fields = array( 'ID' );
+	if ( in_array( $field, $int_fields ) ) {
 		$value = (int) $value;
+	}
 
-	if ( 'raw' == $context )
+	if ( 'raw' == $context ) {
 		return $value;
+	}
 
-	if ( !is_string($value) && !is_numeric($value) )
+	if ( ! is_string( $value ) && ! is_numeric( $value ) ) {
 		return $value;
+	}
 
 	$prefixed = false !== strpos( $field, 'user_' );
 
@@ -1191,10 +1231,10 @@
 			$value = apply_filters( "edit_user_{$field}", $value, $user_id );
 		}
 
-		if ( 'description' == $field )
+		if ( 'description' == $field ) {
 			$value = esc_html( $value ); // textarea_escaped?
-		else
-			$value = esc_attr($value);
+		} else { $value = esc_attr( $value );
+		}
 	} elseif ( 'db' == $context ) {
 		if ( $prefixed ) {
 			/** This filter is documented in wp-includes/post.php */
@@ -1206,7 +1246,7 @@
 			 *
 			 * The dynamic portion of the hook name, `$field`, refers to the prefixed user
 			 * field being filtered, such as 'user_login', 'user_email', 'first_name', etc.
- 			 *
+			  *
 			 * @since 2.9.0
 			 *
 			 * @param mixed $value Value of the prefixed user field.
@@ -1235,10 +1275,11 @@
 			 */
 			$value = apply_filters( "user_{$field}", $value, $user_id, $context );
 		}
-	}
+	}// End if().
 
-	if ( 'user_url' == $field )
-		$value = esc_url($value);
+	if ( 'user_url' == $field ) {
+		$value = esc_url( $value );
+	}
 
 	if ( 'attribute' == $context ) {
 		$value = esc_attr( $value );
@@ -1265,10 +1306,10 @@
 		$user = $user->data;
 	}
 
-	wp_cache_add($user->ID, $user, 'users');
-	wp_cache_add($user->user_login, $user->ID, 'userlogins');
-	wp_cache_add($user->user_email, $user->ID, 'useremail');
-	wp_cache_add($user->user_nicename, $user->ID, 'userslugs');
+	wp_cache_add( $user->ID, $user, 'users' );
+	wp_cache_add( $user->user_login, $user->ID, 'userlogins' );
+	wp_cache_add( $user->user_email, $user->ID, 'useremail' );
+	wp_cache_add( $user->user_nicename, $user->ID, 'userslugs' );
 }
 
 /**
@@ -1280,11 +1321,13 @@
  * @param WP_User|int $user User object or ID to be cleaned from the cache
  */
 function clean_user_cache( $user ) {
-	if ( is_numeric( $user ) )
+	if ( is_numeric( $user ) ) {
 		$user = new WP_User( $user );
+	}
 
-	if ( ! $user->exists() )
+	if ( ! $user->exists() ) {
 		return;
+	}
 
 	wp_cache_delete( $user->ID, 'users' );
 	wp_cache_delete( $user->user_login, 'userlogins' );
@@ -1326,7 +1369,7 @@
  * @return int|false The user's ID on success, and false on failure.
  */
 function email_exists( $email ) {
-	if ( $user = get_user_by( 'email', $email) ) {
+	if ( $user = get_user_by( 'email', $email ) ) {
 		return $user->ID;
 	}
 	return false;
@@ -1453,7 +1496,7 @@
 
 	// user_login must be between 0 and 60 characters.
 	if ( empty( $user_login ) ) {
-		return new WP_Error('empty_user_login', __('Cannot create a user with an empty login name.') );
+		return new WP_Error( 'empty_user_login', __( 'Cannot create a user with an empty login name.' ) );
 	} elseif ( mb_strlen( $user_login ) > 60 ) {
 		return new WP_Error( 'user_login_too_long', __( 'Username may not be longer than 60 characters.' ) );
 	}
@@ -1620,15 +1663,15 @@
 
 	$meta['locale'] = isset( $userdata['locale'] ) ? $userdata['locale'] : '';
 
-	$user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $user_nicename, $user_login));
+	$user_nicename_check = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $user_nicename, $user_login ) );
 
 	if ( $user_nicename_check ) {
 		$suffix = 2;
-		while ($user_nicename_check) {
+		while ( $user_nicename_check ) {
 			// user_nicename allows 50 chars. Subtract one for a hyphen, plus the length of the suffix.
 			$base_length = 49 - mb_strlen( $suffix );
 			$alt_user_nicename = mb_substr( $user_nicename, 0, $base_length ) . "-$suffix";
-			$user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $alt_user_nicename, $user_login));
+			$user_nicename_check = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $alt_user_nicename, $user_login ) );
 			$suffix++;
 		}
 		$user_nicename = $alt_user_nicename;
@@ -1651,16 +1694,16 @@
 	$user = new WP_User( $user_id );
 
 	/**
- 	 * Filters a user's meta values and keys before the user is created or updated.
- 	 *
- 	 * Does not include contact methods. These are added using `wp_get_user_contact_methods( $user )`.
- 	 *
- 	 * @since 4.4.0
- 	 *
- 	 * @param array $meta {
- 	 *     Default meta values and keys for the user.
- 	 *
- 	 *     @type string   $nickname             The user's nickname. Default is the user's username.
+	  * Filters a user's meta values and keys before the user is created or updated.
+	  *
+	  * Does not include contact methods. These are added using `wp_get_user_contact_methods( $user )`.
+	  *
+	  * @since 4.4.0
+	  *
+	  * @param array $meta {
+	  *     Default meta values and keys for the user.
+	  *
+	  *     @type string   $nickname             The user's nickname. Default is the user's username.
 	 *     @type string   $first_name           The user's first name.
 	 *     @type string   $last_name            The user's last name.
 	 *     @type string   $description          The user's description.
@@ -1671,10 +1714,10 @@
 	 *                                          not forced.
 	 *     @type bool     $show_admin_bar_front Whether to show the admin bar on the front end for the user.
 	 *                                          Default true.
- 	 * }
+	  * }
 	 * @param WP_User $user   User object.
 	 * @param bool    $update Whether the user is being updated rather than created.
- 	 */
+	  */
 	$meta = apply_filters( 'insert_user_meta', $meta, $user, $update );
 
 	// Update user meta.
@@ -1691,7 +1734,7 @@
 	if ( isset( $userdata['role'] ) ) {
 		$user->set_role( $userdata['role'] );
 	} elseif ( ! $update ) {
-		$user->set_role(get_option('default_role'));
+		$user->set_role( get_option( 'default_role' ) );
 	}
 	wp_cache_delete( $user_id, 'users' );
 	wp_cache_delete( $user_login, 'userlogins' );
@@ -1736,7 +1779,7 @@
  * @param mixed $userdata An array of user data or a user object of type stdClass or WP_User.
  * @return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated.
  */
-function wp_update_user($userdata) {
+function wp_update_user( $userdata ) {
 	if ( $userdata instanceof stdClass ) {
 		$userdata = get_object_vars( $userdata );
 	} elseif ( $userdata instanceof WP_User ) {
@@ -1870,7 +1913,7 @@
 			$pass_change_email['message'] = str_replace( '###SITEURL###', home_url(), $pass_change_email['message'] );
 
 			wp_mail( $pass_change_email['to'], sprintf( $pass_change_email['subject'], $blog_name ), $pass_change_email['message'], $pass_change_email['headers'] );
-		}
+		}// End if().
 
 		if ( ! empty( $send_email_change_email ) ) {
 			/* translators: Do not translate USERNAME, ADMIN_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */
@@ -1925,17 +1968,17 @@
 			$email_change_email['message'] = str_replace( '###SITEURL###', home_url(), $email_change_email['message'] );
 
 			wp_mail( $email_change_email['to'], sprintf( $email_change_email['subject'], $blog_name ), $email_change_email['message'], $email_change_email['headers'] );
-		}
+		}// End if().
 
 		if ( $switched_locale ) {
 			restore_previous_locale();
 		}
-	}
+	}// End if().
 
 	// Update the cookies if the password changed.
 	$current_user = wp_get_current_user();
 	if ( $current_user->ID == $ID ) {
-		if ( isset($plaintext_pass) ) {
+		if ( isset( $plaintext_pass ) ) {
 			wp_clear_auth_cookie();
 
 			// Here we calculate the expiration length of the current auth cookie and compare it to the default expiration.
@@ -1967,13 +2010,13 @@
  * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not
  *                      be created.
  */
-function wp_create_user($username, $password, $email = '') {
+function wp_create_user( $username, $password, $email = '' ) {
 	$user_login = wp_slash( $username );
-	$user_email = wp_slash( $email    );
+	$user_email = wp_slash( $email );
 	$user_pass = $password;
 
-	$userdata = compact('user_login', 'user_email', 'user_pass');
-	return wp_insert_user($userdata);
+	$userdata = compact( 'user_login', 'user_email', 'user_pass' );
+	return wp_insert_user( $userdata );
 }
 
 /**
@@ -2009,7 +2052,7 @@
 		$methods = array(
 			'aim'    => __( 'AIM' ),
 			'yim'    => __( 'Yahoo IM' ),
-			'jabber' => __( 'Jabber / Google Talk' )
+			'jabber' => __( 'Jabber / Google Talk' ),
 		);
 	}
 
@@ -2019,7 +2062,7 @@
 	 * @since 2.9.0
 	 *
 	 * @param array   $methods Array of contact methods and their labels.
- 	 * @param WP_User $user    WP_User object.
+	  * @param WP_User $user    WP_User object.
 	 */
 	return apply_filters( 'user_contactmethods', $methods, $user );
 }
@@ -2160,20 +2203,23 @@
  * @param string $login     The user login.
  * @return WP_User|WP_Error WP_User object on success, WP_Error object for invalid or expired keys.
  */
-function check_password_reset_key($key, $login) {
+function check_password_reset_key( $key, $login ) {
 	global $wpdb, $wp_hasher;
 
-	$key = preg_replace('/[^a-z0-9]/i', '', $key);
+	$key = preg_replace( '/[^a-z0-9]/i', '', $key );
 
-	if ( empty( $key ) || !is_string( $key ) )
-		return new WP_Error('invalid_key', __('Invalid key'));
+	if ( empty( $key ) || ! is_string( $key ) ) {
+		return new WP_Error( 'invalid_key', __( 'Invalid key' ) );
+	}
 
-	if ( empty($login) || !is_string($login) )
-		return new WP_Error('invalid_key', __('Invalid key'));
+	if ( empty( $login ) || ! is_string( $login ) ) {
+		return new WP_Error( 'invalid_key', __( 'Invalid key' ) );
+	}
 
 	$row = $wpdb->get_row( $wpdb->prepare( "SELECT ID, user_activation_key FROM $wpdb->users WHERE user_login = %s", $login ) );
-	if ( ! $row )
-		return new WP_Error('invalid_key', __('Invalid key'));
+	if ( ! $row ) {
+		return new WP_Error( 'invalid_key', __( 'Invalid key' ) );
+	}
 
 	if ( empty( $wp_hasher ) ) {
 		require_once ABSPATH . WPINC . '/class-phpass.php';
@@ -2344,8 +2390,9 @@
 	 */
 	$errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
 
-	if ( $errors->get_error_code() )
+	if ( $errors->get_error_code() ) {
 		return $errors;
+	}
 
 	$user_pass = wp_generate_password( 12, false );
 	$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
@@ -2515,7 +2562,7 @@
 		return $current_user;
 	}
 
-	if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) {
+	if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
 		wp_set_current_user( 0 );
 		return $current_user;
 	}
Index: src/wp-includes/vars.php
===================================================================
--- src/wp-includes/vars.php	(revision 40901)
+++ src/wp-includes/vars.php	(working copy)
@@ -22,40 +22,41 @@
 // On which page are we ?
 if ( is_admin() ) {
 	// wp-admin pages are checked more carefully
-	if ( is_network_admin() )
-		preg_match('#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches);
-	elseif ( is_user_admin() )
-		preg_match('#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches);
-	else
-		preg_match('#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches);
+	if ( is_network_admin() ) {
+		preg_match( '#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
+	} elseif ( is_user_admin() ) {
+		preg_match( '#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
+	} else { preg_match( '#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
+	}
 	$pagenow = $self_matches[1];
-	$pagenow = trim($pagenow, '/');
-	$pagenow = preg_replace('#\?.*?$#', '', $pagenow);
+	$pagenow = trim( $pagenow, '/' );
+	$pagenow = preg_replace( '#\?.*?$#', '', $pagenow );
 	if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) {
 		$pagenow = 'index.php';
 	} else {
-		preg_match('#(.*?)(/|$)#', $pagenow, $self_matches);
-		$pagenow = strtolower($self_matches[1]);
-		if ( '.php' !== substr($pagenow, -4, 4) )
+		preg_match( '#(.*?)(/|$)#', $pagenow, $self_matches );
+		$pagenow = strtolower( $self_matches[1] );
+		if ( '.php' !== substr( $pagenow, -4, 4 ) ) {
 			$pagenow .= '.php'; // for Options +Multiviews: /wp-admin/themes/index.php (themes.php is queried)
+		}
 	}
 } else {
-	if ( preg_match('#([^/]+\.php)([?/].*?)?$#i', $_SERVER['PHP_SELF'], $self_matches) )
-		$pagenow = strtolower($self_matches[1]);
-	else
-		$pagenow = 'index.php';
+	if ( preg_match( '#([^/]+\.php)([?/].*?)?$#i', $_SERVER['PHP_SELF'], $self_matches ) ) {
+		$pagenow = strtolower( $self_matches[1] );
+	} else { $pagenow = 'index.php';
+	}
 }
-unset($self_matches);
+unset( $self_matches );
 
 // Simple browser detection
 $is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = $is_edge = false;
 
-if ( isset($_SERVER['HTTP_USER_AGENT']) ) {
-	if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false ) {
+if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
+	if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Lynx' ) !== false ) {
 		$is_lynx = true;
 	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Edge' ) !== false ) {
 		$is_edge = true;
-	} elseif ( stripos($_SERVER['HTTP_USER_AGENT'], 'chrome') !== false ) {
+	} elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chrome' ) !== false ) {
 		if ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chromeframe' ) !== false ) {
 			$is_admin = is_admin();
 			/**
@@ -65,29 +66,31 @@
 			 *
 			 * @param bool $is_admin Whether to use the Google Chrome Frame. Default is the value of is_admin().
 			 */
-			if ( $is_chrome = apply_filters( 'use_google_chrome_frame', $is_admin ) )
+			if ( $is_chrome = apply_filters( 'use_google_chrome_frame', $is_admin ) ) {
 				header( 'X-UA-Compatible: chrome=1' );
+			}
 			$is_winIE = ! $is_chrome;
 		} else {
 			$is_chrome = true;
 		}
-	} elseif ( stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false ) {
+	} elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'safari' ) !== false ) {
 		$is_safari = true;
-	} elseif ( ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false ) && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false ) {
+	} elseif ( ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) !== false ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'Win' ) !== false ) {
 		$is_winIE = true;
-	} elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false ) {
+	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mac' ) !== false ) {
 		$is_macIE = true;
-	} elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false ) {
+	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Gecko' ) !== false ) {
 		$is_gecko = true;
-	} elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false ) {
+	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera' ) !== false ) {
 		$is_opera = true;
-	} elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false ) {
+	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Nav' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.' ) !== false ) {
 		$is_NS4 = true;
 	}
-}
+}// End if().
 
-if ( $is_safari && stripos($_SERVER['HTTP_USER_AGENT'], 'mobile') !== false )
+if ( $is_safari && stripos( $_SERVER['HTTP_USER_AGENT'], 'mobile' ) !== false ) {
 	$is_iphone = true;
+}
 
 $is_IE = ( $is_macIE || $is_winIE );
 
@@ -97,19 +100,19 @@
  * Whether the server software is Apache or something else
  * @global bool $is_apache
  */
-$is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false);
+$is_apache = (strpos( $_SERVER['SERVER_SOFTWARE'], 'Apache' ) !== false || strpos( $_SERVER['SERVER_SOFTWARE'], 'LiteSpeed' ) !== false);
 
 /**
  * Whether the server software is Nginx or something else
  * @global bool $is_nginx
  */
-$is_nginx = (strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false);
+$is_nginx = (strpos( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false);
 
 /**
  * Whether the server software is IIS or something else
  * @global bool $is_IIS
  */
-$is_IIS = !$is_apache && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false);
+$is_IIS = ! $is_apache && (strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) !== false || strpos( $_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer' ) !== false);
 
 /**
  * Whether the server software is IIS 7.X or greater
@@ -121,19 +124,19 @@
  * Test if the current browser runs on a mobile device (smart phone, tablet, etc.)
  *
  * @since 3.4.0
- * 
+ *
  * @return bool
  */
 function wp_is_mobile() {
-	if ( empty($_SERVER['HTTP_USER_AGENT']) ) {
+	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
 		$is_mobile = false;
-	} elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false // many mobile devices (all iPhone, iPad, etc.)
-		|| strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false
-		|| strpos($_SERVER['HTTP_USER_AGENT'], 'Silk/') !== false
-		|| strpos($_SERVER['HTTP_USER_AGENT'], 'Kindle') !== false
-		|| strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== false
-		|| strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false
-		|| strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mobi') !== false ) {
+	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Mobile' ) !== false // many mobile devices (all iPhone, iPad, etc.)
+		|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Android' ) !== false
+		|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Silk/' ) !== false
+		|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Kindle' ) !== false
+		|| strpos( $_SERVER['HTTP_USER_AGENT'], 'BlackBerry' ) !== false
+		|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mini' ) !== false
+		|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mobi' ) !== false ) {
 			$is_mobile = true;
 	} else {
 		$is_mobile = false;
Index: src/wp-includes/widgets/class-wp-nav-menu-widget.php
===================================================================
--- src/wp-includes/widgets/class-wp-nav-menu-widget.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-nav-menu-widget.php	(working copy)
@@ -27,7 +27,7 @@
 			'description' => __( 'Add a custom menu to your sidebar.' ),
 			'customize_selective_refresh' => true,
 		);
-		parent::__construct( 'nav_menu', __('Custom Menu'), $widget_ops );
+		parent::__construct( 'nav_menu', __( 'Custom Menu' ), $widget_ops );
 	}
 
 	/**
@@ -44,20 +44,22 @@
 		// Get menu
 		$nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false;
 
-		if ( !$nav_menu )
+		if ( ! $nav_menu ) {
 			return;
+		}
 
 		/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
 		$instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
 
 		echo $args['before_widget'];
 
-		if ( !empty($instance['title']) )
+		if ( ! empty( $instance['title'] ) ) {
 			echo $args['before_title'] . $instance['title'] . $args['after_title'];
+		}
 
 		$nav_menu_args = array(
 			'fallback_cb' => '',
-			'menu'        => $nav_menu
+			'menu'        => $nav_menu,
 		);
 
 		/**
Index: src/wp-includes/widgets/class-wp-widget-archives.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-archives.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-archives.php	(working copy)
@@ -28,7 +28,7 @@
 			'description' => __( 'A monthly archive of your site&#8217;s Posts.' ),
 			'customize_selective_refresh' => true,
 		);
-		parent::__construct('archives', __('Archives'), $widget_ops);
+		parent::__construct( 'archives', __( 'Archives' ), $widget_ops );
 	}
 
 	/**
@@ -71,7 +71,7 @@
 			$dropdown_args = apply_filters( 'widget_archives_dropdown_args', array(
 				'type'            => 'monthly',
 				'format'          => 'option',
-				'show_post_count' => $c
+				'show_post_count' => $c,
 			) );
 
 			switch ( $dropdown_args['type'] ) {
@@ -111,12 +111,12 @@
 		 */
 		wp_get_archives( apply_filters( 'widget_archives_args', array(
 			'type'            => 'monthly',
-			'show_post_count' => $c
+			'show_post_count' => $c,
 		) ) );
 		?>
 		</ul>
 		<?php
-		}
+}// End if().
 
 		echo $args['after_widget'];
 	}
@@ -134,7 +134,7 @@
 	 */
 	public function update( $new_instance, $old_instance ) {
 		$instance = $old_instance;
-		$new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') );
+		$new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '', 'count' => 0, 'dropdown' => '' ) );
 		$instance['title'] = sanitize_text_field( $new_instance['title'] );
 		$instance['count'] = $new_instance['count'] ? 1 : 0;
 		$instance['dropdown'] = $new_instance['dropdown'] ? 1 : 0;
@@ -151,14 +151,14 @@
 	 * @param array $instance Current settings.
 	 */
 	public function form( $instance ) {
-		$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') );
+		$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'count' => 0, 'dropdown' => '' ) );
 		$title = sanitize_text_field( $instance['title'] );
 		?>
-		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
+		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
 		<p>
-			<input class="checkbox" type="checkbox"<?php checked( $instance['dropdown'] ); ?> id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>" /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as dropdown'); ?></label>
+			<input class="checkbox" type="checkbox"<?php checked( $instance['dropdown'] ); ?> id="<?php echo $this->get_field_id( 'dropdown' ); ?>" name="<?php echo $this->get_field_name( 'dropdown' ); ?>" /> <label for="<?php echo $this->get_field_id( 'dropdown' ); ?>"><?php _e( 'Display as dropdown' ); ?></label>
 			<br/>
-			<input class="checkbox" type="checkbox"<?php checked( $instance['count'] ); ?> id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" /> <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Show post counts'); ?></label>
+			<input class="checkbox" type="checkbox"<?php checked( $instance['count'] ); ?> id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" /> <label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Show post counts' ); ?></label>
 		</p>
 		<?php
 	}
Index: src/wp-includes/widgets/class-wp-widget-calendar.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-calendar.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-calendar.php	(working copy)
@@ -101,8 +101,8 @@
 		$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
 		$title = sanitize_text_field( $instance['title'] );
 		?>
-		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
-		<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
+		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
+		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
 		<?php
 	}
 }
Index: src/wp-includes/widgets/class-wp-widget-categories.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-categories.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-categories.php	(working copy)
@@ -59,7 +59,7 @@
 		$cat_args = array(
 			'orderby'      => 'name',
 			'show_count'   => $c,
-			'hierarchical' => $h
+			'hierarchical' => $h,
 		);
 
 		if ( $d ) {
@@ -115,7 +115,7 @@
 ?>
 		</ul>
 <?php
-		}
+		}// End if().
 
 		echo $args['after_widget'];
 	}
@@ -134,9 +134,9 @@
 	public function update( $new_instance, $old_instance ) {
 		$instance = $old_instance;
 		$instance['title'] = sanitize_text_field( $new_instance['title'] );
-		$instance['count'] = !empty($new_instance['count']) ? 1 : 0;
-		$instance['hierarchical'] = !empty($new_instance['hierarchical']) ? 1 : 0;
-		$instance['dropdown'] = !empty($new_instance['dropdown']) ? 1 : 0;
+		$instance['count'] = ! empty( $new_instance['count'] ) ? 1 : 0;
+		$instance['hierarchical'] = ! empty( $new_instance['hierarchical'] ) ? 1 : 0;
+		$instance['dropdown'] = ! empty( $new_instance['dropdown'] ) ? 1 : 0;
 
 		return $instance;
 	}
@@ -151,23 +151,23 @@
 	 */
 	public function form( $instance ) {
 		//Defaults
-		$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
+		$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
 		$title = sanitize_text_field( $instance['title'] );
-		$count = isset($instance['count']) ? (bool) $instance['count'] :false;
+		$count = isset( $instance['count'] ) ? (bool) $instance['count'] :false;
 		$hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false;
 		$dropdown = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false;
 		?>
-		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?></label>
-		<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
+		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
+		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
 
-		<p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> />
-		<label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Display as dropdown' ); ?></label><br />
+		<p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'dropdown' ); ?>" name="<?php echo $this->get_field_name( 'dropdown' ); ?>"<?php checked( $dropdown ); ?> />
+		<label for="<?php echo $this->get_field_id( 'dropdown' ); ?>"><?php _e( 'Display as dropdown' ); ?></label><br />
 
-		<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>"<?php checked( $count ); ?> />
-		<label for="<?php echo $this->get_field_id('count'); ?>"><?php _e( 'Show post counts' ); ?></label><br />
+		<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>"<?php checked( $count ); ?> />
+		<label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Show post counts' ); ?></label><br />
 
-		<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hierarchical'); ?>" name="<?php echo $this->get_field_name('hierarchical'); ?>"<?php checked( $hierarchical ); ?> />
-		<label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show hierarchy' ); ?></label></p>
+		<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'hierarchical' ); ?>" name="<?php echo $this->get_field_name( 'hierarchical' ); ?>"<?php checked( $hierarchical ); ?> />
+		<label for="<?php echo $this->get_field_id( 'hierarchical' ); ?>"><?php _e( 'Show hierarchy' ); ?></label></p>
 		<?php
 	}
 
Index: src/wp-includes/widgets/class-wp-widget-links.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-links.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-links.php	(working copy)
@@ -41,11 +41,11 @@
 	 * @param array $instance Settings for the current Links widget instance.
 	 */
 	public function widget( $args, $instance ) {
-		$show_description = isset($instance['description']) ? $instance['description'] : false;
-		$show_name = isset($instance['name']) ? $instance['name'] : false;
-		$show_rating = isset($instance['rating']) ? $instance['rating'] : false;
-		$show_images = isset($instance['images']) ? $instance['images'] : true;
-		$category = isset($instance['category']) ? $instance['category'] : false;
+		$show_description = isset( $instance['description'] ) ? $instance['description'] : false;
+		$show_name = isset( $instance['name'] ) ? $instance['name'] : false;
+		$show_rating = isset( $instance['rating'] ) ? $instance['rating'] : false;
+		$show_images = isset( $instance['images'] ) ? $instance['images'] : true;
+		$category = isset( $instance['category'] ) ? $instance['category'] : false;
 		$orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : 'name';
 		$order = $orderby == 'rating' ? 'DESC' : 'ASC';
 		$limit = isset( $instance['limit'] ) ? $instance['limit'] : -1;
@@ -95,15 +95,22 @@
 	 */
 	public function update( $new_instance, $old_instance ) {
 		$new_instance = (array) $new_instance;
-		$instance = array( 'images' => 0, 'name' => 0, 'description' => 0, 'rating' => 0 );
+		$instance = array(
+			'images' => 0,
+			'name' => 0,
+			'description' => 0,
+			'rating' => 0,
+		);
 		foreach ( $instance as $field => $val ) {
-			if ( isset($new_instance[$field]) )
-				$instance[$field] = 1;
+			if ( isset( $new_instance[ $field ] ) ) {
+				$instance[ $field ] = 1;
+			}
 		}
 
 		$instance['orderby'] = 'name';
-		if ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ) ) )
+		if ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ) ) ) {
 			$instance['orderby'] = $new_instance['orderby'];
+		}
 
 		$instance['category'] = intval( $new_instance['category'] );
 		$instance['limit'] = ! empty( $new_instance['limit'] ) ? intval( $new_instance['limit'] ) : -1;
@@ -122,15 +129,24 @@
 	public function form( $instance ) {
 
 		//Defaults
-		$instance = wp_parse_args( (array) $instance, array( 'images' => true, 'name' => true, 'description' => false, 'rating' => false, 'category' => false, 'orderby' => 'name', 'limit' => -1 ) );
+		$instance = wp_parse_args( (array) $instance, array(
+			'images' => true,
+			'name' => true,
+			'description' => false,
+			'rating' => false,
+			'category' => false,
+			'orderby' => 'name',
+			'limit' => -1,
+		) );
 		$link_cats = get_terms( 'link_category' );
-		if ( ! $limit = intval( $instance['limit'] ) )
+		if ( ! $limit = intval( $instance['limit'] ) ) {
 			$limit = -1;
+		}
 			?>
 		<p>
-		<label for="<?php echo $this->get_field_id('category'); ?>"><?php _e( 'Select Link Category:' ); ?></label>
-		<select class="widefat" id="<?php echo $this->get_field_id('category'); ?>" name="<?php echo $this->get_field_name('category'); ?>">
-		<option value=""><?php _ex('All Links', 'links widget'); ?></option>
+		<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Select Link Category:' ); ?></label>
+		<select class="widefat" id="<?php echo $this->get_field_id( 'category' ); ?>" name="<?php echo $this->get_field_name( 'category' ); ?>">
+		<option value=""><?php _ex( 'All Links', 'links widget' ); ?></option>
 		<?php
 		foreach ( $link_cats as $link_cat ) {
 			echo '<option value="' . intval( $link_cat->term_id ) . '"'
@@ -139,8 +155,8 @@
 		}
 		?>
 		</select>
-		<label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e( 'Sort by:' ); ?></label>
-		<select name="<?php echo $this->get_field_name('orderby'); ?>" id="<?php echo $this->get_field_id('orderby'); ?>" class="widefat">
+		<label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Sort by:' ); ?></label>
+		<select name="<?php echo $this->get_field_name( 'orderby' ); ?>" id="<?php echo $this->get_field_id( 'orderby' ); ?>" class="widefat">
 			<option value="name"<?php selected( $instance['orderby'], 'name' ); ?>><?php _e( 'Link title' ); ?></option>
 			<option value="rating"<?php selected( $instance['orderby'], 'rating' ); ?>><?php _e( 'Link rating' ); ?></option>
 			<option value="id"<?php selected( $instance['orderby'], 'id' ); ?>><?php _e( 'Link ID' ); ?></option>
@@ -148,18 +164,18 @@
 		</select>
 		</p>
 		<p>
-		<input class="checkbox" type="checkbox"<?php checked($instance['images'], true) ?> id="<?php echo $this->get_field_id('images'); ?>" name="<?php echo $this->get_field_name('images'); ?>" />
-		<label for="<?php echo $this->get_field_id('images'); ?>"><?php _e('Show Link Image'); ?></label><br />
-		<input class="checkbox" type="checkbox"<?php checked($instance['name'], true) ?> id="<?php echo $this->get_field_id('name'); ?>" name="<?php echo $this->get_field_name('name'); ?>" />
-		<label for="<?php echo $this->get_field_id('name'); ?>"><?php _e('Show Link Name'); ?></label><br />
-		<input class="checkbox" type="checkbox"<?php checked($instance['description'], true) ?> id="<?php echo $this->get_field_id('description'); ?>" name="<?php echo $this->get_field_name('description'); ?>" />
-		<label for="<?php echo $this->get_field_id('description'); ?>"><?php _e('Show Link Description'); ?></label><br />
-		<input class="checkbox" type="checkbox"<?php checked($instance['rating'], true) ?> id="<?php echo $this->get_field_id('rating'); ?>" name="<?php echo $this->get_field_name('rating'); ?>" />
-		<label for="<?php echo $this->get_field_id('rating'); ?>"><?php _e('Show Link Rating'); ?></label>
+		<input class="checkbox" type="checkbox"<?php checked( $instance['images'], true ) ?> id="<?php echo $this->get_field_id( 'images' ); ?>" name="<?php echo $this->get_field_name( 'images' ); ?>" />
+		<label for="<?php echo $this->get_field_id( 'images' ); ?>"><?php _e( 'Show Link Image' ); ?></label><br />
+		<input class="checkbox" type="checkbox"<?php checked( $instance['name'], true ) ?> id="<?php echo $this->get_field_id( 'name' ); ?>" name="<?php echo $this->get_field_name( 'name' ); ?>" />
+		<label for="<?php echo $this->get_field_id( 'name' ); ?>"><?php _e( 'Show Link Name' ); ?></label><br />
+		<input class="checkbox" type="checkbox"<?php checked( $instance['description'], true ) ?> id="<?php echo $this->get_field_id( 'description' ); ?>" name="<?php echo $this->get_field_name( 'description' ); ?>" />
+		<label for="<?php echo $this->get_field_id( 'description' ); ?>"><?php _e( 'Show Link Description' ); ?></label><br />
+		<input class="checkbox" type="checkbox"<?php checked( $instance['rating'], true ) ?> id="<?php echo $this->get_field_id( 'rating' ); ?>" name="<?php echo $this->get_field_name( 'rating' ); ?>" />
+		<label for="<?php echo $this->get_field_id( 'rating' ); ?>"><?php _e( 'Show Link Rating' ); ?></label>
 		</p>
 		<p>
-		<label for="<?php echo $this->get_field_id('limit'); ?>"><?php _e( 'Number of links to show:' ); ?></label>
-		<input id="<?php echo $this->get_field_id('limit'); ?>" name="<?php echo $this->get_field_name('limit'); ?>" type="text" value="<?php echo $limit == -1 ? '' : intval( $limit ); ?>" size="3" />
+		<label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of links to show:' ); ?></label>
+		<input id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo $limit == -1 ? '' : intval( $limit ); ?>" size="3" />
 		</p>
 		<?php
 	}
Index: src/wp-includes/widgets/class-wp-widget-meta.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-meta.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-meta.php	(working copy)
@@ -45,7 +45,7 @@
 	 */
 	public function widget( $args, $instance ) {
 		/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
-		$title = apply_filters( 'widget_title', empty($instance['title']) ? __( 'Meta' ) : $instance['title'], $instance, $this->id_base );
+		$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Meta' ) : $instance['title'], $instance, $this->id_base );
 
 		echo $args['before_widget'];
 		if ( $title ) {
@@ -55,8 +55,8 @@
 			<ul>
 			<?php wp_register(); ?>
 			<li><?php wp_loginout(); ?></li>
-			<li><a href="<?php echo esc_url( get_bloginfo( 'rss2_url' ) ); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
-			<li><a href="<?php echo esc_url( get_bloginfo( 'comments_rss2_url' ) ); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
+			<li><a href="<?php echo esc_url( get_bloginfo( 'rss2_url' ) ); ?>"><?php _e( 'Entries <abbr title="Really Simple Syndication">RSS</abbr>' ); ?></a></li>
+			<li><a href="<?php echo esc_url( get_bloginfo( 'comments_rss2_url' ) ); ?>"><?php _e( 'Comments <abbr title="Really Simple Syndication">RSS</abbr>' ); ?></a></li>
 			<?php
 			/**
 			 * Filters the "Powered by WordPress" text in the Meta widget.
@@ -75,7 +75,7 @@
 			?>
 			</ul>
 			<?php
-		echo $args['after_widget'];
+			echo $args['after_widget'];
 	}
 
 	/**
@@ -108,7 +108,7 @@
 		$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
 		$title = sanitize_text_field( $instance['title'] );
 ?>
-			<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
+			<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
 <?php
 	}
 }
Index: src/wp-includes/widgets/class-wp-widget-pages.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-pages.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-pages.php	(working copy)
@@ -57,8 +57,9 @@
 		$sortby = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby'];
 		$exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude'];
 
-		if ( $sortby == 'menu_order' )
+		if ( $sortby == 'menu_order' ) {
 			$sortby = 'menu_order, post_title';
+		}
 
 		/**
 		 * Filters the arguments for the Pages widget.
@@ -73,7 +74,7 @@
 			'title_li'    => '',
 			'echo'        => 0,
 			'sort_column' => $sortby,
-			'exclude'     => $exclude
+			'exclude'     => $exclude,
 		) ) );
 
 		if ( ! empty( $out ) ) {
@@ -125,17 +126,21 @@
 	 */
 	public function form( $instance ) {
 		//Defaults
-		$instance = wp_parse_args( (array) $instance, array( 'sortby' => 'post_title', 'title' => '', 'exclude' => '') );
+		$instance = wp_parse_args( (array) $instance, array(
+			'sortby' => 'post_title',
+			'title' => '',
+			'exclude' => '',
+		) );
 		?>
 		<p>
 			<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:' ); ?></label>
-			<input class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
+			<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
 		</p>
 		<p>
 			<label for="<?php echo esc_attr( $this->get_field_id( 'sortby' ) ); ?>"><?php _e( 'Sort by:' ); ?></label>
 			<select name="<?php echo esc_attr( $this->get_field_name( 'sortby' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'sortby' ) ); ?>" class="widefat">
-				<option value="post_title"<?php selected( $instance['sortby'], 'post_title' ); ?>><?php _e('Page title'); ?></option>
-				<option value="menu_order"<?php selected( $instance['sortby'], 'menu_order' ); ?>><?php _e('Page order'); ?></option>
+				<option value="post_title"<?php selected( $instance['sortby'], 'post_title' ); ?>><?php _e( 'Page title' ); ?></option>
+				<option value="menu_order"<?php selected( $instance['sortby'], 'menu_order' ); ?>><?php _e( 'Page order' ); ?></option>
 				<option value="ID"<?php selected( $instance['sortby'], 'ID' ); ?>><?php _e( 'Page ID' ); ?></option>
 			</select>
 		</p>
Index: src/wp-includes/widgets/class-wp-widget-recent-comments.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-recent-comments.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-recent-comments.php	(working copy)
@@ -36,7 +36,7 @@
 		}
 	}
 
- 	/**
+	 /**
 	 * Outputs the default styles for the Recent Comments widget.
 	 *
 	 * @since 2.8.0
@@ -52,8 +52,9 @@
 		 * @param string $id_base The widget ID.
 		 */
 		if ( ! current_theme_supports( 'widgets' ) // Temp hack #14876
-			|| ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) )
+			|| ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) {
 			return;
+		}
 		?>
 		<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
 		<?php
@@ -70,8 +71,9 @@
 	 * @param array $instance Settings for the current Recent Comments widget instance.
 	 */
 	public function widget( $args, $instance ) {
-		if ( ! isset( $args['widget_id'] ) )
+		if ( ! isset( $args['widget_id'] ) ) {
 			$args['widget_id'] = $this->id;
+		}
 
 		$output = '';
 
@@ -81,8 +83,9 @@
 		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
 
 		$number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
-		if ( ! $number )
+		if ( ! $number ) {
 			$number = 5;
+		}
 
 		/**
 		 * Filters the arguments for the Recent Comments widget.
@@ -96,7 +99,7 @@
 		$comments = get_comments( apply_filters( 'widget_comments_args', array(
 			'number'      => $number,
 			'status'      => 'approve',
-			'post_status' => 'publish'
+			'post_status' => 'publish',
 		) ) );
 
 		$output .= $args['before_widget'];
Index: src/wp-includes/widgets/class-wp-widget-recent-posts.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-recent-posts.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-recent-posts.php	(working copy)
@@ -53,8 +53,9 @@
 		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
 
 		$number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
-		if ( ! $number )
+		if ( ! $number ) {
 			$number = 5;
+		}
 		$show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;
 
 		/**
@@ -70,15 +71,15 @@
 			'posts_per_page'      => $number,
 			'no_found_rows'       => true,
 			'post_status'         => 'publish',
-			'ignore_sticky_posts' => true
+			'ignore_sticky_posts' => true,
 		) ) );
 
-		if ($r->have_posts()) :
+		if ( $r->have_posts() ) :
 		?>
 		<?php echo $args['before_widget']; ?>
 		<?php if ( $title ) {
 			echo $args['before_title'] . $title . $args['after_title'];
-		} ?>
+} ?>
 		<ul>
 		<?php while ( $r->have_posts() ) : $r->the_post(); ?>
 			<li>
Index: src/wp-includes/widgets/class-wp-widget-rss.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-rss.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-rss.php	(working copy)
@@ -27,7 +27,10 @@
 			'description' => __( 'Entries from any RSS or Atom feed.' ),
 			'customize_selective_refresh' => true,
 		);
-		$control_ops = array( 'width' => 400, 'height' => 200 );
+		$control_ops = array(
+			'width' => 400,
+			'height' => 200,
+		);
 		parent::__construct( 'rss', __( 'RSS' ), $widget_ops, $control_ops );
 	}
 
@@ -42,44 +45,50 @@
 	 * @param array $instance Settings for the current RSS widget instance.
 	 */
 	public function widget( $args, $instance ) {
-		if ( isset($instance['error']) && $instance['error'] )
+		if ( isset( $instance['error'] ) && $instance['error'] ) {
 			return;
+		}
 
 		$url = ! empty( $instance['url'] ) ? $instance['url'] : '';
-		while ( stristr($url, 'http') != $url )
-			$url = substr($url, 1);
+		while ( stristr( $url, 'http' ) != $url ) {			$url = substr( $url, 1 );
+		}
 
-		if ( empty($url) )
+		if ( empty( $url ) ) {
 			return;
+		}
 
 		// self-url destruction sequence
-		if ( in_array( untrailingslashit( $url ), array( site_url(), home_url() ) ) )
+		if ( in_array( untrailingslashit( $url ), array( site_url(), home_url() ) ) ) {
 			return;
+		}
 
-		$rss = fetch_feed($url);
+		$rss = fetch_feed( $url );
 		$title = $instance['title'];
 		$desc = '';
 		$link = '';
 
-		if ( ! is_wp_error($rss) ) {
-			$desc = esc_attr(strip_tags(@html_entity_decode($rss->get_description(), ENT_QUOTES, get_option('blog_charset'))));
-			if ( empty($title) )
+		if ( ! is_wp_error( $rss ) ) {
+			$desc = esc_attr( strip_tags( @html_entity_decode( $rss->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) ) ) );
+			if ( empty( $title ) ) {
 				$title = strip_tags( $rss->get_title() );
+			}
 			$link = strip_tags( $rss->get_permalink() );
-			while ( stristr($link, 'http') != $link )
-				$link = substr($link, 1);
+			while ( stristr( $link, 'http' ) != $link ) {				$link = substr( $link, 1 );
+			}
 		}
 
-		if ( empty($title) )
-			$title = empty($desc) ? __('Unknown Feed') : $desc;
+		if ( empty( $title ) ) {
+			$title = empty( $desc ) ? __( 'Unknown Feed' ) : $desc;
+		}
 
 		/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
 		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
 
 		$url = strip_tags( $url );
 		$icon = includes_url( 'images/rss.png' );
-		if ( $title )
-			$title = '<a class="rsswidget" href="' . esc_url( $url ) . '"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="' . esc_url( $icon ) . '" alt="RSS" /></a> <a class="rsswidget" href="' . esc_url( $link ) . '">'. esc_html( $title ) . '</a>';
+		if ( $title ) {
+			$title = '<a class="rsswidget" href="' . esc_url( $url ) . '"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="' . esc_url( $icon ) . '" alt="RSS" /></a> <a class="rsswidget" href="' . esc_url( $link ) . '">' . esc_html( $title ) . '</a>';
+		}
 
 		echo $args['before_widget'];
 		if ( $title ) {
@@ -88,9 +97,10 @@
 		wp_widget_rss_output( $rss, $instance );
 		echo $args['after_widget'];
 
-		if ( ! is_wp_error($rss) )
+		if ( ! is_wp_error( $rss ) ) {
 			$rss->__destruct();
-		unset($rss);
+		}
+		unset( $rss );
 	}
 
 	/**
@@ -105,7 +115,7 @@
 	 * @return array Updated settings to save.
 	 */
 	public function update( $new_instance, $old_instance ) {
-		$testurl = ( isset( $new_instance['url'] ) && ( !isset( $old_instance['url'] ) || ( $new_instance['url'] != $old_instance['url'] ) ) );
+		$testurl = ( isset( $new_instance['url'] ) && ( ! isset( $old_instance['url'] ) || ( $new_instance['url'] != $old_instance['url'] ) ) );
 		return wp_widget_rss_process( $new_instance, $testurl );
 	}
 
Index: src/wp-includes/widgets/class-wp-widget-search.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-search.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-search.php	(working copy)
@@ -65,10 +65,12 @@
 	 * @param array $instance Current settings.
 	 */
 	public function form( $instance ) {
-		$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
+		$instance = wp_parse_args( (array) $instance, array(
+			'title' => '',
+		) );
 		$title = $instance['title'];
 		?>
-		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
+		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></label></p>
 		<?php
 	}
 
@@ -85,7 +87,9 @@
 	 */
 	public function update( $new_instance, $old_instance ) {
 		$instance = $old_instance;
-		$new_instance = wp_parse_args((array) $new_instance, array( 'title' => ''));
+		$new_instance = wp_parse_args( (array) $new_instance, array(
+			'title' => '',
+		) );
 		$instance['title'] = sanitize_text_field( $new_instance['title'] );
 		return $instance;
 	}
Index: src/wp-includes/widgets/class-wp-widget-tag-cloud.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-tag-cloud.php	(revision 40901)
+++ src/wp-includes/widgets/class-wp-widget-tag-cloud.php	(working copy)
@@ -41,14 +41,14 @@
 	 * @param array $instance Settings for the current Tag Cloud widget instance.
 	 */
 	public function widget( $args, $instance ) {
-		$current_taxonomy = $this->_get_current_taxonomy($instance);
-		if ( !empty($instance['title']) ) {
+		$current_taxonomy = $this->_get_current_taxonomy( $instance );
+		if ( ! empty( $instance['title'] ) ) {
 			$title = $instance['title'];
 		} else {
 			if ( 'post_tag' == $current_taxonomy ) {
-				$title = __('Tags');
+				$title = __( 'Tags' );
 			} else {
-				$tax = get_taxonomy($current_taxonomy);
+				$tax = get_taxonomy( $current_taxonomy );
 				$title = $tax->labels->name;
 			}
 		}
@@ -106,7 +106,7 @@
 		$instance = array();
 		$instance['title'] = sanitize_text_field( $new_instance['title'] );
 		$instance['count'] = ! empty( $new_instance['count'] ) ? 1 : 0;
-		$instance['taxonomy'] = stripslashes($new_instance['taxonomy']);
+		$instance['taxonomy'] = stripslashes( $new_instance['taxonomy'] );
 		return $instance;
 	}
 
@@ -119,16 +119,18 @@
 	 * @param array $instance Current settings.
 	 */
 	public function form( $instance ) {
-		$current_taxonomy = $this->_get_current_taxonomy($instance);
+		$current_taxonomy = $this->_get_current_taxonomy( $instance );
 		$title_id = $this->get_field_id( 'title' );
 		$count = isset( $instance['count'] ) ? (bool) $instance['count'] : false;
 		$instance['title'] = ! empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
 
-		echo '<p><label for="' . $title_id .'">' . __( 'Title:' ) . '</label>
-			<input type="text" class="widefat" id="' . $title_id .'" name="' . $this->get_field_name( 'title' ) .'" value="' . $instance['title'] .'" />
+		echo '<p><label for="' . $title_id . '">' . __( 'Title:' ) . '</label>
+			<input type="text" class="widefat" id="' . $title_id . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $instance['title'] . '" />
 		</p>';
 
-		$taxonomies = get_taxonomies( array( 'show_tagcloud' => true ), 'object' );
+		$taxonomies = get_taxonomies( array(
+			'show_tagcloud' => true,
+		), 'object' );
 		$id = $this->get_field_id( 'taxonomy' );
 		$name = $this->get_field_name( 'taxonomy' );
 		$input = '<input type="hidden" id="' . $id . '" name="' . $name . '" value="%s" />';
@@ -143,41 +145,41 @@
 
 		switch ( count( $taxonomies ) ) {
 
-		// No tag cloud supporting taxonomies found, display error message
-		case 0:
-			echo '<p>' . __( 'The tag cloud will not be displayed since there are no taxonomies that support the tag cloud widget.' ) . '</p>';
-			printf( $input, '' );
+			// No tag cloud supporting taxonomies found, display error message
+			case 0:
+				echo '<p>' . __( 'The tag cloud will not be displayed since there are no taxonomies that support the tag cloud widget.' ) . '</p>';
+				printf( $input, '' );
 			break;
 
-		// Just a single tag cloud supporting taxonomy found, no need to display a select.
-		case 1:
-			$keys = array_keys( $taxonomies );
-			$taxonomy = reset( $keys );
-			printf( $input, esc_attr( $taxonomy ) );
-			echo $count_checkbox;
+			// Just a single tag cloud supporting taxonomy found, no need to display a select.
+			case 1:
+				$keys = array_keys( $taxonomies );
+				$taxonomy = reset( $keys );
+				printf( $input, esc_attr( $taxonomy ) );
+				echo $count_checkbox;
 			break;
 
-		// More than one tag cloud supporting taxonomy found, display a select.
-		default:
-			printf(
-				'<p><label for="%1$s">%2$s</label>' .
-				'<select class="widefat" id="%1$s" name="%3$s">',
-				$id,
-				__( 'Taxonomy:' ),
-				$name
-			);
-
-			foreach ( $taxonomies as $taxonomy => $tax ) {
+			// More than one tag cloud supporting taxonomy found, display a select.
+			default:
 				printf(
-					'<option value="%s"%s>%s</option>',
-					esc_attr( $taxonomy ),
-					selected( $taxonomy, $current_taxonomy, false ),
-					$tax->labels->name
+					'<p><label for="%1$s">%2$s</label>' .
+					'<select class="widefat" id="%1$s" name="%3$s">',
+					$id,
+					__( 'Taxonomy:' ),
+					$name
 				);
-			}
 
-			echo '</select></p>' . $count_checkbox;
-		}
+				foreach ( $taxonomies as $taxonomy => $tax ) {
+						printf(
+							'<option value="%s"%s>%s</option>',
+							esc_attr( $taxonomy ),
+							selected( $taxonomy, $current_taxonomy, false ),
+							$tax->labels->name
+						);
+				}
+
+					echo '</select></p>' . $count_checkbox;
+		}// End switch().
 	}
 
 	/**
@@ -189,9 +191,10 @@
 	 * @param array $instance Current settings.
 	 * @return string Name of the current taxonomy if set, otherwise 'post_tag'.
 	 */
-	public function _get_current_taxonomy($instance) {
-		if ( !empty($instance['taxonomy']) && taxonomy_exists($instance['taxonomy']) )
+	public function _get_current_taxonomy( $instance ) {
+		if ( ! empty( $instance['taxonomy'] ) && taxonomy_exists( $instance['taxonomy'] ) ) {
 			return $instance['taxonomy'];
+		}
 
 		return 'post_tag';
 	}
Index: src/wp-includes/widgets.php
===================================================================
--- src/wp-includes/widgets.php	(revision 40901)
+++ src/wp-includes/widgets.php	(working copy)
@@ -87,7 +87,7 @@
 	'wp_widget_rss',
 	'wp_widget_rss_control',
 	'wp_widget_recent_comments',
-	'wp_widget_recent_comments_control'
+	'wp_widget_recent_comments_control',
 );
 
 //
@@ -107,10 +107,10 @@
  *
  * @param string $widget_class The name of a class that extends WP_Widget
  */
-function register_widget($widget_class) {
+function register_widget( $widget_class ) {
 	global $wp_widget_factory;
 
-	$wp_widget_factory->register($widget_class);
+	$wp_widget_factory->register( $widget_class );
 }
 
 /**
@@ -127,10 +127,10 @@
  *
  * @param string $widget_class The name of a class that extends WP_Widget.
  */
-function unregister_widget($widget_class) {
+function unregister_widget( $widget_class ) {
 	global $wp_widget_factory;
 
-	$wp_widget_factory->unregister($widget_class);
+	$wp_widget_factory->unregister( $widget_class );
 }
 
 /**
@@ -163,20 +163,21 @@
 	global $wp_registered_sidebars;
 	$number = (int) $number;
 
-	if ( is_string($args) )
-		parse_str($args, $args);
+	if ( is_string( $args ) ) {
+		parse_str( $args, $args );
+	}
 
 	for ( $i = 1; $i <= $number; $i++ ) {
 		$_args = $args;
 
-		if ( $number > 1 )
-			$_args['name'] = isset($args['name']) ? sprintf($args['name'], $i) : sprintf(__('Sidebar %d'), $i);
-		else
-			$_args['name'] = isset($args['name']) ? $args['name'] : __('Sidebar');
+		if ( $number > 1 ) {
+			$_args['name'] = isset( $args['name'] ) ? sprintf( $args['name'], $i ) : sprintf( __( 'Sidebar %d' ), $i );
+		} else { $_args['name'] = isset( $args['name'] ) ? $args['name'] : __( 'Sidebar' );
+		}
 
 		// Custom specified ID's are suffixed if they exist already.
 		// Automatically generated sidebar names need to be suffixed regardless starting at -0
-		if ( isset($args['id']) ) {
+		if ( isset( $args['id'] ) ) {
 			$_args['id'] = $args['id'];
 			$n = 2; // Start at -2 for conflicting custom ID's
 			while ( is_registered_sidebar( $_args['id'] ) ) {
@@ -188,7 +189,7 @@
 				$_args['id'] = 'sidebar-' . ++$n;
 			} while ( is_registered_sidebar( $_args['id'] ) );
 		}
-		register_sidebar($_args);
+		register_sidebar( $_args );
 	}
 }
 
@@ -233,15 +234,15 @@
  * }
  * @return string Sidebar ID added to $wp_registered_sidebars global.
  */
-function register_sidebar($args = array()) {
+function register_sidebar( $args = array() ) {
 	global $wp_registered_sidebars;
 
-	$i = count($wp_registered_sidebars) + 1;
+	$i = count( $wp_registered_sidebars ) + 1;
 
 	$id_is_empty = empty( $args['id'] );
 
 	$defaults = array(
-		'name' => sprintf(__('Sidebar %d'), $i ),
+		'name' => sprintf( __( 'Sidebar %d' ), $i ),
 		'id' => "sidebar-$i",
 		'description' => '',
 		'class' => '',
@@ -258,9 +259,9 @@
 		_doing_it_wrong( __FUNCTION__, sprintf( __( 'No %1$s was set in the arguments array for the "%2$s" sidebar. Defaulting to "%3$s". Manually set the %1$s to "%3$s" to silence this notice and keep existing sidebar content.' ), '<code>id</code>', $sidebar['name'], $sidebar['id'] ), '4.2.0' );
 	}
 
-	$wp_registered_sidebars[$sidebar['id']] = $sidebar;
+	$wp_registered_sidebars[ $sidebar['id'] ] = $sidebar;
 
-	add_theme_support('widgets');
+	add_theme_support( 'widgets' );
 
 	/**
 	 * Fires once a sidebar has been registered.
@@ -335,31 +336,33 @@
 function wp_register_sidebar_widget( $id, $name, $output_callback, $options = array() ) {
 	global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates, $_wp_deprecated_widgets_callbacks;
 
-	$id = strtolower($id);
+	$id = strtolower( $id );
 
-	if ( empty($output_callback) ) {
-		unset($wp_registered_widgets[$id]);
+	if ( empty( $output_callback ) ) {
+		unset( $wp_registered_widgets[ $id ] );
 		return;
 	}
 
-	$id_base = _get_widget_id_base($id);
-	if ( in_array($output_callback, $_wp_deprecated_widgets_callbacks, true) && !is_callable($output_callback) ) {
+	$id_base = _get_widget_id_base( $id );
+	if ( in_array( $output_callback, $_wp_deprecated_widgets_callbacks, true ) && ! is_callable( $output_callback ) ) {
 		unset( $wp_registered_widget_controls[ $id ] );
 		unset( $wp_registered_widget_updates[ $id_base ] );
 		return;
 	}
 
-	$defaults = array('classname' => $output_callback);
-	$options = wp_parse_args($options, $defaults);
+	$defaults = array(
+		'classname' => $output_callback,
+	);
+	$options = wp_parse_args( $options, $defaults );
 	$widget = array(
 		'name' => $name,
 		'id' => $id,
 		'callback' => $output_callback,
-		'params' => array_slice(func_get_args(), 4)
+		'params' => array_slice( func_get_args(), 4 ),
 	);
-	$widget = array_merge($widget, $options);
+	$widget = array_merge( $widget, $options );
 
-	if ( is_callable($output_callback) && ( !isset($wp_registered_widgets[$id]) || did_action( 'widgets_init' ) ) ) {
+	if ( is_callable( $output_callback ) && ( ! isset( $wp_registered_widgets[ $id ] ) || did_action( 'widgets_init' ) ) ) {
 
 		/**
 		 * Fires once for each registered widget.
@@ -369,7 +372,7 @@
 		 * @param array $widget An array of default widget arguments.
 		 */
 		do_action( 'wp_register_sidebar_widget', $widget );
-		$wp_registered_widgets[$id] = $widget;
+		$wp_registered_widgets[ $id ] = $widget;
 	}
 }
 
@@ -388,13 +391,15 @@
  * @return string|void Widget description, if available.
  */
 function wp_widget_description( $id ) {
-	if ( !is_scalar($id) )
+	if ( ! is_scalar( $id ) ) {
 		return;
+	}
 
 	global $wp_registered_widgets;
 
-	if ( isset($wp_registered_widgets[$id]['description']) )
-		return esc_html( $wp_registered_widgets[$id]['description'] );
+	if ( isset( $wp_registered_widgets[ $id ]['description'] ) ) {
+		return esc_html( $wp_registered_widgets[ $id ]['description'] );
+	}
 }
 
 /**
@@ -411,13 +416,15 @@
  * @return string|void Sidebar description, if available.
  */
 function wp_sidebar_description( $id ) {
-	if ( !is_scalar($id) )
+	if ( ! is_scalar( $id ) ) {
 		return;
+	}
 
 	global $wp_registered_sidebars;
 
-	if ( isset($wp_registered_sidebars[$id]['description']) )
-		return esc_html( $wp_registered_sidebars[$id]['description'] );
+	if ( isset( $wp_registered_sidebars[ $id ]['description'] ) ) {
+		return esc_html( $wp_registered_sidebars[ $id ]['description'] );
+	}
 }
 
 /**
@@ -427,7 +434,7 @@
  *
  * @param int|string $id Widget ID.
  */
-function wp_unregister_sidebar_widget($id) {
+function wp_unregister_sidebar_widget( $id ) {
 
 	/**
 	 * Fires just before a widget is removed from a sidebar.
@@ -438,8 +445,8 @@
 	 */
 	do_action( 'wp_unregister_sidebar_widget', $id );
 
-	wp_register_sidebar_widget($id, '', '');
-	wp_unregister_widget_control($id);
+	wp_register_sidebar_widget( $id, '', '' );
+	wp_unregister_widget_control( $id );
 }
 
 /**
@@ -470,25 +477,29 @@
 function wp_register_widget_control( $id, $name, $control_callback, $options = array() ) {
 	global $wp_registered_widget_controls, $wp_registered_widget_updates, $wp_registered_widgets, $_wp_deprecated_widgets_callbacks;
 
-	$id = strtolower($id);
-	$id_base = _get_widget_id_base($id);
+	$id = strtolower( $id );
+	$id_base = _get_widget_id_base( $id );
 
-	if ( empty($control_callback) ) {
-		unset($wp_registered_widget_controls[$id]);
-		unset($wp_registered_widget_updates[$id_base]);
+	if ( empty( $control_callback ) ) {
+		unset( $wp_registered_widget_controls[ $id ] );
+		unset( $wp_registered_widget_updates[ $id_base ] );
 		return;
 	}
 
-	if ( in_array($control_callback, $_wp_deprecated_widgets_callbacks, true) && !is_callable($control_callback) ) {
+	if ( in_array( $control_callback, $_wp_deprecated_widgets_callbacks, true ) && ! is_callable( $control_callback ) ) {
 		unset( $wp_registered_widgets[ $id ] );
 		return;
 	}
 
-	if ( isset($wp_registered_widget_controls[$id]) && !did_action( 'widgets_init' ) )
+	if ( isset( $wp_registered_widget_controls[ $id ] ) && ! did_action( 'widgets_init' ) ) {
 		return;
+	}
 
-	$defaults = array('width' => 250, 'height' => 200 ); // height is never used
-	$options = wp_parse_args($options, $defaults);
+	$defaults = array(
+		'width' => 250,
+		'height' => 200,
+	); // height is never used
+	$options = wp_parse_args( $options, $defaults );
 	$options['width'] = (int) $options['width'];
 	$options['height'] = (int) $options['height'];
 
@@ -496,20 +507,22 @@
 		'name' => $name,
 		'id' => $id,
 		'callback' => $control_callback,
-		'params' => array_slice(func_get_args(), 4)
+		'params' => array_slice( func_get_args(), 4 ),
 	);
-	$widget = array_merge($widget, $options);
+	$widget = array_merge( $widget, $options );
 
-	$wp_registered_widget_controls[$id] = $widget;
+	$wp_registered_widget_controls[ $id ] = $widget;
 
-	if ( isset($wp_registered_widget_updates[$id_base]) )
+	if ( isset( $wp_registered_widget_updates[ $id_base ] ) ) {
 		return;
+	}
 
-	if ( isset($widget['params'][0]['number']) )
+	if ( isset( $widget['params'][0]['number'] ) ) {
 		$widget['params'][0]['number'] = -1;
+	}
 
-	unset($widget['width'], $widget['height'], $widget['name'], $widget['id']);
-	$wp_registered_widget_updates[$id_base] = $widget;
+	unset( $widget['width'], $widget['height'], $widget['name'], $widget['id'] );
+	$wp_registered_widget_updates[ $id_base ] = $widget;
 }
 
 /**
@@ -527,19 +540,20 @@
 function _register_widget_update_callback( $id_base, $update_callback, $options = array() ) {
 	global $wp_registered_widget_updates;
 
-	if ( isset($wp_registered_widget_updates[$id_base]) ) {
-		if ( empty($update_callback) )
-			unset($wp_registered_widget_updates[$id_base]);
+	if ( isset( $wp_registered_widget_updates[ $id_base ] ) ) {
+		if ( empty( $update_callback ) ) {
+			unset( $wp_registered_widget_updates[ $id_base ] );
+		}
 		return;
 	}
 
 	$widget = array(
 		'callback' => $update_callback,
-		'params' => array_slice(func_get_args(), 3)
+		'params' => array_slice( func_get_args(), 3 ),
 	);
 
-	$widget = array_merge($widget, $options);
-	$wp_registered_widget_updates[$id_base] = $widget;
+	$widget = array_merge( $widget, $options );
+	$wp_registered_widget_updates[ $id_base ] = $widget;
 }
 
 /**
@@ -555,21 +569,25 @@
  * @param array      $options       Optional. Widget control options. See wp_register_widget_control().
  *                                  Default empty array.
  */
-function _register_widget_form_callback($id, $name, $form_callback, $options = array()) {
+function _register_widget_form_callback( $id, $name, $form_callback, $options = array() ) {
 	global $wp_registered_widget_controls;
 
-	$id = strtolower($id);
+	$id = strtolower( $id );
 
-	if ( empty($form_callback) ) {
-		unset($wp_registered_widget_controls[$id]);
+	if ( empty( $form_callback ) ) {
+		unset( $wp_registered_widget_controls[ $id ] );
 		return;
 	}
 
-	if ( isset($wp_registered_widget_controls[$id]) && !did_action( 'widgets_init' ) )
+	if ( isset( $wp_registered_widget_controls[ $id ] ) && ! did_action( 'widgets_init' ) ) {
 		return;
+	}
 
-	$defaults = array('width' => 250, 'height' => 200 );
-	$options = wp_parse_args($options, $defaults);
+	$defaults = array(
+		'width' => 250,
+		'height' => 200,
+	);
+	$options = wp_parse_args( $options, $defaults );
 	$options['width'] = (int) $options['width'];
 	$options['height'] = (int) $options['height'];
 
@@ -577,11 +595,11 @@
 		'name' => $name,
 		'id' => $id,
 		'callback' => $form_callback,
-		'params' => array_slice(func_get_args(), 4)
+		'params' => array_slice( func_get_args(), 4 ),
 	);
-	$widget = array_merge($widget, $options);
+	$widget = array_merge( $widget, $options );
 
-	$wp_registered_widget_controls[$id] = $widget;
+	$wp_registered_widget_controls[ $id ] = $widget;
 }
 
 /**
@@ -591,7 +609,7 @@
  *
  * @param int|string $id Widget ID.
  */
-function wp_unregister_widget_control($id) {
+function wp_unregister_widget_control( $id ) {
 	wp_register_widget_control( $id, '', '' );
 }
 
@@ -648,28 +666,35 @@
 	 *                                Default true.
 	 */
 	do_action( 'dynamic_sidebar_before', $index, true );
-	$sidebar = $wp_registered_sidebars[$index];
+	$sidebar = $wp_registered_sidebars[ $index ];
 
 	$did_one = false;
-	foreach ( (array) $sidebars_widgets[$index] as $id ) {
+	foreach ( (array) $sidebars_widgets[ $index ] as $id ) {
 
-		if ( !isset($wp_registered_widgets[$id]) ) continue;
+		if ( ! isset( $wp_registered_widgets[ $id ] ) ) { continue;
+		}
 
 		$params = array_merge(
-			array( array_merge( $sidebar, array('widget_id' => $id, 'widget_name' => $wp_registered_widgets[$id]['name']) ) ),
-			(array) $wp_registered_widgets[$id]['params']
+			array(
+				array_merge( $sidebar, array(
+					'widget_id' => $id,
+					'widget_name' => $wp_registered_widgets[ $id ]['name'],
+				) ),
+			),
+			(array) $wp_registered_widgets[ $id ]['params']
 		);
 
 		// Substitute HTML id and class attributes into before_widget
 		$classname_ = '';
-		foreach ( (array) $wp_registered_widgets[$id]['classname'] as $cn ) {
-			if ( is_string($cn) )
+		foreach ( (array) $wp_registered_widgets[ $id ]['classname'] as $cn ) {
+			if ( is_string( $cn ) ) {
 				$classname_ .= '_' . $cn;
-			elseif ( is_object($cn) )
-				$classname_ .= '_' . get_class($cn);
+			} elseif ( is_object( $cn ) ) {
+				$classname_ .= '_' . get_class( $cn );
+			}
 		}
-		$classname_ = ltrim($classname_, '_');
-		$params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $classname_);
+		$classname_ = ltrim( $classname_, '_' );
+		$params[0]['before_widget'] = sprintf( $params[0]['before_widget'], $id, $classname_ );
 
 		/**
 		 * Filters the parameters passed to a widget's display callback.
@@ -705,7 +730,7 @@
 		 */
 		$params = apply_filters( 'dynamic_sidebar_params', $params );
 
-		$callback = $wp_registered_widgets[$id]['callback'];
+		$callback = $wp_registered_widgets[ $id ]['callback'];
 
 		/**
 		 * Fires before a widget's display callback is called.
@@ -734,11 +759,11 @@
 		 */
 		do_action( 'dynamic_sidebar', $wp_registered_widgets[ $id ] );
 
-		if ( is_callable($callback) ) {
-			call_user_func_array($callback, $params);
+		if ( is_callable( $callback ) ) {
+			call_user_func_array( $callback, $params );
 			$did_one = true;
 		}
-	}
+	}// End foreach().
 
 	/**
 	 * Fires after widgets are rendered in a dynamic sidebar.
@@ -797,17 +822,18 @@
 
 	$sidebars_widgets = wp_get_sidebars_widgets();
 
-	if ( is_array($sidebars_widgets) ) {
+	if ( is_array( $sidebars_widgets ) ) {
 		foreach ( $sidebars_widgets as $sidebar => $widgets ) {
 			if ( $skip_inactive && ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) ) {
 				continue;
 			}
 
-			if ( is_array($widgets) ) {
+			if ( is_array( $widgets ) ) {
 				foreach ( $widgets as $widget ) {
-					if ( ( $callback && isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) || ( $id_base && _get_widget_id_base($widget) == $id_base ) ) {
-						if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] )
+					if ( ( $callback && isset( $wp_registered_widgets[ $widget ]['callback'] ) && $wp_registered_widgets[ $widget ]['callback'] == $callback ) || ( $id_base && _get_widget_id_base( $widget ) == $id_base ) ) {
+						if ( ! $widget_id || $widget_id == $wp_registered_widgets[ $widget ]['id'] ) {
 							return $sidebar;
+						}
 					}
 				}
 			}
@@ -828,12 +854,14 @@
  */
 function is_dynamic_sidebar() {
 	global $wp_registered_widgets, $wp_registered_sidebars;
-	$sidebars_widgets = get_option('sidebars_widgets');
+	$sidebars_widgets = get_option( 'sidebars_widgets' );
 	foreach ( (array) $wp_registered_sidebars as $index => $sidebar ) {
 		if ( ! empty( $sidebars_widgets[ $index ] ) ) {
-			foreach ( (array) $sidebars_widgets[$index] as $widget )
-				if ( array_key_exists($widget, $wp_registered_widgets) )
+			foreach ( (array) $sidebars_widgets[ $index ] as $widget ) {
+				if ( array_key_exists( $widget, $wp_registered_widgets ) ) {
 					return true;
+				}
+			}
 		}
 	}
 	return false;
@@ -848,9 +876,9 @@
  * @return bool true if the sidebar is in use, false otherwise.
  */
 function is_active_sidebar( $index ) {
-	$index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index);
+	$index = ( is_int( $index ) ) ? "sidebar-$index" : sanitize_title( $index );
 	$sidebars_widgets = wp_get_sidebars_widgets();
-	$is_active_sidebar = ! empty( $sidebars_widgets[$index] );
+	$is_active_sidebar = ! empty( $sidebars_widgets[ $index ] );
 
 	/**
 	 * Filters whether a dynamic sidebar is considered "active".
@@ -884,24 +912,27 @@
  * @return array Upgraded list of widgets to version 3 array format when called from the admin.
  */
 function wp_get_sidebars_widgets( $deprecated = true ) {
-	if ( $deprecated !== true )
+	if ( $deprecated !== true ) {
 		_deprecated_argument( __FUNCTION__, '2.8.1' );
+	}
 
 	global $_wp_sidebars_widgets, $sidebars_widgets;
 
 	// If loading from front page, consult $_wp_sidebars_widgets rather than options
 	// to see if wp_convert_widget_settings() has made manipulations in memory.
-	if ( !is_admin() ) {
-		if ( empty($_wp_sidebars_widgets) )
-			$_wp_sidebars_widgets = get_option('sidebars_widgets', array());
+	if ( ! is_admin() ) {
+		if ( empty( $_wp_sidebars_widgets ) ) {
+			$_wp_sidebars_widgets = get_option( 'sidebars_widgets', array() );
+		}
 
 		$sidebars_widgets = $_wp_sidebars_widgets;
 	} else {
-		$sidebars_widgets = get_option('sidebars_widgets', array());
+		$sidebars_widgets = get_option( 'sidebars_widgets', array() );
 	}
 
-	if ( is_array( $sidebars_widgets ) && isset($sidebars_widgets['array_version']) )
-		unset($sidebars_widgets['array_version']);
+	if ( is_array( $sidebars_widgets ) && isset( $sidebars_widgets['array_version'] ) ) {
+		unset( $sidebars_widgets['array_version'] );
+	}
 
 	/**
 	 * Filters the list of sidebars and their widgets.
@@ -922,8 +953,9 @@
  * @param array $sidebars_widgets Sidebar widgets and their settings.
  */
 function wp_set_sidebars_widgets( $sidebars_widgets ) {
-	if ( !isset( $sidebars_widgets['array_version'] ) )
+	if ( ! isset( $sidebars_widgets['array_version'] ) ) {
 		$sidebars_widgets['array_version'] = 3;
+	}
 	update_option( 'sidebars_widgets', $sidebars_widgets );
 }
 
@@ -942,8 +974,9 @@
 
 	$defaults = array();
 
-	foreach ( (array) $wp_registered_sidebars as $index => $sidebar )
-		$defaults[$index] = array();
+	foreach ( (array) $wp_registered_sidebars as $index => $sidebar ) {
+		$defaults[ $index ] = array();
+	}
 
 	return $defaults;
 }
@@ -960,16 +993,17 @@
  * @param array  $settings
  * @return array
  */
-function wp_convert_widget_settings($base_name, $option_name, $settings) {
+function wp_convert_widget_settings( $base_name, $option_name, $settings ) {
 	// This test may need expanding.
 	$single = $changed = false;
-	if ( empty($settings) ) {
+	if ( empty( $settings ) ) {
 		$single = true;
 	} else {
-		foreach ( array_keys($settings) as $number ) {
-			if ( 'number' == $number )
+		foreach ( array_keys( $settings ) as $number ) {
+			if ( 'number' == $number ) {
 				continue;
-			if ( !is_numeric($number) ) {
+			}
+			if ( ! is_numeric( $number ) ) {
 				$single = true;
 				break;
 			}
@@ -977,22 +1011,25 @@
 	}
 
 	if ( $single ) {
-		$settings = array( 2 => $settings );
+		$settings = array(
+			2 => $settings,
+		);
 
 		// If loading from the front page, update sidebar in memory but don't save to options
 		if ( is_admin() ) {
-			$sidebars_widgets = get_option('sidebars_widgets');
+			$sidebars_widgets = get_option( 'sidebars_widgets' );
 		} else {
-			if ( empty($GLOBALS['_wp_sidebars_widgets']) )
-				$GLOBALS['_wp_sidebars_widgets'] = get_option('sidebars_widgets', array());
+			if ( empty( $GLOBALS['_wp_sidebars_widgets'] ) ) {
+				$GLOBALS['_wp_sidebars_widgets'] = get_option( 'sidebars_widgets', array() );
+			}
 			$sidebars_widgets = &$GLOBALS['_wp_sidebars_widgets'];
 		}
 
 		foreach ( (array) $sidebars_widgets as $index => $sidebar ) {
-			if ( is_array($sidebar) ) {
+			if ( is_array( $sidebar ) ) {
 				foreach ( $sidebar as $i => $name ) {
 					if ( $base_name == $name ) {
-						$sidebars_widgets[$index][$i] = "$name-2";
+						$sidebars_widgets[ $index ][ $i ] = "$name-2";
 						$changed = true;
 						break 2;
 					}
@@ -1000,13 +1037,15 @@
 			}
 		}
 
-		if ( is_admin() && $changed )
-			update_option('sidebars_widgets', $sidebars_widgets);
+		if ( is_admin() && $changed ) {
+			update_option( 'sidebars_widgets', $sidebars_widgets );
+		}
 	}
 
 	$settings['_multiwidget'] = 1;
-	if ( is_admin() )
+	if ( is_admin() ) {
 		update_option( $option_name, $settings );
+	}
 
 	return $settings;
 }
@@ -1036,21 +1075,21 @@
 function the_widget( $widget, $instance = array(), $args = array() ) {
 	global $wp_widget_factory;
 
-	$widget_obj = $wp_widget_factory->widgets[$widget];
+	$widget_obj = $wp_widget_factory->widgets[ $widget ];
 	if ( ! ( $widget_obj instanceof WP_Widget ) ) {
 		return;
 	}
 
 	$default_args = array(
 		'before_widget' => '<div class="widget %s">',
-		'after_widget'  => "</div>",
+		'after_widget'  => '</div>',
 		'before_title'  => '<h2 class="widgettitle">',
 		'after_title'   => '</h2>',
 	);
 	$args = wp_parse_args( $args, $default_args );
 	$args['before_widget'] = sprintf( $args['before_widget'], $widget_obj->widget_options['classname'] );
 
-	$instance = wp_parse_args($instance);
+	$instance = wp_parse_args( $instance );
 
 	/**
 	 * Fires before rendering the requested widget.
@@ -1063,8 +1102,8 @@
 	 */
 	do_action( 'the_widget', $widget, $instance, $args );
 
-	$widget_obj->_set(-1);
-	$widget_obj->widget($args, $instance);
+	$widget_obj->_set( -1 );
+	$widget_obj->widget( $args, $instance );
 }
 
 /**
@@ -1090,10 +1129,11 @@
 function _wp_sidebars_changed() {
 	global $sidebars_widgets;
 
-	if ( ! is_array( $sidebars_widgets ) )
+	if ( ! is_array( $sidebars_widgets ) ) {
 		$sidebars_widgets = wp_get_sidebars_widgets();
+	}
 
-	retrieve_widgets(true);
+	retrieve_widgets( true );
 }
 
 /**
@@ -1129,83 +1169,90 @@
 				continue;
 			}
 
-			if ( !in_array( $sidebar, $registered_sidebar_keys ) ) {
-				$_sidebars_widgets['orphaned_widgets_' . ++$orphaned] = $widgets;
-				unset( $_sidebars_widgets[$sidebar] );
+			if ( ! in_array( $sidebar, $registered_sidebar_keys ) ) {
+				$_sidebars_widgets[ 'orphaned_widgets_' . ++$orphaned ] = $widgets;
+				unset( $_sidebars_widgets[ $sidebar ] );
 			}
 		}
 	} else {
-		if ( empty( $sidebars_widgets ) )
+		if ( empty( $sidebars_widgets ) ) {
 			return;
+		}
 
 		unset( $sidebars_widgets['array_version'] );
 
-		$old = array_keys($sidebars_widgets);
-		sort($old);
-		sort($registered_sidebar_keys);
+		$old = array_keys( $sidebars_widgets );
+		sort( $old );
+		sort( $registered_sidebar_keys );
 
-		if ( $old == $registered_sidebar_keys )
+		if ( $old == $registered_sidebar_keys ) {
 			return;
+		}
 
 		$_sidebars_widgets = array(
-			'wp_inactive_widgets' => !empty( $sidebars_widgets['wp_inactive_widgets'] ) ? $sidebars_widgets['wp_inactive_widgets'] : array()
+			'wp_inactive_widgets' => ! empty( $sidebars_widgets['wp_inactive_widgets'] ) ? $sidebars_widgets['wp_inactive_widgets'] : array(),
 		);
 
 		unset( $sidebars_widgets['wp_inactive_widgets'] );
 
 		foreach ( $wp_registered_sidebars as $id => $settings ) {
 			if ( $theme_changed ) {
-				$_sidebars_widgets[$id] = array_shift( $sidebars_widgets );
+				$_sidebars_widgets[ $id ] = array_shift( $sidebars_widgets );
 			} else {
 				// no theme change, grab only sidebars that are currently registered
-				if ( isset( $sidebars_widgets[$id] ) ) {
-					$_sidebars_widgets[$id] = $sidebars_widgets[$id];
-					unset( $sidebars_widgets[$id] );
+				if ( isset( $sidebars_widgets[ $id ] ) ) {
+					$_sidebars_widgets[ $id ] = $sidebars_widgets[ $id ];
+					unset( $sidebars_widgets[ $id ] );
 				}
 			}
 		}
 
 		foreach ( $sidebars_widgets as $val ) {
-			if ( is_array($val) && ! empty( $val ) )
-				$_sidebars_widgets['orphaned_widgets_' . ++$orphaned] = $val;
+			if ( is_array( $val ) && ! empty( $val ) ) {
+				$_sidebars_widgets[ 'orphaned_widgets_' . ++$orphaned ] = $val;
+			}
 		}
-	}
+	}// End if().
 
 	// discard invalid, theme-specific widgets from sidebars
 	$shown_widgets = array();
 
 	foreach ( $_sidebars_widgets as $sidebar => $widgets ) {
-		if ( !is_array($widgets) )
+		if ( ! is_array( $widgets ) ) {
 			continue;
+		}
 
 		$_widgets = array();
 		foreach ( $widgets as $widget ) {
-			if ( isset($wp_registered_widgets[$widget]) )
+			if ( isset( $wp_registered_widgets[ $widget ] ) ) {
 				$_widgets[] = $widget;
+			}
 		}
 
-		$_sidebars_widgets[$sidebar] = $_widgets;
-		$shown_widgets = array_merge($shown_widgets, $_widgets);
+		$_sidebars_widgets[ $sidebar ] = $_widgets;
+		$shown_widgets = array_merge( $shown_widgets, $_widgets );
 	}
 
 	$sidebars_widgets = $_sidebars_widgets;
-	unset($_sidebars_widgets, $_widgets);
+	unset( $_sidebars_widgets, $_widgets );
 
 	// find hidden/lost multi-widget instances
 	$lost_widgets = array();
 	foreach ( $wp_registered_widgets as $key => $val ) {
-		if ( in_array($key, $shown_widgets, true) )
+		if ( in_array( $key, $shown_widgets, true ) ) {
 			continue;
+		}
 
-		$number = preg_replace('/.+?-([0-9]+)$/', '$1', $key);
+		$number = preg_replace( '/.+?-([0-9]+)$/', '$1', $key );
 
-		if ( 2 > (int) $number )
+		if ( 2 > (int) $number ) {
 			continue;
+		}
 
 		$lost_widgets[] = $key;
 	}
 
-	$sidebars_widgets['wp_inactive_widgets'] = array_merge($lost_widgets, (array) $sidebars_widgets['wp_inactive_widgets']);
+	$sidebars_widgets['wp_inactive_widgets'] = array_merge( $lost_widgets, (array) $sidebars_widgets['wp_inactive_widgets'] );
 	if ( 'customize' !== $theme_changed ) {
 		wp_set_sidebars_widgets( $sidebars_widgets );
 	}
@@ -1223,17 +1270,18 @@
  */
 function wp_widget_rss_output( $rss, $args = array() ) {
 	if ( is_string( $rss ) ) {
-		$rss = fetch_feed($rss);
-	} elseif ( is_array($rss) && isset($rss['url']) ) {
+		$rss = fetch_feed( $rss );
+	} elseif ( is_array( $rss ) && isset( $rss['url'] ) ) {
 		$args = $rss;
-		$rss = fetch_feed($rss['url']);
-	} elseif ( !is_object($rss) ) {
+		$rss = fetch_feed( $rss['url'] );
+	} elseif ( ! is_object( $rss ) ) {
 		return;
 	}
 
-	if ( is_wp_error($rss) ) {
-		if ( is_admin() || current_user_can('manage_options') )
+	if ( is_wp_error( $rss ) ) {
+		if ( is_admin() || current_user_can( 'manage_options' ) ) {
 			echo '<p><strong>' . __( 'RSS Error:' ) . '</strong> ' . $rss->get_error_message() . '</p>';
+		}
 		return;
 	}
 
@@ -1241,16 +1289,17 @@
 	$args = wp_parse_args( $args, $default_args );
 
 	$items = (int) $args['items'];
-	if ( $items < 1 || 20 < $items )
+	if ( $items < 1 || 20 < $items ) {
 		$items = 10;
+	}
 	$show_summary  = (int) $args['show_summary'];
 	$show_author   = (int) $args['show_author'];
 	$show_date     = (int) $args['show_date'];
 
-	if ( !$rss->get_item_quantity() ) {
+	if ( ! $rss->get_item_quantity() ) {
 		echo '<ul><li>' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</li></ul>';
 		$rss->__destruct();
-		unset($rss);
+		unset( $rss );
 		return;
 	}
 
@@ -1294,7 +1343,7 @@
 		$author = '';
 		if ( $show_author ) {
 			$author = $item->get_author();
-			if ( is_object($author) ) {
+			if ( is_object( $author ) ) {
 				$author = $author->get_name();
 				$author = ' <cite>' . esc_html( strip_tags( $author ) ) . '</cite>';
 			}
@@ -1307,10 +1356,10 @@
 		} else {
 			echo "<li><a class='rsswidget' href='$link'>$title</a>{$date}{$author}</li>";
 		}
-	}
+	}// End foreach().
 	echo '</ul>';
 	$rss->__destruct();
-	unset($rss);
+	unset( $rss );
 }
 
 /**
@@ -1373,13 +1422,13 @@
 	<label for="rss-show-date-<?php echo $esc_number; ?>"><?php _e( 'Display item date?' ); ?></label></p>
 <?php
 	endif;
-	foreach ( array_keys($default_inputs) as $input ) :
-		if ( 'hidden' === $inputs[$input] ) :
-			$id = str_replace( '_', '-', $input );
+foreach ( array_keys( $default_inputs ) as $input ) :
+	if ( 'hidden' === $inputs[ $input ] ) :
+		$id = str_replace( '_', '-', $input );
 ?>
-	<input type="hidden" id="rss-<?php echo esc_attr( $id ); ?>-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][<?php echo esc_attr( $input ); ?>]" value="<?php echo esc_attr( $args[ $input ] ); ?>" />
+<input type="hidden" id="rss-<?php echo esc_attr( $id ); ?>-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][<?php echo esc_attr( $input ); ?>]" value="<?php echo esc_attr( $args[ $input ] ); ?>" />
 <?php
-		endif;
+endif;
 	endforeach;
 }
 
@@ -1401,8 +1450,9 @@
  */
 function wp_widget_rss_process( $widget_rss, $check_feed = true ) {
 	$items = (int) $widget_rss['items'];
-	if ( $items < 1 || 20 < $items )
+	if ( $items < 1 || 20 < $items ) {
 		$items = 10;
+	}
 	$url           = esc_url_raw( strip_tags( $widget_rss['url'] ) );
 	$title         = isset( $widget_rss['title'] ) ? trim( strip_tags( $widget_rss['title'] ) ) : '';
 	$show_summary  = isset( $widget_rss['show_summary'] ) ? (int) $widget_rss['show_summary'] : 0;
@@ -1410,18 +1460,18 @@
 	$show_date     = isset( $widget_rss['show_date'] ) ? (int) $widget_rss['show_date'] : 0;
 
 	if ( $check_feed ) {
-		$rss = fetch_feed($url);
+		$rss = fetch_feed( $url );
 		$error = false;
 		$link = '';
-		if ( is_wp_error($rss) ) {
+		if ( is_wp_error( $rss ) ) {
 			$error = $rss->get_error_message();
 		} else {
-			$link = esc_url(strip_tags($rss->get_permalink()));
-			while ( stristr($link, 'http') != $link )
-				$link = substr($link, 1);
+			$link = esc_url( strip_tags( $rss->get_permalink() ) );
+			while ( stristr( $link, 'http' ) != $link ) {				$link = substr( $link, 1 );
+			}
 
 			$rss->__destruct();
-			unset($rss);
+			unset( $rss );
 		}
 	}
 
Index: src/wp-includes/wp-db.php
===================================================================
--- src/wp-includes/wp-db.php	(revision 40901)
+++ src/wp-includes/wp-db.php	(working copy)
@@ -228,7 +228,7 @@
 	 * @access public
 	 * @var string
 	 */
-	 public $base_prefix;
+	public $base_prefix;
 
 	/**
 	 * Whether the database queries are ready to start executing.
@@ -265,8 +265,18 @@
 	 * @see wpdb::tables()
 	 * @var array
 	 */
-	var $tables = array( 'posts', 'comments', 'links', 'options', 'postmeta',
-		'terms', 'term_taxonomy', 'term_relationships', 'termmeta', 'commentmeta' );
+	var $tables = array(
+	'posts',
+	'comments',
+	'links',
+	'options',
+	'postmeta',
+		'terms',
+	'term_taxonomy',
+	'term_relationships',
+	'termmeta',
+	'commentmeta',
+	);
 
 	/**
 	 * List of deprecated WordPress tables
@@ -298,8 +308,15 @@
 	 * @see wpdb::tables()
 	 * @var array
 	 */
-	var $ms_global_tables = array( 'blogs', 'signups', 'site', 'sitemeta',
-		'sitecategories', 'registration_log', 'blog_versions' );
+	var $ms_global_tables = array(
+	'blogs',
+	'signups',
+	'site',
+	'sitemeta',
+		'sitecategories',
+	'registration_log',
+	'blog_versions',
+	);
 
 	/**
 	 * WordPress Comments table
@@ -585,8 +602,13 @@
 	 * @access protected
 	 * @var array
 	 */
-	protected $incompatible_modes = array( 'NO_ZERO_DATE', 'ONLY_FULL_GROUP_BY',
-		'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'TRADITIONAL' );
+	protected $incompatible_modes = array(
+	'NO_ZERO_DATE',
+	'ONLY_FULL_GROUP_BY',
+		'STRICT_TRANS_TABLES',
+	'STRICT_ALL_TABLES',
+	'TRADITIONAL',
+	);
 
 	/**
 	 * Whether to use mysqli over mysql.
@@ -626,8 +648,9 @@
 	public function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
 		register_shutdown_function( array( $this, '__destruct' ) );
 
-		if ( WP_DEBUG && WP_DEBUG_DISPLAY )
+		if ( WP_DEBUG && WP_DEBUG_DISPLAY ) {
 			$this->show_errors();
+		}
 
 		/* Use ext/mysqli if it exists and:
 		 *  - WP_USE_EXT_MYSQL is defined as false, or
@@ -678,8 +701,9 @@
 	 * @return mixed The private member
 	 */
 	public function __get( $name ) {
-		if ( 'col_info' === $name )
+		if ( 'col_info' === $name ) {
 			$this->load_col_info();
+		}
 
 		return $this->$name;
 	}
@@ -698,7 +722,7 @@
 			'table_charset',
 			'check_current_query',
 		);
-		if (  in_array( $name, $protected_members, true ) ) {
+		if ( in_array( $name, $protected_members, true ) ) {
 			return;
 		}
 		$this->$name = $value;
@@ -737,7 +761,7 @@
 		$charset = '';
 		$collate = '';
 
-		if ( function_exists('is_multisite') && is_multisite() ) {
+		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
 			$charset = 'utf8';
 			if ( defined( 'DB_COLLATE' ) && DB_COLLATE ) {
 				$collate = DB_COLLATE;
@@ -811,10 +835,12 @@
 	 * @param string   $collate Optional. The collation. Default null.
 	 */
 	public function set_charset( $dbh, $charset = null, $collate = null ) {
-		if ( ! isset( $charset ) )
+		if ( ! isset( $charset ) ) {
 			$charset = $this->charset;
-		if ( ! isset( $collate ) )
+		}
+		if ( ! isset( $collate ) ) {
 			$collate = $this->collate;
+		}
 		if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) {
 			$set_charset_succeeded = true;
 
@@ -825,8 +851,9 @@
 
 				if ( $set_charset_succeeded ) {
 					$query = $this->prepare( 'SET NAMES %s', $charset );
-					if ( ! empty( $collate ) )
+					if ( ! empty( $collate ) ) {
 						$query .= $this->prepare( ' COLLATE %s', $collate );
+					}
 					mysqli_query( $dbh, $query );
 				}
 			} else {
@@ -835,8 +862,9 @@
 				}
 				if ( $set_charset_succeeded ) {
 					$query = $this->prepare( 'SET NAMES %s', $charset );
-					if ( ! empty( $collate ) )
+					if ( ! empty( $collate ) ) {
 						$query .= $this->prepare( ' COLLATE %s', $collate );
+					}
 					mysql_query( $query, $dbh );
 				}
 			}
@@ -919,30 +947,36 @@
 	 */
 	public function set_prefix( $prefix, $set_table_names = true ) {
 
-		if ( preg_match( '|[^a-z0-9_]|i', $prefix ) )
-			return new WP_Error('invalid_db_prefix', 'Invalid database prefix' );
+		if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) {
+			return new WP_Error( 'invalid_db_prefix', 'Invalid database prefix' );
+		}
 
 		$old_prefix = is_multisite() ? '' : $prefix;
 
-		if ( isset( $this->base_prefix ) )
+		if ( isset( $this->base_prefix ) ) {
 			$old_prefix = $this->base_prefix;
+		}
 
 		$this->base_prefix = $prefix;
 
 		if ( $set_table_names ) {
-			foreach ( $this->tables( 'global' ) as $table => $prefixed_table )
+			foreach ( $this->tables( 'global' ) as $table => $prefixed_table ) {
 				$this->$table = $prefixed_table;
+			}
 
-			if ( is_multisite() && empty( $this->blogid ) )
+			if ( is_multisite() && empty( $this->blogid ) ) {
 				return $old_prefix;
+			}
 
 			$this->prefix = $this->get_blog_prefix();
 
-			foreach ( $this->tables( 'blog' ) as $table => $prefixed_table )
+			foreach ( $this->tables( 'blog' ) as $table => $prefixed_table ) {
 				$this->$table = $prefixed_table;
+			}
 
-			foreach ( $this->tables( 'old' ) as $table => $prefixed_table )
+			foreach ( $this->tables( 'old' ) as $table => $prefixed_table ) {
 				$this->$table = $prefixed_table;
+			}
 		}
 		return $old_prefix;
 	}
@@ -958,19 +992,22 @@
 	 * @return int previous blog id
 	 */
 	public function set_blog_id( $blog_id, $site_id = 0 ) {
-		if ( ! empty( $site_id ) )
+		if ( ! empty( $site_id ) ) {
 			$this->siteid = $site_id;
+		}
 
 		$old_blog_id  = $this->blogid;
 		$this->blogid = $blog_id;
 
 		$this->prefix = $this->get_blog_prefix();
 
-		foreach ( $this->tables( 'blog' ) as $table => $prefixed_table )
+		foreach ( $this->tables( 'blog' ) as $table => $prefixed_table ) {
 			$this->$table = $prefixed_table;
+		}
 
-		foreach ( $this->tables( 'old' ) as $table => $prefixed_table )
+		foreach ( $this->tables( 'old' ) as $table => $prefixed_table ) {
 			$this->$table = $prefixed_table;
+		}
 
 		return $old_blog_id;
 	}
@@ -984,13 +1021,14 @@
 	 */
 	public function get_blog_prefix( $blog_id = null ) {
 		if ( is_multisite() ) {
-			if ( null === $blog_id )
+			if ( null === $blog_id ) {
 				$blog_id = $this->blogid;
+			}
 			$blog_id = (int) $blog_id;
-			if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) )
+			if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) ) {
 				return $this->base_prefix;
-			else
-				return $this->base_prefix . $blog_id . '_';
+			} else { return $this->base_prefix . $blog_id . '_';
+			}
 		} else {
 			return $this->base_prefix;
 		}
@@ -1027,16 +1065,18 @@
 		switch ( $scope ) {
 			case 'all' :
 				$tables = array_merge( $this->global_tables, $this->tables );
-				if ( is_multisite() )
+				if ( is_multisite() ) {
 					$tables = array_merge( $tables, $this->ms_global_tables );
+				}
 				break;
 			case 'blog' :
 				$tables = $this->tables;
 				break;
 			case 'global' :
 				$tables = $this->global_tables;
-				if ( is_multisite() )
+				if ( is_multisite() ) {
 					$tables = array_merge( $tables, $this->ms_global_tables );
+				}
 				break;
 			case 'ms_global' :
 				$tables = $this->ms_global_tables;
@@ -1049,24 +1089,27 @@
 		}
 
 		if ( $prefix ) {
-			if ( ! $blog_id )
+			if ( ! $blog_id ) {
 				$blog_id = $this->blogid;
+			}
 			$blog_prefix = $this->get_blog_prefix( $blog_id );
 			$base_prefix = $this->base_prefix;
 			$global_tables = array_merge( $this->global_tables, $this->ms_global_tables );
 			foreach ( $tables as $k => $table ) {
-				if ( in_array( $table, $global_tables ) )
+				if ( in_array( $table, $global_tables ) ) {
 					$tables[ $table ] = $base_prefix . $table;
-				else
-					$tables[ $table ] = $blog_prefix . $table;
+				} else { $tables[ $table ] = $blog_prefix . $table;
+				}
 				unset( $tables[ $k ] );
 			}
 
-			if ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) )
+			if ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) ) {
 				$tables['users'] = CUSTOM_USER_TABLE;
+			}
 
-			if ( isset( $tables['usermeta'] ) && defined( 'CUSTOM_USER_META_TABLE' ) )
+			if ( isset( $tables['usermeta'] ) && defined( 'CUSTOM_USER_META_TABLE' ) ) {
 				$tables['usermeta'] = CUSTOM_USER_META_TABLE;
+			}
 		}
 
 		return $tables;
@@ -1084,8 +1127,9 @@
 	 * @param resource|null $dbh Optional link identifier.
 	 */
 	public function select( $db, $dbh = null ) {
-		if ( is_null($dbh) )
+		if ( is_null( $dbh ) ) {
 			$dbh = $this->dbh;
+		}
 
 		if ( $this->use_mysqli ) {
 			$success = mysqli_select_db( $dbh, $db );
@@ -1111,7 +1155,7 @@
 				$message .= '<li>' . sprintf(
 					/* translators: 1: database user, 2: database name */
 					__( 'Does the user %1$s have permission to use the %2$s database?' ),
-					'<code>' . htmlspecialchars( $this->dbuser, ENT_QUOTES )  . '</code>',
+					'<code>' . htmlspecialchars( $this->dbuser, ENT_QUOTES ) . '</code>',
 					'<code>' . htmlspecialchars( $db, ENT_QUOTES ) . '</code>'
 				) . "</li>\n";
 
@@ -1119,7 +1163,7 @@
 					/* translators: %s: database name */
 					__( 'On some systems the name of your database is prefixed with your username, so it would be like <code>username_%1$s</code>. Could that be the problem?' ),
 					htmlspecialchars( $db, ENT_QUOTES )
-				). "</li>\n";
+				) . "</li>\n";
 
 				$message .= "</ul>\n";
 
@@ -1130,8 +1174,8 @@
 				) . "</p>\n";
 
 				$this->bail( $message, 'db_select_fail' );
-			}
-		}
+			}// End if().
+		}// End if().
 	}
 
 	/**
@@ -1149,8 +1193,9 @@
 	 * @return string
 	 */
 	function _weak_escape( $string ) {
-		if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) )
+		if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) {
 			_deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' );
+		}
 		return addslashes( $string );
 	}
 
@@ -1198,9 +1243,9 @@
 		if ( is_array( $data ) ) {
 			foreach ( $data as $k => $v ) {
 				if ( is_array( $v ) ) {
-					$data[$k] = $this->_escape( $v );
+					$data[ $k ] = $this->_escape( $v );
 				} else {
-					$data[$k] = $this->_real_escape( $v );
+					$data[ $k ] = $this->_real_escape( $v );
 				}
 			}
 		} else {
@@ -1224,14 +1269,15 @@
 	 * @return mixed
 	 */
 	public function escape( $data ) {
-		if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) )
+		if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) {
 			_deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' );
+		}
 		if ( is_array( $data ) ) {
 			foreach ( $data as $k => $v ) {
-				if ( is_array( $v ) )
-					$data[$k] = $this->escape( $v, 'recursive' );
-				else
-					$data[$k] = $this->_weak_escape( $v, 'internal' );
+				if ( is_array( $v ) ) {
+					$data[ $k ] = $this->escape( $v, 'recursive' );
+				} else { $data[ $k ] = $this->_weak_escape( $v, 'internal' );
+				}
 			}
 		} else {
 			$data = $this->_weak_escape( $data, 'internal' );
@@ -1250,8 +1296,9 @@
 	 * @param string $string to escape
 	 */
 	public function escape_by_ref( &$string ) {
-		if ( ! is_float( $string ) )
+		if ( ! is_float( $string ) ) {
 			$string = $this->_real_escape( $string );
+		}
 	}
 
 	/**
@@ -1289,8 +1336,9 @@
 	 * @return string|void Sanitized query string, if there is a query to prepare.
 	 */
 	public function prepare( $query, $args ) {
-		if ( is_null( $query ) )
+		if ( is_null( $query ) ) {
 			return;
+		}
 
 		// This is not meant to be foolproof -- but it will catch obviously incorrect usage.
 		if ( strpos( $query, '%' ) === false ) {
@@ -1300,8 +1348,9 @@
 		$args = func_get_args();
 		array_shift( $args );
 		// If args were passed as an array (as in vsprintf), move them up
-		if ( isset( $args[0] ) && is_array($args[0]) )
+		if ( isset( $args[0] ) && is_array( $args[0] ) ) {
 			$args = $args[0];
+		}
 		$query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it
 		$query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting
 		$query = preg_replace( '|(?<!%)%f|' , '%F', $query ); // Force floats to be locale unaware
@@ -1350,7 +1399,7 @@
 	public function print_error( $str = '' ) {
 		global $EZSQL_ERROR;
 
-		if ( !$str ) {
+		if ( ! $str ) {
 			if ( $this->use_mysqli ) {
 				$str = mysqli_error( $this->dbh );
 			} else {
@@ -1359,8 +1408,9 @@
 		}
 		$EZSQL_ERROR[] = array( 'query' => $this->last_query, 'error_str' => $str );
 
-		if ( $this->suppress_errors )
+		if ( $this->suppress_errors ) {
 			return false;
+		}
 
 		wp_load_translations_early();
 
@@ -1375,8 +1425,9 @@
 		error_log( $error_str );
 
 		// Are we showing errors?
-		if ( ! $this->show_errors )
+		if ( ! $this->show_errors ) {
 			return false;
+		}
 
 		// If there is an error then take note of it
 		if ( is_multisite() ) {
@@ -1476,7 +1527,7 @@
 			$this->result = null;
 
 			// Sanity check before using the handle
-			if ( empty( $this->dbh ) || !( $this->dbh instanceof mysqli ) ) {
+			if ( empty( $this->dbh ) || ! ( $this->dbh instanceof mysqli ) ) {
 				return;
 			}
 
@@ -1569,7 +1620,7 @@
 			} else {
 				$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
 			}
-		}
+		}// End if().
 
 		if ( ! $this->dbh && $allow_bail ) {
 			wp_load_translations_early();
@@ -1618,7 +1669,7 @@
 			$this->select( $this->dbname, $this->dbh );
 
 			return true;
-		}
+		}// End if().
 
 		return false;
 	}
@@ -1810,8 +1861,9 @@
 
 		if ( $this->last_error ) {
 			// Clear insert_id on a subsequent failed insert.
-			if ( $this->insert_id && preg_match( '/^\s*(insert|replace)\s/i', $query ) )
+			if ( $this->insert_id && preg_match( '/^\s*(insert|replace)\s/i', $query ) ) {
 				$this->insert_id = 0;
+			}
 
 			$this->print_error();
 			return false;
@@ -1839,12 +1891,12 @@
 			$num_rows = 0;
 			if ( $this->use_mysqli && $this->result instanceof mysqli_result ) {
 				while ( $row = mysqli_fetch_object( $this->result ) ) {
-					$this->last_result[$num_rows] = $row;
+					$this->last_result[ $num_rows ] = $row;
 					$num_rows++;
 				}
 			} elseif ( is_resource( $this->result ) ) {
 				while ( $row = mysql_fetch_object( $this->result ) ) {
-					$this->last_result[$num_rows] = $row;
+					$this->last_result[ $num_rows ] = $row;
 					$num_rows++;
 				}
 			}
@@ -1853,7 +1905,7 @@
 			// and return number of rows selected
 			$this->num_rows = $num_rows;
 			$return_val     = $num_rows;
-		}
+		}// End if().
 
 		return $return_val;
 	}
@@ -2281,12 +2333,12 @@
 		}
 
 		// Extract var out of cached results based x,y vals
-		if ( !empty( $this->last_result[$y] ) ) {
-			$values = array_values( get_object_vars( $this->last_result[$y] ) );
+		if ( ! empty( $this->last_result[ $y ] ) ) {
+			$values = array_values( get_object_vars( $this->last_result[ $y ] ) );
 		}
 
 		// If there is a value return it else return null
-		return ( isset( $values[$x] ) && $values[$x] !== '' ) ? $values[$x] : null;
+		return ( isset( $values[ $x ] ) && $values[ $x ] !== '' ) ? $values[ $x ] : null;
 	}
 
 	/**
@@ -2315,20 +2367,21 @@
 			return null;
 		}
 
-		if ( !isset( $this->last_result[$y] ) )
+		if ( ! isset( $this->last_result[ $y ] ) ) {
 			return null;
+		}
 
 		if ( $output == OBJECT ) {
-			return $this->last_result[$y] ? $this->last_result[$y] : null;
+			return $this->last_result[ $y ] ? $this->last_result[ $y ] : null;
 		} elseif ( $output == ARRAY_A ) {
-			return $this->last_result[$y] ? get_object_vars( $this->last_result[$y] ) : null;
+			return $this->last_result[ $y ] ? get_object_vars( $this->last_result[ $y ] ) : null;
 		} elseif ( $output == ARRAY_N ) {
-			return $this->last_result[$y] ? array_values( get_object_vars( $this->last_result[$y] ) ) : null;
+			return $this->last_result[ $y ] ? array_values( get_object_vars( $this->last_result[ $y ] ) ) : null;
 		} elseif ( strtoupper( $output ) === OBJECT ) {
 			// Back compat for OBJECT being previously case insensitive.
-			return $this->last_result[$y] ? $this->last_result[$y] : null;
+			return $this->last_result[ $y ] ? $this->last_result[ $y ] : null;
 		} else {
-			$this->print_error( " \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N" );
+			$this->print_error( ' \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N' );
 		}
 	}
 
@@ -2345,7 +2398,7 @@
 	 * @param int         $x     Optional. Column to return. Indexed from 0.
 	 * @return array Database query result. Array indexed from 0 by SQL result row number.
 	 */
-	public function get_col( $query = null , $x = 0 ) {
+	public function get_col( $query = null, $x = 0 ) {
 		if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
 			$this->check_current_query = false;
 		}
@@ -2357,7 +2410,7 @@
 		$new_array = array();
 		// Extract the column values
 		for ( $i = 0, $j = count( $this->last_result ); $i < $j; $i++ ) {
-			$new_array[$i] = $this->get_var( null, $x, $i );
+			$new_array[ $i ] = $this->get_var( null, $x, $i );
 		}
 		return $new_array;
 	}
@@ -2400,8 +2453,9 @@
 			foreach ( $this->last_result as $row ) {
 				$var_by_ref = get_object_vars( $row );
 				$key = array_shift( $var_by_ref );
-				if ( ! isset( $new_array[ $key ] ) )
+				if ( ! isset( $new_array[ $key ] ) ) {
 					$new_array[ $key ] = $row;
+				}
 			}
 			return $new_array;
 		} elseif ( $output == ARRAY_A || $output == ARRAY_N ) {
@@ -2633,7 +2687,7 @@
 			$length = false;
 		}
 
-		switch( $type ) {
+		switch ( $type ) {
 			case 'char':
 			case 'varchar':
 				return array(
@@ -2678,7 +2732,7 @@
 
 			default:
 				return false;
-		}
+		}// End switch().
 	}
 
 	/**
@@ -2853,7 +2907,6 @@
 					/x';
 				$value['value'] = preg_replace( $regex, '$1', $value['value'] );
 
-
 				if ( false !== $length && mb_strlen( $value['value'], 'UTF-8' ) > $length ) {
 					$value['value'] = mb_substr( $value['value'], 0, $length, 'UTF-8' );
 				}
@@ -2862,7 +2915,7 @@
 
 			// We couldn't use any local conversions, send it to the DB.
 			$value['db'] = $db_check_string = true;
-		}
+		}// End foreach().
 		unset( $value ); // Remove by reference.
 
 		if ( $db_check_string ) {
@@ -2889,7 +2942,7 @@
 
 					if ( is_array( $value['length'] ) ) {
 						$queries[ $col ] = $this->prepare( "CONVERT( LEFT( CONVERT( %s USING $charset ), %.0f ) USING $connection_charset )", $value['value'], $value['length']['length'] );
-					} else if ( 'binary' !== $charset ) {
+					} elseif ( 'binary' !== $charset ) {
 						// If we don't have a length, there's no need to convert binary - it will always return the same result.
 						$queries[ $col ] = $this->prepare( "CONVERT( CONVERT( %s USING $charset ) USING $connection_charset )", $value['value'] );
 					}
@@ -2908,17 +2961,17 @@
 			}
 
 			$this->check_current_query = false;
-			$row = $this->get_row( "SELECT " . implode( ', ', $sql ), ARRAY_A );
+			$row = $this->get_row( 'SELECT ' . implode( ', ', $sql ), ARRAY_A );
 			if ( ! $row ) {
 				return new WP_Error( 'wpdb_strip_invalid_text_failure' );
 			}
 
 			foreach ( array_keys( $data ) as $column ) {
-				if ( isset( $row["x_$column"] ) ) {
-					$data[ $column ]['value'] = $row["x_$column"];
+				if ( isset( $row[ "x_$column" ] ) ) {
+					$data[ $column ]['value'] = $row[ "x_$column" ];
 				}
 			}
-		}
+		}// End if().
 
 		return $data;
 	}
@@ -2999,7 +3052,7 @@
 				'value'   => $value,
 				'charset' => $charset,
 				'length'  => $this->get_col_length( $table, $column ),
-			)
+			),
 		);
 
 		$data = $this->strip_invalid_text( $data );
@@ -3036,7 +3089,7 @@
 				. '|REPLACE(?:\s+LOW_PRIORITY|\s+DELAYED)?(?:\s+INTO)?'
 				. '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?'
 				. '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:.+?FROM)?'
-				. ')\s+((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
+		. ')\s+((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
 			return str_replace( '`', '', $maybe[1] );
 		}
 
@@ -3069,7 +3122,7 @@
 				. '|LOAD\s+DATA.*INFILE.*INTO\s+TABLE'
 				. '|(?:GRANT|REVOKE).*ON\s+TABLE'
 				. '|SHOW\s+(?:.*FROM|.*TABLE)'
-				. ')\s+\(*\s*((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
+		. ')\s+\(*\s*((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
 			return str_replace( '`', '', $maybe[1] );
 		}
 
@@ -3084,8 +3137,9 @@
 	 * @access protected
 	 */
 	protected function load_col_info() {
-		if ( $this->col_info )
+		if ( $this->col_info ) {
 			return;
+		}
 
 		if ( $this->use_mysqli ) {
 			$num_fields = mysqli_num_fields( $this->result );
@@ -3117,12 +3171,12 @@
 				$i = 0;
 				$new_array = array();
 				foreach ( (array) $this->col_info as $col ) {
-					$new_array[$i] = $col->{$info_type};
+					$new_array[ $i ] = $col->{$info_type};
 					$i++;
 				}
 				return $new_array;
 			} else {
-				return $this->col_info[$col_offset]->{$info_type};
+				return $this->col_info[ $col_offset ]->{$info_type};
 			}
 		}
 	}
@@ -3162,15 +3216,15 @@
 	 * @return false|void
 	 */
 	public function bail( $message, $error_code = '500' ) {
-		if ( !$this->show_errors ) {
+		if ( ! $this->show_errors ) {
 			if ( class_exists( 'WP_Error', false ) ) {
-				$this->error = new WP_Error($error_code, $message);
+				$this->error = new WP_Error( $error_code, $message );
 			} else {
 				$this->error = $message;
 			}
 			return false;
 		}
-		wp_die($message);
+		wp_die( $message );
 	}
 
 
@@ -3216,9 +3270,9 @@
 	public function check_database_version() {
 		global $wp_version, $required_mysql_version;
 		// Make sure the server has the required MySQL version
-		if ( version_compare($this->db_version(), $required_mysql_version, '<') ) {
+		if ( version_compare( $this->db_version(), $required_mysql_version, '<' ) ) {
 			/* translators: 1: WordPress version number, 2: Minimum required MySQL version number */
-			return new WP_Error('database_version', sprintf( __( '<strong>ERROR</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ));
+			return new WP_Error( 'database_version', sprintf( __( '<strong>ERROR</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ) );
 		}
 	}
 
@@ -3249,10 +3303,12 @@
 	public function get_charset_collate() {
 		$charset_collate = '';
 
-		if ( ! empty( $this->charset ) )
+		if ( ! empty( $this->charset ) ) {
 			$charset_collate = "DEFAULT CHARACTER SET $this->charset";
-		if ( ! empty( $this->collate ) )
+		}
+		if ( ! empty( $this->collate ) ) {
 			$charset_collate .= " COLLATE $this->collate";
+		}
 
 		return $charset_collate;
 	}
Index: src/wp-includes/wp-diff.php
===================================================================
--- src/wp-includes/wp-diff.php	(revision 40901)
+++ src/wp-includes/wp-diff.php	(working copy)
@@ -18,4 +18,4 @@
 }
 
 require( ABSPATH . WPINC . '/class-wp-text-diff-renderer-table.php' );
-require( ABSPATH . WPINC . '/class-wp-text-diff-renderer-inline.php' );
\ No newline at end of file
+require( ABSPATH . WPINC . '/class-wp-text-diff-renderer-inline.php' );
