wp_admin_css_color

函式
wp_admin_css_color ( $key, $name, $url, $colors = array(), $icons = array() )
引數
  • (string) $key The unique key for this theme.
    Required:
  • (string) $name The name of the theme.
    Required:
  • (string) $url The URL of the CSS file containing the color scheme.
    Required:
  • (array) $colors Optional. An array of CSS color definition strings which are used to give the user a feel for the theme.
    Required:
    Default: array()
  • (array) $icons { Optional. CSS color definitions used to color any SVG icons. @type string $base SVG icon base color. @type string $focus SVG icon color on focus. @type string $current SVG icon color of current admin menu link. }
    Required:
    Default: array()
定義位置
相關方法
wp_admin_css_uriwp_admin_csswp_admin_canonical_urlwp_custom_css_cbwp_admin_headers
引入
2.5.0
棄用
-

wp_admin_css_color: 這個函式在管理頁面中新增一個顏色方案的CSS檔案: 這個函式接收一個配色方案的名稱,並建立CSS檔案,用於在指定的配色方案中顯示管理頁面。

註冊一個管理色彩方案css檔案。

允許一個外掛註冊一個新的管理色彩方案。比如說:

wp_admin_css_color( ‘classic’, __( ‘Classic’ ), admin_url(“css/colors-classic.css” ), array(
‘#07273E’, ‘#14568A’, ‘#D54E21’, ‘#2683AE’
) );

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,
	);
}

常見問題

FAQs
檢視更多 >