[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
Sun Jun 7 04:57:04 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 dshanske):

 @TimothyBlynJacobs Been thinking about this and it ends up being a bit
 more complicated. You can, from a post type, for example, get the rest
 controller...but what is the best way to know what the resource is based
 on the post? I'm trying to figure out a more generic methodology.

 Are we safe just supporting the built-in controllers, and then adding a
 filter and putting the onus on people creating custom endpoints to handle
 that themselves?

 This is probably a good place for me to start.
 https://developer.wordpress.org/reference/classes/wp_rest_posts_controller/prepare_links/

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49116#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list