WordPress.org

Make WordPress Core

Changeset 19398


Ignore:
Timestamp:
11/22/2011 04:19:05 PM (7 years ago)
Author:
ryan
Message:

Don't show Add New and Comments admin bar menus in network or user admins. Add tooltip to comments menu. Props ocean90. fixes #19327

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r19373 r19398  
    517517    $awaiting_mod = wp_count_comments();
    518518    $awaiting_mod = $awaiting_mod->moderated;
    519 
    520     $icon  = "<div class='ab-comments-icon'>";
     519    $awaiting_title = sprintf( _n( '%s comment awaiting moderation', '%s comments awaiting moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
     520
     521    $icon  = "<div class='ab-comments-icon' title='$awaiting_title'>";
    521522    $icon .= "<div class='ab-comments-icon-body'></div>";
    522523    $icon .= "<div class='ab-comments-icon-arrow'></div>";
  • trunk/wp-includes/class-wp-admin-bar.php

    r19390 r19398  
    260260
    261261        // Content related.
    262         add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
    263         add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 );
     262        if ( ! is_network_admin() && ! is_user_admin() ) {
     263            add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
     264            add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 );
     265        }
    264266        add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );
    265267        add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 90 );
Note: See TracChangeset for help on using the changeset viewer.