bp_core_get_paged_users_sql

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

    Source Reference:

    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-classes.php :: Trac Source Line: 313
      			case 'popular':
      				$sql[] = "ORDER BY CONVERT(um.meta_value, SIGNED) DESC";
      				break;
      		}
      
      		if ( $limit && $page )
      			$sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
      
      		// Get paginated results
      		$paged_users_sql = apply_filters( 'bp_core_get_paged_users_sql', join( ' ', (array)$sql ), $sql );
      		$paged_users     = $wpdb->get_results( $paged_users_sql );
      
      		// Re-jig the SQL so we can get the total user count
      		unset( $sql['select_main'] );
      
      		if ( !empty( $sql['select_active'] ) )
      			unset( $sql['select_active'] );
      
      		if ( !empty( $sql['select_popular'] ) )
      			unset( $sql['select_popular'] );
      

Comments are closed.