• Laszlo

    (@laszloszalvak)


    Hi!

    As I see, currently this plugin overrides the default avatars over the “get_avatar_url” filter:
    add_filter( 'get_avatar_url', 'wp_user_avatars_filter_get_avatar_url', 10, 3 );

    This is nice, but you could rather use the “pre_get_avatar_data” filter:

    by passing the avatar url in the $args[‘url’].
    The problem is that, plugins which are using the “pre_get_avatar_data” filter, will make the “get_avatar_url” filter not being fired, as it will short circuit the get_avatar_data() function, which means your custom avatars will never appear.

    If multiple plugins would use the “pre_get_avatar_data” filter, then with the add_filter priority you could still make your avatars displayed.

    Best regards,
    Laszlo.

  • The topic ‘Using the pre_get_avatar_data filter’ is closed to new replies.