Call wp_debug_mode(); to reduce PHP notices that break API responses #10476
Labels
Backwards Compatibility
Issues or PRs that impact backwards compatability
REST API Interaction
Related to REST API
[Type] Enhancement
A suggestion for improvement.
Milestone
PHP notices are expected to be disabled for REST API responses. However,
wp_debug_mode()
is currently called too early in core to disable PHP notices. See https://core.trac.wordpress.org/ticket/44534We should call
wp_debug_notice();
in Gutenberg to reduce PHP notices in API requests. We may want to test the waters with the solution proposed in https://core.trac.wordpress.org/ticket/44534#comment:8 (setting much earlier thanrest_api_ini
based onContent-Type:application/json
) to see if it's a durable-enough solution to the problem.Related #4936
The text was updated successfully, but these errors were encountered: