Index: admin-bar.php
===================================================================
--- admin-bar.php	(revision 29094)
+++ admin-bar.php	(working copy)
@@ -18,8 +18,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( ABSPATH . WPINC . '/class-wp-admin-bar.php' );
@@ -34,10 +35,11 @@
 	 * @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
+	} else {
 		return false;
+	}
 
 	$wp_admin_bar->initialize();
 	$wp_admin_bar->add_menus();
@@ -62,8 +64,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 false;
+	}
 
 	/**
 	 * Load all necessary admin bar items.
@@ -184,8 +187,9 @@
 	$current_user = wp_get_current_user();
 	$profile_url  = get_edit_profile_url( $user_id );
 
-	if ( ! $user_id )
+	if ( ! $user_id ) {
 		return;
+	}
 
 	$avatar = get_avatar( $user_id, 26 );
 	$howdy  = sprintf( __('Howdy, %1$s'), $current_user->display_name );
@@ -215,8 +219,9 @@
 	$current_user = wp_get_current_user();
 	$profile_url  = get_edit_profile_url( $user_id );
 
-	if ( ! $user_id )
+	if ( ! $user_id ) {
 		return;
+	}
 
 	$wp_admin_bar->add_group( array(
 		'parent' => 'my-account',
@@ -261,17 +266,20 @@
  */
 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() && ! is_super_admin() )
+	if ( ! is_user_member_of_blog() && ! is_super_admin() ) {
 		return;
+	}
 
 	$blogname = get_bloginfo('name');
 
-	if ( empty( $blogname ) )
+	if ( empty( $blogname ) ) {
 		$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
+	}
 
 	if ( is_network_admin() ) {
 		$blogname = sprintf( __('Network Admin: %s'), esc_html( get_current_site()->site_name ) );
@@ -330,12 +338,14 @@
  */
 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 && ! is_super_admin() )
+	if ( count( $wp_admin_bar->user->blogs ) < 1 && ! is_super_admin() ) {
 		return;
+	}
 
 	$wp_admin_bar->add_menu( array(
 		'id'    => 'my-sites',
@@ -459,8 +469,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 ) . '" />';
 
@@ -524,8 +535,9 @@
 	} 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 ) )
@@ -563,37 +575,45 @@
 
 	$cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' );
 
-	if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->create_posts ) )
+	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' ) )
+	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' ) )
+	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 ) )
+	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' ) || current_user_can( 'promote_users' ) )
+	if ( current_user_can( 'create_users' ) || current_user_can( 'promote_users' ) ) {
 		$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>';
 
@@ -626,8 +646,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;
@@ -654,11 +675,13 @@
 function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
 	$wp_admin_bar->add_group( array( 'parent' => 'site-name', 'id' => 'appearance' ) );
 
-	if ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) )
+	if ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) ) {
 		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) );
+	}
 
-	if ( ! current_user_can( 'edit_theme_options' ) )
+	if ( ! current_user_can( 'edit_theme_options' ) ) {
 		return;
+	}
 
 	$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
 	$wp_admin_bar->add_menu( array(
@@ -672,17 +695,21 @@
 	) );
 	add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );
 
-	if ( current_theme_supports( 'widgets' )  )
+	if ( current_theme_supports( 'widgets' )  ) {
 		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );
+	}
 
-	if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
+	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' ) )
+	if ( current_theme_supports( 'custom-background' ) ) {
 		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) );
+	}
 
-	if ( current_theme_supports( 'custom-header' ) )
+	if ( current_theme_supports( 'custom-header' ) ) {
 		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) );
+	}
 }
 
 /**
@@ -696,8 +723,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>';
@@ -720,8 +748,9 @@
  * @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" />';
@@ -816,12 +845,14 @@
 	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;
+	}
 
 	// 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 ) {
@@ -859,8 +890,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;
 }
