Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call wp_debug_mode(); to reduce PHP notices that break API responses #10476

Closed
danielbachhuber opened this issue Oct 10, 2018 · 0 comments
Closed
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability REST API Interaction Related to REST API [Type] Enhancement A suggestion for improvement.

Comments

@danielbachhuber
Copy link
Member

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/44534

We 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 than rest_api_ini based on Content-Type:application/json) to see if it's a durable-enough solution to the problem.

Related #4936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability REST API Interaction Related to REST API [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

1 participant