Changeset 56223 for trunk/src/wp-includes/load.php
- Timestamp:
- 07/13/2023 12:27:06 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/load.php
r56153 r56223 272 272 * developing for WordPress. 273 273 * 274 * Valid developer modes are 'core', 'plugin', 'theme', or an empty string to disable developer mode. 274 * Valid development modes are 'core', 'plugin', 'theme', 'all', or an empty string to disable development mode. 275 * 'all' is a special value to signify that all three development modes 'core', 'plugin', and 'theme' are enabled. 275 276 * 276 277 * Developer mode is considered separately from `WP_DEBUG` and {@see wp_get_environment_type()}. It does not affect 277 278 * debugging output, but rather functional nuances in WordPress. 279 * 280 * This function controls the currently set development mode value. To check for whether a specific development mode is 281 * enabled, use wp_in_development_mode(). 278 282 * 279 283 * @since 6.3.0 … … 299 303 'plugin', 300 304 'theme', 305 'all', 301 306 '', 302 307 ); … … 308 313 309 314 return $current_mode; 315 } 316 317 /** 318 * Checks whether the site is in the given development mode. 319 * 320 * @since 6.3.0 321 * 322 * @param string $mode Development mode to check for. Either 'core', 'plugin', 'theme', or 'all'. 323 * @return bool True if the given mode is covered by the current development mode, false otherwise. 324 */ 325 function wp_in_development_mode( $mode ) { 326 $current_mode = wp_get_development_mode(); 327 if ( empty( $current_mode ) ) { 328 return false; 329 } 330 331 // Return true if the current mode encompasses all modes. 332 if ( 'all' === $current_mode ) { 333 return true; 334 } 335 336 // Return true if the current mode is the given mode. 337 return $mode === $current_mode; 310 338 } 311 339
Note: See TracChangeset
for help on using the changeset viewer.