wp_get_development_mode(): string
Retrieves the current development mode.
Description
The development mode affects how certain parts of the WordPress application behave, which is relevant when developing for WordPress.
Development mode can be set via the WP_DEVELOPMENT_MODE
constant in wp-config.php
.
Possible values are ‘core’, ‘plugin’, ‘theme’, ‘all’, or an empty string to disable development mode. ‘all’ is a special value to signify that all three development modes (‘core’, ‘plugin’, and ‘theme’) are enabled.
Development mode is considered separately from WP_DEBUG
and wp_get_environment_type() .
It does not affect debugging output, but rather functional nuances in WordPress.
This function retrieves the currently set development mode value. To check whether a specific development mode is enabled, use wp_is_development_mode() .
Return
string The current development mode.
Source
File: wp-includes/load.php
.
View all references
function wp_get_development_mode() {
static $current_mode = null;
if ( ! defined( 'WP_RUN_CORE_TESTS' ) && null !== $current_mode ) {
return $current_mode;
}
$development_mode = WP_DEVELOPMENT_MODE;
// Exclusively for core tests, rely on the `$_wp_tests_development_mode` global.
if ( defined( 'WP_RUN_CORE_TESTS' ) && isset( $GLOBALS['_wp_tests_development_mode'] ) ) {
$development_mode = $GLOBALS['_wp_tests_development_mode'];
}
$valid_modes = array(
'core',
'plugin',
'theme',
'all',
'',
);
if ( ! in_array( $development_mode, $valid_modes, true ) ) {
$development_mode = '';
}
$current_mode = $development_mode;
return $current_mode;
}
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
-
Skip to note 1 content You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note