[benecaster_episode_share]
Renders social share buttons for an episode. Share links are auto-generated from the episode URL and title — no per-platform URL entry required.
The episode must be published. For a draft, scheduled, private, pending or trashed episode (an episode_id you set, or the current post) the shortcode renders nothing for visitors; anyone who can edit that episode still sees it, as with [benecaster_player].
Share text comes from the text attribute, which supports merge tags: {{episode_title}}, {{show_name}}, {{episode_number}}. Without it, the text is the episode title.
The share text reaches X only. Facebook no longer accepts prefilled share text and LinkedIn removes it, so those buttons share the episode link alone, and copy-link copies the link. That is a limit of the platforms, and no setting changes it. On X the composer adds the episode URL itself, so the text should not include it.
Copy link puts the episode URL on the clipboard, with no share text, and its label reads Copied! for two seconds to confirm. Browsers only allow this on a secure page, so on a site served over plain http:// (anywhere other than localhost) the button does nothing.
The four platforms are X, Facebook, LinkedIn and copy-link. A slug outside that list renders nothing rather than a broken button.
Output filterable via benecaster_episode_share_output. Share text filterable per share platform via benecaster_episode_share_text, which does not run for Copy link.
Styling or scripting the Copy link button? Select it by its data-copy-url attribute. The shortcode renders it as .benecaster-episode-share__copy and the Share Buttons Episode Page block renders it as .benecaster-share-buttons__copy, so a class selector reaches only one of the two. data-copy-url is on both and holds the URL the button copies.
Parameters
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
episode_id |
int |
(current episode)
|
No | Episode to generate share links for |
show_id |
int |
(current show)
|
No | Used for show name merge tag resolution |
style |
string |
buttons
|
No | buttons — labeled button row; icons — icon-only row; minimal — icon row, no labels, no borders |
platforms |
string |
twitter_x,facebook,linkedin,copy_link
|
No | Comma-separated platform slugs to include, from twitter_x, facebook, linkedin and copy_link. Omit to show all four, in that order. The list is fixed: each platform needs built-in code to build its share link. |
text |
string |
{{episode_title}}
|
No | Share message template, used by the X button only; the other platforms share the link alone. Supports merge tags {{episode_title}}, {{show_name}}, {{episode_number}}. |
Example
<!-- Default share buttons for current episode -->
[benecaster_episode_share]
<!-- Icons only, specific platforms -->
[benecaster_episode_share style="icons" platforms="twitter_x,facebook,copy_link"]
<!-- Custom share text with merge tags -->
[benecaster_episode_share text="🎧 {{episode_title}} — new episode of {{show_name}}"]
<!-- Minimal style, all platforms, specific episode -->
[benecaster_episode_share episode_id="123" style="minimal"]