As the dev notes for the upcoming WordPress 6.3 release are rolling out, there are so many exciting features that have not yet been highlighted. The new development mode, initiated by declaring the WP_DEVELOPMENT_MODE
constant, is one that will be particularly useful for theme developers initially.
“The development mode configured on a site defines the kind of development work that the site is being used for,” Google-sponsored WordPress Core Committer Felix Arntz said. This mode is not recommended for production sites.
The possible values for the WP_DEVELOPMENT_MODE
constant include core, plugin, theme, all, or an empty string (which is the default). The “all” value is applicable to sites where all three aspects may be modified, such as a client website in progress.
“There are currently only a few use-cases in WordPress core which are determined by the development mode, but this will likely increase in the future,” Arntz said. “Most usage today relates to theme.json
caching.”
Since the cache is usually only invalidated when the theme is updated, it can become cumbersome to developers who are actively modifying theme.json and have to manually invalidate it to see their changes. This caching functionality is bypassed when the value is set to “theme.”
Although the WP_ENVIRONMENT_TYPE constant seems similar to the new developer mode, it specifically denotes whether the environment is development, staging, or production but does not specify what type of development is being done.
“It is likely that you will only use the WP_DEVELOPMENT_MODE
constant on a site where WP_DEBUG
is enabled and WP_ENVIRONMENT_TYPE
is either ‘development’ or ‘local,’ since it is not advised for development to occur directly against staging or production environments,” Arntz said.
For more details on when and how to use Developer Mode, and code samples for checking if development mode is active on a site, developers can refer to the dev note published to the make.wordpress.org/core blog.
WP Tavern
Leave a Reply
You must be logged in to post a comment.