Send the full comment object to get_avatar()
rather than just the comment author's email address
#1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
get_avatar()
can accept a user ID, email address, or comment object. It's best to use a comment object because it provides the most context to plugins which use theget_avatar
filter to change the response of theget_avatar()
function.Note that core WordPress always sends the full comment object to
get_avatar()
when rendering comment avatars.Jetpack uses the
get_avatar
filter to replace the default avatar with the Twitter or Facebook avatar for comments submitted using Twitter or Facebook authentication. Jetpack needs the full comment object to do this.