Created
February 2, 2012 12:25
-
-
Save ocean90/1723233 to your computer and use it in GitHub Desktop.
Remove gravatar from the WordPress Toolbar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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