Last active
October 24, 2016 22:12
-
-
Save darinronne/5363e6f1c2b2f6f44ad3b3690a05eb4d to your computer and use it in GitHub Desktop.
Gravity Forms - Add "autocomplete='new-password'" to password inputs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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