wp_color_scheme_settings

The WordPress Core wp color scheme settings function.

Description

wp_color_scheme_settings(); 

Usage

  1. if ( !function_exists( 'wp_color_scheme_settings' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/misc.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_color_scheme_settings(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/misc.php  
  1. function wp_color_scheme_settings() { 
  2. global $_wp_admin_css_colors; 
  3.  
  4. $color_scheme = get_user_option( 'admin_color' ); 
  5.  
  6. // It's possible to have a color scheme set that is no longer registered. 
  7. if ( empty( $_wp_admin_css_colors[ $color_scheme ] ) ) { 
  8. $color_scheme = 'fresh'; 
  9.  
  10. if ( ! empty( $_wp_admin_css_colors[ $color_scheme ]->icon_colors ) ) { 
  11. $icon_colors = $_wp_admin_css_colors[ $color_scheme ]->icon_colors; 
  12. } elseif ( ! empty( $_wp_admin_css_colors['fresh']->icon_colors ) ) { 
  13. $icon_colors = $_wp_admin_css_colors['fresh']->icon_colors; 
  14. } else { 
  15. // Fall back to the default set of icon colors if the default scheme is missing. 
  16. $icon_colors = array( 'base' => '#82878c', 'focus' => '#00a0d2', 'current' => '#fff' ); 
  17.  
  18. echo '<script type="text/javascript">var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ) ) . ";</script>\n";