Skip to main content

benecaster_explicit_badge_label

Filter Free

Overrides the human-readable text inside the explicit badge. The default is “Explicit” for both explicit modes and “Clean” for the clean mode.

This filter exists because the wording is genuinely contested. Some podcasters want the compact “E” that Apple uses, some want “18+”, some want their own phrasing — and every one of those strings has to be translatable for the Localization work. Reach for this before the HTML filter: it is the smaller hammer, and it leaves the accessibility attributes and class modifiers intact.

The returned string is escaped at render time, so return plain text rather than markup. If you need markup, that is what benecaster_explicit_badge_html is for.

Parameters

Name Type Default Description
$label string — Default label text for this mode.
$mode string — The resolved mode the label belongs to — `'clean'`, `'yes'`, or `'explicit'`.

Returns: string

Examples

Use a compact "E" instead of "Explicit"

add_filter( 'benecaster_explicit_badge_label', function ( string $label, string $mode ): string {
    return 'clean' === $mode ? $label : 'E';
}, 10, 2 );

Reword both labels in your own text domain

add_filter( 'benecaster_explicit_badge_label', function ( string $label, string $mode ): string {
    return 'clean' === $mode
        ? __( 'Family friendly', 'my-theme' )
        : __( 'Adult content', 'my-theme' );
}, 10, 2 );

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