• Resolved baedyllion

    (@baedyllion)


    Hello,
    is it possible to prevent post authors from commenting on their own posts?
    Thanks.
    Cheers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support gVectors Support

    (@gvectorssupport)

    Hi baedyllion,

    You can do it using the wpdiscuz_form_render hook. More info here: https://wpdiscuz.com/docs/codex/filters/wpdiscuz_form_render/

    Thread Starter baedyllion

    (@baedyllion)

    hello, thank you for the reply.
    I’m content with the plugin, especially with the private comments. but I also need this feature, so I’m trying to figure out how I can manage this. I’m not a coder myself, so It’s a bit difficult for me to figure out. I’d really appreciate If you could direct me in the right direction. I tried the code below but didnt get any luck. It closed the comments for everybody, not just for post author. What am I doing wrong ? Thanks in advance. Cheers.

    add_filter(“wpdiscuz_form_render”, function ($output, $commentsCount, $currentUser) {
    if ($currentUser->ID = $post->post_author) {
    $open = false;
    }

    }, 10, 3);

    Plugin Support gVectors Support

    (@gvectorssupport)

    @baedyllion,

    Please use this code:

    add_filter("wpdiscuz_form_render", function ($output, $commentsCount, $currentUser) {
        global $post;
       if ($currentUser->ID == $post->post_author) {
          $output = "";
       }
       return $output;
    }, 10, 3);
    Thread Starter baedyllion

    (@baedyllion)

    Hello,

    thank you very much for the solution. It worked perfectly.I appreciate the help a lot. Great work.

    Have a nice day.

    Cheers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘is it possible to prevent post authors from commenting on their own posts?’ is closed to new replies.