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:

functions.php
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.

  1. GiveWP icon GiveWP100,000+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) includes/donors/frontend-donor-functions.php:73
  2. Hummingbird Performance icon Hummingbird Performance70,000+ installs apply_filters( 'get_avatar_comment_types', array( 'comment', 'pingback' ) ) core/modules/class-gravatar.php:206
  3. Leira Letter Avatar icon Leira Letter Avatar6,000+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) public/class-leira-letter-avatar-public.php:193
  4. ActivityPub icon ActivityPub6,000+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) includes/class-avatars.php:47
  5. Avatar Privacy icon Avatar Privacy1,000+ installs apply_filters( 'get_avatar_comment_types', [ 'comment' ] ) includes/avatar-privacy/components/class-avatar-handling.php:420
  6. Webmention icon Webmention900+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) includes/functions.php:283
  7. IdeaPush icon IdeaPush700+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) inc/functions/helper-functions.php:332
  8. Wiremo icon Wiremo600+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) config.php:330
  9. Booking Ultra Pro Appointments Booking Calendar Plugin icon Booking Ultra Pro Appointments Booking Calendar Plugin400+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) classes/bookingultra.user.php:3010
  10. WP Avatar icon WP Avatar300+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) inc/plugin-functions.php:109
  11. WP Custom Author Image icon WP Custom Author Image90+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) wp-custom-author-image.php:742
  12. Author or User Image icon Author or User Image20+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) includes/class-plugin.php:123
  13. Chehrak icon Chehrak10+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) chehrak.php:47
  14. Tietuku Avatar for WordPress icon Tietuku Avatar for WordPress10+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) tietuku_avatar.php:41
  15. EDD Purchase Gravatars icon EDD Purchase Gravatars10+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) edd-purchase-gravatars.php:100
  16. XMPP Authentication icon XMPP Authentication10+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) plugged.php:60
  17. Libravatar icon Libravatar10+ installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) libravatar.php:83
  18. Profileir icon ProfileirFewer than 10 installs apply_filters( 'get_avatar_comment_types', array( 'comment' ) ) profileir.php:43
  19. ClaimedAvatar icon 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.