Skip to content

Commit

Permalink
Add support for WP_DEVELOPMENT_MODE
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzap committed Jul 31, 2023
1 parent 54f7a95 commit d515bb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Env/WordPressEnvBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion templates/wp-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit d515bb1

Please sign in to comment.