Merge pull request #21856 from woocommerce/fix/21763
Apply field priority sorting on additional filters
This commit is contained in:
commit
f39b006264
|
@ -704,7 +704,11 @@ class WC_Countries {
|
|||
unset( $fields['address_2'] );
|
||||
}
|
||||
|
||||
return apply_filters( 'woocommerce_default_address_fields', $fields );
|
||||
$default_address_fields = apply_filters( 'woocommerce_default_address_fields', $fields );
|
||||
// Sort each of the fields based on priority.
|
||||
uasort( $default_address_fields, 'wc_checkout_fields_uasort_comparison' );
|
||||
|
||||
return $default_address_fields;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1280,6 +1284,10 @@ class WC_Countries {
|
|||
* on country selection. If you want to change things like the required status of an
|
||||
* address field, filter woocommerce_default_address_fields instead.
|
||||
*/
|
||||
return apply_filters( 'woocommerce_' . $type . 'fields', $address_fields, $country );
|
||||
$address_fields = apply_filters( 'woocommerce_' . $type . 'fields', $address_fields, $country );
|
||||
// Sort each of the fields based on priority.
|
||||
uasort( $address_fields, 'wc_checkout_fields_uasort_comparison' );
|
||||
|
||||
return $address_fields;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue