• Hello,

    How can I prevent logged in authors from voting on their own published posts to prevent biased voting. Only other loggedin users should be able to vote on his post.

    A function to hide the rating widget from logged in authors when they visit their own published posts.

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter teeboy4real

    (@teeboy4real)

    I tried the code below which seemed to work,
    Please can you validate the code thanks

    
    /* ------------------------------------------------------------------------- *
     * Remove rating widget for post author to prevent biased voting 
    /* ------------------------------------------------------------------------- */
    function rmp_hide_author_rating_widget() {
        global $post;
        if ( get_current_user_id() == $post->post_author ) {
        return false;
      }
      return true;
    }
    add_filter( 'rmp_display_rating_widget', 'rmp_hide_author_rating_widget' );
    
    
Viewing 1 replies (of 1 total)
  • The topic ‘Prevent biased self voting by post authors’ is closed to new replies.