[wp-trac] [WordPress Trac] #38342: Quick Draft: Leverage REST API endpoints

WordPress Trac noreply at wordpress.org
Sun Nov 20 00:07:30 UTC 2016


#38342: Quick Draft: Leverage REST API endpoints
---------------------------------+-----------------------------------
 Reporter:  adamsilverstein      |       Owner:
     Type:  enhancement          |      Status:  new
 Priority:  normal               |   Milestone:  Future Release
Component:  Administration       |     Version:
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 4.8-early  |     Focuses:  javascript, rest-api
---------------------------------+-----------------------------------

Comment (by jnylen0):

 Also, one more wrinkle that hasn't been discussed much yet:  the need to
 use `wp_localize_script` to pass settings such as site offset to the
 client.  This is an ok solution for clients that live within the admin,
 but:

 - It's not very RESTful.
 - It won't work for any client outside of the admin.

 No doubt there will be more reasons to do this sort of thing in the
 future.

 As mentioned in [https://github.com/WP-
 API/docs-v2/pull/190#discussion_r86808352 this docs PR], the current
 settings endpoint is not a good solution because it requires
 `manage_options`.

 Plugins can write custom endpoints to expose the data they need, but this
 will lead to a lot of duplicated code and unnecessary extra API endpoints.
 More code, more surface area, more bugs.

 There's a ticket about finer-grained access to the data in site settings
 (#38731).  I think we should take a look because it's directly relevant to
 this effort.

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


More information about the wp-trac mailing list