How to add extra class to Avatars
-
Hey,
I want to add an extra class to the avatars based on user-id.
Basically, I’m trying to differentiate admins from members..
Here’s a sample of what I’m trying (Trying to explain the logic. I know filters won’t work like this):
function avatar_extra_class($user_id) { if (user_can( $user_id, 'manage_options' ) ) { addClass "admin-account"; } elseif (user_can( $user_id, 'edit_published_posts' ) ) { addClass "Author-account"; } else { addClass "General-account"; } } add_filter( 'bp_get_avatar', 'avatar_extra_class');
I shall be very grateful for any suggestions/recommendation on the same! 🙂
Thank you in Advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.