bp_registration_get_pending_users

Get our pending users.

Description

(array) bp_registration_get_pending_users( (int) $start_from = 0 ); 

Returns (array)

Array of user ID objects or empty array.

Parameters (1)

0. $start_from — Optional. (int)
Offset to start from with our paging of pending users.

Usage

  1. if ( !function_exists( 'bp_registration_get_pending_users' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-registration-options/includes/admin.php'; 
  3.  
  4. // Offset to start from with our paging of pending users. 
  5. $start_from = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_registration_get_pending_users($start_from); 
  9.  

Defined (1)

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

/includes/admin.php  
  1. function bp_registration_get_pending_users( $start_from = 0 ) { 
  2. global $wpdb; 
  3.  
  4. $sql = " 
  5. SELECT u.ID AS user_id 
  6. FROM " . $wpdb->users . " AS u 
  7. INNER JOIN " . $wpdb->usermeta . " AS um 
  8. WHERE u.ID = um.user_id 
  9. AND um.meta_key = %s 
  10. AND meta_value = %s 
  11. ORDER BY u.user_registered 
  12. LIMIT %d, 20"; 
  13.  
  14. $results = $wpdb->get_results( $wpdb->prepare( $sql, '_bprwg_is_moderated', 'true', $start_from ) ); 
  15.  
  16. /** 
  17. * Filters the results of the pending users. 
  18. * @since 4.3.0 
  19. * @param array $results Array of found pending users. 
  20. */ 
  21. $results = apply_filters( 'bpro_hook_get_pending_users', $results ); 
  22.  
  23. return ( ! empty( $results ) ) ? $results : array();