[wp-trac] [WordPress Trac] #61739: REST API: Implement 'targetHints' property

WordPress Trac noreply at wordpress.org
Wed Jul 24 09:53:08 UTC 2024


#61739: REST API: Implement 'targetHints' property
------------------------------------------+------------------------------
 Reporter:  Mamaduka                      |       Owner:  (none)
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  REST API                      |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  rest-api
------------------------------------------+------------------------------
Changes (by Mamaduka):

 * keywords:   => needs-patch needs-unit-tests


Comment:

 Sharing suggestions by @TimothyBlynJacobs, during our 1-on-1 chat:

 > I think the big question is whether this should be done controller by
 controller, or if we can
 > handle it more at a server level.
 >
 > I think it’s worth looking at writing something similar to
 `rest_send_allow_header`, but
 > implementing it as “middleware” attached to
 `rest_request_after_callbacks`. Where we’d check if
 > the item or is an array of items with links, and then merge into it a
 targetHints definition.
 >
 > That way we don’t have to add mostly boiler plate code to every
 controller, and everything get’s
 > it for free if they implement their API properly.
 >
 > In this case, we shouldn’t need to dive into that level. We should be
 able to operate on a
 > higher level of abstraction. What `rest_send_allow_header` does is it
 calls the appropriate
 > `permission_callback` functions.

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


More information about the wp-trac mailing list