[wp-trac] [WordPress Trac] #44534: wp_debug_mode() does not turn off display_errors for REST requests

WordPress Trac noreply at wordpress.org
Wed Oct 10 13:39:51 UTC 2018


#44534: wp_debug_mode() does not turn off display_errors for REST requests
--------------------------+-----------------------------
 Reporter:  chrisl27      |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  5.0
Component:  REST API      |     Version:  4.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  rest-api
--------------------------+-----------------------------

Comment (by danielbachhuber):

 > `REST_REQUEST` is defined in `rest_api_loaded()` where it is run from
 the parse_request action, after `wp_debug_mode()` has run.

 Worth noting that this is still quite late in the request, which means
 plugins and themes could still emit errors as their loading.

 An alternative we could explore is inspecting the `Content-Type` header in
 `wp_debug_mode()` and assuming PHP notices should be disabled if `Content-
 Type: application/json`.

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


More information about the wp-trac mailing list