WordPress 3.8 get current admin color scheme

I actually made it!

In my script file, at the to I define a new variable and copy the $_wp_admin_css_colors variable into it using the admin_head hook, since the variable gets destroyed at some later point:

<?php
    global $admin_colors; // only needed if colors must be available in classes
    add_action('admin_head', function() {
        global $_wp_admin_css_colors;
        global $admin_colors; // only needed if colors must be available in classes
        $admin_colors = $_wp_admin_css_colors;
    });

    // more script content...
?>

Leave a Comment