WC_Cart_Fees::sort_fees_callback
Sort fees by amount.
Method of the class: WC_Cart_Fees{}
Hooks from the method
Returns
Int.
Usage
// protected - for code of main (parent) or child class $result = $this->sort_fees_callback( $a, $b );
- $a(stdClass) (required)
- Fee object.
- $b(stdClass) (required)
- Fee object.
WC_Cart_Fees::sort_fees_callback() WC Cart Fees::sort fees callback code WC 10.4.3
protected function sort_fees_callback( $a, $b ) {
/**
* Filter sort fees callback.
*
* @since 3.8.0
* @param int Sort order, -1 or 1.
* @param stdClass $a Fee object.
* @param stdClass $b Fee object.
*/
return apply_filters( 'woocommerce_sort_fees_callback', $a->amount > $b->amount ? -1 : 1, $a, $b );
}