bbp_current_user_can_publish_replies

Check if the current user can publish replies.

Description

bbp_current_user_can_publish_replies(); 

Usage

  1. if ( !function_exists( 'bbp_current_user_can_publish_replies' ) ) { 
  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_replies(); 
  7.  

Defined (1)

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

/includes/users/template.php  
  1. function bbp_current_user_can_publish_replies() { 
  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. // Do not allow anonymous if not enabled 
  11. } elseif ( !is_user_logged_in() && bbp_allow_anonymous() ) { 
  12. $retval = true; 
  13.  
  14. // User is logged in 
  15. } elseif ( current_user_can( 'publish_replies' ) ) { 
  16. $retval = true; 
  17.  
  18. // Allow access to be filtered 
  19. return (bool) apply_filters( 'bbp_current_user_can_publish_replies', $retval );