Make WordPress Core

Changeset 61998


Ignore:
Timestamp:
03/12/2026 09:12:53 PM (2 weeks ago)
Author:
SergeyBiryukov
Message:

Docs: Explicitly document the rest_revision_query filter.

The rest_revision_query filter in WP_REST_Revisions_Controller::get_items() carried a cross-reference comment claiming it was documented in the posts controller. This was incorrect, as the posts controller documents rest_{$this->post_type}_query — a dynamic hook that fires only for post types managed by WP_REST_Posts_Controller.

WP_REST_Revisions_Controller extends WP_REST_Controller directly (not the posts controller), so the dynamic hook never fires for revisions. rest_revision_query is a standalone hook and has never had its own PHPDoc block.

Follow-up to [43584].

Props apermo, mukesh27, SergeyBiryukov.
See #64224.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php

    r61987 r61998  
    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.
     
    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 5.0.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 ) ) {
Note: See TracChangeset for help on using the changeset viewer.