WordPress filter hook · part of WordPress core
get_avatar_comment_types
A WordPress core filter that 19 plugins also fire themselves, running on 186K+ sites between them.
“Filters the list of allowed comment types for retrieving avatars.”
How to use get_avatar_comment_types
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'get_avatar_comment_types', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from GiveWP's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
19 plugins that fire get_avatar_comment_types
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
GiveWP100,000+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )includes/donors/frontend-donor-functions.php:73 -
Hummingbird Performance70,000+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment', 'pingback' ) )core/modules/class-gravatar.php:206 -
Leira Letter Avatar6,000+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )public/class-leira-letter-avatar-public.php:193 -
ActivityPub6,000+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )includes/class-avatars.php:47 -
Avatar Privacy1,000+ installs
apply_filters( 'get_avatar_comment_types', [ 'comment' ] )includes/avatar-privacy/components/class-avatar-handling.php:420 -
Webmention900+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )includes/functions.php:283 -
IdeaPush700+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )inc/functions/helper-functions.php:332 -
Wiremo600+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )config.php:330 -
Booking Ultra Pro Appointments Booking Calendar Plugin400+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )classes/bookingultra.user.php:3010 -
WP Avatar300+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )inc/plugin-functions.php:109 -
WP Custom Author Image90+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )wp-custom-author-image.php:742 -
Author or User Image20+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )includes/class-plugin.php:123 -
Chehrak10+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )chehrak.php:47 -
Tietuku Avatar for WordPress10+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )tietuku_avatar.php:41 -
EDD Purchase Gravatars10+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )edd-purchase-gravatars.php:100 -
XMPP Authentication10+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )plugged.php:60 -
Libravatar10+ installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )libravatar.php:83 -
ProfileirFewer than 10 installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )profileir.php:43 -
ClaimedAvatarFewer than 10 installs
apply_filters( 'get_avatar_comment_types', array( 'comment' ) )claimedavatar.php:31
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.