Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/guillaumeg87/wpmu-plugins-environment-marker/archive/refs/heads/master.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
-
Add variable in your wp-config.php
-
define('WP_ENV', 'local');
-
Allowed variable values
- local : #2e7d32 (vert)
- staging: #1565c0 (blue)
- preprod: #ef6c00 (orange)
- prod: #AB1109 (red)
- Troubleshooting
Need to use a file loader, because Wordpress read only php file in mu-plugins directory, so here is an exemple
// Add new mu-plugin with duplicated line as below require WPMU_PLUGIN_DIR . '/environment-marker/environment.php';