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 |
---|---|
49 | * Filters the query arguments for a search request. |
50 | * |
51 | * Enables adding extra arguments or setting defaults for a post format search request. |
52 | * |
53 | * @since 5.6.0 |
54 | * |
55 | * @param array $query_args Key value array of query var to query value. |
56 | * @param WP_REST_Request $request The request used. |
57 | */ |
58 | $query_args = apply_filters( 'rest_post_format_search_query', $query_args, $request ); |
59 |
|
60 | $found_ids = array(); |
61 | foreach ( $format_slugs as $index => $format_slug ) { |
62 | if ( ! empty( $query_args['search'] ) ) { |
63 | $format_string = get_post_format_string( $format_slug ); |
64 | $format_slug_match = stripos( $format_slug, $query_args['search'] ) !== false; |
65 | $format_string_match = stripos( $format_string, $query_args['search'] ) !== false; |
66 | if ( ! $format_slug_match && ! $format_string_match ) { |
67 | continue; |