Support » Fixing WordPress » Prevent a post's author from commenting

  • Resolved ntoqiakt

    (@ntoqiakt)


    Hi all,

    I’m working on a site where I have a group of users just with read and edit_post capability. Their posts are checked and published by their category admins who also moderate the comments.

    I noticed though that once the post was published the authors could go back and comment without moderation. Is there a way to prevent this from happening? Ie, require moderation even for the post authors?

    Thanks

Viewing 1 replies (of 1 total)
  • ntoqiakt

    (@ntoqiakt)

    I guess my title wasn’t very accurate… however after lots of a searching I managed to find the solution. All credit goes to housebg for posting the solution here:

    Comment Moderation Issue – need help

    I’ll add it here just in case it helps anyone:

    add_filter('pre_comment_approved', 'xko_pre_comment_approved', null, 2);
    function xko_pre_comment_approved($approved, $commentdata)
    {
        $approved = 0;
    
      return $approved;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Prevent a post's author from commenting’ is closed to new replies.