Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need a way to set the default avatar for buddypress's bp_core_fetch_avatar. Using the regular get_avatar you can just set the $default path but I can't find anyway to do it with buddypress's function. For instance, I use this function to get the full size avatar for a post author but adding default => "mysite.com/default.png" doesn't pass.

function fod_post_author_avatar() {
global $post;

if ( function_exists('bp_core_fetch_avatar') ) {
    echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $post->post_author, 'type' => 'full', 'width' => "130px", 'height' => "130px", default => "http://mysite.com/wp-content/themes/123/images/default-avatar.png" ) ) ); 
} else if ( function_exists('get_avatar') ) {
    get_avatar();
}
}
share|improve this question

1 Answer

I need a way to set the default avatar for buddypress's bp_core_fetch_avatar.

Why?

adding default => "mysite.com/default.png" doesn't pass

There is no 'default' option in that BP function http://phpxref.ftwr.co.uk/buddypress/nav.html?bp-core/bp-core-avatars.php.source.html#l78

You can define the default avatar site-wide by using BP_AVATAR_DEFAULT

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.