[wp-trac] [WordPress Trac] #44534: wp_debug_mode() does not turn off display_errors for REST requests
WordPress Trac
noreply at wordpress.org
Mon Oct 15 23:08:27 UTC 2018
#44534: wp_debug_mode() does not turn off display_errors for REST requests
---------------------------------+-----------------------
Reporter: chrisl27 | Owner: earnjam
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 5.0
Component: REST API | Version: 4.5
Severity: normal | Resolution:
Keywords: has-patch fixed-5.0 | Focuses: rest-api
---------------------------------+-----------------------
Comment (by duanestorey):
I suspect if you want to just debug and ensure no output happens you can
just define REST_REQUEST in your code. It would bypass the same check in
the debug init. The actual define later would likely throw an error I
think, but display errors would be off then anyways.
Replying to [comment:25 JustinSainton]:
> @danielbachhuber Would it be unreasonable to make the output of
`wp_is_json_request` a filterable value? I know I've debugged countless
issues by noticing errors in JSON output that is often only exposed there.
Being able to conditionally `add_filter( 'wp_is_json_request',
'__return_true' )` in some cases would be really valuable. Happy to patch
if we think this is worth the filter-maintenance tradeoff.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44534#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list