Skip to content

Commit

Permalink
Merge pull request #68 from WP-for-Church/dev
Browse files Browse the repository at this point in the history
Release 2.4.11
  • Loading branch information
Nikola Miljković authored Aug 31, 2017
2 parents cac2671 + 0ac34f6 commit e01cf13
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 46 deletions.
14 changes: 8 additions & 6 deletions includes/podcast-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ function wpfc_podcast_add_head() {
<?php if ( trim( category_description() ) !== '' ) : ?>
<itunes:summary><?php echo str_replace( '&nbsp;', '',
\SermonManager::getOption( 'enable_podcast_html_description' ) ?
stripslashes( wp_filter_kses( wpautop( category_description() ) ), true ) :
stripslashes( wpautop( wp_filter_kses( category_description() ) ), true ) :
stripslashes( wp_filter_nohtml_kses( category_description() ) ) ); ?></itunes:summary>
<?php else: ?>
<itunes:summary><?php echo str_replace( '&nbsp;', '',
\SermonManager::getOption( 'enable_podcast_html_description' ) ?
stripslashes( wp_filter_kses( wpautop( \SermonManager::getOption( 'itunes_summary' ) ) ) ) :
stripslashes( wpautop( wp_filter_kses( \SermonManager::getOption( 'itunes_summary' ) ) ) ) :
stripslashes( wp_filter_nohtml_kses( \SermonManager::getOption( 'itunes_summary' ) ) ) ); ?></itunes:summary>
<?php endif; ?>
<itunes:owner>
Expand All @@ -128,7 +128,9 @@ function wpfc_podcast_add_head() {
*/
function wpfc_podcast_add_item() {
global $post;
$audio = str_ireplace( 'https://', 'http://', get_post_meta( $post->ID, 'sermon_audio', true ) );
$audio_raw = str_ireplace( 'https://', 'http://', get_post_meta( $post->ID, 'sermon_audio', true ) );
$audio_p = strrpos( $audio_raw, '/' ) + 1;
$audio = substr( $audio_raw, 0, $audio_p ) . rawurlencode( substr( $audio_raw, $audio_p ) );
$speaker = strip_tags( get_the_term_list( $post->ID, 'wpfc_preacher', '', ' &amp; ', '' ) );
$series = strip_tags( get_the_term_list( $post->ID, 'wpfc_sermon_series', '', ', ', '' ) );
$topics = strip_tags( get_the_term_list( $post->ID, 'wpfc_sermon_topics', '', ', ', '' ) );
Expand All @@ -141,7 +143,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' ) ?
stripslashes( wp_filter_kses( wpautop( get_wpfc_sermon_meta( 'sermon_description' ) ) ) ) :
stripslashes( wpautop( wp_filter_kses( get_wpfc_sermon_meta( 'sermon_description' ) ) ) ) :
stripslashes( 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 @@ -172,7 +174,7 @@ function wpfc_podcast_add_item() {
*/
function wpfc_podcast_summary( $content ) {
if ( \SermonManager::getOption( 'enable_podcast_html_description' ) ) {
$content = stripslashes( wp_filter_kses( wpautop( get_wpfc_sermon_meta( 'sermon_description' ) ) ) );
$content = stripslashes( wpautop( wp_filter_kses( get_wpfc_sermon_meta( 'sermon_description' ) ) ) );
} else {
$content = stripslashes( wp_filter_nohtml_kses( get_wpfc_sermon_meta( 'sermon_description' ) ) );
}
Expand Down Expand Up @@ -228,7 +230,7 @@ function wpfc_bloginfo_rss_filter( $info, $show ) {
break;
case 'description':
if ( \SermonManager::getOption( 'enable_podcast_html_description' ) ) {
$new_info = stripslashes( wp_filter_kses( wpautop( \SermonManager::getOption( 'itunes_summary' ) ) ) );
$new_info = stripslashes( wpautop( wp_filter_kses( \SermonManager::getOption( 'itunes_summary' ) ) ) );
} else {
$new_info = stripslashes( wp_filter_nohtml_kses( \SermonManager::getOption( 'itunes_summary' ) ) );
}
Expand Down
10 changes: 0 additions & 10 deletions includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,6 @@ function displaySermons( $atts = array() ) {
'post_type' => 'wpfc_sermon',
'posts_per_page' => $args['per_page'],
'order' => $args['order'],
'meta_key' => 'sermon_date',
'meta_value_num' => time(),
'meta_compare' => '<=',
'paged' => $my_page,
);

Expand All @@ -643,13 +640,6 @@ function displaySermons( $atts = array() ) {
$args['orderby'] = 'date';
}

// set the ordering options
if ( $args['orderby'] === 'date' ) {
$query_args['orderby'] = 'meta_value_num';
} else {
$query_args['orderby'] = $args['orderby'];
}

// if we should show just specific sermons
if ( $args['sermons'] ) {
$posts_in = explode( ',', $args['sermons'] );
Expand Down
23 changes: 1 addition & 22 deletions includes/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,29 +363,8 @@ function wpfc_sermon_audio() {
// render additional files
function wpfc_sermon_attachments() {
global $post;
$args = array(
'post_type' => 'attachment',
'numberposts' => - 1,
'post_status' => null,
'post_parent' => $post->ID,
'exclude' => get_post_thumbnail_id()
);
$attachments = get_posts( $args );
$html = '';
$html .= '<div id="wpfc-attachments" class="cf">';
$html = '<div id="wpfc-attachments" class="cf">';
$html .= '<p><strong>' . __( 'Download Files', 'sermon-manager' ) . '</strong>';
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
// skip audio, so we don't have double URLs
if ( get_wpfc_sermon_meta( 'sermon_audio' ) === wp_get_attachment_url( $attachment->ID ) ) {
continue;
}

$html .= '<br/><a target="_blank" href="' . wp_get_attachment_url( $attachment->ID ) . '">';
$html .= $attachment->post_title;
$html .= '</a>';
}
}
if ( get_wpfc_sermon_meta( 'sermon_audio' ) ) {
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_audio' ) . '" class="sermon-attachments" download><span class="dashicons dashicons-media-audio"></span>' . __( 'MP3', 'sermon-manager' ) . '</a>';
}
Expand Down
13 changes: 7 additions & 6 deletions includes/types-taxonomies.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,13 @@ function wpfc_sermon_metaboxes() {
'id' => 'sermon_video',
'type' => 'textarea_code'
) );
$cmb2->add_field( array(
'name' => __( 'Video', 'sermon-manager' ),
'desc' => __( 'Paste your link for Vimeo, Youtube, or other service here', 'sermon-manager' ),
'id' => 'sermon_video_link',
'type' => 'text'
) );
$cmb2->add_field( apply_filters( 'sm_cmb2_field_sermon_video_link', array(
'name' => __( 'Video', 'sermon-manager' ),
'desc' => __( 'Paste your link for Vimeo, Youtube, or other service here', 'sermon-manager' ),
'id' => 'sermon_video_link',
'type' => 'text'
) )
);
$cmb2->add_field( array(
'name' => __( 'Sermon Notes', 'sermon-manager' ),
'desc' => __( 'Upload a pdf file or enter an URL.', 'sermon-manager' ),
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: http://wpforchurch.com/
Tags: church, sermon, sermons, preaching, podcasting
Requires at least: 4.5
Tested up to: 4.8.1
Stable tag: 2.4.10
Stable tag: 2.4.11

Add audio and video sermons, manage speakers, series, and more to your church website.

Expand Down Expand Up @@ -83,6 +83,12 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man
2. Sermon Files

== Changelog ==
= 2.4.11 =
* Fix paragraphs in podcast feed description
* Fix podcasts not validating with exotic mp3 file names
* Fix double URLs appearing in sermon downloads
* Fix sermons not appearing in shortcodes

= 2.4.10 =
* Fix filtering styling being broken

Expand Down
2 changes: 1 addition & 1 deletion sermons.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Sermon Manager for WordPress
Plugin URI: http://www.wpforchurch.com/products/sermon-manager-for-wordpress/
Description: Add audio and video sermons, manage speakers, series, and more. Visit <a href="http://wpforchurch.com" target="_blank">Wordpress for Church</a> for tutorials and support.
Version: 2.4.10
Version: 2.4.11
Author: WP for Church
Contributors: wpforchurch, jprummer, jamzth
Author URI: http://www.wpforchurch.com/
Expand Down

0 comments on commit e01cf13

Please sign in to comment.