WordPress Environment Switcher
Easily switch between different site environments from the WordPress admin bar.
by Sean Fisher · github.com/alleyinteractive/wp-environment-switcher · website
★ 4stars
252kcomposer installs
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/alleyinteractive/wp-environment-switcher/archive/refs/heads/develop.zipAlso on Packagist as alleyinteractive/wp-environment-switcher:
composer require alleyinteractive/wp-environment-switcherFrom the readme
WordPress Environment Switcher
Easily switch between different site environments from the WordPress admin bar.
Props to WordPress Stage Switcher for the inspiration.
Installation
You can install the package via Composer:
Usage
Activate the plugin in WordPress and you will see the switcher appear in the top right admin bar:
The plugin reads the current WordPress environment from the current hosting
provider (Pantheon and WordPress VIP supported) and falls back to
wpgetenvironmenttype() which can be set by defining WPENVIRONMENTTYPE
in your wp-config.php file. You can override the current environment by
using the wpenvironmentswitchercurrentenvironment filter:
You can define the available environments by using the
wpenvironmentswitcherenvironments filter:
The environments can also be defined as an array of associative arrays, which allows for more flexibility:
The type, url, and label keys are required for each environment.
The plugin will automatically detect the current environment and highlight it in
the switcher. By default, the plugin will show the switcher to anybody with the
manageoptions capability. You can change this by modifying the capability
mapped to the vie
Read the full README on GitHub →