bp_registration_get_pending_user_count

Get a count of our pending users.

Description

(integer) bp_registration_get_pending_user_count(); 

Returns (integer)

count of our current pending users


Usage

  1. if ( !function_exists( 'bp_registration_get_pending_user_count' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-registration-options/includes/admin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_registration_get_pending_user_count(); 
  7.  

Defined (1)

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

/includes/admin.php  
  1. function bp_registration_get_pending_user_count() { 
  2.  
  3. if ( false === ( $rs = get_transient( 'bpro_user_count' ) ) ) { 
  4. global $wpdb; 
  5.  
  6. $sql = "SELECT count( user_id ) AS count FROM " . $wpdb->usermeta . " WHERE meta_key = %s AND meta_value = %s"; 
  7.  
  8. $rs = $wpdb->get_col( $wpdb->prepare( $sql, '_bprwg_is_moderated', 'true' ) ); 
  9.  
  10. if ( ! empty( $rs ) ) { 
  11. set_transient( 'bpro_user_count', $rs, 60 * 5 ); 
  12.  
  13. return ( $rs ) ? $rs[0] : '0';