You are here

function og_node_type in Organic groups 5

Same name and namespace in other branches
  1. 5.8 og.module \og_node_type()
  2. 5.3 og.module \og_node_type()
  3. 5.7 og.module \og_node_type()
  4. 6.2 og.module \og_node_type()
  5. 6 og.module \og_node_type()

An implementation of hook_node_type. Automatically update admin preferences when node type is renamed or removed.

File

./og.module, line 2277

Code

function og_node_type($op, $info) {
  switch ($op) {
    case 'delete':
      variable_del('og_content_type_usage_' . $info->type);
      break;
    case 'update':
      $usage = variable_get('og_content_type_usage_' . $info->type, 'omitted');
      variable_set('og_content_type_usage_' . $info->type, $usage);
      variable_del('og_content_type_usage_' . $info->old_type);
  }
}