Changeset 5162
- Timestamp:
- 11/23/2013 09:23:49 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/includes/search/template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/search/template.php
r5134 r5162 86 86 $r = bbp_parse_args( $args, $default, 'has_search_results' ); 87 87 88 // Don't bother if we don't have search terms89 if ( empty( $r['s'] ) )90 return false;91 92 88 // Get bbPress 93 89 $bbp = bbpress(); 94 90 95 91 // Call the query 96 $bbp->search_query = new WP_Query( $r ); 92 if ( ! empty( $r['s'] ) ) { 93 $bbp->search_query = new WP_Query( $r ); 94 } 97 95 98 96 // Add pagination values to query object … … 103 101 $bbp->search_query->is_home = false; 104 102 105 // Found posts106 if ( !$bbp->search_query->found_posts )107 return false;108 109 103 // Only add pagination is query returned results 110 if ( (int) $bbp->search_query->found_posts && (int) $bbp->search_query->posts_per_page) {104 if ( ! empty( $bbp->search_query->found_posts ) && ! empty( $bbp->search_query->posts_per_page ) ) { 111 105 112 106 // Array of arguments to add after pagination links
Note: See TracChangeset
for help on using the changeset viewer.