Creating content types programmatically in Drupal 7. If you add this code to install hook then this way you can define your own content types in a module for an example.
Source code viewer
'type' => 'page', 'name' => st('Page'), 'base' => 'node_content', 'description' => st("Use <em>pages</em> for your static content, such as an 'About us' page."), 'custom' => 1, 'modified' => 1, 'locked' => 0, ), 'type' => 'article', 'name' => st('Article'), 'base' => 'node_content', 'description' => st('Use <em>articles</em> for time-specific content like news, press releases or blog posts.'), 'custom' => 1, 'modified' => 1, 'locked' => 0, ), ); foreach ($types as $type) { $type = node_type_set_defaults($type); node_type_save($type); }Programming Language: PHP