bbp_get_template_part( string $slug, string $name = null )

Adds Forums theme support to any active WordPress theme

Description

Parameters

$slug

(Required)

$name

(Optional) Default null

Default value: null

Source

File: bp-forums/core/template-functions.php

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function bbp_get_template_part( $slug, $name = null ) {
 
    // Execute code for this part
    do_action( 'get_template_part_' . $slug, $slug, $name );
 
    // Setup possible parts
    $templates = array();
    if ( isset( $name ) )
        $templates[] = $slug . '-' . $name . '.php';
    $templates[] = $slug . '.php';
 
    // Allow template parst to be filtered
    $templates = apply_filters( 'bbp_get_template_part', $templates, $slug, $name );
 
    // Return the part that is found
    return bbp_locate_template( $templates, true, false );
}

Changelog

Changelog
Version Description
bbPress (r3032) 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.