Skip to content

Commit

Permalink
Fix sermons preached before 09/09/2001 not showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola committed Oct 5, 2017
1 parent 8c6e6c3 commit 31e41ae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
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
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
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sermons.php
Original file line number Diff line number Diff line change
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 31e41ae

Please sign in to comment.