Skip to content

Commit

Permalink
Fix autop not working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Miljkovic committed Aug 3, 2017
1 parent 2d4758d commit 3322dcb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions includes/podcast-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -91,7 +95,7 @@ function wpfc_podcast_add_head() {
<?php if ( trim( category_description() ) !== '' ) : ?>
<itunes:summary><?php echo str_replace( '&nbsp;', '',
\SermonManager::getOption( 'enable_podcast_html_description' ) ?
wp_filter_kses( wpautop( category_description() ) ):
wpautop( wp_filter_kses( category_description() ), true ) :
wp_filter_nohtml_kses( category_description() ) ); ?></itunes:summary>
<?php else: ?>
<itunes:summary><?php echo str_replace( '&nbsp;', '',
Expand Down Expand Up @@ -135,7 +139,7 @@ function wpfc_podcast_add_item() {
<itunes:subtitle><?php echo esc_html( $series ); ?></itunes:subtitle>
<itunes:summary><?php echo preg_replace( '/&nbsp;/', '',
\SermonManager::getOption( 'enable_podcast_html_description' ) ?
wp_filter_kses( wpautop( get_wpfc_sermon_meta( 'sermon_description' ) ) ) :
wpautop( wp_filter_kses( get_wpfc_sermon_meta( 'sermon_description' ) ) ) :
wp_filter_nohtml_kses( get_wpfc_sermon_meta( 'sermon_description' ) ) ); ?></itunes:summary>
<?php if ( $post_image ) : ?>
<itunes:image href="<?php echo esc_url( $post_image ); ?>"/>
Expand Down Expand Up @@ -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' ) );
}
Expand Down Expand Up @@ -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' ) );
}
Expand Down

0 comments on commit 3322dcb

Please sign in to comment.