Rating: 5 stars
Hi,
Effective plugin, thank you. I have found a piece of code which seems to set a default avatar based on the gender : Male / Female. Do you think you are able to adapt this code with your plugin?
add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );
function myavatar_add_default_avatar( $url )
{
global $bp;
$gender = xprofile_get_field_data('Gender', bp_get_member_user_id());
if ($gender == "Male") {
return $img_url = SECU.'thefashionhero.com/wp-content/uploads/male_avatar.png';
}
else {
return $img_url = SECU.'thefashionhero.com/wp-content/uploads/female_avatar.png';
}
}
add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );
add_filter( 'bp_core_default_avatar_user', 'myavatar_add_default_avatar' );
]]>