wordpress
wordpress copied to clipboard
Consider adding `WP_DEVELOPMENT_MODE`
There has been some caching related changes in recent WP releases.
In short, when developing a site, theme.json and patterns are cached. This makes it annoying to develop since the changes are not seen right away.
When in DEV my suggestion is to add define( 'WP_DEVELOPMENT_MODE', 'all' );. Maybe in wp-config.php:
/**
* For developers: show verbose debugging output if not in production.
*/
if ( 'production' === getenv('WP_ENV') ) {
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', false);
define('SCRIPT_DEBUG', false);
} else {
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
define('WP_DEBUG_LOG', '/data/log/php-error.log');
define('SCRIPT_DEBUG', true);
// Added in here.
define('WP_DEVELOPMENT_MODE', 'all');
}
Very good, makes perfect sense. wp-config.php is the correct place for this as we have that if statement already there checking the WP_ENV variable. This new addition would then affect staging environments as well, where caching is not desired either.
Would you mind creating a PR yourself?
Sure, I can do PR next week.