bp_core_get_total_users_sql

  • apply_filters( 'bp_core_get_total_users_sql', join( ' ', (array)$sql ), $sql )

    Source Reference:

    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-classes.php :: Trac Source Line: 334
      		if ( !empty( $sql['select_alpha'] ) )
      			unset( $sql['select_alpha'] );
      
      		if ( !empty( $sql['pagination'] ) )
      			unset( $sql['pagination'] );
      
      		array_unshift( $sql, "SELECT COUNT(DISTINCT u.ID)" );
      
      		// Get total user results
      		$total_users_sql = apply_filters( 'bp_core_get_total_users_sql', join( ' ', (array)$sql ), $sql );
      		$total_users     = $wpdb->get_var( $total_users_sql );
      
      		/***
      		 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.
      		 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
      		 */
      		if ( !empty( $populate_extras ) ) {
      			$user_ids = array();
      
      			foreach ( (array)$paged_users as $user )
      

Comments are closed.