Skip to main content

[benecaster_user_badge]

Plugin Free Since v1.0.0

Renders a user’s badge chips (tier-auto grants + manual grants) inline. Defaults to the current logged-in user so the shortcode drops into member-only page templates without arguments.

Returns empty string when no user resolves or the user has no badges (no wrapper div is emitted). Enqueues assets/css/badges.css only when markup is actually emitted. Badge data passes through the benecaster_user_badges filter. Output filterable via benecaster_user_badge_shortcode_output.

Parameters

Name Type Default Required Description
user_id int (current user) No WordPress user ID whose badges to render. Defaults to the currently logged-in user.
show_id int (site-wide) No Optional. Passed to benecaster_get_user_badges() so the benecaster_user_badges filter can scope badge visibility per show without changing the schema.

Example

<!-- Current user's badges on a member profile page -->
[benecaster_user_badge]

<!-- Specific user's badges -->
[benecaster_user_badge user_id="42"]

<!-- Badges scoped to a specific show for a forum integration -->
[benecaster_user_badge show_id="3"]