Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hirejordansmith/e7c42c31d912d11194597b43ebf4cb0e to your computer and use it in GitHub Desktop.
Save hirejordansmith/e7c42c31d912d11194597b43ebf4cb0e to your computer and use it in GitHub Desktop.
Change field type of a Gravity Form field
<?php
add_filter( 'gform_gf_field_create', 'convert_hidden_to_text', 10, 2 );
function convert_hidden_to_text( $field, $properties ) {
if( $field->get_input_type() == 'hidden' ) {
$field = new GF_Field_Text( $properties );
}
return $field;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment