Do the job – Improvement for gender based avatar
-
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' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Do the job – Improvement for gender based avatar’ is closed to new replies.