Prevent automatic results from calculating when no performance
This commit is contained in:
@@ -44,13 +44,11 @@ class SP_Meta_Box_Event_Results {
|
|||||||
$finished = false;
|
$finished = false;
|
||||||
|
|
||||||
// Check if any results are recorded
|
// Check if any results are recorded
|
||||||
if ( ! $finished ) {
|
foreach ( $results as $team => $team_results ) {
|
||||||
foreach ( $results as $team => $team_results ) {
|
foreach ( $team_results as $result ) {
|
||||||
foreach ( $team_results as $result ) {
|
if ( '' !== $result ) {
|
||||||
if ( '' !== $result ) {
|
$finished = true;
|
||||||
$finished = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,11 +58,17 @@ class SP_Meta_Box_Event_Results {
|
|||||||
foreach ( $performance as $team => $players ) {
|
foreach ( $performance as $team => $players ) {
|
||||||
foreach ( $players as $player => $pp ) {
|
foreach ( $players as $player => $pp ) {
|
||||||
if ( 0 >= $player ) continue;
|
if ( 0 >= $player ) continue;
|
||||||
foreach ( $pp as $pv ) {
|
foreach ( $pp as $pk => $pv ) {
|
||||||
if ( '' !== trim( $pv ) ) {
|
if ( in_array( $pk, apply_filters( 'sportspress_event_auto_result_bypass_keys', array( 'number', 'status', 'sub' ) ) ) ) continue;
|
||||||
$finished = true;
|
|
||||||
break;
|
if ( is_array( $pv ) ) continue;
|
||||||
}
|
|
||||||
|
$pv = trim( $pv );
|
||||||
|
if ( '' == $pv ) continue;
|
||||||
|
if ( ! ctype_digit( $pv ) ) continue;
|
||||||
|
|
||||||
|
$finished = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user