bbp_is_forum_archive

Check if we are viewing a forum archive.

Description

bbp_is_forum_archive(); 

Usage

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

Defined (1)

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

/includes/common/template.php  
  1. function bbp_is_forum_archive() { 
  2. global $wp_query; 
  3.  
  4. // Default to false 
  5. $retval = false; 
  6.  
  7. // In forum archive 
  8. if ( is_post_type_archive( bbp_get_forum_post_type() ) || bbp_is_query_name( 'bbp_forum_archive' ) || !empty( $wp_query->bbp_show_topics_on_root ) ) 
  9. $retval = true; 
  10.  
  11. return (bool) apply_filters( 'bbp_is_forum_archive', $retval );