wc_checkout_fields_uasort_comparison()
User to sort checkout fields based on priority with uasort.
No Hooks.
Return
Int
.
Usage
wc_checkout_fields_uasort_comparison( $a, $b );
- $a(array) (required)
- First field to compare.
- $b(array) (required)
- Second field to compare.
Changelog
Since 3.5.1 | Introduced. |
wc_checkout_fields_uasort_comparison() wc checkout fields uasort comparison code WC 8.7.0
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'] ); }