Registers an admin color scheme css file.
Description
Allows a plugin to register a new admin color scheme. For example:
wp_admin_css_color( 'classic', __( 'Classic' ), admin_url( "css/colors-classic.css" ), array(
'#07273E', '#14568A', '#D54E21', '#2683AE'
) );
Parameters
$key
stringrequired- The unique key for this theme.
$name
stringrequired- The name of the theme.
$url
stringrequired- The URL of the CSS file containing the color scheme.
$colors
arrayoptional- An array of CSS color definition strings which are used to give the user a feel for the theme.
Default:
array()
$icons
arrayoptional- CSS color definitions used to color any SVG icons.
base
stringSVG icon base color.focus
stringSVG icon color on focus.current
stringSVG icon color of current admin menu link.
Default:
array()
Source
function wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = array() ) {
global $_wp_admin_css_colors;
if ( ! isset( $_wp_admin_css_colors ) ) {
$_wp_admin_css_colors = array();
}
$_wp_admin_css_colors[ $key ] = (object) array(
'name' => $name,
'url' => $url,
'colors' => $colors,
'icon_colors' => $icons,
);
}
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
Example
To register the Classic admin theme using default blue scheme use: