WordPress.org

Forums

Bainternet User Ranks
[resolved] Private + public posts (2 posts)

  1. a1.paul
    Member
    Posted 2 years ago #

    Hi,
    When some of my users post private posts - something they publish but it is only visible to members, their ranking goes up.
    Is it possible to rank the users only based on their public posts?

    Cheers

    http://wordpress.org/extend/plugins/bainternet-user-ranks/

  2. a1.paul
    Member
    Posted 2 years ago #

    Found my own solution after bit of a trial and error. Had to add this 'post_status' => 'publish',

    //user post count
    	public function get_user_posts_count($user_ID){
    		$args = array('author' => $user_ID, <strong>'post_status' => 'publish', </strong>'posts_per_page' => -1);
    		$the_query = new WP_Query( $args );
    		if ($the_query->post_count > 0){
    			return $the_query->post_count;
    		}
    		else{
    			return 0;
    		}
    	}

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Bainternet User Ranks
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic