Example<\/h3>\n\/**\r\n * Implements hook_install().\r\n *\/\r\nfunction activecollab_install() {\r\n $group_activecollab_settings = (object) array(\r\n 'identifier' => 'group_activecollab_settings|user|user|form',\r\n 'group_name' => 'group_activecollab_settings',\r\n 'entity_type' => 'user',\r\n 'bundle' => 'user',\r\n 'mode' => 'form',\r\n 'parent_name' => '',\r\n 'table' => 'field_group',\r\n 'type' => 'Overridden',\r\n 'disabled' => FALSE,\r\n 'export_module' => 'activecollab',\r\n 'label' => 'Active Collab Settings',\r\n 'weight' => '3',\r\n 'children' => array(\r\n 'field_activecollab_apikey',\r\n ),\r\n 'format_type' => 'fieldset',\r\n 'format_settings' => array(\r\n 'formatter' => 'collapsible',\r\n 'instance_settings' => array(\r\n 'description' => '',\r\n 'classes' => '',\r\n 'required_fields' => 1,\r\n ),\r\n ),\r\n );\r\n field_group_group_save($group_activecollab_settings);\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"If you need your module to add a fieldgroup to your Drupal 7 site, follow this quick and easy process:\u00a0Also, if you’re looking to create fields, see this\u00a0related post. Build the fieldgroup through the “manage fields” UI. Modify the code below to include a proper\u00a0$fieldgroup_name,\u00a0$entity_type\u00a0and\u00a0$bundle_name. I needed to add a field to the user profile, so I set the\u00a0$entity_type\u00a0to “user” and the\u00a0$bundle_name\u00a0to “user”. $fieldgroup_name = ”; \/\/ e.g., group_author_info $entity_type = ”; \/\/ e.g., node $bundle_name = ”; \/\/ e.g., story include_once DRUPAL_ROOT . ‘\/includes\/utility.inc’; $group = field_group_load_field_group($fieldgroup_name, $entity_type, $bundle_name, ‘form’); $group_var = ‘$’ . $fieldgroup_name . ‘ = ‘ . substr(drupal_var_export($group), 9) . “;\\r”; $group_var = preg_replace(“\/ ‘id’.*,\\n\/”, ”, $group_var); \/\/ remove the ID property $group_var = preg_replace(“\/ ‘export_type’.*,\\n\/”, ”, $group_var); \/\/ remove the export_type property $output = $group_var . ‘field_group_group_save($’ . $fieldgroup_name . ‘);’; drupal_set_message(“<textarea rows=30 style=\\”width: 100%;\\”>” . $output . ‘<\/textarea>’);<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[84,83,89,90,91],"_links":{"self":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts\/267"}],"collection":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/comments?post=267"}],"version-history":[{"count":8,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts\/267\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts\/267\/revisions\/288"}],"wp:attachment":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/media?parent=267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/categories?post=267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/tags?post=267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}