benecaster_episode_share_output
Filters the final rendered HTML output of [benecaster_episode_share] and the Share Buttons Episode Page block. $links is the share link array after benecaster_episode_share_links filtering — platforms with a null URL have already been omitted. Use to change the button markup, wrap the output in a custom container, or inject additional share targets after the standard set.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$html |
string |
— | Rendered HTML output |
$links |
array |
— | Share link objects after benecaster_episode_share_links filtering |
$atts |
array |
— | Resolved shortcode or block attributes |
Returns:
string
Examples
Wrap output with platform count attribute
add_filter( 'benecaster_episode_share_output', function( $html, $links, $atts ) {
return '<div class="episode-share-block" data-platforms="' . count( $links ) . '">' . $html . '</div>';
}, 10, 3 );
Wrap in custom container class
add_filter( 'benecaster_episode_share_output', function( string $html, array $links, array $atts ): string {
return '<div class="episode-share">' . $html . '</div>';
}, 10, 3 );
Notes
To modify the share message text before it is encoded into platform URLs, use benecaster_episode_share_text instead.
Affects
- [benecaster_episode_share](/shortcodes/benecaster-episode-share/) shortcode
- Share Buttons Episode Page block