Invalid Sample Code
-
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; }
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Invalid Sample Code’ is closed to new replies.