WordPress开发函数admin_color_scheme_picker()
WordPress开发函数admin_color_scheme_picker(),显示默认的管理配色方案选择器(在user-edit.php中使用)。
用法:
admin_color_scheme_picker( int $user_id )
参数:
$user_id
(int) (Required) 用户ID。
来源:
文件: wp-admin/includes/misc.php
function admin_color_scheme_picker( $user_id ) {
global $_wp_admin_css_colors;
ksort( $_wp_admin_css_colors );
if ( isset( $_wp_admin_css_colors['fresh'] ) ) {
// Set Default ('fresh') and Light should go first.
$_wp_admin_css_colors = array_filter(
array_merge(
array(
'fresh' => '',
'light' => '',
'modern' => '',
),
$_wp_admin_css_colors
)
);
}
$current_color = get_user_option( 'admin_color', $user_id );
if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) {
$current_color = 'fresh';
}
?>
}