Fix notice errors on PHP 7.1
This commit is contained in:
parent
53dfc03178
commit
6b29066d3e
|
@ -151,10 +151,13 @@ function wc_get_product_terms( $product_id, $taxonomy, $args = array() ) {
|
|||
* @return int
|
||||
*/
|
||||
function _wc_get_product_terms_name_num_usort_callback( $a, $b ) {
|
||||
if ( $a->name + 0 === $b->name + 0 ) {
|
||||
$aName = (int) $a->name;
|
||||
$bName = (int) $b->name;
|
||||
|
||||
if ( $aName === $bName ) {
|
||||
return 0;
|
||||
}
|
||||
return ( $a->name + 0 < $b->name + 0 ) ? -1 : 1;
|
||||
return ( $aName < $bName ) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue