bbp_current_user_can_access_anonymous_user_form

Performs a series of checks to ensure the current user should see the anonymous user form fields.

Description

bbp_current_user_can_access_anonymous_user_form(); 

Usage

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

Defined (1)

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

/includes/users/template.php  
  1. function bbp_current_user_can_access_anonymous_user_form() { 
  2.  
  3. // Users need to earn access 
  4. $retval = false; 
  5.  
  6. // User is not logged in, and anonymous posting is allowed 
  7. if ( bbp_is_anonymous() ) { 
  8. $retval = true; 
  9.  
  10. // User is editing a topic, and topic is authored by anonymous user 
  11. } elseif ( bbp_is_topic_edit() && bbp_is_topic_anonymous() ) { 
  12. $retval = true; 
  13.  
  14. // User is editing a reply, and reply is authored by anonymous user 
  15. } elseif ( bbp_is_reply_edit() && bbp_is_reply_anonymous() ) { 
  16. $retval = true; 
  17.  
  18. // Allow access to be filtered 
  19. return (bool) apply_filters( 'bbp_current_user_can_access_anonymous_user_form', (bool) $retval );