Skip to content

Instantly share code, notes, and snippets.

@ThatGuySam
Last active July 28, 2022 21:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThatGuySam/d4754b3d207c866c48fda6aec8c93aeb to your computer and use it in GitHub Desktop.
Save ThatGuySam/d4754b3d207c866c48fda6aec8c93aeb to your computer and use it in GitHub Desktop.
Set custom admin color scheme for your local Wordpress environment
<?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