add default values for admin address filters (#44704)

* add default values for "woocommerce_admin_shipping_fields" and "woocommerce_admin_billing_fields" filters

* use null instead
This commit is contained in:
Seghir Nadir 2024-02-16 16:10:26 +01:00 committed by GitHub
parent 5a761ae05e
commit e8a403b406
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Add default values for 'woocommerce_admin_billing_fields' and 'woocommerce_admin_shipping_fields' filters

View File

@ -84,7 +84,7 @@ class CheckoutFieldsAdmin {
* @param string $context The context to show the fields for.
* @return array
*/
public function admin_address_fields( $fields, $order, $context = 'edit' ) {
public function admin_address_fields( $fields, $order = null, $context = 'edit' ) {
if ( ! $order instanceof \WC_Order ) {
return $fields;
}
@ -118,7 +118,7 @@ class CheckoutFieldsAdmin {
* @param string $context The context to show the fields for.
* @return array
*/
public function admin_contact_fields( $fields, $order, $context = 'edit' ) {
public function admin_contact_fields( $fields, $order = null, $context = 'edit' ) {
if ( ! $order instanceof \WC_Order ) {
return $fields;
}
@ -143,7 +143,7 @@ class CheckoutFieldsAdmin {
* @param string $context The context to show the fields for.
* @return array
*/
public function admin_additional_fields( $fields, $order, $context = 'edit' ) {
public function admin_additional_fields( $fields, $order = null, $context = 'edit' ) {
if ( ! $order instanceof \WC_Order ) {
return $fields;
}