wc_checkout_fields_uasort_comparison( array $a, array $b )

User to sort checkout fields based on priority with uasort.


Description Description


Parameters Parameters

$a

(Required) First field to compare.

$b

(Required) Second field to compare.


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/wc-core-functions.php

function wc_checkout_fields_uasort_comparison( $a, $b ) {
	/*
	 * We are not guaranteed to get a priority
	 * setting. So don't compare if they don't
	 * exist.
	 */
	if ( ! isset( $a['priority'], $b['priority'] ) ) {
		return 0;
	}

	return wc_uasort_comparison( $a['priority'], $b['priority'] );
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.5.1 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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