Skip to content

Commit b2580db

Browse files
authored
gpld-conditional-limits.php: Fixed issue where GP Limit Dates' frontend assets were not being enqueued when using snippet.
1 parent 281b694 commit b2580db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gp-limit-dates/gpld-conditional-limits.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public function init() {
2929
add_filter( 'gform_register_init_scripts', array( $this, 'add_init_script' ), 10, 2 );
3030
add_filter( 'gform_enqueue_scripts', array( $this, 'enqueue_form_scripts' ) );
3131
add_action( 'gform_field_validation', array( $this, 'validate' ), 11, 4 );
32+
33+
// Enables date limits for the form field, allowing the `gp-limit-dates` script to be enqueued.
34+
add_filter( "gpld_has_limit_dates_enabled_{$this->_args['form_id']}_{$this->_args['field_id']}", '__return_true', 10, 2 );
3235
}
3336

3437
public function enqueue_form_scripts( $form ) {

0 commit comments

Comments
 (0)