How to modify field group markup? field_group.module defines a function as follows:

function field_group_pre_render_accordion_item(&amp;$element, $group, &amp;$form) {
  $element += array(
    '#type' =&gt; 'markup',
    '#prefix' =&gt; '&lt;h3 class="field-group-format-toggler ' . $group-&gt;format_type . ($group-&gt;collapsed ? '' : ' field-group-accordion-active') . '"&gt;&lt;a href="#"&gt;' . check_plain(t($group-&gt;label)) . '&lt;/a&gt;&lt;/h3&gt;
    &lt;div class="field-group-format-wrapper ' . $group-&gt;classes . '"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
    //'#attributes' =&gt; array('class' =&gt; array($group-&gt;format_type)),
  );
  if (!empty($group-&gt;description)) {
    $element['#prefix'] .= '&lt;div class="description"&gt;' . $group-&gt;description . '&lt;/div&gt;';
  }
}


Which is an instance of field_group_pre_render_&lt;format-type&gt;.

What I want to do is change that prefix code from an h3 to a div. But I'm not sure what the appropriate function/hook would be to use. 

The Field Group API defines a hook_field_group_pre_render function but the $element argument in this function doesn't supply the #prefix element - so I'm not sure.

Ideally I could just totally override the function field_group_pre_render_accordion_item in my own code...
Implementing hook_field_group_pre_render_alter() seems the way to go, it's called just after field_group_field_group_pre_render() which calls field_group_pre_render_accordion_item() and receives the correct info.

It should be like this:

function mymodule_field_group_pre_render_alter(&amp;$element, $group, &amp;$form) {
  if ($group-&gt;format_type == 'accordion_item') {
    $element['#prefix'] = '&lt;div class="field-group-format-toggler ' . $group-&gt;format_type . ($group-&gt;collapsed ? '' : ' field-group-accordion-active') . '"&gt;&lt;a href="#"&gt;' . check_plain(t($group-&gt;label)) . '&lt;/a&gt;&lt;/div&gt;&lt;div class="field-group-format-wrapper ' . $group-&gt;classes . '"&gt;';
    if (!empty($group-&gt;description)) {
      $element['#prefix'] .= '&lt;div class="description"&gt;' . $group-&gt;description . '&lt;/div&gt;';
    }
  }
}


Remember to implement it in a module, as a hook_*_alter() implemented in a front-end theme may not be discovered while flushing cache via drush or in the back-end theme.