WordPress.org

Make WordPress Core

Ticket #12104: 12104.diff

File 12104.diff, 1.5 KB (added by nacin, 2 years ago)
  • wp-admin/edit-comments.php

     
    88 
    99/** WordPress Administration Bootstrap */ 
    1010require_once('./admin.php'); 
    11 if ( !current_user_can('edit_posts') ) 
     11if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'moderate_comments' ) ) 
    1212        wp_die(__('Cheatin’ uh?')); 
    1313 
    1414$wp_list_table = _get_list_table('WP_Comments_List_Table'); 
  • wp-admin/menu.php

     
    8080 
    8181$awaiting_mod = wp_count_comments(); 
    8282$awaiting_mod = $awaiting_mod->moderated; 
    83 $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' ); 
    84 unset($awaiting_mod); 
     83$cap = current_user_can( 'moderate_comments' ) ? 'moderate_comments' : 'edit_posts'; 
     84$menu[25] = array( sprintf( __('Comments %s'), "<span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), $cap, 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'div' ); 
     85unset($awaiting_mod, $cap); 
    8586 
    8687$submenu[ 'edit-comments.php' ][0] = array( __('All Comments'), 'edit_posts', 'edit-comments.php' ); 
    8788