Last active
July 28, 2022 21:26
-
-
Save ThatGuySam/d4754b3d207c866c48fda6aec8c93aeb to your computer and use it in GitHub Desktop.
Set custom admin color scheme for your local Wordpress environment
This file contains 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 | |
// Force Color Scheme for environments | |
// so that you're less likely to accidentally | |
// make a DEV update to a Production WordPress | |
// instance. | |
add_filter( 'get_user_option_admin_color', 'update_user_option_admin_color', 5 ); | |
function update_user_option_admin_color( $color_scheme ) { | |
if (defined('WP_LOCAL_DEV') && WP_LOCAL_DEV) return 'ocean'; | |
return 'default'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment