On this page
wp_admin_css_color( string $key, string $name, string $url, array $colors = array(), array $icons = array() )
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
$keystring Required-
The unique key for this theme.
$namestring Required-
The name of the theme.
$urlstring Required-
The URL of the CSS file containing the color scheme.
$colorsarray Optional-
An array of CSS color definition strings which are used to give the user a feel for the theme.
Default:
array() $iconsarray Optional-
CSS color definitions used to color any SVG icons.
basestringSVG icon base color.focusstringSVG icon color on focus.currentstringSVG icon color of current admin menu link.
Default:
array()
Source
File: wp-includes/general-template.php. View all references
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,
);
}
Related
Used By
| Used By | Description |
|---|---|
| register_admin_color_schemes() wp-includes/general-template.php | Registers the default admin color schemes. |
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_admin_css_color