BP avatars missing special classes
-
I have some code for my theme that adds some extra classes to avatars on blog post comments.
function bt_get_avatar($avatar, $type) { if (!is_object($type)) { return $avatar; } $avatar = str_replace("class='avatar", "class='avatar pull-left media-object", $avatar); return $avatar; } add_filter('get_avatar', 'bt_get_avatar', 10, 2);
But for some reason anyone that is a “member” of the buddypress plugin doesn’t get these applied to their comments. Ive had some success with hooking bp_core_avatar_class but it seems to now add those classes to all instances of the get_avatar everywhere, and thats not what I want exactly. For example, it adds these to the toolbar/admin bar avatar also. Disabling BP restores the classes back to all comments on the blog. Using the comment form while not logged in posts a comment with the classes added. The result is a mixture of comments, some with the avatar classes, some without.
Is there a way to make the above code function as expected with BP enable?
- The topic ‘BP avatars missing special classes’ is closed to new replies.