From 3322dcb614d3deaefde154f76d565090176c59a9 Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Fri, 4 Aug 2017 01:22:28 +0200 Subject: [PATCH] Fix autop not working correctly --- includes/podcast-functions.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/podcast-functions.php b/includes/podcast-functions.php index 6d9c99b..1eb7900 100755 --- a/includes/podcast-functions.php +++ b/includes/podcast-functions.php @@ -34,6 +34,10 @@ function wpfc_podcast_add_hooks( $query ) { add_filter( 'the_excerpt_rss', 'wpfc_podcast_summary' ); add_filter( 'rss_enclosure', '__return_empty_string' ); + if ( \SermonManager::getOption( 'enable_podcast_html_description' ) ) { + add_filter( 'the_excerpt_rss', 'wpautop' ); + } + // remove sermons that don't have audio $query->set( 'meta_query', array( 'relation' => 'AND', @@ -91,7 +95,7 @@ function wpfc_podcast_add_head() { @@ -166,7 +170,7 @@ function wpfc_podcast_add_item() { */ function wpfc_podcast_summary( $content ) { if ( \SermonManager::getOption( 'enable_podcast_html_description' ) ) { - $content = wp_filter_kses( wpautop( get_wpfc_sermon_meta( 'sermon_description' ) ) ); + $content = wpautop( wp_filter_kses( get_wpfc_sermon_meta( 'sermon_description' ) ) ); } else { $content = wp_filter_nohtml_kses( get_wpfc_sermon_meta( 'sermon_description' ) ); } @@ -222,7 +226,7 @@ function wpfc_bloginfo_rss_filter( $info, $show ) { break; case 'description': if ( \SermonManager::getOption( 'enable_podcast_html_description' ) ) { - $new_info = wp_filter_kses( wpautop( \SermonManager::getOption( 'itunes_summary' ) ) ); + $new_info = wpautop( wp_filter_kses( \SermonManager::getOption( 'itunes_summary' ) ) ); } else { $new_info = wp_filter_nohtml_kses( \SermonManager::getOption( 'itunes_summary' ) ); }