• Resolved peternepstad

    (@peternepstad)


    Currently the “Show Earners” checkbox shows large avatar images. Since logins are being imported from Active Directory, users will not have pictures, nor will they be added. Any chance that Show Earners can display a list of names instead? Or is there some code I can use to achieve the same effect?

    Thanks much,

    — Peter Nepstad

    https://www.ads-software.com/plugins/badgeos/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    Looks like the best we can do as is is utilize the filter inside of get_avatar() which is what we use for the link text/image.

    At the end of get_avatar():

    return apply_filters( 'get_avatar', $avatar, $id_or_email, $size, $default, $alt );

    You could hook into that, use the $id_or_email value to get the user’s info and return just their first/last name instead.

    Thread Starter peternepstad

    (@peternepstad)

    I found that bit of code and played around a bit but I’m not quite proficient enough with functions to know how exactly to change what is being returned.

    In the meantime, I also tried a plug-in route, using the Active Directory Integration plug in, which is what I was using, combined with the additional Active Directory Thumbnails plugin let me pull in images so now the images works, I’ll see at launch how the users like it.

    Thanks much,

    — Peter

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Try this out. This is also assuming you’re not using BuddyPress at all.

    function custom_bos_avatar_change( $avatar, $id_or_email ) {
    	$user = get_user_meta( $id_or_email );
    
    	return $user['nickname'][0];
    }
    add_filter( 'get_avatar', 'custom_bos_avatar_change', 11, 2 );

    If you are using BuddyPress as well, let me know, it’ll need a bit more touchups.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can "Show Earners" checkbox list names?’ is closed to new replies.