Created
January 11, 2017 18:56
-
-
Save mattmcgiv/08dfc652bdef9ce4094425e01a19f308 to your computer and use it in GitHub Desktop.
add-autocomplete-to-gravity-forms
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
<?php | |
add_filter( 'gform_field_content', function ( $field_content, $field ) { | |
if ( $field->type == 'email' ) { | |
return str_replace( 'type=', "autocomplete='email' type=", $field_content ); | |
} | |
if ( $field->type == 'name' ) { | |
return str_replace( 'type=', "autocomplete='name' 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