Hi,
The sample code for checking against the host name doesn’t work. I believe that there should be two closing brackets after each $_SERVER['HTTP_HOST']
add_filter( 'shc_show_env_id_env', 'my_show_env_id_env' );
function my_show_env_id_env( $env ) {
// match staging.example.com
if ( preg_match( '/\bstaging\b/i', $_SERVER['HTTP_HOST'] ) {
return array( 'Staging', 'staging' );
}
// match qa.example.com
if ( preg_match( '/\bqa\b/i', $_SERVER['HTTP_HOST'] ) {
return array( 'QA', 'qa' );
}
return $env;
}
]]>