bp_get_forum_topic_type

Return the currently viewed topic list type.

Description

(string) bp_get_forum_topic_type(); 

Eg, newest,, popular, etc.

Returns (string)

Type of the currently viewed topic list.


Usage

  1. if ( !function_exists( 'bp_get_forum_topic_type' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_forum_topic_type(); 
  7.  

Defined (1)

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

/bp-forums/bp-forums-template.php  
  1. function bp_get_forum_topic_type() { 
  2.  
  3. if ( !bp_is_directory() || !bp_current_action() ) 
  4. return 'newest'; 
  5.  
  6. /** 
  7. * Filters the currently viewed topic list type. 
  8. * Eg, 'newest', 'popular', etc. 
  9. * @since 1.1.0 
  10. * @param string $value Currently viewed topic list type. 
  11. */