WC_Tax::sort_rates()private staticWC 1.0

Logical sort order for tax rates based on the following in order of priority.

Method of the class: WC_Tax{}

No Hooks.

Return

Array.

Usage

$result = WC_Tax::sort_rates( $rates );
$rates(array) (required)
Rates to be sorted.

WC_Tax::sort_rates() code WC 8.7.0

private static function sort_rates( $rates ) {
	uasort( $rates, __CLASS__ . '::sort_rates_callback' );
	$i = 0;
	foreach ( $rates as $key => $rate ) {
		$rates[ $key ]->tax_rate_order = $i++;
	}
	return $rates;
}