Tips for customizing the color scheme of the background management interface in WordPress: wordpress color scheme. Tips for customizing the color scheme of the background management interface in WordPress. The brand-new background design starting with wordpress color scheme WordPress3.8 supports multi-color selection, by default, there are eight tips for customizing the color scheme of the background management interface in WordPress.
The background of the brand-new design starting with WordPress 3.8 supports multi-color selection. by default, there are eight very exquisite colors that can be selected by users.
The color scheme WordPress provides a function wp_admin_css_color () that allows developers to customize the color scheme. you only need to call this function to complete all registration operations.
Parameters
wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = array() );
$ Key (string): The color ID.
$ Name (string): Color name, displayed in the background
$ Url (string): CSS referenced when this color is selected
$ Colors (array): The demo color under the name when the user selects a color. you can set unlimited values. we recommend four colors. The default value is an empty array.
$ Icons (array): the color of the SVG icon. it can be set to an array with a length of 3. the key values are base, focus, and current. The default value is an empty array.
Example
First, you need to prepare a CSS file, which stores the CSS file called when the user selects your color scheme, that is, the CSS of the color scheme, which can be customized, you can also copy the default color CSS of WordPress to modify it (/wp-admin/css/colors.min.css ).
Then you can register it in the PHP file. let's take a look at an example. In this example, a function is created and mounted to admin_init, and then the color is added.
/***** Create background custom color * export Bing_add_admin_color () {wp_admin_css_color ('Bing ', 'custom', get_bloginfo ('Template _ directory '). '/color_style.css', array ('red', '# aaa',' # FEFEFE ',' #000 '), array ('base' =>' #999 ', 'corout' => '# 2ea2cc', 'current' => '# fff');} add_action ('admin _ init', 'Bing _ add_admin_color ');
Location
Function File:/wp-des/general-template.php
Articles you may be interested in:
- Implement function parsing for sending http requests in WordPress
- How to set the default content in the WordPress article editor
- PHP functions used to create and retrieve sidebar in WordPress
- How to add and execute actions in WordPress
The background of the brand-new design starting with WordPress 3.8 supports multi-color selection. by default, there are eight very exquisite types...