Skip to content

Commit

Permalink
Merge pull request #123 from WP-for-Church/dev
Browse files Browse the repository at this point in the history
Release 2.8.1
  • Loading branch information
Nikola Miljković authored Oct 5, 2017
2 parents 12de887 + 4752adb commit 1850c54
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
1 change: 0 additions & 1 deletion includes/CMB2/includes/types/CMB2_Type_Text_Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/class-sm-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
5 changes: 5 additions & 0 deletions includes/class-sm-dates-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down Expand Up @@ -150,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 );
}
}
Expand Down
2 changes: 1 addition & 1 deletion includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.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

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

## Changelog ##
### 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
* Fix confusion regarding date field (remove placeholder value)

### 2.8 ###
* Add better support for templating plugins (Elementor and Visual Composer, to mention some)
* Add better compatibility with themes and search
Expand Down
4 changes: 2 additions & 2 deletions 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.8
* Version: 2.8.1
* Author: WP for Church
* Author URI: https://www.wpforchurch.com/
* Requires at least: 4.5
Expand Down Expand Up @@ -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' );
}
Expand Down

0 comments on commit 1850c54

Please sign in to comment.