From 565e259851eb9f7eeb2dbf50b91c15663aafe4eb Mon Sep 17 00:00:00 2001 From: vasikgreif Date: Wed, 23 Mar 2016 14:00:51 +0100 Subject: [PATCH] Add filter for required fields error message Add the ability to change required fields error message, as discussed here: https://github.com/woothemes/woocommerce/pull/10591 --- includes/class-wc-checkout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index 3610ca2e118..d146330b915 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -457,7 +457,7 @@ class WC_Checkout { $field_label = $field['label']; break; } - wc_add_notice( sprintf( _x( '%s is a required field.', 'FIELDNAME is a required field.', 'woocommerce' ), '' . $field_label . '' ), 'error' ); + wc_add_notice( apply_filters( 'woocommerce_required_checkout_fields_error', sprintf( _x( '%s is a required field.', 'FIELDNAME is a required field.', 'woocommerce' ), '' . $field_label . '' ), $field_label ), 'error' ); } if ( ! empty( $this->posted[ $key ] ) ) {