A client is asking that users only be allowed the choice between three company-branded Admin Color Schemes and none of the default schemes. I know I can hide the entire picker from the menu and force a default custom scheme to be used, but can I remove just the WordPress options and keep my custom options without using CSS?
I was able to make it work using this tutorial.
For example, this function removes all other color scheme options except the default ("Fresh"), "Midnight", and any custom schemes you've added:
function my_limit_admin_color_options()
{
global $_wp_admin_css_colors;
/* Get color data */
$fresh_color_data = $_wp_admin_css_colors['fresh'];
$midnight_color_data = $_wp_admin_css_colors['midnight'];
/* color scheme options */
$_wp_admin_css_colors = array(
'fresh' => $fresh_color_data,
'midnight' => $midnight_color_data
);
}
add_action('admin_init', 'my_limit_admin_color_options', 1);
Be sure to force a default theme if you remove the "Fresh" option, otherwise the user might be frustrated if they change it to something else, and can't change it back.
If you remove all the options but one, the Admin Color Scheme picker will be removed from the options page.