From 27521e8958d35d64684b8bdc242107156e6bc48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Miljkovi=C4=87?= Date: Tue, 9 Oct 2018 08:33:08 +0200 Subject: [PATCH] Add option to enable sermon series image fallback in the feed Closes #92 --- includes/admin/settings/class-sm-settings-podcast.php | 8 ++++++++ readme.txt | 1 + views/wpfc-podcast-feed.php | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/includes/admin/settings/class-sm-settings-podcast.php b/includes/admin/settings/class-sm-settings-podcast.php index fd91ba8..b642694 100644 --- a/includes/admin/settings/class-sm-settings-podcast.php +++ b/includes/admin/settings/class-sm-settings-podcast.php @@ -202,6 +202,14 @@ public function get_settings() { 'desc' => 'URL to use for the Overcast link in the [list_podcasts] shortcode. Shortcode key to include/exclude: overcast.', 'desc_tip' => 'Leave empty to disable.', ), + array( + 'title' => __( 'Sermon Image', 'sermon-manager-for-wordpress' ), + 'type' => 'checkbox', + 'id' => 'podcast_sermon_image_series', + 'desc' => __( 'Fallback to series image if sermon does not have its own image.', 'sermon-manager-for-wordpress' ), + 'desc_tip' => __( 'Default disabled.', 'sermon-manager-for-wordpress' ), + 'default' => 'no', + ), array( 'type' => 'sectionend', diff --git a/readme.txt b/readme.txt index e4d5189..bb01f99 100755 --- a/readme.txt +++ b/readme.txt @@ -105,6 +105,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man ## Changelog ## ### 2.15.3 ### * New: Add option to disable "views" count for editors and admins +* New: Add option to enable sermon series image fallback in the feed * Fix: Podcast shortcode SVG icons not working in Firefox * Fix: Getting 404 on filtering * Fix: Sermon Manager errors out when output buffering is disabled diff --git a/views/wpfc-podcast-feed.php b/views/wpfc-podcast-feed.php index 6fdc645..f3f6d66 100644 --- a/views/wpfc-podcast-feed.php +++ b/views/wpfc-podcast-feed.php @@ -174,7 +174,7 @@ $speaker = $speakers_terms ? $speakers_terms[0]->name : ''; $series = strip_tags( get_the_term_list( $post->ID, 'wpfc_sermon_series', '', ', ', '' ) ); $topics = strip_tags( get_the_term_list( $post->ID, 'wpfc_sermon_topics', '', ', ', '' ) ); - $post_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' ); + $post_image = get_sermon_image_url( SermonManager::getOption( 'podcast_sermon_image_series' ) ); $post_image = str_ireplace( 'https://', 'http://', ! empty( $post_image['0'] ) ? $post_image['0'] : '' ); $audio_duration = get_post_meta( $post->ID, '_wpfc_sermon_duration', true ) ?: '0:00'; $audio_file_size = get_post_meta( $post->ID, '_wpfc_sermon_size', 'true' ) ?: 0;