bp_current_component()

Return the name of the current component.

Description

Return

(string) Component name.

Source

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

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.