WordPress.org

Make WordPress Core

Changeset 16952


Ignore:
Timestamp:
12/15/10 16:48:06 (3 years ago)
Author:
nacin
Message:

Admin bar blogname handling improvements. Kill visible property vestige. props ocean90, fixes #15308.

File:
1 edited

Legend:

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

    r16934 r16952  
    115115        $blavatar = '<img src="' . esc_url($default) . '" alt="' . esc_attr__( 'Blavatar' ) . '" width="16" height="16" class="blavatar"/>'; 
    116116 
    117         $marker = ''; 
    118         if ( strlen($blog->blogname) > 18 ) 
    119             $marker = '...'; 
    120  
    121         if ( empty( $blog->blogname ) ) 
    122             $blogname = $blog->domain; 
    123         else 
    124             $blogname = substr( $blog->blogname, 0, 18 ) . $marker; 
    125  
    126         if ( ! isset( $blog->visible ) || $blog->visible === true ) { 
    127             $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname,  'href' => get_admin_url($blog->userblog_id), ) ); 
    128             $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-d', 'title' => __( 'Dashboard' ), 'href' => get_admin_url($blog->userblog_id), ) ); 
    129  
    130             if ( current_user_can_for_blog( $blog->userblog_id, 'edit_posts' ) ) { 
    131                 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => get_admin_url($blog->userblog_id, 'post-new.php'), ) ); 
    132                 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url($blog->userblog_id, 'edit-comments.php'), ) ); 
    133             } 
    134  
    135             $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url($blog->userblog_id), ) ); 
     117        $blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname; 
     118        if ( strlen( $blogname ) > 15 ) 
     119            $blogname = substr( $blogname, 0, 15 ) . '&hellip;'; 
     120 
     121        $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname,  'href' => get_admin_url($blog->userblog_id), ) ); 
     122        $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-d', 'title' => __( 'Dashboard' ), 'href' => get_admin_url($blog->userblog_id), ) ); 
     123 
     124        if ( current_user_can_for_blog( $blog->userblog_id, 'edit_posts' ) ) { 
     125            $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => get_admin_url($blog->userblog_id, 'post-new.php'), ) ); 
     126            $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url($blog->userblog_id, 'edit-comments.php'), ) ); 
    136127        } 
     128 
     129        $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url($blog->userblog_id), ) ); 
    137130    } 
    138131} 
Note: See TracChangeset for help on using the changeset viewer.