aha. On User X’s profile, show his achievements to everyone.
Not sure where exactly you’re aiming to display on the profile pages, but in terms of querying for the achievements and whatnot, I’d use badgeos_get_user_achievements()
and bp_displayed_user_id()
https://badgeos.org/api/source-function-badgeos_get_user_achievements.html#12-66
To do the fetching, I’d do something like the following:
$achievements = badgeos_get_user_achievements( array( 'user_id' => bp_displayed_user_id() ) );
if ( !empty( $achievements ) ) {
foreach( $achievements as $achievement ) {
//Output stuff here.
}
}
The $achievements
variable will be an array of achievement/post objects. With each object will be a handful of properties: “ID”, “post_type”, “points”, “date_earned”. Each will be available to display via $achievement->post_type, for example with above.
With regards to achievement images, since they’re post types, and you have the achievement/post ID, you can use that with get_the_post_thumbnail()
.
Hope that helps and gives you a good idea of how to proceed.