function node_types_rebuild

7.x node.module node_types_rebuild()
6.x node.module node_types_rebuild()

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

4 calls to node_types_rebuild()
drupal_flush_all_caches in drupal-6.x/includes/common.inc
Flush all cached data on the site.
node_type_delete_confirm_submit in drupal-6.x/modules/node/content_types.inc
Process content type delete confirm submissions.
node_type_form_submit in drupal-6.x/modules/node/content_types.inc
Implementation of hook_form_submit().
system_modules_submit in drupal-6.x/modules/system/system.admin.inc
Submit callback; handles modules form submission.

File

drupal-6.x/modules/node/node.module, line 464
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

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();
}