Fix absolute date ranges not applying to secondary post types

This commit is contained in:
Brian Miyaji
2017-11-15 22:47:10 +11:00
parent 9312cc0bdd
commit db885ccc20
3 changed files with 10 additions and 24 deletions

View File

@@ -85,19 +85,13 @@ class SP_Calendar extends SP_Secondary_Post {
if ( $this->relative ) { if ( $this->relative ) {
if ( ! $this->past ) $this->past = get_post_meta( $this->ID, 'sp_date_past', true );
$this->past = get_post_meta( $this->ID, 'sp_date_past', true ); $this->future = get_post_meta( $this->ID, 'sp_date_future', true );
if ( ! $this->future )
$this->future = get_post_meta( $this->ID, 'sp_date_future', true );
} else { } else {
if ( ! $this->from ) $this->from = get_post_meta( $this->ID, 'sp_date_from', true );
$this->from = get_post_meta( $this->ID, 'sp_date_from', true ); $this->to = get_post_meta( $this->ID, 'sp_date_to', true );
if ( ! $this->to )
$this->to = get_post_meta( $this->ID, 'sp_date_to', true );
} }

View File

@@ -56,16 +56,12 @@ class SP_League_Table extends SP_Secondary_Post {
if ( $this->relative ) { if ( $this->relative ) {
if ( ! $this->past ) $this->past = get_post_meta( $this->ID, 'sp_date_past', true );
$this->past = get_post_meta( $this->ID, 'sp_date_past', true );
} else { } else {
if ( ! $this->from ) $this->from = get_post_meta( $this->ID, 'sp_date_from', true );
$this->from = get_post_meta( $this->ID, 'sp_date_from', true ); $this->to = get_post_meta( $this->ID, 'sp_date_to', true );
if ( ! $this->to )
$this->to = get_post_meta( $this->ID, 'sp_date_to', true );
} }

View File

@@ -64,16 +64,12 @@ class SP_Player_List extends SP_Secondary_Post {
if ( $this->relative ) { if ( $this->relative ) {
if ( ! $this->past ) $this->past = get_post_meta( $this->ID, 'sp_date_past', true );
$this->past = get_post_meta( $this->ID, 'sp_date_past', true );
} else { } else {
if ( ! $this->from ) $this->from = get_post_meta( $this->ID, 'sp_date_from', true );
$this->from = get_post_meta( $this->ID, 'sp_date_from', true ); $this->to = get_post_meta( $this->ID, 'sp_date_to', true );
if ( ! $this->to )
$this->to = get_post_meta( $this->ID, 'sp_date_to', true );
} }