Changing "People who have earned this" display
-
Hi, I’m trying to change the list of “People who have earned this:” to show user nicknames instead of avatars. I am using BadgeOS Version 1.4.4 and BadgeOS Community Add-On Version 1.2.0.
I found the badgeos_get_achievement_earners_list function in badgeos/includes/achievement-functions.php and replaced the following on line 642:
$user_content = ' <li><a>ID ) . '">' . get_avatar( $user->ID ) . '</a></li> ';
with
$user_content = ' <li><a>ID ) . '">' . the_author_meta( 'nickname' , $user->ID ) . '</a></li> ';
However, while that does display the user nickname, it appears above “People who have earned this:”, and user avatars still show up in an unordered list.
So I also found the function badgeos_bp_achievement_earner in badgeos-community-add-on/includes/bp-members.php and replaced the following:
$user = new BP_Core_User( $user_id );<br /> return ' <li><a>user_url . '">' . $user->avatar_mini . '</a></li> ';
with
$user = new BP_Core_User( $user_id );<br /> return ' <li><a>user_url . '">' . the_author_meta( 'nickname' , $user->ID ) . '</a></li> ';
Here’s a link to an example page: https://westmontlibrary.org/inventyoursummer/badge/wild-child/
I’m close, but I could use some help nailing it down. I hope it’s okay to ask a question like this here. Thank you!
Edit: I tried putting the code inside backticks, but I think I messed it up somewhere.
- The topic ‘Changing "People who have earned this" display’ is closed to new replies.