FIX3: Loss condition was not applied on event results

This commit is contained in:
savvasha
2022-07-07 20:43:16 +03:00
parent d9767bdfd5
commit ce755f50c1
2 changed files with 44 additions and 8 deletions

View File

@@ -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' => '&lt;',
),
array(
'key' => 'sp_condition',
'value' => '<',
),
),
);
$lt_outcomes = get_posts( $args );
if ( empty( $lt_outcomes ) ) {

View File

@@ -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' => '&gt;',
),
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' => '&lt;',
),
array(
'key' => 'sp_condition',
'value' => '<',
),
),
);
$lt_outcomes = get_posts( $args );
if ( empty( $lt_outcomes ) ) {