_wc_get_product_terms_parent_usort_callback()WC 1.0

Sort by parent.

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.

Return

Int.

Usage

_wc_get_product_terms_parent_usort_callback( $a, $b );
$a(WP_Post) (required)
First item to compare.
$b(WP_Post) (required)
Second item to compare.

_wc_get_product_terms_parent_usort_callback() code WC 8.6.1

function _wc_get_product_terms_parent_usort_callback( $a, $b ) {
	if ( $a->parent === $b->parent ) {
		return 0;
	}
	return ( $a->parent < $b->parent ) ? 1 : -1;
}