Docs: Clarify where the wp_get_development_mode() value is retrieved from.

Includes:
* Adding a mention of the `WP_DEVELOPMENT_MODE` constant.
* Minor DocBlock formatting adjustments.

Follow-up to [56042], [56223].

See #57487, #57840.

git-svn-id: https://develop.svn.wordpress.org/trunk@56231 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-07-14 14:08:04 +00:00
parent ec42a73cef
commit 2548797fc6
2 changed files with 13 additions and 11 deletions

View File

@@ -78,8 +78,8 @@ function wp_initial_constants() {
}
/*
* Add define( 'WP_DEVELOPMENT_MODE', 'core' ) or define( 'WP_DEVELOPMENT_MODE', 'plugin' ) or
* define( 'WP_DEVELOPMENT_MODE', 'theme' ) or define( 'WP_DEVELOPMENT_MODE', 'all' ) to wp-config.php
* Add define( 'WP_DEVELOPMENT_MODE', 'core' ), or define( 'WP_DEVELOPMENT_MODE', 'plugin' ), or
* define( 'WP_DEVELOPMENT_MODE', 'theme' ), or define( 'WP_DEVELOPMENT_MODE', 'all' ) to wp-config.php
* to signify development mode for WordPress core, a plugin, a theme, or all three types respectively.
*/
if ( ! defined( 'WP_DEVELOPMENT_MODE' ) ) {

View File

@@ -268,17 +268,19 @@ function wp_get_environment_type() {
/**
* Retrieves the current development mode.
*
* The development mode affects how certain parts of the WordPress application behave, which is relevant when
* developing for WordPress.
* The development mode affects how certain parts of the WordPress application behave,
* which is relevant when developing for WordPress.
*
* Valid development modes 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 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.
*
* Developer mode is considered separately from `WP_DEBUG` and {@see wp_get_environment_type()}. It does not affect
* debugging output, but rather functional nuances in WordPress.
* Developer 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 controls the currently set development mode value. To check for whether a specific development mode is
* enabled, use wp_in_development_mode().
* This function retrieves the currently set development mode value. To check whether
* a specific development mode is enabled, use wp_in_development_mode().
*
* @since 6.3.0
*
@@ -293,7 +295,7 @@ function wp_get_development_mode() {
$development_mode = WP_DEVELOPMENT_MODE;
// Exclusively for core tests, rely on a global `$_wp_tests_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'];
}