Skip to content

Commit 56e6249

Browse files
authored
gplcb-conditional-limits.php: Fixed an issue with script generating console errors.
1 parent 1049e8e commit 56e6249

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

gp-limit-checkboxes/gplcb-conditional-limits.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public function enqueue_form_scripts( $form ) {
6767
public function load_form_script( $form, $is_ajax_enabled ) {
6868

6969
if ( $this->is_applicable_form( $form ) && ! self::$is_script_output && ! $this->is_ajax_submission( $form['id'], $is_ajax_enabled ) ) {
70-
$this->output_script();
70+
add_action( 'wp_footer', array( $this, 'output_script' ) );
71+
add_action( 'gform_preview_footer', array( $this, 'output_script' ) );
7172
}
7273

7374
return $form;

gravity-forms/gw-coupons-exclude-products.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ function init() {
5454
function load_form_script( $form ) {
5555

5656
if ( $this->is_applicable_form( $form ) && ! self::$is_script_output ) {
57-
$this->output_script();
57+
add_action( 'wp_footer', array( $this, 'output_script' ) );
58+
add_action( 'gform_preview_footer', array( $this, 'output_script' ) );
5859
}
5960

6061
return $form;

0 commit comments

Comments
 (0)