WordPress 6.3: New Development Mode

Exciting New Features in WordPress 6.3: Introducing Developer Mode

As the release of WordPress 6.3 approaches, developers and users alike are eagerly anticipating the new features and improvements that will be introduced. While many of these features have been highlighted, there is one in particular that is worth noting – the new Developer Mode.

What is Developer Mode?

Developer Mode is a new feature in WordPress 6.3 that allows theme developers to configure their development environment more effectively. By declaring the WP_DEVELOPMENT_MODE constant, developers can specify the type of development work being done on their site.

It’s important to note that Developer Mode is not recommended for production sites. Its purpose is to facilitate theme development and testing, making it easier for developers to make changes and see the results without affecting the live site.

How Does Developer Mode Work?

When using Developer Mode, developers can set the WP_DEVELOPMENT_MODE constant to one of the following values: core, plugin, theme, all, or an empty string (which is the default). The “all” value is particularly useful for sites where all three aspects – core, plugin, and theme – may be modified simultaneously, such as a client website in progress.

The Benefits of Developer Mode

One of the main benefits of Developer Mode is its impact on theme.json caching. In WordPress, the cache is typically only invalidated when the theme is updated. This can be problematic for developers who are actively modifying theme.json and need to see their changes immediately. However, when Developer Mode is set to “theme,” the caching functionality is bypassed, allowing developers to see their changes in real-time.

It’s worth mentioning that Developer Mode should not be confused with the WP_ENVIRONMENT_TYPE constant. While WP_ENVIRONMENT_TYPE denotes whether the environment is development, staging, or production, it does not specify the type of development being done. In contrast, Developer Mode focuses specifically on the type of development work being carried out.

Best Practices for Using Developer Mode

According to Felix Arntz, a Google-sponsored WordPress Core Committer, it is advisable to use the WP_DEVELOPMENT_MODE constant on a site where WP_DEBUG is enabled and WP_ENVIRONMENT_TYPE is set to either “development” or “local.” This ensures that development occurs in a controlled environment and not directly against staging or production environments.

For developers looking for more information on when and how to use Developer Mode, as well as code samples for checking if Developer Mode is active on a site, the dev note published on the make.wordpress.org/core blog provides detailed instructions.

Conclusion

As WordPress 6.3 approaches, the introduction of Developer Mode is an exciting development for theme developers. With the ability to configure their development environment more effectively, developers can make changes and see the results in real-time without affecting the live site. While Developer Mode is not recommended for production sites, it offers numerous benefits for those actively involved in theme development and testing. By setting the WP_DEVELOPMENT_MODE constant, developers can take advantage of this powerful new feature and streamline their development process.

Stay in Touch

spot_img

Related Articles