Last active
July 11, 2018 17:10
-
-
Save spacedmonkey/6d0b395df4664040df9095fdd54a1562 to your computer and use it in GitHub Desktop.
Change the admin theme depending on enviroments in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'get_user_metadata', function ( $value, $object_id, $meta_key, $single ) { | |
if ( 'admin_color' !== $meta_key || ! $single ) { | |
return $value; | |
} | |
if ( ! defined( 'WPCOM_IS_VIP_ENV' ) ) { | |
return $value; | |
} | |
switch ( WPCOM_IS_VIP_ENV ) { | |
case 'develop': | |
$value = 'light'; | |
break; | |
case 'preprod': | |
$value = 'blue'; | |
break; | |
case 'production': | |
$value = 'sunrise'; | |
break; | |
} | |
return $value; | |
}, 999, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment