From 212e761d413111064ef6e34db851fca1517e0b28 Mon Sep 17 00:00:00 2001 From: saifsultanc Date: Mon, 6 Jan 2025 22:28:58 +0530 Subject: [PATCH] `gw-validate-that-a-value-exists.php`: Fixed an issue with script not working with value validation snippet. --- gravity-forms/gw-validate-that-a-value-exists.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gravity-forms/gw-validate-that-a-value-exists.php b/gravity-forms/gw-validate-that-a-value-exists.php index cda0b66df..695438dae 100644 --- a/gravity-forms/gw-validate-that-a-value-exists.php +++ b/gravity-forms/gw-validate-that-a-value-exists.php @@ -176,7 +176,8 @@ public function load_form_script( $form, $is_ajax_enabled ) { // Do not output main script if AJAX is enabled if ( ! $is_ajax_enabled && $this->is_applicable_form( $form ) && ! self::$is_script_output && ! $this->is_ajax_submission( $form['id'], $is_ajax_enabled ) ) { - $this->output_script(); + add_action( 'wp_footer', array( $this, 'output_script' ) ); + add_action( 'gform_preview_footer', array( $this, 'output_script' ) ); } return $form;