Last active
June 10, 2026 06:40
-
-
Save maddisondesigns/7cda688d8765757dc9d6f4b77b650f27 to your computer and use it in GitHub Desktop.
Automatically set WordPress Administration Color Scheme to previous default (Fresh) colour scheme for a specific user
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
| /** | |
| * Automatically set Administration Color Scheme to previous default (Fresh) colour scheme for a specific user | |
| * Replace [insert_username_here] with the relevant username | |
| */ | |
| function set_admin_color_scheme( $color_scheme ) { | |
| $current_user = wp_get_current_user(); | |
| if ( strtolower( '[insert_username_here]' ) === strtolower( $current_user->user_login ) ) { | |
| return 'fresh'; | |
| } | |
| return $color_scheme; | |
| } | |
| add_filter( 'get_user_option_admin_color', 'set_admin_color_scheme', 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment