From be2c026f3fbdf20be49d815392cb474a722b9dad Mon Sep 17 00:00:00 2001 From: savvasha Date: Wed, 15 Aug 2018 09:43:29 +0300 Subject: [PATCH] Avoid PHP warnings with Midseason Transfers When Midseason Transfers are used we have to convert the string values to integers (i.e. `'601.1'` to `601`) to avoid PHP warnings --- includes/sp-core-functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index c279b7db..6b4e4563 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -1473,10 +1473,12 @@ if ( ! function_exists( 'sp_sort_terms' ) ) { * @return int Sorting order. */ function sp_sort_terms( $a, $b ) { - if ( is_int( $a ) ) { + if ( is_numeric( $a ) ) { + $a = intval( $a ); $a = get_term( $a ); } - if ( is_int( $b ) ) { + if ( is_numeric( $b ) ) { + $b = intval( $b ); $b = get_term( $b ); } return get_term_meta( $a->term_id, 'sp_order', true ) > get_term_meta( $b->term_id, 'sp_order', true );