/ Published in: PHP
With thanks to emspace for the original code :)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Helper function to create a content type. * * @param $properties * An array with node type properties, that override the default ones. */ function _create_content_type($properties) { 'type' => '', 'name' => t(''), 'module' => 'node', 'description' => t(''), 'custom' => TRUE, 'modified' => TRUE, 'locked' => FALSE, ); $type = (object) _node_type_set_defaults($type); node_type_save($type); }