wp_admin_css_color()WP 2.5.0

Registers an admin color scheme css file.

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'
) );

Хуков нет.


null. Ничего (null).


wp_admin_css_color( $key, $name, $url, $colors, $icons );
$key(строка) (обязательный)
The unique key for this theme.
$name(строка) (обязательный)
The name of the theme.
$url(строка) (обязательный)
The URL of the CSS file containing the color scheme.
An array of CSS color definition strings which are used to give the user a feel for the theme.
По умолчанию: array()

CSS color definitions used to color any SVG icons.

По умолчанию: array()

  • base(строка)
    SVG icon base color.

  • focus(строка)
    SVG icon color on focus.

  • current(строка)
    SVG icon color of current admin menu link.


  • Global. Массив. $_wp_admin_css_colors

Список изменений

С версии 2.5.0 Введена.

Код wp_admin_css_color() WP 6.5.5

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,