Skip to content

Instantly share code, notes, and snippets.

@darinronne
Last active October 24, 2016 22:12
Show Gist options
  • Save darinronne/5363e6f1c2b2f6f44ad3b3690a05eb4d to your computer and use it in GitHub Desktop.
Save darinronne/5363e6f1c2b2f6f44ad3b3690a05eb4d to your computer and use it in GitHub Desktop.
Gravity Forms - Add "autocomplete='new-password'" to password inputs
// Add "autocomplete='new-password'" to password input so that password managers don't try to autofill it.
add_filter( 'gform_field_content', function ( $field_content, $field ) {
if ( $field->type == 'password' ) {
return str_replace( 'type=', "autocomplete='new-password' type=", $field_content );
}
return $field_content;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment