[wp-trac] [WordPress Trac] #49116: Add Links to the REST version of a Resource in the header of the page
WordPress Trac
noreply at wordpress.org
Wed Jun 10 02:25:27 UTC 2020
#49116: Add Links to the REST version of a Resource in the header of the page
-------------------------------------------------+-------------------------
Reporter: dshanske | Owner: dshanske
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.5
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests dev- | Focuses: rest-api
feedback |
-------------------------------------------------+-------------------------
Comment (by TimothyBlynJacobs):
This is looking great, thanks @dshanske!
I agree with @tfrommen on the patch feedback. I think we should also make
sure `rest_get_route_for_post` and `rest_get_route_for_term` have the same
signature, that is both only accept a `WP_Post|WP_Term` object.
For the post type controller, we can also use the `get_rest_controller`
method which has some additional checks around the class.
For taxonomies, lets be safe and make sure the taxonomy has `show_in_rest`
enabled.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49116#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list