0

I want to prevent other authors from editing other people's comment made in their post.

Does anyone here know how to do this?

1 Answer 1

0

Try use the following code in your themes functions.php

// http://scribu.net/wordpress/prevent-blog-authors-from-editing-comments.html
function restrict_comment_editing( $caps, $cap, $user_id, $args ) { 
if ( 'edit_comment' == $cap ) {
        $comment = get_comment( $args[0] );

if ( $comment->user_id != $user_id )
        $caps[] = 'moderate_comments';
}

   return $caps;
}

add_filter( 'map_meta_cap', 'restrict_comment_editing', 10, 4 );
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.