Created
June 24, 2018 05:33
-
-
Save WordBits/2e2716d972d6f913adb92c3c1943cb81 to your computer and use it in GitHub Desktop.
Gets the colors being used in the current user's admin color scheme.
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/get-wordpress-admin-color-scheme/ | |
// Created by: jeffmatson | |
?> | |
<?php | |
function build_admin_colors() { | |
global $_wp_admin_css_colors; | |
$current_color_scheme = get_user_meta( get_current_user_id(), 'admin_color', true ); | |
$colors = array_merge( | |
$_wp_admin_css_colors[ $current_color_scheme ]->colors, | |
$_wp_admin_css_colors[ $current_color_scheme ]->icon_colors | |
); | |
return $colors; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment