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
Return Return
(int|false) The ID of the directory page associated with the component. False if none is found.
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; }
Changelog Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |