Skip to content

Commit

Permalink
Release 2.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola committed Jan 25, 2018
2 parents cacfec8 + 6de8425 commit fecc2ca
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion includes/class-sm-dates-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public static function maybe_update_date( $post_ID, $post, $update ) {

if ( $update ) {
// compare sermon date and if user changed it update sermon date and disable auto update
if ( ! empty( $GLOBALS['sm_original_sermon_date'] ) && ! empty( $_POST['sermon_date'] ) ) {
if ( ! empty( $_POST['sermon_date'] ) ) {
$dt = DateTime::createFromFormat( SermonManager::getOption( 'date_format' ) ?: 'm/d/Y', $_POST['sermon_date'] );
$dt_post = DateTime::createFromFormat( 'U', mysql2date( 'U', $post->post_date ) );

Expand Down
10 changes: 0 additions & 10 deletions includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -880,16 +880,6 @@ function displaySermons( $atts = array() ) {
if ( $query->have_posts() ) {
ob_start(); ?>
<div id="wpfc_sermon">
<form role="search" method="get" class="wpfc_searchform" action="<?php echo home_url( '/' ); ?>">
<h4>Search</h4>
<div>
<input type="text" name="s" id="s" placeholder="Search by book, preacher, month & more.."/>
<input type="hidden" name="sentence" value="1"/>
<input type="hidden" name="post_type" value="wpfc_sermon"/>
<button type="submit" id="searchsubmit" value="Search" class="btn btn-default"><i
class="glyphicon glyphicon-search"></i></button>
</div>
</form>
<div id="wpfc_loading">
<?php while ( $query->have_posts() ): ?>
<?php $query->the_post();
Expand Down
25 changes: 22 additions & 3 deletions includes/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
add_action( 'sermon_single', 'wpfc_sermon_single' );
add_action( 'sermon_excerpt', 'wpfc_sermon_excerpt' );
add_filter( 'the_content', 'add_wpfc_sermon_content' );
add_filter( 'the_excerpt', 'add_wpfc_sermon_player' );

// Include template for displaying sermons
function sermon_template_include( $template ) {
Expand Down Expand Up @@ -443,13 +444,13 @@ function wpfc_sermon_attachments() {
$html = '<div id="wpfc-attachments" class="cf">';
$html .= '<p><strong>' . __( 'Download Files', 'sermon-manager-for-wordpress' ) . '</strong>';
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-for-wordpress' ) . '</a>';
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_audio' ) . '" class="sermon-attachments" download="' . basename( get_wpfc_sermon_meta( 'sermon_audio' ) ) . '"><span class="dashicons dashicons-media-audio"></span>' . __( 'MP3', 'sermon-manager-for-wordpress' ) . '</a>';
}
if ( get_wpfc_sermon_meta( 'sermon_notes' ) ) {
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_notes' ) . '" class="sermon-attachments"><span class="dashicons dashicons-media-document"></span>' . __( 'Notes', 'sermon-manager-for-wordpress' ) . '</a>';
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_notes' ) . '" class="sermon-attachments" download="' . basename( get_wpfc_sermon_meta( 'sermon_notes' ) ) . '"><span class="dashicons dashicons-media-document"></span>' . __( 'Notes', 'sermon-manager-for-wordpress' ) . '</a>';
}
if ( get_wpfc_sermon_meta( 'sermon_bulletin' ) ) {
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_bulletin' ) . '" class="sermon-attachments"><span class="dashicons dashicons-media-document"></span>' . __( 'Bulletin', 'sermon-manager-for-wordpress' ) . '</a>';
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_bulletin' ) . '" class="sermon-attachments" download="' . basename( get_wpfc_sermon_meta( 'sermon_bulletin' ) ) . '"><span class="dashicons dashicons-media-document"></span>' . __( 'Bulletin', 'sermon-manager-for-wordpress' ) . '</a>';
}
$html .= '</p>';
$html .= '</div>';
Expand Down Expand Up @@ -572,6 +573,24 @@ function wpfc_sermon_excerpt( $return = false ) {
return $output;
}

function add_wpfc_sermon_player() {
$content = '';

if ( \SermonManager::getOption( 'archive_player' ) || \SermonManager::getOption( 'archive_meta' ) ) {
$content = '<div class="wpfc_sermon cf">';
if ( \SermonManager::getOption( 'archive_player' ) ) {
$content .= wpfc_sermon_media();
}
if ( \SermonManager::getOption( 'archive_meta' ) ) {
$content .= wpfc_sermon_attachments();
}

$content .= '</div>';
}

return $content;
}

function add_wpfc_sermon_content( $content ) {
if ( 'wpfc_sermon' == get_post_type() && in_the_loop() == true ) {
if ( ! is_feed() && ( is_archive() || is_search() ) ) {
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: church, sermon, sermons, preaching, podcasting, manage, managing, podcasts
Requires at least: 4.5
Tested up to: 4.9.2
Requires PHP: 5.3
Stable tag: 2.11.1
Stable tag: 2.11.2
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##
### 2.11.2 ###
* Change: Remove accidentally added search form from PR #159
* Fix: Attachments not being downloaded when clicked on them
* Fix: Player not appearing in excerpt
* Fix: Sermon dates not saving

### 2.11.1 ###
* Fix: Fatal error on update because of not-loaded function

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: https://www.wpforchurch.com/products/sermon-manager-for-wordpress/
* Description: Add audio and video sermons, manage speakers, series, and more.
* Version: 2.11.1
* Version: 2.11.2
* Author: WP for Church
* Author URI: https://www.wpforchurch.com/
* Requires at least: 4.5
Expand Down

0 comments on commit fecc2ca

Please sign in to comment.