_wc_get_product_terms_name_num_usort_callback()
Sort by name (numeric).
Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.
No Hooks.
Returns
Int.
Usage
_wc_get_product_terms_name_num_usort_callback( $a, $b );
_wc_get_product_terms_name_num_usort_callback() wc get product terms name num usort callback code WC 10.6.2
function _wc_get_product_terms_name_num_usort_callback( $a, $b ) {
$a_name = (float) $a->name;
$b_name = (float) $b->name;
if ( abs( $a_name - $b_name ) < 0.001 ) {
return 0;
}
return ( $a_name < $b_name ) ? -1 : 1;
}