[wp-trac] [WordPress Trac] #53656: Not possible to get a post type's REST API namespace if modified
WordPress Trac
noreply at wordpress.org
Mon Oct 11 21:27:28 UTC 2021
#53656: Not possible to get a post type's REST API namespace if modified
----------------------------------------+---------------------------
Reporter: swissspidy | Owner: spacedmonkey
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.9
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: needs-unit-tests has-patch | Focuses: rest-api
----------------------------------------+---------------------------
Changes (by spacedmonkey):
* keywords: has-patch => needs-unit-tests has-patch
* owner: (none) => spacedmonkey
* focuses: => rest-api
* status: new => assigned
* milestone: Future Release => 5.9
Comment:
I have created a PR / patch for this ticket at
[https://github.com/WordPress/wordpress-develop/pull/1749 #1749].
This PR adds the following
- This adds a new `rest_namespace` param to `register_post_type` /
`WP_Post_Type`.
- Updates REST API controller to read from rest_namespace property of the
`WP_Post_Type` object in all the REST API controllers.
- Add field to Post types controller.
- Update logic in `rest_get_route_for_post` function
The patch does have unit tests yet. Can you take a look @swissspidy
@TimothyBlynJacobs and see if you are happy with the approach, I will add
unit tests and move this forward.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53656#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list