/show-environment-in-editor

Show current server environment in the Gutenberg editor screen

Primary LanguageJavaScript

Show Environment In Editor

GitHub Workflow Status WordPress Plugin Version WordPress Plugin Required PHP Version WordPress Plugin: Required WP Version WordPress Plugin: Tested WP Version Actively Maintained

WordPress 5.5 introduced the WP_ENVIRONMENT_TYPE constant, which allows you to define the current environment where WordPress is running, either production, staging, local, or development. You can use the Display Environment Type plugin to show this information in the admin bar.

However, in new WordPress versions, the admin bar is hidden in the post editor and site editor. This plugin adds a new icon in the block editor toolbar to display the environment type. You can think of this as a complimentary plugin to Display Environment Type because it's highly recommended that you use both plugins at the same time.

Requirements

  • WordPress 5.5 or later
  • PHP 7.2 or later

Installation

  1. Install the plugin from your WordPress dashboard
  2. Activate the Show Environment In Editor via the plugins admin page

Frequently Asked Questions

My environment shows "production". How can I change it?

You can set the environment type in wp-config.php. Here are the values you can use.  

// Production
define('WP_ENVIRONMENT_TYPE', 'production');

// Staging
define('WP_ENVIRONMENT_TYPE', 'staging');

// Local
define('WP_ENVIRONMENT_TYPE', 'local');

// Development
define('WP_ENVIRONMENT_TYPE', 'development');

Support the plugin

Maintaining a WordPress plugin is a lot of work. If you like the plugin, please consider rating it on WordPress.org. You can also support me on GitHub sponsors. Thank you!

If you are interested, you can also check out my other WordPress plugins: