Support » Plugin: WP Post Rating » Disable rating for authors commenting on their own post

  • Resolved dnextreme88

    (@dnextreme88)


    Is it possible to disable rating for authors who are commenting on their posts? I want them to be able to add comments but not rate their own post. I am creating a freelance hiring job website but I don’t want employers to rate their own jobs of their own posts. Is it possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dnextreme88

    (@dnextreme88)

    Since there’s no answer, I had to be independent to do it myself, albeit learning CSS and some WP functions. I placed the following code on my theme’s comments.php file:

    if (isset($_GET['replytocom']) && $current_user->ID == $post->post_author) { // Post authors can only reply to other user's comments and cannot add their own comment to posts
      comment_form($comments_args);
    } 
    if (is_user_logged_in() && $current_user->ID != $post->post_author) { // Hides the comment form from post authors to avoid them from rating their own job listings
      comment_form($comments_args);
    }
    • This reply was modified 2 months, 1 week ago by dnextreme88.
    • This reply was modified 2 months, 1 week ago by dnextreme88.
    Plugin Author shoaib88

    (@shoaib88)

    Hi,
    Again thanks and glad that you have found solution.

    I will also update my next plugin version with your provided solution.

    Thanks a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.