diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php index f08ebff4..7eda4a9f 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php @@ -187,8 +187,17 @@ class SP_Meta_Box_Event_Results { 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, - 'meta_key' => 'sp_condition', - 'meta_value' => '>', + 'meta_query' => array( + 'relation' => 'OR', + array( + 'key' => 'sp_condition', + 'value' => '>', + ), + array( + 'key' => 'sp_condition', + 'value' => '>', + ), + ), ); $gt_outcomes = get_posts( $args ); if ( empty( $gt_outcomes ) ) { @@ -200,8 +209,17 @@ class SP_Meta_Box_Event_Results { 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, - 'meta_key' => 'sp_condition', - 'meta_value' => '<', + 'meta_query' => array( + 'relation' => 'OR', + array( + 'key' => 'sp_condition', + 'value' => '<', + ), + array( + 'key' => 'sp_condition', + 'value' => '<', + ), + ), ); $lt_outcomes = get_posts( $args ); if ( empty( $lt_outcomes ) ) { diff --git a/includes/class-sp-event.php b/includes/class-sp-event.php index 4db7303d..1289bd12 100644 --- a/includes/class-sp-event.php +++ b/includes/class-sp-event.php @@ -741,8 +741,17 @@ class SP_Event extends SP_Custom_Post { 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, - 'meta_key' => 'sp_condition', - 'meta_value' => '>', + 'meta_query' => array( + 'relation' => 'OR', + array( + 'key' => 'sp_condition', + 'value' => '>', + ), + array( + 'key' => 'sp_condition', + 'value' => '>', + ), + ), ); $gt_outcomes = get_posts( $args ); if ( empty( $gt_outcomes ) ) { @@ -754,8 +763,17 @@ class SP_Event extends SP_Custom_Post { 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, - 'meta_key' => 'sp_condition', - 'meta_value' => '<', + 'meta_query' => array( + 'relation' => 'OR', + array( + 'key' => 'sp_condition', + 'value' => '<', + ), + array( + 'key' => 'sp_condition', + 'value' => '<', + ), + ), ); $lt_outcomes = get_posts( $args ); if ( empty( $lt_outcomes ) ) {