$types = array(
array(
  'type' => 'page',
  'name' => st('Page'),
  'module' => 'node',
  'description' => st('If you want to add a static page, like a contact page or an about page, use a page.'),
  'custom' => TRUE,
  'modified' => TRUE,
  'locked' => FALSE,
),

 foreach ($types as $type) {
   $type = (object) _node_type_set_defaults($type);
   node_type_save($type);
}

Is this worth it or is the array with foreach loop already simple enough? Probably low priority, it's nice being able to read the content types....

Comments

boris mann’s picture

Version: » 5.x-1.x-dev
Status: Active » Fixed

Doesn't make sense to do anything with the array, I don't think. Committed a small function to do the object casting and saving.

Anonymous’s picture

Status: Fixed » Closed (fixed)