benecaster_feed_podcast_episode_tags
Filters the per-episode Podcasting 2.0 tag array before XML output. Pre-populated from episode meta. Add-ons receive the populated array and may add, override, or remove entries. All keys are optional.
| Key | Type | Podcast 2.0 tag | Populated by | |—|—|—|—| | `transcript` | `{url: string, type: string}` | `podcast:transcript` | Transcription Service add-on | | `soundbites` | `list<{start_time: float, duration: float, title?: string}>` | `podcast:soundbite` | — | | `feed_credits` | `list<{name: string, role?: string, url?: string, image?: string}>` | `podcast:person` | Guest Manager add-on | | `images` | string (srcset) | `podcast:images` | — | | `season` | `{number: int, name?: string}` | `podcast:season` | — | | `chapters` | `{url: string, type?: string}` | `podcast:chapters` | Core (Chapter Markers) |
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tags |
array |
— | Per-episode Podcasting 2.0 tag array. See description for key reference. All keys optional. |
$episode_id |
int |
— | Episode post ID |
$show_id |
int |
— | Show post ID |
Returns:
array
Example
add_filter( 'benecaster_feed_podcast_episode_tags', function( $tags, $episode_id, $show_id ) {
// Inject a soundbite from post meta (start/duration stored as JSON).
$soundbite = get_post_meta( $episode_id, '_episode_soundbite', true );
if ( $soundbite ) {
$sb = json_decode( $soundbite, true );
$tags['soundbites'][] = [
'start_time' => (float) $sb['start'],
'duration' => (float) $sb['duration'],
'title' => $sb['title'] ?? '',
];
}
return $tags;
}, 10, 3 );