Getting group avatar, outside of loop.
-
I’ve found only a few examples of using bp_get_group_avatar(). I can’t seem to get anything returned other then a blank image.
http://phpxref.ftwr.co.uk/buddypress/bp-groups/bp-groups-template.php.source.html#l380
So from this method, I’ve tried passing an item_id in the args array as the group ID and also bypassing this wrapper function by calling “bp_core_fetch_avatar()” but without much luck. It would be nice to throw an error or give some feedback other then an unexpected result.
I would be happy to fetch something from the database if it where there but my best guess without getting too far into the code is that when that fancy jquery cropper thing hands off the file somewhere, it saves it using an MD5 or similar. I’ve spent plenty of hours looking at this by now and if I can do this the right way, I would prefer that then hacking this the wrong way.
Could anyone give me some pointers? I have a group ID within a plugin I’m writing, I just want to have it return the avatar or even better yet a URL or filename. Using a method that echos an image tag in a loop is not very useful to me. I really need a method that returns something, not echo’ed
Thanks!
- The topic ‘Getting group avatar, outside of loop.’ is closed to new replies.