Skip to content

Instantly share code, notes, and snippets.

@markusvonplunkett
Created November 28, 2018 12:01
Show Gist options
  • Save markusvonplunkett/6c22f63a50b1a908eda722c138713003 to your computer and use it in GitHub Desktop.
Save markusvonplunkett/6c22f63a50b1a908eda722c138713003 to your computer and use it in GitHub Desktop.
Remove autocomplete from data form fields
add_filter( 'gform_field_content', function($input, $field, $value, $lead_id, $form_id){
if($field->type == 'date'){
$input = preg_replace( '/<(input)/', '<${1} autocomplete="off" ', $input );
}
return $input;
}, 5, 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment