Programmatically accessing a field group relationship I believe I am using the default Fieldgroup module. I have added a new group using "Add new group", then I have created a couple test fields and nested them under that group.

I see the entry is added in my 'field_group' table in my database.  What I am wondering is how I can programmatically see that relationship.  Please bear with me. After adding content I am using field_info_instance to view each field for that node.  I do not see any field that shows a connection to the group I created.  Is there a function that would let me see this relationship on a field by field basis??

Thank you,
I couldn't find one in the module anywhere but I cobbled this together and it seems to work ok:

function field_get_field_group($field) {
  $group_info = field_group_read_groups(array('entity_type' =&gt; $field['entity_type'], 'bundle' =&gt; $field['bundle']));
  foreach ($group_info[$field['entity_type']][$field['bundle']]['form'] as $group) {
    if (in_array($field['field_name'], $group-&gt;children)) {
      return $group;
    }
  }
  return FALSE;
}


Usage:

$field = field_info_instance('node', 'field_image', 'article');

if ($field_group = field_get_field_group($field)) {
  $group_name = $field_group-&gt;group_name;
  // etc...
}


You'll probably want to add some error checking ;)