bp_registration_hide_pending_members

Hide members, who haven't been approved yet, on the frontend listings.

Description

(object) bp_registration_hide_pending_members( (object) $args ); 

Returns (object)

Amended arguments with IDs to exclude.

Parameters (1)

0. $args (object)
Arguments that BuddyPress will use to query for members.

Usage

  1. if ( !function_exists( 'bp_registration_hide_pending_members' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-registration-options/includes/core.php'; 
  3.  
  4. // Arguments that BuddyPress will use to query for members. 
  5. $args = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_registration_hide_pending_members($args); 
  9.  

Defined (1)

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

/includes/core.php  
  1. function bp_registration_hide_pending_members( $args ) { 
  2. global $wpdb; 
  3.  
  4. $private_network = get_option( 'bprwg_privacy_network' ); 
  5.  
  6. if ( empty( $private_network ) || ! $private_network ) { 
  7. return false; 
  8.  
  9. $ids = array(); 
  10.  
  11. $sql = "SELECT user_id FROM " . $wpdb->prefix . "usermeta WHERE meta_key = '_bprwg_is_moderated' AND meta_value = %s"; 
  12. $rs = $wpdb->get_results( $wpdb->prepare( $sql, 'true' ), ARRAY_N ); 
  13. // Grab the actual IDs. 
  14. foreach ( $rs as $key => $value ) { 
  15. $ids[] = $value[0]; 
  16.  
  17. if ( $ids ) { 
  18. $args->query_vars['exclude'] = $ids; 
  19.  
  20. return $args; 
  21.