[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 22:12:55 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 peterwilsoncc):
How about using `true` to check if any development mode is available. That
will mean that WP doesn't return `true` when a falsey value is used. It
will also allow for code such as:
{{{#!php
<?php
if ( wp_is_development_mode( false ) ) {
wp_cache_set( 'thing', 'stuff' );
}
}}}
With `null` being used to indicate any mode then the code to do the above
seems a little less intuitive:
{{{#!php
<?php
if ( ! wp_is_development_mode( null ) ) {
wp_cache_set( 'thing', 'stuff' );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58855#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list