Skip to content

Commit 435ab04

Browse files
committed
Docs: add PHPDoc for rest_revision_query filter
Replace the incorrect "documented in posts-controller" cross-reference with a proper @SInCE 4.7.0 PHPDoc block. Add @see WP_REST_Posts_Controller::get_items() to the method docblock to surface the parallel relationship. Related to https://core.trac.wordpress.org/ticket/64224
1 parent 64086b2 commit 435ab04

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ protected function get_revision( $id ) {
226226
*
227227
* @since 4.7.0
228228
*
229+
* @see WP_REST_Posts_Controller::get_items()
230+
*
229231
* @param WP_REST_Request $request Full details about the request.
230232
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
231233
*/
@@ -297,7 +299,17 @@ public function get_items( $request ) {
297299
$args['update_post_meta_cache'] = false;
298300
}
299301

300-
/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
302+
/**
303+
* Filters WP_Query arguments when querying revisions via the REST API.
304+
*
305+
* Serves the same purpose as the {@see 'rest_{$this->post_type}_query'} filter in
306+
* WP_REST_Posts_Controller, but for the standalone WP_REST_Revisions_Controller.
307+
*
308+
* @since 4.7.0
309+
*
310+
* @param array $args Array of arguments for WP_Query.
311+
* @param WP_REST_Request $request The REST API request.
312+
*/
301313
$args = apply_filters( 'rest_revision_query', $args, $request );
302314
if ( ! is_array( $args ) ) {
303315
$args = array();

0 commit comments

Comments
 (0)