Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Avatar does not show outside BuddyPress

@danbp

Participant

Finally, i got it to work by improving my previous code.

This one works correctly now.

function bpfr_my_new_avatar_url( $local_url, $params ) {

// ensure we have always the right user_id
$user_id = $params['item_id'];

$ranking = xprofile_get_field_data ('ranking', $user_id );

	if ($ranking == "Top 25") {		
		$local_url = get_stylesheet_directory_uri() .'/custom_img/25.png';
	}
	
	if ($ranking == "Top 24") {		
		$local_url = get_stylesheet_directory_uri() .'/custom_img/24.png';
	}
return $local_url;

}
add_filter( 'bp_core_default_avatar_user', 'bpfr_my_new_avatar_url', 10, 2 );
Skip to toolbar