WordPress.org

Make WordPress Core

Ticket #19372: 19372.patch

File 19372.patch, 753 bytes (added by johnbillion, 6 years ago)
  • wp-admin/menu.php

     
    7878        }
    7979        unset($tax);
    8080
    81 $awaiting_mod = wp_count_comments();
    82 $awaiting_mod = $awaiting_mod->moderated;
     81$awaiting_mod = 0;
     82
     83if ( current_user_can( 'edit_posts' ) ) {
     84        $awaiting_mod = wp_count_comments();
     85        $awaiting_mod = $awaiting_mod->moderated;
     86}
     87
    8388$menu[25] = array( sprintf( __('Comments %s'), "<span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'div' );
    8489unset($awaiting_mod);
    8590