On this page
apply_filters( "rest_query_var-{$key}", string $value )
Filters the query_vars used in get_items() for the constructed query.
Description
The dynamic portion of the hook name, $key, refers to the query_var key.
Parameters
$valuestring-
The query_var value.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php. View all references
$query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
Related
Used By
| Used By | Description |
|---|---|
| WP_REST_Revisions_Controller::prepare_items_query() wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Determines the allowed query_vars for a get_items() response and prepares them for WP_Query. |
| WP_REST_Posts_Controller::prepare_items_query() wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Determines the allowed query_vars for a get_items() response and prepares them for WP_Query. |
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_query_var-key