[wp-trac] [WordPress Trac] #40919: REST API: Allow overriding `jQuery.ajax` calls from within wp-admin

WordPress Trac noreply at wordpress.org
Tue Jun 6 03:35:47 UTC 2017


#40919: REST API: Allow overriding `jQuery.ajax` calls from within wp-admin
-------------------------------------+-------------------------------------
 Reporter:  jnylen0                  |       Owner:  jnylen0
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  4.8.1
Component:  REST API                 |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-refresh  |     Focuses:  javascript,
  dev-feedback                       |  administration, rest-api
-------------------------------------+-------------------------------------

Comment (by rmccue):

 Right now, this patch is pretty useless, and is basically just abstraction
 for abstraction's sake (I get the need behind it, but there's already ways
 to do that).

 That said, if it incorporated the nonce header for you automatically, I'd
 be happy to use it.

 Not a big fan of the naming here though; `RESTRequest` sounds like a class
 name to me. `wp.api.request()` I think would be a better name, and fits
 with the existing `wp.api` for the Backbone library. That said, it's also
 slightly confusing in that you'd have two scripts with an overlapping
 namespace. `wp.api_request` or `wp.rest_request` might be better there?

 (We could also consider switching to use `fetch()` with
 [https://github.com/github/fetch the polyfill] for this...)

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


More information about the wp-trac mailing list