I'm trying to get the stylesheet of the currently active admin color scheme to style a plugin to fit into the color context.
As mentioned in this post I had a look at the implementation of admin_color_scheme_picker()
in wp-admin/includes/misc.php:564
. They use a global variable called $_wp_admin_css_colors
but when I try to access (var_dump()
) it, it's NULL
.
Is there any way to access to actual CSS code?
Why is the global variable NULL
? I did a grep -n '$_wp_admin_css_colors' -r .
and couldn't find any line where it gets destroyed...
EDIT
I see it wasn't clear what I exactly want. I don't want to access the actual CSS code, but the color codes that gets parsed into CSS. In wp-includes/general-template.php:2117
the default themes are registered like this:
wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ),
admin_url( "css/colors$suffix.css" ),
array( '#222', '#333', '#0074a2', '#2ea2cc' ),
array( 'base' => '#999', 'focus' => '#2ea2cc', 'current' => '#fff' )
);
And I'd like to access the variables like this in PHP. Copying the definition is not an option, since other plugins and themes could add their theme themselves.