Skip to main content

PodcastNamespace

\Benecaster\Feed\Namespaces\PodcastNamespace

Class Free Deprecated in v1.0.0

Deprecated — use PodcastIndexNamespace instead.

A compatibility shim, not a feed handler. It does not implement FeedNamespaceInterface, is never registered with the namespace registry, and emits no XML. Its only job is to keep callbacks on two deprecated filters working: benecaster_podcast_chapters and benecaster_podcast_transcripts. The plugin calls its register() at boot, which adds two callbacks to benecaster_feed_podcast_episode_tags at priority 1. Each callback does nothing unless the matching deprecated filter has a callback registered. When it does, it logs a _doing_it_wrong() notice once per request and copies that filter’s result into the tag array under chapters or transcript, where PodcastIndexNamespace renders it.

New code should not use the deprecated filters or this class. Set the chapters or transcript key in the tag array from a callback on benecaster_feed_podcast_episode_tags. PodcastIndexNamespace is the handler that renders the Podcasting 2.0 tags.

Methods

Method Visibility Since Description
register(): void Public — Adds shim_chapters() and shim_transcript() to benecaster_feed_podcast_episode_tags at priority 1 with 3 arguments each.
shim_chapters( array $tags, int $episode_id, int $show_id ): array Public — Returns $tags unchanged when nothing is registered on benecaster_podcast_chapters. Otherwise it logs the deprecation notice, and unless $tags['chapters'] is already set it applies the deprecated filter with an empty array and the episode ID and, when the result has a non-empty url, stores the result as $tags['chapters'].
shim_transcript( array $tags, int $episode_id, int $show_id ): array Public — Returns $tags unchanged when nothing is registered on benecaster_podcast_transcripts. Otherwise it logs the deprecation notice, and unless $tags['transcript'] is already set it applies the deprecated filter and takes the first entry only, because the tag array holds one transcript. When that entry has a url it is stored as $tags['transcript'] with its type, defaulting to text/plain.

Hooks Fired

Notes

The shim runs at priority 1, before Benecaster's own chapters-URL provider at priority 10, and both skip a key that is already set, so a chapters URL from the deprecated filter takes precedence over the one derived from an episode's authored chapters. Only the first transcript from the deprecated filter is used.