apply_filters( 'rest_revision_query', array $args, WP_REST_Request $request )
- Since
- 5.0.0
Filters WP_Query arguments when querying revisions via the REST API.
Description
Serves the same purpose as the {@see 'rest_{$this->post_type}_query'} filter in WP_REST_Posts_Controller, but for the standalone WP_REST_Revisions_Controller.
Compatibility
- WordPress
- since 5.0.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$argsarray- Array of arguments for WP_Query.
$requestWP_REST_Request- The REST API request.
Where this hook fires · 1
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php:313WP_REST_Revisions_Controller::get_items()
Source code
* * @since 5.0.0 * * @param array $args Array of arguments for WP_Query. * @param WP_REST_Request $request The REST API request. */ $args = apply_filters( 'rest_revision_query', $args, $request ); if ( ! is_array( $args ) ) { $args = array(); } $query_args = $this->prepare_items_query( $args, $request ); $revisions_query = new WP_Query();Changelog
Introduced in 5.0.0. 2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Parameter
$args added.verified against source7.0.4
Parameter
$request added.verified against source5.0.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.