bbp_is_user_active

Checks if user is active.

Description

bbp_is_user_active( (int) $user_id = 0 ); 

Parameters (1)

0. $user_id — Optional. (int)
The user ID to check

Usage

  1. if ( !function_exists( 'bbp_is_user_active' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/users/capabilities.php'; 
  3.  
  4. // The user ID to check 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_is_user_active($user_id); 
  9.  

Defined (1)

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

/includes/users/capabilities.php  
  1. function bbp_is_user_active( $user_id = 0 ) { 
  2.  
  3. // Default to current user 
  4. if ( empty( $user_id ) && is_user_logged_in() ) 
  5. $user_id = bbp_get_current_user_id(); 
  6.  
  7. // No user to check 
  8. if ( empty( $user_id ) ) 
  9. return false; 
  10.  
  11. // Check spam 
  12. if ( bbp_is_user_spammer( $user_id ) ) 
  13. return false; 
  14.  
  15. // Check deleted 
  16. if ( bbp_is_user_deleted( $user_id ) ) 
  17. return false; 
  18.  
  19. // Assume true if not spam or deleted 
  20. return true;