[WIP] Global styles controller: extend with WP_REST_Posts_Controller#6008
[WIP] Global styles controller: extend with WP_REST_Posts_Controller#6008ramonjd wants to merge 2 commits intoWordPress:trunkfrom
Conversation
Extending `WP_REST_Global_Styles_Controller` with `WP_REST_Posts_Controller`
|
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 SVNIf you're a Core Committer, use this list when committing to GitHub Merge commitsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. 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. |
|
@ramonjd are you checking the unit test failure? |
@mukeshpanchal27 This PR is work in progress (WIP) so, no, not yet. I still need to work on the feature a bit first. Thanks! |
| '/wp/v2/comments/(?P<id>[\\d]+)', | ||
| '/wp/v2/global-styles/(?P<id>[\/\w-]+)', | ||
| '/wp/v2/global-styles/(?P<id>[\d]+)/autosaves', | ||
| '/wp/v2/global-styles/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)', |
There was a problem hiding this comment.
It would be handy to be able to opt-out of these as well if folks want to skip registering these routes, e.g., 'autosave_rest_controller_class' => false, in register_post_type().
1f51e1f#diff-52c8c412194f4e6bf199f6bbf576b66410eb470aa181330bdd7c290c9ed075e4R929
There was a problem hiding this comment.
Or a supports_autosaves, similar to supports_revisions? 🤷🏻
There was a problem hiding this comment.
@ramonjd For now, we could just add the global post type here -
wordpress-develop/src/wp-includes/class-wp-post-type.php
Lines 925 to 927 in 235cb39
WIP - Extending
WP_REST_Global_Styles_ControllerwithWP_REST_Posts_ControllerSee: #5699 (review)