Skip to main content

benecaster_feed_channel_data

Filter Free

Filters the channel-level data array before the feed is rendered. Every key reaches the tag it names — the plain RSS elements and the itunes: tags are both rendered from the array this filter returns, so one change here moves every tag that carries the value. Use it to override any field at render time without touching stored settings, and — with $tier_slug — to give one tier’s feed a different title, artwork or summary from another’s.

Fires once per tier per feed compilation. The feed cache is per tier, so per-tier output is cached correctly.

Key Type Renders as
title string <title>, <image><title>, <itunes:title>
link string <link>, <image><link>
description string <description> — the short show description
summary string <itunes:summary> — the full show body, tier gate already resolved
language string <language>
copyright string <copyright> — omitted when empty
build_date string (RFC 2822) <lastBuildDate> and <pubDate>
feed_url string <atom:link rel="self">
artwork string URL <image><url> and <itunes:image href>
author string <itunes:author> and <itunes:owner><itunes:name>
author_email string <itunes:owner><itunes:email>
subtitle string <itunes:subtitle> — omitted when empty
category string <itunes:category text> — omitted when empty
subcategory string nested <itunes:category text>
explicit bool <itunes:explicit> true/false
type string <itunes:type> — episodic or serial; any other value renders episodic
is_private bool <itunes:block>Yes</itunes:block> when true
is_complete bool <itunes:complete>Yes</itunes:complete> when true
new_feed_url string <itunes:new-feed-url> — an empty string suppresses the tag

podcast: namespace tags are not in this array — they have their own authoritative filter, benecaster_feed_podcast_channel_tags.

Parameters

Name Type Default Description
$channel_data array — Channel data array. See the description for every key and the tag it renders.
$show_id int — ID of the show
$tier_slug string — Tier slug for this feed compilation pass (`public` for the public feed)

Returns: array

Examples

Label paid feeds in the podcast app

add_filter( 'benecaster_feed_channel_data', function ( array $data, int $show_id, string $tier_slug ): array {
    if ( 'public' !== $tier_slug ) {
        $data['title'] .= ' (Premium)';
    }
    return $data;
}, 10, 3 );

Suppress the redirect tag for one show without clearing stored settings

add_filter( 'benecaster_feed_channel_data', function ( array $data, int $show_id ): array {
    if ( MY_SHOW_ID === $show_id ) {
        $data['new_feed_url'] = '';
    }
    return $data;
}, 10, 2 );

Different artwork on paid feeds

add_filter( 'benecaster_feed_channel_data', function ( array $data, int $show_id, string $tier_slug ): array {
    if ( 'public' !== $tier_slug ) {
        // Moves both <image><url> and <itunes:image> — the one Apple Podcasts reads.
        $data['artwork'] = 'https://cdn.example.com/premium-artwork.jpg';
    }
    return $data;
}, 10, 3 );

Notes

Always return the full array with your changes applied — a key you drop renders as empty.

$tier_slug is a trailing argument; a callback registered for two arguments is unaffected. The itunes: keys (artwork, author, category, new_feed_url and the rest) reach their tags.

Related: benecaster_feed_episode_data (the same for each item), benecaster_rss_extra_channel_tags (add channel elements this array has no key for).

Need this built rather than just documented? See our services →