Changeset 5468 for trunk/src/includes/search/template.php
- Timestamp:
- 09/08/2014 03:38:41 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/search/template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/search/template.php
r5466 r5468 44 44 /** Defaults **************************************************************/ 45 45 46 $default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() ); 46 $default_search_terms = bbp_get_search_terms(); 47 $default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() ); 47 48 48 49 // Default query args … … 53 54 'orderby' => 'date', // Sorted by date 54 55 'order' => 'DESC', // Most recent first 55 'ignore_sticky_posts' => true, // Stickies not supported 56 's' => bbp_get_search_terms(), // This is a search 56 'ignore_sticky_posts' => true // Stickies not supported 57 57 ); 58 59 // Only set 's' if search terms exist 60 // https://bbpress.trac.wordpress.org/ticket/2607 61 if ( false !== $default_search_terms ) { 62 $default['s'] = $default_search_terms; 63 } 58 64 59 65 // What are the default allowed statuses (based on user caps) … … 89 95 $bbp = bbpress(); 90 96 91 // Call the query97 // Only call the search query if 's' is not empty 92 98 if ( ! empty( $r['s'] ) ) { 93 99 $bbp->search_query = new WP_Query( $r );
Note: See TracChangeset
for help on using the changeset viewer.