From db885ccc20656e7974d6097299a668dad5006069 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Wed, 15 Nov 2017 22:47:10 +1100 Subject: [PATCH] Fix absolute date ranges not applying to secondary post types --- includes/class-sp-calendar.php | 14 ++++---------- includes/class-sp-league-table.php | 10 +++------- includes/class-sp-player-list.php | 10 +++------- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/includes/class-sp-calendar.php b/includes/class-sp-calendar.php index c409efc4..26bb0761 100644 --- a/includes/class-sp-calendar.php +++ b/includes/class-sp-calendar.php @@ -85,19 +85,13 @@ class SP_Calendar extends SP_Secondary_Post { if ( $this->relative ) { - if ( ! $this->past ) - $this->past = get_post_meta( $this->ID, 'sp_date_past', true ); - - if ( ! $this->future ) - $this->future = get_post_meta( $this->ID, 'sp_date_future', true ); + $this->past = get_post_meta( $this->ID, 'sp_date_past', true ); + $this->future = get_post_meta( $this->ID, 'sp_date_future', true ); } else { - if ( ! $this->from ) - $this->from = get_post_meta( $this->ID, 'sp_date_from', true ); - - if ( ! $this->to ) - $this->to = get_post_meta( $this->ID, 'sp_date_to', true ); + $this->from = get_post_meta( $this->ID, 'sp_date_from', true ); + $this->to = get_post_meta( $this->ID, 'sp_date_to', true ); } diff --git a/includes/class-sp-league-table.php b/includes/class-sp-league-table.php index 8d123cfc..0e7a1cc7 100644 --- a/includes/class-sp-league-table.php +++ b/includes/class-sp-league-table.php @@ -56,16 +56,12 @@ class SP_League_Table extends SP_Secondary_Post { 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 { - if ( ! $this->from ) - $this->from = get_post_meta( $this->ID, 'sp_date_from', true ); - - if ( ! $this->to ) - $this->to = get_post_meta( $this->ID, 'sp_date_to', true ); + $this->from = get_post_meta( $this->ID, 'sp_date_from', true ); + $this->to = get_post_meta( $this->ID, 'sp_date_to', true ); } diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php index e70c4547..a6279625 100644 --- a/includes/class-sp-player-list.php +++ b/includes/class-sp-player-list.php @@ -64,16 +64,12 @@ class SP_Player_List extends SP_Secondary_Post { 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 { - if ( ! $this->from ) - $this->from = get_post_meta( $this->ID, 'sp_date_from', true ); - - if ( ! $this->to ) - $this->to = get_post_meta( $this->ID, 'sp_date_to', true ); + $this->from = get_post_meta( $this->ID, 'sp_date_from', true ); + $this->to = get_post_meta( $this->ID, 'sp_date_to', true ); }