[benecaster_player]
Embeds an episode audio or video player. Respects access controls — if the current user does not have access to the episode, renders the output of benecaster_locked_content_message instead of the player. Renders in all contexts including pages, posts, and widget areas.
Styling
The player wrapper uses BEM classes. The block is .benecaster-player; the style modifier is .benecaster-player--standard, .benecaster-player--minimal, or .benecaster-player--card (set from the style attribute). The wrapper also carries data-episode-id and data-show-id attributes used by the frontend JS beacon.
Three element classes render inside the wrapper: .benecaster-player__artwork (wraps img when show_artwork is truthy and the episode has artwork), .benecaster-player__title (a p rendered when show_title is truthy and the title is non-empty), and .benecaster-player__audio (native audio controls preload="none"). The locked-state message uses .benecaster-locked on a p.
No CSS custom properties are exposed — no --bc-* variables, no inline style="" attributes. The plugin ships no stylesheet for .benecaster-player. No template override path exists — the render is fully inline; there is no templates/player/ directory and no benecaster_locate_template() call.
For markup-level customization use the two PHP filters: benecaster_player_output ($html, $episode_id, $atts) mutates the final HTML string; benecaster_locked_content_message ($html, $episode_id, '', $user_tier) mutates the locked-state message HTML.
Parameters
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
episode_id |
int |
current episode
|
No | ID of the episode to play. Defaults to the current episode when rendered inside a single episode template. |
show_id |
int |
— | No | If episode_id is not set, plays the latest episode of this show. On single-show installs, may be omitted — auto-resolved via benecaster_get_sole_show_id(). On multi-show installs without an explicit show_id, renders an inline error comment. |
style |
string |
standard
|
No | Player layout. Options: standard, minimal, card. |
show_title |
bool |
true
|
No | Whether to display the episode title above the player. |
show_artwork |
bool |
true
|
No | Whether to display episode artwork alongside the player. |
Example
<!-- Play a specific episode with the card style -->
[benecaster_player episode_id="42" style="card"]
<!-- Play latest episode of a show, minimal style, no artwork -->
[benecaster_player show_id="5" style="minimal" show_artwork="false"]