Skip to content

Commit a68645d

Browse files
committed
gpld-conditional-limits.php: Fixed conditional limit dates snippet not working issue.
1 parent 281b694 commit a68645d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ 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']}", function ( $result, $field ) {
35+
return true;
36+
}, 10, 2 );
3237
}
3338

3439
public function enqueue_form_scripts( $form ) {

0 commit comments

Comments
 (0)