[wp-trac] [WordPress Trac] #58855: Fix and enhance wp_in_development_mode() to be able to return whether a development mode is beiung used
WordPress Trac
noreply at wordpress.org
Thu Jul 20 04:59:53 UTC 2023
#58855: Fix and enhance wp_in_development_mode() to be able to return whether a
development mode is beiung used
-------------------------+---------------------
Reporter: azaozz | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.4
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+---------------------
Comment (by knutsp):
In case `WP_DEVELOPMENT_MODE` is defined as a legal value and
`WP_ENVIRONMENT_TYPE` is undefined `WP_ENVIRONMENT_TYPE` should be defined
to 'development'.
`WP_DEBUG` may explicitly be defined false, and still
`WP_ENVIRONMENT_TYPE` could be 'development' and `WP_DEVELOPMENT_MODE`
could be either undefined or set to false or an empty value. Debugging is
not the same as developing, all the time, and vice versa.
What is the use case `wp_i[n|s]_development_mode()` to check for any mode?
The environment and `WP_DEBUG` should be sufficient when it's about
reporting, logging or checking that may slow down the site. The mode is
primarily about caching and avoiding internal behviour that makes certain
kinds of development harder, slower or unpredictable. But if one still
insist some may need this, `if ( wp_get_development_mode() ) {}` will work
without explicit casting to boolean.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58855#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list