Avoid PHP Error A non-numeric value encountered ./includes/class-sp-league-table.php on line 793 if an empty space is added as a value
This commit is contained in:
@@ -790,7 +790,7 @@ class SP_League_Table extends SP_Secondary_Post {
|
||||
if ( sp_array_value( $a, $priority['column'], 0 ) != sp_array_value( $b, $priority['column'], 0 ) ):
|
||||
|
||||
// Compare column values
|
||||
$output = sp_array_value( $a, $priority['column'], 0 ) - sp_array_value( $b, $priority['column'], 0 );
|
||||
$output = (float) sp_array_value( $a, $priority['column'], 0 ) - (float) sp_array_value( $b, $priority['column'], 0 );
|
||||
|
||||
// Flip value if descending order
|
||||
if ( $priority['order'] == 'DESC' ) $output = 0 - $output;
|
||||
|
||||
Reference in New Issue
Block a user