bbp_get_topic_archive_title( string $title = '' )

Return the topic archive title

Description

Parameters

$title

(Optional) Default text to use as title

Default value: ''

Return

(string) The topic archive title

Source

File: bp-forums/topics/template.php

680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
function bbp_get_topic_archive_title( $title = '' ) {
 
    // If no title was passed
    if ( empty( $title ) ) {
 
        // Set root text to page title
        $page = bbp_get_page_by_path( bbp_get_topic_archive_slug() );
        if ( !empty( $page ) ) {
            $title = get_the_title( $page->ID );
 
        // Default to topic post type name label
        } else {
            $tto    = get_post_type_object( bbp_get_topic_post_type() );
            $title  = $tto->labels->name;
        }
    }
 
    return apply_filters( 'bbp_get_topic_archive_title', $title );
}

Changelog

Changelog
Version Description
bbPress (r3249) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.