Deseja remover as opções de esquema de cores do administrador das configurações do perfil do usuário? Você encontrará vários esquemas de cores na seção de perfil do administrador. Embora provavelmente exista um plugin para isso, criamos um trecho de código rápido que pode ser usado para remover as opções de esquema de cores do administrador do perfil do usuário.
Instruções:
Tudo o que você precisa fazer é adicionar esse código ao arquivo functions.php do seu tema ou em um plug-in específico do site:
function admin_color_scheme() { global $_wp_admin_css_colors; $_wp_admin_css_colors = 0; } add_action('admin_head', 'admin_color_scheme');
Como alternativa, você pode usar este snippet, que usa um método diferente. Tudo o que você precisa fazer é adicionar esse código ao arquivo functions.php do seu tema ou em um plug-in específico do site:
if(is_admin()){ remove_action("admin_color_scheme_picker", "admin_color_scheme_picker"); }
Observação: Se esta é a primeira vez que você adiciona trechos de código no WordPress, consulte nosso guia sobre como copiar/colar corretamente trechos de código no WordPress, para não danificar acidentalmente seu site.
Se você gostou desse snippet de código, considere dar uma olhada em nossos outros artigos no site, como: 43 melhores temas de fotografia para WordPress e 9 melhores plugins de eventos para WordPress.
no longer good, gives missing key warning
The solution for WordPress 6 is to use:
$_wp_admin_css_colors = [];
since it is expecting an array.
Thank you so much… 🙂
Thank you so much it is working now:
function admin_color_scheme() {
global $_wp_admin_css_colors;
$_wp_admin_css_colors = [];
}
add_action(‘admin_head’, ‘admin_color_scheme’);
Thanks
wordpress 6 eror wp-admin\user-edit.php on line 303
Works on WordPress 3.8.1 also! Great code!
Thanks for confirming this! I knew would work, but yeah…
Awesome…this worked so well it was a “10 second fix”
Dude, thank you very much, I’ve been banging my head against the wall trying to get rid of this schnizz!
[…] snippet comes to you courtesy of Kevin Chard of WPsnipp.com. For more fun bits of code, check out the WordPress Code Snippets […]
How can I add my own, new color schemes?
I would say the easiest way would be to use this plugin
http://wordpress.org/extend/plugins/easy-admin-color-schemes/
It’s still there. I’m also using the plugin Theme My Login. Any suggestions?
Give this other method a try see if that works for you,
http://wpsnipp.com/index.php/functions-php/remove-admin-color-scheme-picker-from-profile/
The other option if not these would be to use css or jquery to hide it.
I noticed that Theme My Login was using it’s own template, maybe that was making problems. I completely removed Profile Options from the profile editing template, so it’s not a problem anymore.
Sounds great glad to hear you got things working. If you wanted post details on what method you used for the ‘my login’ plugin others may have a use for it as well.
@edinchez:disqus, Thank you for your post; I would like to remove the color scheme options and I’m using Theme My Login; however, I didn’t understand what you did to resolve the issue. Will you please describe it in more detail?
Thank you,
James
delete this, check above for the solution.
First of all make a backup of:
/wp-content/plugins/theme-my-login/templates/profile-form.php
Then open it and delete the code from line 25 to line 62. This is to remove the whole Personal Options section. If you only want to remove the color scheme options section, delete the code from line 34 to line 40.