WC_Tax::sort_rates()
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() WC Tax::sort rates code WC 9.4.2
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; }