[wp-trac] [WordPress Trac] #40614: REST API: String argument for rest_do_request/rest_ensure_request does not work as expected.

WordPress Trac noreply at wordpress.org
Tue Aug 22 06:54:40 UTC 2017


#40614: REST API: String argument for rest_do_request/rest_ensure_request does not
work as expected.
-------------------------------+------------------------------
 Reporter:  TimothyBlynJacobs  |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  REST API           |     Version:  4.4
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:  rest-api
-------------------------------+------------------------------

Comment (by rmccue):

 Hmm, I wonder how this happened, maybe we changed `rest_ensure_request()`
 at some point, because the idea of that function was to do just this. In
 any case, I think it's too late to change it.

 I'd prefer to do the simple thing here and treat a string parameter as a
 route with no further parsing (that is, directly instantiate
 `WP_REST_Request`). More advanced usage can continue to create a
 `WP_REST_Request` manually; I'd rather not have `rest_do_request()` turn
 into an everything-and-the-kitchen-sink function. Alternatively, we could
 remove the string capability altogether and treat this as a docs bug.

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


More information about the wp-trac mailing list