Forum Replies Created
Yeah… I’m logged in and don’t see any edit buttons.
I would like to add my vote to fleshing out the docs. Having comprehensive docs (at least for template tags) could have saved people like me hours and hours of work. And sad to say, the sparse documentation is pretty much the only thing that’s keeping me from embracing BuddyPress again for my next social networking project…
As for contributing, I’m only semi-literate in how BuddyPress works but I’ll try to contribute what I can based on what I’ve learned digging through the code. If only there was a way. Why isnt there a wiki or something?
I actually couldn’t find the template tags php file in my buddypress folder. I think I’ll just use the SVN for now. It has a nice search function.
Beer funds sent. Thanks again~
Nevermind, I googled for that function and found the SVN repo where that function is defined: http://bp-dev.org/phpxref/nav.html?_functions/index.html
The params it takes are:
$defaults = array(
‘item_id’ => false,
‘object’ => ‘user’, // user OR group OR blog OR custom type (if you use filters)
‘type’ => ‘thumb’,
‘avatar_dir’ => ‘avatars’,
‘width’ => false,
‘height’ => false,
‘class’ => ‘avatar’,
‘id’ => false,
‘alt’ => __( ‘Avatar Image’, ‘buddypress’ ),
… and the params can be fed into bp_core_fetch_avatar() in the form of “name=value&name=value” pairs as a string.
Hope this helps someone else who is having the same issue.
YOU ARE AMAZING! You know, you just redeemed my whole afternoon of work. Hooray I owe you a beer for that one!
Well… here’s the postscript. It all comes back to one thing I’ve been frustrated with: why is there no good documentation on BP or BBpress template tags? I had to search the code repo to find a hint that bp_core_get_avatar() was deprecated in favor of bp_core_fetch_avatar(), and after that still didn’t know that I had to put “item_id=” before the ID in the argument string. Not sure how I would have figured that one out on my own, given my apparent lack of PHP reading skills.
If someone knows a secret source of well-documented template tags, do let me know. All I’ve found so far is https://codex.buddypress.org/developer-discussions/buddypress-template-tags/ for Buddypress (which doesn’t even have bp_core_fetch_avatar() listed). Bummer.
Okay, I do have one last question for you: what other params does bp_core_fetch_avatar() take, and how can I find out? for instance, can I specify a different size of avatar?