bp_get_search_placeholder( string $component = '' )
Get the placeholder text for the search box for a given component.
Description Description
Parameters Parameters
- $component
-
(Optional) Component name. Defaults to current component.
Default value: ''
Return Return
(string) Placeholder text for the search field.
Source Source
File: bp-core/bp-core-template.php
function bp_get_search_placeholder( $component = '' ) {
$query_arg = bp_core_get_component_search_query_arg( $component );
if ( $query_arg && ! empty( $_REQUEST[ $query_arg ] ) ) {
$placeholder = wp_unslash( $_REQUEST[ $query_arg ] );
} else {
$placeholder = bp_get_search_default_text( $component );
}
return $placeholder;
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |