bp_current_component()

Return the name of the current component.

Description

Return

(string) Component name.

Source

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

1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
function bp_current_component() {
    $bp                = buddypress();
    $current_component = !empty( $bp->current_component )
        ? $bp->current_component
        : false;
 
    /**
     * Filters the name of the current component.
     *
     * @since BuddyPress 1.0.0
     *
     * @param string|bool $current_component Current component if available or false.
     */
    return apply_filters( 'bp_current_component', $current_component );
}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 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.