Skip to content

Instantly share code, notes, and snippets.

/file1.php Secret

Created April 18, 2017 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1b965f5c3243abf470de7644ef56b7f8 to your computer and use it in GitHub Desktop.
Save anonymous/1b965f5c3243abf470de7644ef56b7f8 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'gform_form_tag', 'gform_form_tag_autocomplete', 11, 2 );
function gform_form_tag_autocomplete( $form_tag, $form ) {
if ( is_admin() ) return $form_tag;
if ( GFFormsModel::is_html5_enabled() ) {
$form_tag = str_replace( '>', ' autocomplete="off">', $form_tag );
}
return $form_tag;
}
add_filter( 'gform_field_content', 'gform_form_input_autocomplete', 11, 5 );
function gform_form_input_autocomplete( $input, $field, $value, $lead_id, $form_id ) {
if ( is_admin() ) return $input;
if ( GFFormsModel::is_html5_enabled() ) {
$input = preg_replace( '/<(input|textarea)/', '<${1} autocomplete="off" ', $input );
}
return $input;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment