1 simpletest_example.install simpletest_example_install()

Implements hook_install().

Creates a 'simpletest_example' node type.

Related topics

File

modules/examples/simpletest_example/simpletest_example.install, line 13
Install, update and uninstall functions for the simpletest_example module.

Code

function simpletest_example_install() {
  $simpletest_example_node_type = (object) array(
    'type' => 'simpletest_example',
    'name' => t('Simpletest Example Node Type'),
    'base' => 'node_content',
    'description' => t('simpletest_example page node type.'),
    'custom' => 1,
    'modified' => 1,
    'locked' => 0,
    'is_new' => TRUE,
    'settings' => array(
      'promote_enabled' => FALSE,
    ),
  );

  node_type_save($simpletest_example_node_type);
  node_add_body_field($simpletest_example_node_type);
}