benecaster_get_podcast_platforms()
benecaster_get_podcast_platforms(): array
The podcast listening platforms for “Listen on” links, in the order [benecaster_platform_links] displays them. Use it to offer the shortcode’s platforms choices in a block or widget.
The list ends with rss, and a picker must offer it. The shortcode’s platforms attribute leaves out anything it does not name, so a picker that writes its selection there with no rss choice drops the show’s own RSS Feed link the moment anything is ticked. The label is the one the shortcode renders.
Return Value
Type:
array
slug => label, in display order, with translated labels: apple_podcasts, spotify, overcast, pocket_casts, castro, podcast_addict, amazon_music, youtube_music, rss (RSS Feed).
Example
$choices = benecaster_get_podcast_platforms();
// [ 'apple_podcasts' => 'Apple Podcasts', 'spotify' => 'Spotify', …, 'rss' => 'RSS Feed' ]
$automatic = benecaster_get_automatic_podcast_platforms(); // [ 'rss' ]
foreach ( $choices as $slug => $label ) {
// An automatic entry is a plain on/off choice: there is no URL to enter.
$hint = in_array( $slug, $automatic, true ) ? ' (added automatically)' : '';
printf( '<label><input type="checkbox" value="%s"> %s%s</label>', esc_attr( $slug ), esc_html( $label ), esc_html( $hint ) );
}
Notes
rss has no URL to enter. The shortcode fills it in from the show's public feed (unless the podcaster added their own rss link, which wins). Offer it as a checkbox, never a URL field, and ask benecaster_get_automatic_podcast_platforms() which entries work that way.
This is not the same list as Show Settings. Show Settings has no field for rss, deliberately, so this list is Show Settings' platforms plus the automatic entries.
Read-only, with no filter, by design — for the same reason as benecaster_get_social_platforms(): the show's settings keep their own list, so an added platform could never be chosen.
Need this built rather than just documented? See our services →