From e47b86f5948d82f5450ddf2295230d090a90efcd Mon Sep 17 00:00:00 2001 From: Nikola Date: Thu, 5 Oct 2017 18:49:36 +0200 Subject: [PATCH 1/5] Fix PHP notice --- includes/class-sm-dates-wp.php | 4 ++++ readme.txt | 3 +++ 2 files changed, 7 insertions(+) diff --git a/includes/class-sm-dates-wp.php b/includes/class-sm-dates-wp.php index 7a470b4..070515a 100644 --- a/includes/class-sm-dates-wp.php +++ b/includes/class-sm-dates-wp.php @@ -73,6 +73,10 @@ public static function get_original_series( $post_ID ) { * @since 2.8 */ public static function save_series_date( $post_ID, $post, $update ) { + if ( ! isset( $_POST['tax_input'] ) ) { + return; + } + $series = $_POST['tax_input']['wpfc_sermon_series']; $orig_series = $GLOBALS['sm_original_series']; diff --git a/readme.txt b/readme.txt index 589aa7b..e65c9dc 100755 --- a/readme.txt +++ b/readme.txt @@ -93,6 +93,9 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man 2. Sermon Files ## Changelog ## +### 2.9 ### +* Fix a PHP notice on new sermon creation + ### 2.8 ### * Add better support for templating plugins (Elementor and Visual Composer, to mention some) * Add better compatibility with themes and search From 8c6e6c373c4e33e5f76e48de3f57c3f5cc916671 Mon Sep 17 00:00:00 2001 From: Nikola Date: Thu, 5 Oct 2017 18:55:44 +0200 Subject: [PATCH 2/5] Fix sermon date not saving on first save --- includes/class-sm-dates-wp.php | 1 + readme.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/includes/class-sm-dates-wp.php b/includes/class-sm-dates-wp.php index 070515a..3bbd467 100644 --- a/includes/class-sm-dates-wp.php +++ b/includes/class-sm-dates-wp.php @@ -154,6 +154,7 @@ public static function maybe_update_date( $post_ID, $post, $update ) { if ( ! empty( $GLOBALS['sm_original_sermon_date'] ) && ! empty( $_POST['sermon_date'] ) ) { $dt = DateTime::createFromFormat( SermonManager::getOption( 'date_format' ) ?: 'm/d/Y', $_POST['sermon_date'] ); if ( $dt instanceof DateTime && $dt->format( 'U' ) != $GLOBALS['sm_original_sermon_date'] ) { + update_post_meta( $post_ID, 'sermon_date', $dt->format( 'U' ) ); update_post_meta( $post_ID, 'sermon_date_auto', 0 ); } } diff --git a/readme.txt b/readme.txt index e65c9dc..00e59c1 100755 --- a/readme.txt +++ b/readme.txt @@ -95,6 +95,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man ## Changelog ## ### 2.9 ### * Fix a PHP notice on new sermon creation +* Fix sermon date not saving on first save ### 2.8 ### * Add better support for templating plugins (Elementor and Visual Composer, to mention some) From 31e41ae4ff5f770b8946a4d35e96e198614eec6a Mon Sep 17 00:00:00 2001 From: Nikola Date: Thu, 5 Oct 2017 19:02:16 +0200 Subject: [PATCH 3/5] Fix sermons preached before 09/09/2001 not showing up --- includes/class-sm-api.php | 2 +- includes/shortcodes.php | 2 +- readme.txt | 1 + sermons.php | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/class-sm-api.php b/includes/class-sm-api.php index 5ec785c..c94db35 100644 --- a/includes/class-sm-api.php +++ b/includes/class-sm-api.php @@ -76,7 +76,7 @@ public function fix_ordering( $args ) { if ( $args['orderby'] === 'date' ) { $args['orderby'] = 'meta_value_num'; $args['meta_key'] = 'sermon_date'; - $args['meta_value'] = time(); + $args['meta_value_num'] = time(); $args['meta_compare'] = '<='; } elseif ( $args['orderby'] === 'wpdate' ) { $args['orderby'] = 'date'; diff --git a/includes/shortcodes.php b/includes/shortcodes.php index a1c10df..b0a8914 100755 --- a/includes/shortcodes.php +++ b/includes/shortcodes.php @@ -106,7 +106,7 @@ public function displaySermonsList( $atts ) { $query_args['orderby'] = 'meta_value_num'; $query_args['meta_key'] = 'sermon_date'; $query_args['meta_compare'] = '<='; - $query_args['meta_value'] = time(); + $query_args['meta_value_num'] = time(); } // get items diff --git a/readme.txt b/readme.txt index 00e59c1..17b976f 100755 --- a/readme.txt +++ b/readme.txt @@ -96,6 +96,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man ### 2.9 ### * Fix a PHP notice on new sermon creation * Fix sermon date not saving on first save +* Fix sermons preached before 09/09/2001 not showing up ### 2.8 ### * Add better support for templating plugins (Elementor and Visual Composer, to mention some) diff --git a/sermons.php b/sermons.php index 602be70..41ac9e3 100755 --- a/sermons.php +++ b/sermons.php @@ -177,7 +177,7 @@ public static function fix_sermons_ordering( $query ) { is_tax( 'wpfc_bible_book' ) ) { $query->set( 'meta_key', 'sermon_date' ); - $query->set( 'meta_value', time() ); + $query->set( 'meta_value_num', time() ); $query->set( 'meta_compare', '<=' ); $query->set( 'orderby', 'meta_value_num' ); } From 8ead7ca65961b33946779c5e3d15bd03753a2943 Mon Sep 17 00:00:00 2001 From: Nikola Date: Thu, 5 Oct 2017 19:15:32 +0200 Subject: [PATCH 4/5] Remove date placeholder --- includes/CMB2/includes/types/CMB2_Type_Text_Date.php | 1 - readme.txt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/CMB2/includes/types/CMB2_Type_Text_Date.php b/includes/CMB2/includes/types/CMB2_Type_Text_Date.php index cfd95f7..fb4697a 100755 --- a/includes/CMB2/includes/types/CMB2_Type_Text_Date.php +++ b/includes/CMB2/includes/types/CMB2_Type_Text_Date.php @@ -20,7 +20,6 @@ public function render() { 'value' => isset( $_GET['post'] ) ? ( get_post_meta( $_GET['post'], 'sermon_date_auto', true ) ? '' : $this->field->get_timestamp_format() ) : '', 'desc' => $this->_desc(), 'js_dependencies' => array( 'jquery-ui-core', 'jquery-ui-datepicker' ), - 'placeholder' => isset( $_GET['post'] ) ? ( get_post_meta( $_GET['post'], 'sermon_date_auto', true ) ? $this->field->get_timestamp_format() : '' ) : $this->field->get_timestamp_format( 'date_format', time() ), ) ); if ( false === strpos( $args['class'], 'timepicker' ) ) { diff --git a/readme.txt b/readme.txt index 17b976f..3ff4a0e 100755 --- a/readme.txt +++ b/readme.txt @@ -97,6 +97,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man * Fix a PHP notice on new sermon creation * Fix sermon date not saving on first save * Fix sermons preached before 09/09/2001 not showing up +* Fix confusion regarding date field (remove placeholder value) ### 2.8 ### * Add better support for templating plugins (Elementor and Visual Composer, to mention some) From 4752adbb7d5b027815040c54f87a119cb0f1d00b Mon Sep 17 00:00:00 2001 From: Nikola Date: Thu, 5 Oct 2017 19:19:17 +0200 Subject: [PATCH 5/5] Update version --- readme.txt | 4 ++-- sermons.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 3ff4a0e..2d25b1e 100755 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: church, sermon, sermons, preaching, podcasting, manage, managing, podcasts Requires at least: 4.5 Tested up to: 4.8.2 Requires PHP: 5.3 -Stable tag: 2.8 +Stable tag: 2.8.1 License: GPLv2 License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -93,7 +93,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man 2. Sermon Files ## Changelog ## -### 2.9 ### +### 2.8.1 ### * Fix a PHP notice on new sermon creation * Fix sermon date not saving on first save * Fix sermons preached before 09/09/2001 not showing up diff --git a/sermons.php b/sermons.php index 41ac9e3..909d6ab 100755 --- a/sermons.php +++ b/sermons.php @@ -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.8 + * Version: 2.8.1 * Author: WP for Church * Author URI: https://www.wpforchurch.com/ * Requires at least: 4.5