rest_post_format_search_query filter-hookWP 5.6.0

Filters the query arguments for a REST API search request.

Enables adding extra arguments or setting defaults for a post format search request.


add_filter( 'rest_post_format_search_query', 'wp_kama_rest_post_format_search_query_filter', 10, 2 );

 * Function for `rest_post_format_search_query` filter-hook.
 * @param array           $query_args Key value array of query var to query value.
 * @param WP_REST_Request $request    The request used.
 * @return array
function wp_kama_rest_post_format_search_query_filter( $query_args, $request ){

	// filter...
	return $query_args;
Key value array of query var to query value.
The request used.


Since 5.6.0 Introduced.

Where the hook is called

wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php 58
$query_args = apply_filters( 'rest_post_format_search_query', $query_args, $request );

Where the hook is used in WordPress

Usage not found.