bp_registration_is_current_user_pending

The BP Registration Options bp registration is current user pending function.

Description

bp_registration_is_current_user_pending( (int) $user_id = 0 ); 

Parameters (1)

0. $user_id — Optional. (int)
The user id.

Usage

  1. if ( !function_exists( 'bp_registration_is_current_user_pending' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-registration-options/includes/utility.php'; 
  3.  
  4. // The user id. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_registration_is_current_user_pending($user_id); 
  9.  

Defined (1)

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

/includes/utility.php  
  1. function bp_registration_is_current_user_pending( $user_id = 0 ) { 
  2.  
  3. $pending = false; 
  4.  
  5. if ( empty( $user_id ) ) { 
  6. $user_id = get_current_user_id(); 
  7.  
  8. $pending_users = bp_registration_get_pending_users(); 
  9. $pending_user_ids = wp_list_pluck( $pending_users, 'user_id' ); 
  10.  
  11. if ( in_array( $user_id, $pending_user_ids ) ) { 
  12. $pending = true; 
  13.  
  14. return $pending;