node_types_rebuild

Definition

node_types_rebuild()
node/node.module, line 305

Description

Resets the database cache of node types, and saves all new or non-modified module-defined node types to the database.

Code

<?php
function node_types_rebuild() {
  _node_types_build();

  $node_types = node_get_types('types', NULL, TRUE);

  foreach ($node_types as $type => $info) {
    if (!empty($info->is_new)) {
      node_type_save($info);
    }
    if (!empty($info->disabled)) {
      node_type_delete($info->type);
    }
  }

  _node_types_build();
}
?>