get_avatar with a link?
-
I wrote a plugin that uses the get_avatar filter to display custom images, and it’s breaking with the Admin Bar in 3.1. Any advice appreciated.
The IMG tags returned by my plugin are wrapped in an A tag to make the image into a link. This hash always worked fine for avatars in comments, etc. Unfortunately the Admin Bar in 3.1 wraps the result of get_avatar() in an “A” tag, assuming it’s just an IMG, which causes a nested “A” tag situation like this:
<a href="admin bar-supplied URL"><a href="my custom URL"><img .../></a></a>
which breaks the HTML of the page.
If I modify my plugin to remove my “A” tag, this fixes the Admin Bar, but my avatars are no longer linked to my custom URL.
What is the right way, in 3.1, to make avatars clickable and linked to a custom URL?
- The topic ‘get_avatar with a link?’ is closed to new replies.