bbp_check_forum_edit

Redirect if unathorized user is attempting to edit a forum.

Description

bbp_check_forum_edit(); 

Usage

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

Defined (1)

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

/includes/forums/functions.php  
  1. function bbp_check_forum_edit() { 
  2.  
  3. // Bail if not editing a topic 
  4. if ( !bbp_is_forum_edit() ) 
  5. return; 
  6.  
  7. // User cannot edit topic, so redirect back to reply 
  8. if ( !current_user_can( 'edit_forum', bbp_get_forum_id() ) ) { 
  9. wp_safe_redirect( bbp_get_forum_permalink() ); 
  10. exit();