Filters WP_Query arguments when querying posts via the REST API.
The dynamic portion of the hook name, $this->post_type, refers to the post type slug.
Possible hook names include:
rest_post_queryrest_page_queryrest_attachment_queryEnables adding extra arguments or setting defaults for a post collection request.
$argsarray
$requestWP_REST_Request
$args = apply_filters( "rest_{$this->post_type}_query", $args, $request );
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_this-post_type_query