bbp_is_topic_tag_edit

Check if the current page is editing a topic tag.

Description

bbp_is_topic_tag_edit(); 

Usage

  1. if ( !function_exists( 'bbp_is_topic_tag_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_topic_tag_edit(); 
  7.  

Defined (1)

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

/includes/common/template.php  
  1. function bbp_is_topic_tag_edit() { 
  2. global $wp_query, $pagenow, $taxnow; 
  3.  
  4. // Bail if topic-tags are off 
  5. if ( ! bbp_allow_topic_tags() ) 
  6. return false; 
  7.  
  8. // Assume false 
  9. $retval = false; 
  10.  
  11. // Check query 
  12. if ( !empty( $wp_query->bbp_is_topic_tag_edit ) && ( true === $wp_query->bbp_is_topic_tag_edit ) ) 
  13. $retval = true; 
  14.  
  15. // Editing in admin 
  16. elseif ( is_admin() && ( 'edit-tags.php' === $pagenow ) && ( bbp_get_topic_tag_tax_id() === $taxnow ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) 
  17. $retval = true; 
  18.  
  19. return (bool) apply_filters( 'bbp_is_topic_tag_edit', $retval );