Docs: add PHPDoc for rest_revision_query filter#11201
Docs: add PHPDoc for rest_revision_query filter#11201apermo wants to merge 1 commit intoWordPress:trunkfrom
Conversation
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
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
| * @since 4.7.0 | ||
| * | ||
| * @param array $args Array of arguments for WP_Query. | ||
| * @param WP_REST_Request $request The REST API request. |
There was a problem hiding this comment.
| * @param WP_REST_Request $request The REST API request. | |
| * @param WP_REST_Request $request Request used to generate the response. |
Summary
The
rest_revision_queryfilter inWP_REST_Revisions_Controller::get_items()carried a cross-reference comment claiming it was documented in the posts controller:That cross-reference is incorrect. The posts controller documents
rest_{$this->post_type}_query— a dynamic hook that fires only for post types managed byWP_REST_Posts_Controller.WP_REST_Revisions_ControllerextendsWP_REST_Controllerdirectly (not the posts controller), so the dynamic hook never fires for revisions.rest_revision_queryis a standalone hook and has never had its own PHPDoc block.Deeper context apermo#9
Changes
@since 4.7.0PHPDoc block forrest_revision_query@see WP_REST_Posts_Controller::get_items()to theget_items()method docblock to surface the parallel relationship between the two controllers, following the same{@see}pattern used incomment.phpandpost.phpfor related hooksTrac ticket: https://core.trac.wordpress.org/ticket/64224
Use of AI Tools
Research (architectural investigation, prior-art search across core) and code were produced by Claude Code (claude-sonnet-4-6). The contributor reviewed the findings, steered the documentation approach, and approved the final implementation.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.