diff --git a/gp-limit-dates/gpld-conditional-limits.php b/gp-limit-dates/gpld-conditional-limits.php index 960e9ccd7..078ab5f30 100644 --- a/gp-limit-dates/gpld-conditional-limits.php +++ b/gp-limit-dates/gpld-conditional-limits.php @@ -29,6 +29,9 @@ public function init() { add_filter( 'gform_register_init_scripts', array( $this, 'add_init_script' ), 10, 2 ); add_filter( 'gform_enqueue_scripts', array( $this, 'enqueue_form_scripts' ) ); add_action( 'gform_field_validation', array( $this, 'validate' ), 11, 4 ); + + // Enables date limits for the form field, allowing the `gp-limit-dates` script to be enqueued. + add_filter( "gpld_has_limit_dates_enabled_{$this->_args['form_id']}_{$this->_args['field_id']}", '__return_true', 10, 2 ); } public function enqueue_form_scripts( $form ) {