mycred_display_users_badges

Description

This function renders a list of all the badges a give user has earned.

This function is only available if the Badges add-on is enabled.

Available since version 1.5

Returns

All badge images a user has earned.

Parameters

Param Type Required Description
function mycred_display_users_badges(
$user_id int Yes

The users numeric ID.

) { ... }

Examples

Example 1: Show the current users badges.

$user_id = get_current_user_id();

echo '<h3>Your badges</h3>';
mycred_display_users_badges( $user_id );