¿Desea eliminar las opciones de combinación de colores del administrador de la configuración del perfil de usuario? Encontrarás múltiples combinaciones de colores en la sección del perfil del administrador. Si bien es probable que haya un plugin para esto, hemos creado un fragmento de código rápido que se puede utilizar para eliminar las opciones de combinación de colores de administración de perfil de usuario.
Instrucciones:
Todo lo que tienes que hacer es añadir este código al archivo functions.php de tu tema o en un plugin específico del sitio:
function admin_color_scheme() { global $_wp_admin_css_colors; $_wp_admin_css_colors = 0; } add_action('admin_head', 'admin_color_scheme');
También puedes utilizar este fragmento de código, que utiliza un método diferente. Todo lo que tienes que hacer es añadir este código al archivo functions.php de tu tema o en un plugin específico del sitio:
if(is_admin()){ remove_action("admin_color_scheme_picker", "admin_color_scheme_picker"); }
Nota: Si es la primera vez que añade fragmentos de código en WordPress, consulte nuestra guía sobre cómo copiar / pegar correctamente fragmentos de código en WordPress, para no romper accidentalmente su sitio.
Si te ha gustado este fragmento de código, por favor considere revisar nuestros otros artículos en el sitio como: 43 mejores temas de fotografía para WordPress y 9 mejores 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.