From da72685b1b39810668457a5b242e8aa9cf35ea5f Mon Sep 17 00:00:00 2001 From: Dharmesh Patel Date: Fri, 23 Aug 2024 12:21:01 +0530 Subject: [PATCH] Remove hardcoded fallback string. --- assets/js/admin.js | 7 +--- .../admin/templates/create-account-page.php | 13 +++--- includes/class-mailchimp-admin.php | 42 ++++--------------- 3 files changed, 16 insertions(+), 46 deletions(-) diff --git a/assets/js/admin.js b/assets/js/admin.js index 2a967bd..ec51915 100644 --- a/assets/js/admin.js +++ b/assets/js/admin.js @@ -189,7 +189,7 @@ // Validate inputs. const validateFormInput = (input) => { - let inputLabel = 'This field'; + let inputLabel = ''; if ( $('label[for="' + input.id + '"] span').length > 0 && $('label[for="' + input.id + '"] span').text() @@ -200,10 +200,7 @@ inputLabel = inputLabel.split('/')[0]; inputLabel = inputLabel.split('(')[0]; } - const requiredError = (params.required_error || "%s can't be blank.").replace( - '%s', - inputLabel, - ); + const requiredError = (params.required_error || '').replace('%s', inputLabel); const requiredInputs = [ 'first_name', 'last_name', diff --git a/includes/admin/templates/create-account-page.php b/includes/admin/templates/create-account-page.php index 8b996eb..e9416e3 100644 --- a/includes/admin/templates/create-account-page.php +++ b/includes/admin/templates/create-account-page.php @@ -57,13 +57,13 @@ -
+
-
+
@@ -109,7 +109,7 @@
@@ -139,7 +139,7 @@