mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
Use edit_comment cap. Props casben79. fixes #16129
git-svn-id: https://develop.svn.wordpress.org/trunk@17232 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
02b5f977c9
commit
ecfd980687
@ -32,10 +32,9 @@ function comment_exists($comment_author, $comment_date) {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function edit_comment() {
|
||||
$comment_post_ID = (int) $_POST['comment_post_ID'];
|
||||
|
||||
if (!current_user_can( 'edit_post', $comment_post_ID ))
|
||||
wp_die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.' ) );
|
||||
if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) )
|
||||
wp_die ( __( 'You are not allowed to edit comments on this post.' ) );
|
||||
|
||||
$_POST['comment_author'] = $_POST['newcomment_author'];
|
||||
$_POST['comment_author_email'] = $_POST['newcomment_author_email'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user