I have a rare situation where the avatar must be in an element’s background-image css property instead of in an img tag. As is, I strip the image src using regex.
A “get_avatar_src” function, like wp_get_attachment_image_src, would be useful here.
<div style="background-image:url('<?php echo get_avatar_src($user_id,32); ?>');" class="avatar"></div>
- The topic ‘get_avatar suggesstion: get_avatar_src()’ is closed to new replies.