[wp-trac] [WordPress Trac] #42061: Add new utility function for checking if the current request is a REST API request.

WordPress Trac noreply at wordpress.org
Wed Jan 23 13:53:32 UTC 2019


#42061: Add new utility function for checking if the current request is a REST API
request.
------------------------------------+-----------------------------
 Reporter:  lots.0.logs             |       Owner:  flixos90
     Type:  enhancement             |      Status:  assigned
 Priority:  normal                  |   Milestone:  Future Release
Component:  Bootstrap/Load          |     Version:  4.9
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  rest-api
------------------------------------+-----------------------------

Comment (by mikejolley):

 @pento We could use this in WooCommerce. We do things such as load the
 cart after wp_loaded action, but we're unable to disable this based on
 REST_REQUEST due to that constant not being set until parse_request.

 A function, available earlier, would be very useful.

 ref https://github.com/woocommerce/woocommerce/issues/20937

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


More information about the wp-trac mailing list