Skip to content

Instantly share code, notes, and snippets.

@New0
Created May 26, 2020 15:00
Show Gist options
  • Save New0/fbffe741e00f21a8bf34649251570c31 to your computer and use it in GitHub Desktop.
Save New0/fbffe741e00f21a8bf34649251570c31 to your computer and use it in GitHub Desktop.
Set the Caldera Forms text field with date Type to only allow future dates to be picked.
<?php
add_filter( 'caldera_forms_field_attributes', function( $attrs, $field ){
//EDIT FIELD ID
if( $field['ID'] === "fld_7194486" ){
$attrs[ 'min' ] = date("Y-m-d");
}
return $attrs;
}, 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment