You are here

Creating Content Type <= hook_install()

  // Content type definition.
  $content_type = array(
    'type' => 'example',
    'name' => $t('example'),
    'description' => $t('A example text.'),
    'title_label' => $t('Example Name'),
    'base' => 'node_content',
    'custom' => TRUE,
  );

  // Set remaining definitions with defaults.
  $node_type = node_type_set_defaults($content_type);

  // Save the content type.
  node_type_save($node_type);
}

code type: