[wp-trac] [WordPress Trac] #57487: Add support for "development mode"
WordPress Trac
noreply at wordpress.org
Wed Feb 1 18:18:06 UTC 2023
#57487: Add support for "development mode"
------------------------------------------+-----------------------------
Reporter: azaozz | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: General | Version:
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses:
------------------------------------------+-----------------------------
Changes (by flixos90):
* keywords: => needs-patch needs-unit-tests
Comment:
Replying to [comment:15 SergeyBiryukov]:
> > {{{
> > function wp_development_mode() {
> > $development_mode = defined( 'WP_DEVELOPMENT_MODE' ) ?
WP_DEVELOPMENT_MODE : false;
> > return apply_filters( 'wp_development_mode', $development_mode );
> > }
> > }}}
>
> This looks good to me :) Should we also check for an environment
variable if set, or would the constant and the filter be enough for now?
I think we could do it without an environment variable for now, since e.g.
`WP_DEBUG` doesn't have an environment variable either.
`WP_ENVIRONMENT_TYPE` supports an environment variable, but arguably that
also makes more sense there than here, since the environment type is, even
per the naming, directly tied to the environment, whereas the development
mode is not.
Something else I'd just like to note is that we should probably validate
in the eventual code that the value from the constant/filter is one of the
allowed values; didn't include it in this mini code example, but later in
the PR I think we should have it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57487#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list