WordPress.org

Make WordPress Core

Ticket #12104: moderate_comments.diff

File moderate_comments.diff, 1.8 KB (added by sillybean, 4 years ago)

this gets the user to the page, but they still can't actually approve a held comment

  • wp-admin/edit-comments.php

     
    99/** WordPress Administration Bootstrap */ 
    1010require_once('admin.php'); 
    1111 
    12 if ( !current_user_can('edit_posts') ) 
     12if ( !current_user_can('moderate_comments') ) 
    1313        wp_die(__('Cheatin’ uh?')); 
    1414 
    1515wp_enqueue_script('admin-comments'); 
     
    4141        foreach ($comment_ids as $comment_id) { // Check the permissions on each 
    4242                $_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) ); 
    4343 
    44                 if ( !current_user_can('edit_post', $_post_id) ) 
     44                if ( !current_user_can('moderate_comments', $_post_id) ) 
    4545                        continue; 
    4646 
    4747                switch( $doaction ) { 
  • wp-admin/menu.php

     
    7474        /* translators: add new page */ 
    7575        $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' ); 
    7676 
    77 $menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top', 'menu-comments', 'div' ); 
     77$menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'moderate_comments', 'edit-comments.php', '', 'menu-top', 'menu-comments', 'div' ); 
    7878 
    7979$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group 
    8080