You are here

function og_node_type_save in Organic groups 7

Add group and group content fields to new content types.

Parameters

$bundle_name: The content type name.

2 calls to og_node_type_save()
og_node_type_insert in ./og.module
Implement hook_node_type_insert().
og_node_type_update in ./og.module
Implement hook_node_type_update().

File

./og.module, line 1943
Enable users to create and manage groups with roles and permissions.

Code

function og_node_type_save($bundle_name) {
  if (variable_get('og_group_type_' . $bundle_name, 'omitted') == 'group') {
    og_create_field(OG_GROUP_FIELD, 'node', $bundle_name);

    // Delete the variable, as we will rely on the presence of th field.
    variable_del('og_group_type_' . $bundle_name);
  }
  if (variable_get('og_group_content_type_' . $bundle_name, 'omitted') == 'og_content') {
    og_create_field(OG_AUDIENCE_FIELD, 'node', $bundle_name);

    // Delete the variable, as we will rely on the presence of th field.
    variable_del('og_group_content_type_' . $bundle_name);
  }
}