Ejemplo n.º 1
0
/**
 * Run the search query
 *
 * @since bbPress (r4579)
 *
 * @param mixed $new_args New arguments
 * @uses bbp_get_search_query_args() To get the search query args
 * @uses bbp_parse_args() To parse the args
 * @uses bbp_has_search_results() To make the search query
 * @return bool False if no results, otherwise if search results are there
 */
function bbp_search_query($new_args = array())
{
    // Existing arguments
    $query_args = bbp_get_search_query_args();
    // Merge arguments
    if (!empty($new_args)) {
        $new_args = bbp_parse_args($new_args, array(), 'search_query');
        $query_args = array_merge($query_args, $new_args);
    }
    return bbp_has_search_results($query_args);
}
<div id="bbpress-forums">

	<?php 
bbp_breadcrumb();
?>

	<?php 
bbp_set_query_name('bbp_search');
?>

	<?php 
do_action('bbp_template_before_search');
?>

	<?php 
if (bbp_has_search_results()) {
    ?>

		 <?php 
    bbp_get_template_part('loop', 'search');
    ?>


	<?php 
} elseif (bbp_get_search_terms()) {
    ?>

		 <?php 
    bbp_get_template_part('feedback', 'no-search');
    ?>