From d515bb1427346f3d650b55f2353e2373263b6626 Mon Sep 17 00:00:00 2001 From: Giuseppe Mazzapica Date: Mon, 31 Jul 2023 19:25:38 +0200 Subject: [PATCH] Add support for WP_DEVELOPMENT_MODE --- src/Env/WordPressEnvBridge.php | 1 + templates/wp-config.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Env/WordPressEnvBridge.php b/src/Env/WordPressEnvBridge.php index 4f097fd..a670f51 100644 --- a/src/Env/WordPressEnvBridge.php +++ b/src/Env/WordPressEnvBridge.php @@ -160,6 +160,7 @@ class WordPressEnvBridge 'WP_DEBUG_DISPLAY' => Filters::FILTER_BOOL, 'WP_DEBUG_LOG' => Filters::FILTER_STRING_OR_BOOL, 'WP_DEFAULT_THEME' => Filters::FILTER_STRING, + 'WP_DEVELOPMENT_MODE' => Filters::FILTER_STRING, 'WP_DISABLE_FATAL_ERROR_HANDLER' => Filters::FILTER_BOOL, 'WP_FEATURE_BETTER_PASSWORDS' => Filters::FILTER_BOOL, 'WP_HOME' => Filters::FILTER_STRING, diff --git a/templates/wp-config.php b/templates/wp-config.php index abdeb94..3ac4b15 100644 --- a/templates/wp-config.php +++ b/templates/wp-config.php @@ -195,6 +195,7 @@ function wpstarter_getenv(?string $key) { switch (WP_ENVIRONMENT_TYPE) { case 'local': defined('WP_LOCAL_DEV') or define('WP_LOCAL_DEV', true); + defined('WP_DEVELOPMENT_MODE') or define('WP_DEVELOPMENT_MODE', 'all'); case 'development': defined('WP_DEBUG') or define('WP_DEBUG', true); defined('WP_DEBUG_DISPLAY') or define('WP_DEBUG_DISPLAY', true); @@ -286,7 +287,8 @@ static function ($color) use ($envLoader) { register_shutdown_function( static function () use ($envLoader, $envType) { $isLocal = $envType === 'local'; - if (!apply_filters('wpstarter.skip-cache-env', $isLocal, $envType)) { + $isDevMode = defined('WP_DEVELOPMENT_MODE') && WP_DEVELOPMENT_MODE; + if (!apply_filters('wpstarter.skip-cache-env', $isLocal || $isDevMode, $envType)) { $envLoader->dumpCached(WPSTARTER_ENV_PATH . WordPressEnvBridge::CACHE_DUMP_FILE); } }