Displaying Achievements and Achievement Data

///Displaying Achievements and Achievement Data
Displaying Achievements and Achievement Data 2019-08-14T06:25:39-04:00

These functions will give you an understanding of how the achievements and achievement data can be inserted into your theme.


$args = array(
'post_type' => badgeos_get_achievement_types_slugs(),
'suppress_filters' => false,
'achievement_relationship' => 'any',
badgeos_get_achievements( $args );

Returns an array of achievements matching the passed arguments.

badgeos_get_achievement_post_thumbnail( $post_id, $image_size, $css_class )
Returns an achievement’s post thumbnail. Falls back first to parent achievement type’s thumbnail, and finally to a default BadgeOS icon from Credly.

badgeos_get_achievement_earners_list( $achievement_id )
Returns an unordered list of users who have earned a given achievement.

badgeos_get_required_achievements_for_achievement_list( $achievement_id, $user_id )
Returns HTML markup (unordered list) for an achievement’s required steps. Automatically adds a “user-has-earned” class to steps the given user has completed.

badgeos_achievement_points_markup( $achievement_id )
Returns HTML markup for an achievement’s specified points.

badgeos_render_achievement( $achievement )
Render full HTML markup an achievement given its post object.

Useful Shortcodes: