Forked from ronalfy/gravity-forms-disable-autocomplete.php
Last active
October 23, 2023 15:33
-
-
Save spivurno/34963fcc649949fa49d3 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Disable Auto-complete
This file contains hidden or 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
<?php | |
// Disable auto-complete on form. | |
add_filter( 'gform_form_tag', function( $form_tag ) { | |
return str_replace( '>', ' autocomplete="off">', $form_tag ); | |
}, 11 ); | |
// Diable auto-complete on each field. | |
add_filter( 'gform_field_content', function( $input ) { | |
return preg_replace( '/<(input|textarea)/', '<${1} autocomplete="off" ', $input ); | |
}, 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment