From 2ebebc5cb2aab95a599c9fb548da28c0e7adad00 Mon Sep 17 00:00:00 2001 From: Rutvik Savsani Date: Tue, 1 Mar 2022 12:08:10 +0530 Subject: [PATCH 1/2] Add action on comment_form_after hook to remove novalidate attribute from comments form --- pwa.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pwa.php b/pwa.php index d8f0d69eb..1f54fcd8a 100644 --- a/pwa.php +++ b/pwa.php @@ -290,6 +290,24 @@ function pwa_load_service_worker_integrations( WP_Service_Worker_Scripts $script } add_action( 'wp_default_service_workers', 'pwa_load_service_worker_integrations', -1 ); +/** + * Remove `novalidate` attribute from the comment form tag. + * + * This is a fix for the `novalidate` attribute being added to the comment form by WordPress + * which disables HTML client-side validation for the form. + */ +function pwa_remove_novalidate_attribute_from_comments_form() { + ?> + + init(); From 614dc7443d3f98dad695e5d07974bf7abd7e9212 Mon Sep 17 00:00:00 2001 From: Rutvik Savsani <53530700+rutviksavsani@users.noreply.github.com> Date: Wed, 2 Mar 2022 09:29:35 +0530 Subject: [PATCH 2/2] Update commentForm var to const in pwa.php Co-authored-by: Weston Ruter --- pwa.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwa.php b/pwa.php index 1f54fcd8a..9bda03c78 100644 --- a/pwa.php +++ b/pwa.php @@ -299,7 +299,7 @@ function pwa_load_service_worker_integrations( WP_Service_Worker_Scripts $script function pwa_remove_novalidate_attribute_from_comments_form() { ?>