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

WordPress Trac noreply at wordpress.org
Wed Nov 2 20:51:22 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 aduth):

 Nice work on latest patch. Some thoughts as I reviewed:

 - Is `wp-includes/rest-api.php` the best place to add the legacy filter? I
 might imagine there could be many of these filters as more queries are
 replaced with client-side API requests.
 - Speaking to this point, should there be more of a standard around how we
 handle overrides for specific admin requests? Maybe a standard header
 named to reflect requests for a particular admin context?
 - Despite pointer comments suggesting otherwise, there does not appear to
 be any documentation for the `dashboard_recent_drafts_query_args` filter.
 - I'm a bit on the fence with the server-side query for post count. Part
 of me can't help but feel if we're querying posts server-side to render
 placeholders, we may as well be rendering them too. I realize `fields` /
 `no_found_rows` make the query more efficient than querying the full
 objects, but it almost feels an admission that a fully JS solution isn't
 quite sufficient on its own.
 - Could we avoid duplication of the default fetch parameters in the
 client? Maybe a standalone function that returns the query arguments that
 can be called from the API override or script localization?
 - More filters that we're still not accounting for: `admin_url` (for edit
 link), `get_the_time` (timestamp)

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


More information about the wp-trac mailing list