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 |
---|---|
74 | * Filters the query arguments for a search request. |
75 | * |
76 | * Enables adding extra arguments or setting defaults for a post search request. |
77 | * |
78 | * @since 5.1.0 |
79 | * |
80 | * @param array $query_args Key value array of query var to query value. |
81 | * @param WP_REST_Request $request The request used. |
82 | */ |
83 | $query_args = apply_filters( 'rest_post_search_query', $query_args, $request ); |
84 |
|
85 | $query = new WP_Query(); |
86 | $found_ids = $query->query( $query_args ); |
87 | $total = $query->found_posts; |
88 |
|
89 | return array( |
90 | self::RESULT_IDS => $found_ids, |
91 | self::RESULT_TOTAL => $total, |
92 | ); |