bp_core_get_directory_page_id( string|null $component = null )

Get the page ID corresponding to a component directory.


Description Description


Parameters Parameters

$component

(Optional) The slug representing the component. Defaults to the current component.

Default value: null


Top ↑

Return Return

(int|false) The ID of the directory page associated with the component. False if none is found.


Top ↑

Source Source

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

function bp_core_get_directory_page_id( $component = null ) {
	if ( ! $component ) {
		$component = bp_current_component();
	}

	$bp_pages = bp_core_get_directory_page_ids( 'all' );

	$page_id = false;
	if ( $component && isset( $bp_pages[ $component ] ) ) {
		$page_id = (int) $bp_pages[ $component ];
	}

	return $page_id;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.