Make WordPress Core


Ignore:
Timestamp:
09/07/2010 11:35:28 PM (16 years ago)
Author:
scribu
Message:

Introduce 'edit_comment' meta cap. Fixes #14520

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/comment.php

    r15132 r15596  
    6161                comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'javascript:history.go(-1)') );
    6262
    63         if ( !current_user_can('edit_post', $comment->comment_post_ID) )
    64                 comment_footer_die( __('You are not allowed to edit comments on this post.') );
     63        if ( !current_user_can( 'edit_comment', $comment_id ) )
     64                comment_footer_die( __('You are not allowed to edit this comment.') );
    6565
    6666        if ( 'trash' == $comment->comment_approved )
     
    8585        }
    8686
    87         if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
     87        if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) {
    8888                wp_redirect( admin_url('edit-comments.php?error=2') );
    8989                die();
     
    185185<?php wp_nonce_field( $nonce_action ); ?>
    186186<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
    187 <input type='hidden' name='p' value='<?php echo esc_attr($comment->comment_post_ID); ?>' />
    188187<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
    189188<input type='hidden' name='noredir' value='1' />
     
    213212        if ( !$comment = get_comment($comment_id) )
    214213                comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );
    215         if ( !current_user_can('edit_post', $comment->comment_post_ID ) )
     214        if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
    216215                comment_footer_die( __('You are not allowed to edit comments on this post.') );
    217216
Note: See TracChangeset for help on using the changeset viewer.