bbp_get_search_url( $default = true )
Return the search url
Description
Return
(string) Search url
Source
File: bp-forums/search/template.php
function bbp_get_search_url( $default = true ) {
global $wp_rewrite;
// Pretty permalinks
if ( $wp_rewrite->using_permalinks() ) {
$url = $wp_rewrite->root . bbp_get_search_slug();
$url = home_url( user_trailingslashit( $url ) );
// Unpretty permalinks
} else {
$url = add_query_arg( array( bbp_get_search_rewrite_id() => '' ), home_url( '/' ) );
}
if ( true === $default ) {
return apply_filters( 'bbp_get_search_url', add_query_arg( 'bp_search', 1, $url ) );
} else {
return apply_filters( 'bbp_get_search_url', $url );
}
}
Changelog
| Version | Description |
|---|---|
| bbPress (r4579) | 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.