bbp_search_query( mixed $new_args = array() )

Run the search query

Description

Parameters

$new_args

(Optional) New arguments

Default value: array()

Return

(bool) False if no results, otherwise if search results are there

Source

File: bp-forums/search/functions.php

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 );
}

Changelog

Changelog
Version Description
bbPress (r4579) 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.