bp_get_directory_title( string $component = '' )
Get the directory title for a component.
Description Description
Used for the
Parameters Parameters
- $component
-
(Optional) Component to get directory title for.
Default value: ''
Return Return
(string)
Source Source
File: bp-core/bp-core-template.php
function bp_get_directory_title( $component = '' ) {
$title = '';
// Use the string provided by the component.
if ( isset( buddypress()->{$component}->directory_title ) && buddypress()->{$component}->directory_title ) {
$title = buddypress()->{$component}->directory_title;
// If none is found, concatenate.
} elseif ( isset( buddypress()->{$component}->name ) ) {
$title = sprintf( __( '%s Directory', 'buddypress' ), buddypress()->{$component}->name );
}
/**
* Filters the directory title for a component.
*
* @since 2.0.0
*
* @param string $title Text to be used in <title> tag.
* @param string $component Current componet being displayed.
*/
return apply_filters( 'bp_get_directory_title', $title, $component );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |