bbp_get_forum_archive_title( string $title = '' )

Return the forum archive title

Description

Parameters

$title

(Optional) Default text to use as title

Default value: ''

Return

(string) The forum archive title

Source

File: bp-forums/forums/template.php

442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
function bbp_get_forum_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_root_slug() );
        if ( !empty( $page ) ) {
            $title = get_the_title( $page->ID );
 
        // Default to forum post type name label
        } else {
            $fto    = get_post_type_object( bbp_get_forum_post_type() );
            $title  = $fto->labels->name;
        }
    }
 
    return apply_filters( 'bbp_get_forum_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.