One of my plugins uses the
get_avatarfilter hook and is often used in conjunction with Add Local Avatar.
But Add Local Avatar doesn’t call the
get_avatarfilter hook correctly, it’s missing the 5th. argument.
If you look at /wp-content/plugins/add-local-avatar/avatars.php at line 1412, you’ll see this …
return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default);
… this is the wrong filter signature, it’s missing the
$altargument. Compare and contrast with what the filter signature should be, according to the WordPress core in /wp-includes/pluggable.php for v3.4 onwards …
return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default, $alt);
… this means that I’m getting support requests about PHP warning messages along the lines of
Warning: Missing argument 5 for WP_Biographia::get_avatar() in/var/www/wp-content/plugins/wp-biographia/wp-biographia.php on line 498
There’s a clash between the filter signatures. So I’ve created a patch for you which will resolve this … you’ll find it as a Gist on GitHub here: https://gist.github.com/4038938
Could you update your plugin and push out a new version which implements
get_avatarcorrectly please? I did post about this about a month ago on a parallel thread here on the forums (http://wordpress.org/support/topic/plugin-add-local-avatar-another-plugin-has-broken-this-one?replies=2) … but you maybe didn’t notice.
- The topic ‘get_avatar Filter Hook Missing 5th. Argument’ is closed to new replies.