I am trying to override a plugin's built in avatar with the default WP avatar. The plugin's filter is this:
add_filter( "idea_push_change_user_image", "idea_push_change_user_image_callback", 10, 1 );
function idea_push_change_user_image_callback( $userId )
{
return "https://cdn.britannica.com/55/174255-004-9A4971E9.jpg";
}
I tried replacing that with 'get_avatar' but it ends up with a broken jpg image
add_filter( "idea_push_change_user_image", "idea_push_change_user_image_callback", 10, 1 );
function idea_push_change_user_image_callback( $userId )
{
return get_avatar( get_the_author_meta( 'ID' ), 32 );
}
Any ideas how to fix, thanks
UPDATE:
Thanks for answers, this has helped. Turns out I needed to pull another plugins (Ultimate Member) avatar not the default:
add_filter( "idea_push_change_user_image", "idea_push_change_user_image_callback", 10, 1 );
function idea_push_change_user_image_callback( $userId )
{
return um_get_user_avatar_url();
}
What's weird is it's only working/visible to the logged in user, not visible to anyone else.