bbp_forum_enforce_blocked

Check if a user is blocked, or cannot spectate the forums.

Description

bbp_forum_enforce_blocked(); 

Usage

  1. if ( !function_exists( 'bbp_forum_enforce_blocked' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/users/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_forum_enforce_blocked(); 
  7.  

Defined (1)

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

/includes/users/functions.php  
  1. function bbp_forum_enforce_blocked() { 
  2.  
  3. // Bail if not logged in or keymaster 
  4. if ( ! is_user_logged_in() || bbp_is_user_keymaster() ) { 
  5. return; 
  6.  
  7. // Set 404 if in bbPress and user cannot spectate 
  8. if ( is_bbpress() && ! current_user_can( 'spectate' ) ) {