How to get all distribution URLs for use in a template (archive/single/sidebar)?
-
first of all: thank you very much for this amazing plugin! It’s really a great help to manage a podcast on our very own server ??
We want to show a list of all the distribution URLs, that we entered in the backend (e.g. wp-admin/edit.php?post_type=podcast&page=podcast_options and /wp-admin/edit.php?post_type=podcast&page=podcast_settings&tab=feed-details).
We figured out, that these URLs get saved as a wp_option with the prefix “ss_podcasting_{servicename}_url”. So we are able to search for these options and display them via get_option(). But if we do not know, which URLs are set, we need to try every single option and check if they are set or not.
We also searched the plugin code and found :
php/classes/controllers/class-players-controller.php line 606
where there is the following object used:
new Option_Handler();
But this seems only to work if we set an episode ID and a “context”.
[EDIT] We could do something like this, but this feels like unnecessary guessing and is very tedious to figure out which services are set
$subscribe_urls['google'] = get_option('ss_podcasting_google_podcasts_url'); $subscribe_urls['apple'] = get_option('ss_podcasting_apple_podcasts_url'); $subscribe_urls['amazon'] = get_option('ss_podcasting_amazon_url'); $subscribe_urls['rss'] = get_option('ss_podcasting_rss_url'); $subscribe_urls['spotify'] = get_option('ss_podcasting_spotify_url');
[/EDIT]
Question: is there an easier way to get all the URLs that were set via the aforementioned wordpress backend settings? (without “guessing” the used distribution services?)
The page I need help with: [log in to see the link]
- The topic ‘How to get all distribution URLs for use in a template (archive/single/sidebar)?’ is closed to new replies.