WC_Cart_Fees::sort_fees_callback( stdClass $a, stdClass $b )

Sort fees by amount.


Description Description


Parameters Parameters

$a

(Required) Fee object.

$b

(Required) Fee object.


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/class-wc-cart-fees.php

	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 );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.