bbp_get_topic_archive_title

Return the topic archive title.

Description

(string) bbp_get_topic_archive_title( (string) $title = '' ); 

Returns (string)

The topic archive title

Parameters (1)

0. $title — Optional. (string) => ''
Default text to use as title

Usage

  1. if ( !function_exists( 'bbp_get_topic_archive_title' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/topics/template.php'; 
  3.  
  4. // Default text to use as title 
  5. $title = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_get_topic_archive_title($title); 
  9.  

Defined (1)

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

/includes/topics/template.php  
  1. function bbp_get_topic_archive_title( $title = '' ) { 
  2.  
  3. // If no title was passed 
  4. if ( empty( $title ) ) { 
  5.  
  6. // Set root text to page title 
  7. if ( !empty( $page ) ) { 
  8. $title = get_the_title( $page->ID ); 
  9.  
  10. // Default to topic post type name label 
  11. } else { 
  12. $tto = get_post_type_object( bbp_get_topic_post_type() ); 
  13. $title = $tto->labels->name; 
  14.  
  15. return apply_filters( 'bbp_get_topic_archive_title', $title );