WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
72 | * Filters the query arguments for a search request. |
73 | * |
74 | * Enables adding extra arguments or setting defaults for a post search request. |
75 | * |
76 | * @since 5.1.0 |
77 | * |
78 | * @param array $query_args Key value array of query var to query value. |
79 | * @param WP_REST_Request $request The request used. |
80 | */ |
81 | $query_args = apply_filters( 'rest_post_search_query', $query_args, $request ); |
82 |
|
83 | $query = new WP_Query(); |
84 | $found_ids = $query->query( $query_args ); |
85 | $total = $query->found_posts; |
86 |
|
87 | return array( |
88 | self::RESULT_IDS => $found_ids, |
89 | self::RESULT_TOTAL => $total, |
90 | ); |