Skip to main content

benecaster_show_description_output

Filter Free Since v1.0.0

Filters the final rendered HTML output of the [benecaster_show_description] shortcode before it is returned to the page. This filter fires after benecaster_show_description has already run, so $description received here is the already-filtered string.

This filter is shortcode-only — it does not fire inside benecaster_get_show_description() or during RSS feed rendering. To filter the raw description string at all call sites (including the RSS feed and direct function calls), use benecaster_show_description instead.

Parameters

Name Type Default Description
$html string Rendered HTML output
$description string The filtered description string passed to the renderer
$atts array Resolved shortcode attributes including show_id and type

Returns: string

Examples

Wrap output in schema.org description span

add_filter( 'benecaster_show_description_output', function( $html, $description, $atts ) {
    // Wrap the description in a schema.org description span.
    return '<span itemprop="description">' . $html . '</span>';
}, 10, 3 );

Wrap output in custom class div

add_filter( 'benecaster_show_description_output', function ( string $html, string $description, array $atts ): string {
    return '<div class="show-summary">' . $html . '</div>';
}, 10, 3 );

Notes

Shortcode only. Does not fire inside benecaster_get_show_description() or during RSS feed rendering. To filter the raw description string at all call sites, use benecaster_show_description instead.

Affects

  • [benecaster_show_description] shortcode