Skip to content

Instantly share code, notes, and snippets.

@awakekat
Created February 11, 2016 05:21
Show Gist options
  • Save awakekat/09371465e119dca7f6ff to your computer and use it in GitHub Desktop.
Save awakekat/09371465e119dca7f6ff to your computer and use it in GitHub Desktop.
Add classes to Gravity Forms fields based on the type of field (i.e. address, name, email, etc.) In functions.php
// Add field type class to Gravity Forms fields
add_filter( 'gform_field_css_class', 'gf_field_type_classes', 10, 3 );
function gf_field_type_classes( $classes, $field, $form ) {
$classes .= ' gfield_' . $field->type;
return $classes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment