WordPress.org

Make WordPress Core

Changeset 18873


Ignore:
Timestamp:
10/03/2011 07:58:33 PM (7 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar.php

    r18853 r18873  
    228228        $blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
    229229
     230    $title = wp_html_excerpt( $blogname, 40 );
     231    if ( $title != $blogname )
     232        $title = trim( $title ) . '…';
    230233
    231234    $wp_admin_bar->add_menu( array(
    232235        'id'    => 'blog-name',
    233         'title' => $blogname,
     236        'title' => $title,
    234237        'href'  => admin_url(),
    235238    ) );
     
    268271    }
    269272
     273    $title_excerpt = wp_html_excerpt( $title, 40 );
     274    if ( $title != $title_excerpt )
     275        $title_excerpt = trim( $title_excerpt ) . '…';
     276
    270277    $wp_admin_bar->add_menu( array(
    271278        'id'    => 'blog-name',
    272         'title' => $title,
     279        'title' => $title_excerpt,
    273280        'href'  => $url,
    274281    ) );
Note: See TracChangeset for help on using the changeset viewer.