bp_is_current_component_core()

Is the current component an active core component?

Description

Use this function when you need to check if the current component is an active core component of BuddyPress. If the current component is inactive, it will return false. If the current component is not part of BuddyPress core, it will return false. If the current component is active, and is part of BuddyPress core, it will return true.

Return

(bool) True if the current component is active and is one of BP's packaged components.

Source

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

function bp_is_current_component_core() {
	$retval = false;

	foreach ( bp_core_get_packaged_component_ids() as $active_component ) {
		if ( bp_is_current_component( $active_component ) ) {
			$retval = true;
			break;
		}
	}

	return $retval;
}

Changelog

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