Created
February 1, 2017 20:14
-
-
Save codenameEli/1e4003ca4d73aa96d60e624ef507ab7e to your computer and use it in GitHub Desktop.
Add your own custom class to Gravity Forms fields. Much easier to do than having the client go into the backend and add a class through the Form Edit screen.
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_css_class', 'chronos_add_custom_field_class', 10, 3 ); | |
function chronos_add_custom_field_class( $classes, $field, $form ) | |
{ | |
$classes .= ' chronos-' . $field->type . '-field'; | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment