Fix notice errors on PHP 7.1

This commit is contained in:
Ramy Talal 2017-04-09 13:45:46 +02:00 committed by GitHub
parent 53dfc03178
commit 6b29066d3e
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}
/**