Changeset 4919
- Timestamp:
- 05/19/2013 05:09:29 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/template-tags.php
r4880 r4919 806 806 807 807 // Check $_GET 808 if ( empty( $retval ) && isset( $_ GET[bbp_get_search_rewrite_id()] ) )808 if ( empty( $retval ) && isset( $_REQUEST[ bbp_get_search_rewrite_id() ] ) && empty( $_REQUEST[ bbp_get_search_rewrite_id() ] ) ) 809 809 $retval = true; 810 810 811 811 return (bool) apply_filters( 'bbp_is_search', $retval ); 812 } 813 814 /** 815 * Check if current page is a search results page 816 * 817 * @since bbPress (r4919) 818 * 819 * @global WP_Query $wp_query To check if WP_Query::bbp_is_search is true 820 * @uses bbp_is_query_name() To get the query name 821 * @return bool Is it a search page? 822 */ 823 function bbp_is_search_results() { 824 global $wp_query; 825 826 // Assume false 827 $retval = false; 828 829 // Check query 830 if ( !empty( $wp_query->bbp_is_search_results ) && ( true == $wp_query->bbp_is_search_results ) ) 831 $retval = true; 832 833 // Check query name 834 if ( empty( $retval ) && bbp_is_query_name( 'bbp_search_results' ) ) 835 $retval = true; 836 837 // Check $_REQUEST 838 if ( empty( $retval ) && !empty( $_REQUEST[bbp_get_search_rewrite_id()] ) ) 839 $retval = true; 840 841 return (bool) apply_filters( 'bbp_is_search_results', $retval ); 812 842 } 813 843 … … 958 988 $bbp_classes[] = 'bbp-search'; 959 989 $bbp_classes[] = 'forum-search'; 990 991 } elseif ( bbp_is_search_results() ) { 992 $bbp_classes[] = 'bbp-search-results'; 993 $bbp_classes[] = 'forum-search-results'; 960 994 } 961 995 … … 1074 1108 1075 1109 } elseif ( bbp_is_search() ) { 1110 $retval = true; 1111 1112 } elseif ( bbp_is_search_results() ) { 1076 1113 $retval = true; 1077 1114 }
Note: See TracChangeset
for help on using the changeset viewer.