Skip to content

Instantly share code, notes, and snippets.

@WordBits
Created June 24, 2018 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WordBits/2e2716d972d6f913adb92c3c1943cb81 to your computer and use it in GitHub Desktop.
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.
<?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