Forked from spivurno/gw-gravity-forms-disable-autocomplete.php
Created
September 9, 2020 09:55
-
-
Save dexit/a24005c1e1aeec7c7ae988c5b826abb7 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