Interacting with Achievement data

///Interacting with Achievement data
Interacting with Achievement data 2019-08-14T06:19:25-04:00

The following functions help with interaction with the achievement data.

Functions:

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

badgeos_is_achievement_sequential( $achievement_id )
Check if the given achievement’s step must be earned sequentially.

badgeos_achievement_user_exceeded_max_earnings( $achievement_id, $user_id )
Check if the given user has already earned the given achievement the maximum number of times.

badgeos_achievement_last_user_activity( $achievement_id, $user_id )
Get the UNIX timestamp for the last activity on the given achievement for the given user.

badgeos_get_achievement_earners( $achievement_id )
Get an array of all users who have earned the given achievement.

badgeos_build_achievement_object( $achievement_id )
Helper function for building an object for our earned achievement to be stored to user meta.

Filters:

achievement_object
Extend or override the earned achievement object data stored to user meta.