500+
April 17, 2025
March 11, 2016
Though it is typically an individually configurable aspect of WordPress, there are times when forcing a single admin color scheme upon all users of a site can be warranted, such as to:
Additionally, the plugin removes the “Admin Color Scheme” profile setting from users who don’t have the capability to set the admin color scheme globally since being able to set its value gives them the false impression that it may actually apply.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
The plugin is further customizable via one filter. Typically, code making use of filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain).
c2c_force_admin_color_scheme (filter)
The ‘c2c_force_admin_color_scheme’ filter allows you to set or override the forced admin color scheme. Use of the constant (“) takes priority over the filtered value, but the filtered value takes priority over the value set via the admin.
Arguments:
Example:
/**
* Sets a forced admin color scheme based on user. Admins get one color scheme, whereas everyone else gets another.
*
* @param string $color The current forced admin color scheme. Empty string indicates no forced admin color scheme.
* @return string
*/
function my_c2c_force_admin_color_scheme( $color ) {
return current_user_can( 'manage_options' ) ? 'sunrise' : 'coffee';
}
add_filter( 'c2c_force_admin_color_scheme', 'my_c2c_force_admin_color_scheme' );
/wp-content/plugins/).c2c_force_admin_color_scheme filter in custom code to programmatically set the forced admin color scheme with greater control.C2C_FORCE_ADMIN_COLOR_SCHEME constant somewhere (such as wp-config.php) if you’d prefer to configure the color that way. Configuring the color in this manner takes precedence over the color as configured via an admin’s profile. Also, if the constant is used, the plugin prevents the setting of admin color schemes entirely from within user profiles, including by admins.Have you followed all of the installation instructions? You must configure the forced admin color scheme by setting the color scheme for yourself while also checking the “Force this admin color scheme?” checkbox.
You can simply deactivate the plugin. Though bear in mind that if you later reactivate the plugin, the forced color scheme at the time the plugin was deactivated (if there was one) may be reinstated (depending on if the constant, hooked filter, and/or plugin setting are still present).
To keep the plugin active, you can pursue the following steps (whichever may apply to you):
* If the forced color scheme is being set via the constant or code making use of the filter hook, then the code relating to either of those cases must be commented out or disabled.
* If the “Force this admin color scheme?” setting was used, then update an administrative profile to uncheck the checkbox and save.
Yes, but only via custom coding by making use of the c2c_force_admin_color_scheme filter. See the documentation for the filter for an example.
The plugin will recognize that the chosen admin color scheme is no longer valid and will act as if one isn’t set. In such a case, users would then see their individually chosen admin color schemes. If the custom admin color scheme becomes available again (before a new existing color scheme is selected as the new scheme to be forced), then the plugin will reinstate it as the forced admin color scheme.
Just to be clear, if an admin color scheme is being forced, then non-admininistrative users won’t see the admin color scheme picker at all.
The plugin does not disable the admin color scheme picker for administrative users even if a value is directly configured in code (via the constant or the filter) so that the admin color schemes can still be seen and previewed in case an admin user wants to evaluate alternatives.
Yes. The tests are not packaged in the release .zip file or included in plugins.svn.wordpress.org, but can be found in the plugin’s GitHub repository.
Highlights:
This minor release fixes a bug that prevented a forced color scheme from being set or unset if one was being forced via the constant, adds clarifying help text, prevents markup from containing unintended markup, removes unit tests from release packaging, updates compatibility through WP 6.8+, and a few more minor changes.
Details:
get_color_scheme_via_setting() to get the forced admin color scheme saved as a plugin setting.gitignore fileREADME.mdbootstrap.phpcomposer.json for PHPUnit Polyfill dependencyphpunit/ into tests/phpunit/bin into tests/Full changelog is available in CHANGELOG.md.