From 8cc6732b03ef37f3781e91a433f6d27e17eb87ee Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 28 Nov 2014 08:13:24 +0000 Subject: [PATCH] Consistently handle an empty site title in Site and My Sites toolbar menus. see #28682. Built from https://develop.svn.wordpress.org/trunk@30598 git-svn-id: http://core.svn.wordpress.org/trunk@30588 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 10 ++++++++-- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 8331af5293..32853c3a14 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -270,8 +270,9 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) { $blogname = get_bloginfo('name'); - if ( empty( $blogname ) ) + if ( ! $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 ) ); @@ -402,7 +403,12 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) { $blavatar = '
'; - $blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname; + $blogname = $blog->blogname; + + if ( ! $blogname ) { + $blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() ); + } + $menu_id = 'blog-' . $blog->userblog_id; $wp_admin_bar->add_menu( array( diff --git a/wp-includes/version.php b/wp-includes/version.php index c841b6b7fd..eb70a2aa5f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-beta2-30597'; +$wp_version = '4.1-beta2-30598'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.