From 018821ff9a1dcca53ed5e4f589b0396656c87668 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Mon, 17 Jul 2023 14:50:21 +0000 Subject: [PATCH] General: Rename `wp_in_development_mode()` to `wp_is_development_mode()`. This changes the function name for the helper function to check whether the current environment is running with the `WP_DEVELOPMENT_MODE` constant set to be more consistent with similar functions in core, like `wp_is_maintenance_mode()` and `wp_is_recover_mode()`. Props flixos90, swissspidy, costdev, peterwilson, robinwpdeveloper, SergeyBiryukov, joemcgill. See 57487. Built from https://develop.svn.wordpress.org/trunk@56249 git-svn-id: http://core.svn.wordpress.org/trunk@55761 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/blocks/index.php | 2 +- wp-includes/deprecated.php | 2 +- wp-includes/global-styles-and-settings.php | 8 ++++---- wp-includes/load.php | 4 ++-- wp-includes/version.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-includes/blocks/index.php b/wp-includes/blocks/index.php index 8b0ab4652b..4a95b90351 100644 --- a/wp-includes/blocks/index.php +++ b/wp-includes/blocks/index.php @@ -44,7 +44,7 @@ function register_core_block_style_handles() { * Ignore transient cache when the development mode is set to 'core'. Why? To avoid interfering with * the core developer's workflow. */ - if ( ! wp_in_development_mode( 'core' ) ) { + if ( ! wp_is_development_mode( 'core' ) ) { $transient_name = 'wp_core_block_css_files'; $files = get_transient( $transient_name ); if ( ! $files ) { diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 169b4cc227..72bf98d832 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -5234,7 +5234,7 @@ function wp_get_global_styles_svg_filters() { * Ignore cache when the development mode is set to 'theme', so it doesn't interfere with the theme * developer's workflow. */ - $can_use_cached = ! wp_in_development_mode( 'theme' ); + $can_use_cached = ! wp_is_development_mode( 'theme' ); $cache_group = 'theme_json'; $cache_key = 'wp_get_global_styles_svg_filters'; if ( $can_use_cached ) { diff --git a/wp-includes/global-styles-and-settings.php b/wp-includes/global-styles-and-settings.php index 4b21ce6cf0..75bebfee56 100644 --- a/wp-includes/global-styles-and-settings.php +++ b/wp-includes/global-styles-and-settings.php @@ -69,7 +69,7 @@ function wp_get_global_settings( $path = array(), $context = array() ) { * Ignore cache when the development mode is set to 'theme', so it doesn't interfere with the theme * developer's workflow. */ - $can_use_cached = ! wp_in_development_mode( 'theme' ); + $can_use_cached = ! wp_is_development_mode( 'theme' ); $settings = false; if ( $can_use_cached ) { @@ -152,7 +152,7 @@ function wp_get_global_stylesheet( $types = array() ) { * Ignore cache when the development mode is set to 'theme', so it doesn't interfere with the theme * developer's workflow. */ - $can_use_cached = empty( $types ) && ! wp_in_development_mode( 'theme' ); + $can_use_cached = empty( $types ) && ! wp_is_development_mode( 'theme' ); /* * By using the 'theme_json' group, this data is marked to be non-persistent across requests. @@ -251,7 +251,7 @@ function wp_get_global_styles_custom_css() { * Ignore cache when the development mode is set to 'theme', so it doesn't interfere with the theme * developer's workflow. */ - $can_use_cached = ! wp_in_development_mode( 'theme' ); + $can_use_cached = ! wp_is_development_mode( 'theme' ); /* * By using the 'theme_json' group, this data is marked to be non-persistent across requests. @@ -360,7 +360,7 @@ function wp_theme_has_theme_json() { * Ignore static cache when the development mode is set to 'theme', to avoid interfering with * the theme developer's workflow. */ - ! wp_in_development_mode( 'theme' ) + ! wp_is_development_mode( 'theme' ) ) { return $theme_has_support[ $stylesheet ]; } diff --git a/wp-includes/load.php b/wp-includes/load.php index c03368901e..9324eed562 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -280,7 +280,7 @@ function 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_in_development_mode(). + * a specific development mode is enabled, use wp_is_development_mode(). * * @since 6.3.0 * @@ -325,7 +325,7 @@ function wp_get_development_mode() { * @param string $mode Development mode to check for. Either 'core', 'plugin', 'theme', or 'all'. * @return bool True if the given mode is covered by the current development mode, false otherwise. */ -function wp_in_development_mode( $mode ) { +function wp_is_development_mode( $mode ) { $current_mode = wp_get_development_mode(); if ( empty( $current_mode ) ) { return false; diff --git a/wp-includes/version.php b/wp-includes/version.php index 7493b3d6a5..8c066e7211 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-beta4-56248'; +$wp_version = '6.3-beta4-56249'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.