ContentNamespace
\Benecaster\Feed\Namespaces\ContentNamespace
The feed handler for <content:encoded>, the full HTML show notes of an episode. Prefix content, URI http://purl.org/rss/1.0/modules/content/. The plugin registers it at boot. It emits nothing at channel level, and one <content:encoded> element in each item. It implements both TierAwareEpisodeNamespaceInterface and DataDrivenNamespaceInterface.
The element’s content is the episode’s post content, passed through the benecaster_episode_content filter and then resolves any access gate and then any tier gate, so a [benecaster_access_gate] or [benecaster_tier_gate] in the episode resolves for the slug being compiled. Any other shortcode is left as raw text. The episode’s stamped credit, if it has one, is appended after the body. An episode with no content and no credit gets no element.
Inside the feed compiler the class is data-driven. episode_data() supplies a content_encoded key to the benecaster_feed_episode_data array, and render_episode() renders whatever that key holds after the filter, so a callback that changes content_encoded changes the tag, and an empty string removes it. Because the compiler tests for the data-driven interface first, it never calls this class’s episode_tags_for_tier(). That method and episode_tags() produce the same output for callers outside the compiler.
Constructor Dependencies
| Type | Description |
|---|---|
?\Benecaster\Feed\FeedTierGate |
Resolves tier gates in the episode content. Optional; without one every gate takes its else branch. |
?\Benecaster\Feed\FeedAccessGate |
Resolves access gates in the episode content, before the tier gate runs. Optional; without one every access gate takes its else branch. |
Methods
| Method | Visibility | Since | Description |
|---|---|---|---|
get_xmlns(): array |
Public | — | Returns [ 'content' => 'http://purl.org/rss/1.0/modules/content/' ]. |
channel_tags( int $show_id ): array |
Public | — | Always returns an empty array. |
episode_tags( int $episode_id, int $show_id ): array |
Public | — | The fragment as the public feed would render it. Calls episode_tags_for_tier() with the public tier, so every tier gate takes its else branch. |
episode_tags_for_tier( int $episode_id, int $show_id, string $tier_slug ): array |
Public | — | The fragment for one tier: builds the episode data for that tier and renders it. |
channel_data( int $show_id, string $tier_slug ): array |
Public | — | Always returns an empty array; this class adds no channel keys. |
render_channel( array $channel_data, int $show_id ): array |
Public | — | Always returns an empty array. |
episode_data( int $episode_id, int $show_id, string $tier_slug ): array |
Public | — | Returns [ 'content_encoded' => ... ]. The value is the episode's post content run through benecaster_episode_content (arguments: the content, the episode ID and the tier slug), then resolved for the slug (access gates, then tier gates) after the filter, so a gate a callback adds is resolved too, then followed by the stamped credit on a new line when the episode has one. |
render_episode( array $episode_data, int $episode_id, int $show_id ): array |
Public | — | Renders $episode_data['content_encoded'] as a ` element wrapped in CDATA, with any ]]>` in the content split so it cannot end the block early. Returns an empty array when the value is empty. |
render_item_content( string $content_encoded ): string |
Public | — | Wraps a string in a `` element and returns it, or an empty string for empty input. Nothing in the plugin calls it now. |
Hooks Fired
Notes
Only the tier-gate tags are resolved in the feed; other shortcodes in the episode content reach <content:encoded> unrendered. The stamped credit is resolved when it is stamped and is not processed again here.