BB_Users_By_Role

The BuddyPress BB Users By Role class.

Defined (1)

The class is defined in the following location(s).

/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php  
  1. class BB_Users_By_Role extends BB_User_Search { 
  2. var $role = ''; 
  3. var $title = ''; 
  4.  
  5. function __construct($role = '', $page = '') { // constructor 
  6. $this->role = $role ? $role : 'member'; 
  7. $this->raw_page = ( '' == $page ) ? false : (int) $page; 
  8. $this->page = (int) ( '' == $page ) ? 1 : $page; 
  9.  
  10. $this->prepare_query(); 
  11. $this->query(); 
  12. $this->do_paging(); 
  13.  
  14. function BB_Users_By_Role($role = '', $page = '') { 
  15. $this->__construct($role, $page); 
  16.  
  17. function query() { 
  18. if ( $_results = bb_get_ids_by_role( $this->role, 0, $this->page, $this->users_per_page ) ) { 
  19. $this->results = bb_get_user($_results); 
  20. $this->total_users_for_query = bb_count_last_query(); 
  21. } else 
  22. $this->search_errors = new WP_Error( 'no_matching_users_found', __( '<strong>No matching users were found!</strong>' ) ); 
  23.  
  24. if ( is_wp_error( $this->search_errors ) ) 
  25. bb_admin_notice( $this->search_errors );