Consistently handle an empty site title in Site and My Sites toolbar menus.
see #28682. git-svn-id: https://develop.svn.wordpress.org/trunk@30598 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
03cb69d8e2
commit
95ffc6e562
|
@ -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 = '<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;
|
||||
|
||||
$wp_admin_bar->add_menu( array(
|
||||
|
|
Loading…
Reference in New Issue