Skip to content

Instantly share code, notes, and snippets.

@ocean90
Created Feb 2, 2012
Embed
What would you like to do?
Remove gravatar from the WordPress Toolbar
<?php
/*
* Entfernt das Gravatar aus der Toolbar.
* @link: http://talkpress.de/artikel/wordpress-admin-bar-datenkrake-missbrauch
*/
/* < PHP 5.3 */
function ds_add_hide_avatar_filter() {
add_filter( 'pre_option_show_avatars', '__return_zero' );
}
add_action( 'admin_bar_menu', 'ds_add_hide_avatar_filter', 0 );
function ds_remove_hide_avatar_filter() {
remove_filter( 'pre_option_show_avatars', '__return_zero' );
}
add_action( 'admin_bar_menu', 'ds_remove_hide_avatar_filter', 10 ) ;
/* PHP 5.3 */
add_action(
'admin_bar_menu',
function() {
add_filter( 'pre_option_show_avatars', '__return_zero' );
},
0
);
add_action(
'admin_bar_menu',
function() {
remove_filter( 'pre_option_show_avatars', '__return_zero' );
},
10
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment