Created
December 12, 2013 17:40
-
-
Save aaronjorbin/7932093 to your computer and use it in GitHub Desktop.
Change the WordPress Admin color scheme every time you login.
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 | |
/* | |
Plugin Name: Color Rotator | |
Description: Change the color scheme every time you login | |
Author: Aaron Jorbin | |
Version: 1.0 | |
Author URI: http://aaron.jorb.in/ | |
License: GPLv2 or later | |
*/ | |
// Every time a user logs in, change the color scheme | |
add_action('wp_login', 'jorbin_color_rotate'); | |
function jorbin_color_rotate() { | |
$new_colors = array( 'fresh', 'light', 'blue', 'midnight', 'sunrise', 'ectoplasm', 'ocean', 'coffee' ); | |
$color_scheme = array_rand( $new_colors , 1); | |
update_user_meta( get_current_user_id(), 'admin_color', $color_scheme ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Proper Repository at https://github.com/aaronjorbin/color-rotator