I haven’t had a proper look through the new Badges extension yet, but no doubt someone in the community (or myself!) will want to add in some custom badges soon. Are there any recommended hooks, actions, or documentation available, or perhaps a quick code snippet we could follow as an example?
Implementing the logic behind it is a bit more complex, the hook depends on the metric – for example, the Favorites Received one uses hivepress/v1/models/favorite/create and hivepress/v1/models/favorite/delete hooks to re-calculate the number of favorites only when it changes. There’s a function that can be called to add/remove a badge (based on the calculated number), but it’s not available outside of the extension code at the moment; we’ll make it public in the next update:
This function would go through the badges with ‘favorites_received’ metric selected, and award the first badge passing the threshold, also cleaning up any other badges with the same metric selected.