wp_admin_css_color
Registers an admin colour scheme css file.
Description
wp_admin_css_color( (string) $key, (string) $name, (string) $url, (array) $colors = array(), (array) $icons = array() );
Allows a plugin to register a new admin colour scheme. For example:
#07273E, #14568A, #D54E21, #2683AE
Parameters (5)
- 0. $key (string)
- The unique key for this theme.
- 1. $name (string)
- The name of the theme.
- 2. $url (string)
- The URL of the CSS file containing the color scheme.
- 3. $colors — Optional. (array) =>
array()
- An array of CSS color definition strings which are used to give the user a feel for the theme.
- 4. $icons — Optional. (array) =>
array()
- CSS color definitions used to color any SVG icons.
Usage
if ( !function_exists( 'wp_admin_css_color' ) ) { require_once ABSPATH . WPINC . '/general-template.php'; } // The unique key for this theme. $key = ''; // The name of the theme. $name = ''; // The URL of the CSS file containing the color scheme. $url = ''; // Optional. An array of CSS color definition strings which are used // to give the user a feel for the theme. $colors = array(); // Optional. CSS color definitions used to color any SVG icons. $icons = array( 'base' => '', 'focus' => '' ); // NOTICE! Understand what this does before running. $result = wp_admin_css_color($key, $name, $url, $colors, $icons);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/general-template.php
- 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,
- );
- }