bbp_is_user_keymaster

Checks if user is a keymaster.

Description

bbp_is_user_keymaster( (int) $user_id = 0 ); 

Parameters (1)

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

Usage

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

Defined (1)

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

/includes/users/capabilities.php  
  1. function bbp_is_user_keymaster( $user_id = 0 ) { 
  2.  
  3. // Default to current user ID if none is passed 
  4. $_user_id = (int) ! empty( $user_id ) ? $user_id : bbp_get_current_user_id(); 
  5.  
  6. // Filter and return 
  7. return (bool) apply_filters( 'bbp_is_user_keymaster', user_can( $_user_id, 'keep_gate' ), $_user_id, $user_id );