[wp-trac] [WordPress Trac] #41998: REST API: Add debug mode
WordPress Trac
noreply at wordpress.org
Sun Sep 11 20:36:52 UTC 2022
#41998: REST API: Add debug mode
--------------------------+--------------------------------
Reporter: Viper007Bond | Owner: TimothyBlynJacobs
Type: enhancement | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.4
Severity: normal | Resolution:
Keywords: has-patch | Focuses: rest-api
--------------------------+--------------------------------
Comment (by kadamwhite):
@TimothyBlynJacobs What are your thoughts on the advantages of
`REST_JSON_ENCODE_OPTIONS` over the `WP_DEBUG_REST_API` constant proposed
in the original trac ticket?
If I am following this, to define that I want my site to JSON pretty
print, I'd use this, correct?:
{{{#!php
define( 'REST_JSON_ENCODE_OPTIONS', JSON_PRETTY_PRINT );
}}}
I don't know that I have a strong opinion on this, and admit that
WP_DEBUG_REST_API achieves a little developer-facing consistency but also
possibly over-implies what you're getting in exchange for setting the
constant. I'd almost expect that if I say "I'm debugging the REST API"
that I'd start getting telemetry or something along with my request
response, which would definitely not be the case here.
Naming things is hard. I'd love a second opinion :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41998#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list