Introduce 'edit_comment' meta cap. Fixes #14520

git-svn-id: https://develop.svn.wordpress.org/trunk@15596 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu
2010-09-07 23:35:28 +00:00
parent 7845df0f09
commit b1def7dad8
6 changed files with 21 additions and 28 deletions

View File

@@ -34,9 +34,7 @@ if ( isset( $_REQUEST['doaction'] ) || isset( $_REQUEST['doaction2'] ) || isset
$redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
$_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id ) );
if ( !current_user_can( 'edit_post', $_post_id ) )
if ( !current_user_can( 'edit_comment', $comment_id ) )
continue;
switch ( $doaction ) {