Excerpt long blog names when displaying them in the admin bar. fixes #18849

git-svn-id: http://svn.automattic.com/wordpress/trunk@18873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-10-03 19:58:33 +00:00
parent 6e0729790f
commit e0a7825baa

View File

@ -227,10 +227,13 @@ function wp_admin_bar_blog_front_menu( $wp_admin_bar ) {
if ( empty( $blogname ) )
$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
$title = wp_html_excerpt( $blogname, 40 );
if ( $title != $blogname )
$title = trim( $title ) . '…';
$wp_admin_bar->add_menu( array(
'id' => 'blog-name',
'title' => $blogname,
'title' => $title,
'href' => admin_url(),
) );
@ -267,9 +270,13 @@ function wp_admin_bar_blog_admin_menu( $wp_admin_bar ) {
$title = preg_replace( '#^(https?://)?(www.)?#', '', $url );
}
$title_excerpt = wp_html_excerpt( $title, 40 );
if ( $title != $title_excerpt )
$title_excerpt = trim( $title_excerpt ) . '…';
$wp_admin_bar->add_menu( array(
'id' => 'blog-name',
'title' => $title,
'title' => $title_excerpt,
'href' => $url,
) );
}