bbp_is_forum_edit

Check if current page is a forum edit page.

Description

bbp_is_forum_edit(); 

Usage

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

Defined (1)

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

/includes/common/template.php  
  1. function bbp_is_forum_edit() { 
  2. global $wp_query, $pagenow; 
  3.  
  4. // Assume false 
  5. $retval = false; 
  6.  
  7. // Check query 
  8. if ( !empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit === true ) ) 
  9. $retval = true; 
  10.  
  11. // Editing in admin 
  12. elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_forum_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) 
  13. $retval = true; 
  14.  
  15. return (bool) apply_filters( 'bbp_is_forum_edit', $retval );