bbp_current_user_can_publish_forums

Check if the current user can publish forums.

Description

bbp_current_user_can_publish_forums(); 

Usage

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

Defined (1)

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

/includes/users/template.php  
  1. function bbp_current_user_can_publish_forums() { 
  2.  
  3. // Users need to earn access 
  4. $retval = false; 
  5.  
  6. // Always allow keymasters 
  7. if ( bbp_is_user_keymaster() ) { 
  8. $retval = true; 
  9.  
  10. // User is logged in 
  11. } elseif ( current_user_can( 'publish_forums' ) ) { 
  12. $retval = true; 
  13.  
  14. // Allow access to be filtered 
  15. return (bool) apply_filters( 'bbp_current_user_can_publish_forums', $retval );