Skip to main content

benecaster_current_tier_output

Filter Premium Since v1.0.0

Filters the text output of the [benecaster_current_tier] shortcode. The shortcode renders the subscriber’s current tier display name, or an empty string for non-subscribers. $tier_slug and $user are null for guests or visitors with no token for the show — return $output unchanged for those cases. The filter output is returned verbatim, so any HTML in the callback must be self-escaped.

Parameters

Name Type Default Description
$output string Current rendered output (tier display name, fallback value, or empty string)
$show_id int ID of the show being resolved
$tier_slug string|null Raw tier slug from the token; null for guests or visitors with no active tier mapping
$user \WP_User|null WordPress user object of the logged-in visitor; null for guests
$atts array Resolved shortcode attributes (show_id, format, fallback)

Returns: string

Example

add_filter( 'benecaster_current_tier_output', function( $output, $show_id, $tier_slug, $user, $atts ) {
    // Append a badge icon next to the tier name for premium subscribers.
    if ( 'premium' === $tier_slug ) {
        $output .= ' ⭐';
    }
    return $output;
}, 10, 5 );

Affects

  • [benecaster_current_tier] shortcode