[wp-trac] [WordPress Trac] #57487: Add support for "development mode"
WordPress Trac
noreply at wordpress.org
Wed Feb 1 17:06:22 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: | Focuses:
-------------------------+-----------------------------
Comment (by SergeyBiryukov):
Replying to [comment:11 knutsp]:
> For `wp_get_environment_type()` add/allow a 'local ' prefix in
`WP_ENVIRONMENT_TYPE`:
> {{{#!php
> [
> 'local', // deprecate later, return as 'local development'
> 'local development',
> 'local staging',
> 'local production'.
> 'development',
> 'staging',
> 'production' // default
> ]
> }}}
Something like this was my initial thinking too, but it looks like a
separate function might be more straightforward to use in the long run,
and would also allow for differentiating between core, plugin, and theme
development.
Replying to [comment:14 flixos90]:
> Basically like this:
>
> {{{
> 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?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57487#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list