WP-for-Church / Sermon-Manager

Sermon Manager for WordPress is the #1 plugin for churches who want to manage their sermons easily and missionally.
https://wordpress.org/plugins/sermon-manager-for-wordpress/
GNU General Public License v2.0
44 stars 34 forks source link

Feature Request: Public Function to return audio url. #308

Open regiside opened 9 months ago

regiside commented 9 months ago

I realize this plugin doesn't have a maintainer at the moment, but if anyone ever picks it back up or decides to fork it, It would be nice if the following code was turned into a function that could be accessed by theme developers and even internally across the plugin as the same or similar code is repeated in multiple view, and in the rss feeds.

The code is used to check if the sermon audio url is a wordpress attachment or an external link and if it's a wordpress attachment return that instead of a hard coded value from the database.

$sermon_audio_id = get_wpfc_sermon_meta( 'sermon_audio_id' ); $sermon_audio_url_wp = $sermon_audio_id ? wp_get_attachment_url( intval( $sermon_audio_id ) ) : false; $sermon_audio_url = $sermon_audio_id && $sermon_audio_url_wp ? $sermon_audio_url_wp : get_wpfc_sermon_meta( 'sermon_audio' );

It would be nice if there was a "get_wpfc_sermon_audio_url" which would return either the wordpress attachment url or the saved database string if it wasn't an attachment.

GermanKiwi commented 2 months ago

I'd recommend creating a ticket at https://wpforchurch.com/my/clientarea.php so the current owner of the plugin can consider adding this. It's still being developed, just not in this Github.