Don't show Add New and Comments admin bar menus in network or user admins. Add tooltip to comments menu. Props ocean90. fixes #19327
git-svn-id: https://develop.svn.wordpress.org/trunk@19398 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
613a83c006
commit
1ae56f59eb
@ -516,8 +516,9 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
|
|||||||
|
|
||||||
$awaiting_mod = wp_count_comments();
|
$awaiting_mod = wp_count_comments();
|
||||||
$awaiting_mod = $awaiting_mod->moderated;
|
$awaiting_mod = $awaiting_mod->moderated;
|
||||||
|
$awaiting_title = sprintf( _n( '%s comment awaiting moderation', '%s comments awaiting moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
|
||||||
|
|
||||||
$icon = "<div class='ab-comments-icon'>";
|
$icon = "<div class='ab-comments-icon' title='$awaiting_title'>";
|
||||||
$icon .= "<div class='ab-comments-icon-body'></div>";
|
$icon .= "<div class='ab-comments-icon-body'></div>";
|
||||||
$icon .= "<div class='ab-comments-icon-arrow'></div>";
|
$icon .= "<div class='ab-comments-icon-arrow'></div>";
|
||||||
$icon .= "</div>";
|
$icon .= "</div>";
|
||||||
|
@ -259,8 +259,10 @@ class WP_Admin_Bar {
|
|||||||
add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 40 );
|
add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 40 );
|
||||||
|
|
||||||
// Content related.
|
// Content related.
|
||||||
|
if ( ! is_network_admin() && ! is_user_admin() ) {
|
||||||
add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
|
add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
|
||||||
add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 );
|
add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 );
|
||||||
|
}
|
||||||
add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );
|
add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );
|
||||||
add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 90 );
|
add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 90 );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user