Skip to main content

benecaster_tier_name_output

Filter Premium

Filters the text output of benecaster_tier_name before it is returned to the page. Returns empty string if the slug is not found.

Return the complete HTML string for the shortcode. Cast with (string).

This value becomes the shortcode’s return value and is not escaped by Benecaster — WordPress emits it as the shortcode’s output. Escape every dynamic part yourself; this is the filter to be careful with, not the display-side ones that run through esc_html().

Returning '' makes the shortcode render nothing at all, which is the supported way to suppress it conditionally. The $atts parameter is the shortcode’s resolved attributes, so a callback can scope itself to one usage rather than every instance on the site.

Parameters

Name Type Default Description
$output string — Tier display name as text; empty string if not found
$show_id int — ID of the show the tier was looked up on. The tier slug is `$atts['tier']`.
$atts array — Resolved shortcode attributes

Returns: string

Example

add_filter( 'benecaster_tier_name_output', function( $output, $show_id, $atts ) {
    // Map internal tier slugs to marketing-friendly display names.
    $names = [
        'starter' => 'Listener',
        'premium' => 'Superfan',
    ];
    return $names[ $atts['tier'] ?? '' ] ?? $output;
}, 10, 3 );

Need this built rather than just documented? See our services →