Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ protected function get_revision( $id ) {
*
* @since 4.7.0
*
* @see WP_REST_Posts_Controller::get_items()
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
Expand Down Expand Up @@ -297,7 +299,17 @@ public function get_items( $request ) {
$args['update_post_meta_cache'] = false;
}

/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
/**
* Filters WP_Query arguments when querying revisions via the REST API.
*
* 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.
*
* @since 4.7.0
*
* @param array $args Array of arguments for WP_Query.
* @param WP_REST_Request $request The REST API request.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param WP_REST_Request $request The REST API request.
* @param WP_REST_Request $request Request used to generate the response.

*/
$args = apply_filters( 'rest_revision_query', $args, $request );
if ( ! is_array( $args ) ) {
$args = array();
Expand Down
Loading