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
This commit is contained in:
parent
8c091940a3
commit
8cc6732b03
|
@ -270,8 +270,9 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) {
|
||||||
|
|
||||||
$blogname = get_bloginfo('name');
|
$blogname = get_bloginfo('name');
|
||||||
|
|
||||||
if ( empty( $blogname ) )
|
if ( ! $blogname ) {
|
||||||
$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
|
$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
|
||||||
|
}
|
||||||
|
|
||||||
if ( is_network_admin() ) {
|
if ( is_network_admin() ) {
|
||||||
$blogname = sprintf( __('Network Admin: %s'), esc_html( get_current_site()->site_name ) );
|
$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 = '<div class="blavatar"></div>';
|
$blavatar = '<div class="blavatar"></div>';
|
||||||
|
|
||||||
$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;
|
$menu_id = 'blog-' . $blog->userblog_id;
|
||||||
|
|
||||||
$wp_admin_bar->add_menu( array(
|
$wp_admin_bar->add_menu( array(
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue