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
885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 | 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.