node_types_rebuild

Versions
5 – 7
node_types_rebuild()

Resets the database cache of node types.

All new or non-modified module-defined node types are saved to the database.

▾ 4 functions call node_types_rebuild()

drupal_flush_all_caches in includes/common.inc
Flush all cached data on the site.
node_type_delete_confirm_submit in modules/node/content_types.inc
Process content type delete confirm submissions.
node_type_form_submit in modules/node/content_types.inc
Implement hook_form_submit().
system_modules_submit in modules/system/system.admin.inc
Submit callback; handles modules form submission.

Code

modules/node/node.module, line 437

<?php
function node_types_rebuild() {
  // Reset and load updated node types.
  drupal_static_reset('_node_types_build');
  foreach (node_type_get_types() as $type => $info) {
    if (!empty($info->is_new)) {
      node_type_save($info);
    }
    if (!empty($info->disabled)) {
      node_type_delete($info->type);
    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.