[wp-trac] [WordPress Trac] #57487: Add support for "development mode"
WordPress Trac
noreply at wordpress.org
Fri Jun 30 20:30:04 UTC 2023
#57487: Add support for "development mode"
-------------------------------------------------+-------------------------
Reporter: azaozz | Owner: flixos90
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.3
Component: General | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests needs-dev- | Focuses:
note |
-------------------------------------------------+-------------------------
Comment (by flixos90):
Replying to [comment:45 peterwilsoncc]:
> I like @knutsp's suggestion in [comment:36 comment #36] of passing a
`$mode` parameter and returning a boolean if it matches either exactly or
by definition.
That sounds like a good addition to me, rather than an alternative. Right
now, we have `wp_get_development_mode()`. How about another function
`wp_in_development_mode( $mode )` to make such usage more
trivial/intuitive?
> I think missing on `site` (or whatever it ends up being called) is to
miss the most common development mode for WordPress. In my experience at
both small and large agencies, site wide development is the norm and
exclusively developing either a theme or plugin is an exception.
I agree with you, though I'm a bit hesistant on the name to give this.
Something I thought about yesterday is: How about we instead introduce an
"all" mode, which effectively is the same as "core and plugin and theme"?
I find that a more intuitive name, and while e.g. an agency doesn't
necessarily touch WordPress core, even that may happen sometimes. For
someone that controls the entire site, maybe an "all" is the most suitable
approach and feels like like a less opinionated name than "site" IMO.
Potentially "all" could even become sort of a default (e.g. is a site only
sets `WP_DEBUG` to `true` but doesn't set `WP_DEVELOPMENT_MODE`, default
to `WP_DEVELOPMENT_MODE=all`).
Worth noting that for someone setting the development mode to "all" this
wouldn't provide any benefit over the previous workaround of using
`WP_DEBUG` (since at that point it's the same "all or nothing" switch),
but even then the possibility of granularity (which is especially crucial
for core, plugin, and theme developers that ''don't'' control the entire
stack) is the benefit of this change.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57487#comment:46>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list