Skip to content

Instantly share code, notes, and snippets.

@elvismdev
Last active September 9, 2019 14:15
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/e3de8123929a5982fe4d3f079ee7dca9 to your computer and use it in GitHub Desktop.
Save elvismdev/e3de8123929a5982fe4d3f079ee7dca9 to your computer and use it in GitHub Desktop.
Example usage filter `wpcfm_current_env`
<?php
// wp-content/mu-plugins/wp-cfm-multi-env.php
// ...
function my_wpcfm_current_env_set( $env ) {
// Detect with your own code logic the current environment the WordPress site is running.
// Generally this will be defined in a constant inside `$_ENV` or `$_SERVER` super-globals.
// ...
$env = 'dev';
return $env;
}
add_filter( 'wpcfm_current_env', 'my_wpcfm_current_env_set' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment