Skip to content

Instantly share code, notes, and snippets.

@elvismdev
Created September 9, 2019 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elvismdev/fc1f95de85c3ed950b6dc46b1d8b0f16 to your computer and use it in GitHub Desktop.
Save elvismdev/fc1f95de85c3ed950b6dc46b1d8b0f16 to your computer and use it in GitHub Desktop.
Example usage filter `wpcfm_multi_env`
<?php
// wp-content/mu-plugins/wp-cfm-multi-env.php
// ...
function my_wpcfm_multi_env_register( $environments ) {
// Define an array containing the hosting environment names.
// Or detect these with your own code logic if all are available in `$_ENV` or `$_SERVER` super-globals.
// ...
$environments = [
'dev',
'test',
'live'
];
return $environments;
}
add_filter( 'wpcfm_multi_env', 'my_wpcfm_multi_env_register' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment