bbp_is_search_results()
Check if current page is a search results page
Description
Return
(bool) Is it a search page?
Source
File: bp-forums/common/template.php
function bbp_is_search_results() { global $wp_query; // Bail if search is disabled if ( ! bbp_allow_search() ) return false; // Assume false $retval = false; // Check query if ( !empty( $wp_query->bbp_search_terms ) ) $retval = true; // Check query name if ( empty( $retval ) && bbp_is_query_name( 'bbp_search_results' ) ) $retval = true; // Check $_REQUEST if ( empty( $retval ) && !empty( $_REQUEST[ bbp_get_search_rewrite_id() ] ) ) $retval = true; return (bool) apply_filters( 'bbp_is_search_results', $retval ); }
Changelog
Version | Description |
---|---|
bbPress (r4919) | 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.