Skip to content

Commit 7bc5a9d

Browse files
committed
fix(wpforms): resolves #343, fix for jquery dependency
1 parent 167a7f2 commit 7bc5a9d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

modules/wpforms/class-wpforms.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ public function add_scripts() {
170170
// Only add scripts to the appropriate pages.
171171
if ( 'enabled' === \ZeroSpam\Core\Settings::get_settings( 'verify_wpforms' ) ) {
172172
wp_enqueue_script( 'zerospam-davidwalsh' );
173-
add_action( 'wp_footer', function() {
174-
echo '<script type="text/javascript">jQuery(".wpforms-form").ZeroSpamDavidWalsh();</script>';
175-
}, 999 );
173+
add_action( 'wp_enqueue_scripts', function() {
174+
wp_add_inline_script('zerospam-davidwalsh', '(function($) {$(function() { $(".wpforms-form").ZeroSpamDavidWalsh(); })})(jQuery)' );
175+
} );
176176
}
177177
}
178178

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ If hosting with Pantheon, see their [known issues page](https://pantheon.io/docs
109109

110110
= v5.4.4 =
111111

112+
* fix(wpforms): resolves #343, fix for jquery dependency
112113
* fix(registration): resolves #342, fix for failed registration output
113114
* fix(php8): resolves #341, fix for php8+ compatibility issue
114115

0 commit comments

Comments
 (0)