Skip to content

Instantly share code, notes, and snippets.

View TrishaM's full-sized avatar

Trisha TrishaM

View GitHub Profile
@dabernathy89
dabernathy89 / gravity-forms-field-groups.php
Created March 13, 2013 19:55
Insert this script into functions.php in your WordPress theme (be cognizant of the opening and closing php tags) to allow field groups in Gravity Forms. The script will create two new field types - Open Group and Close Group. Add classes to your Open Group fields to style your groups. Note that there is a stray (but empty) <li> element created. …
<?php
/*
Insert this script into functions.php in your WordPress theme (be cognizant of the opening and closing php tags) to allow field groups in Gravity Forms. The script will create two new field types - Open Group and Close Group. Add classes to your Open Group fields to style your groups.
Note that there is a stray (but empty) <li> element created. It is given the class "fieldgroup_extra_li" so that you can hide it in your CSS if needed.
*/
add_filter("gform_add_field_buttons", "add_fieldgroup_fields");
function add_fieldgroup_fields($field_groups){
foreach($field_groups as &$group){