1 node.types.inc node_type_reset($type)

Resets relevant fields of a module-defined node type to their default values.


$type: The node type to reset. The node type is passed back by reference with its reset values. If there is no module-defined info for this node type, then nothing happens.


core/modules/node/node.types.inc, line 819
Content type editing user interface.


function node_type_reset($type) {
  $info_array = module_invoke_all('node_info');
  if (isset($info_array[$type->orig_type])) {
    $info_array[$type->orig_type]['type'] = $type->orig_type;
    $info = node_type_set_defaults($info_array[$type->orig_type]);

    foreach ($info as $field => $value) {
      $type->$field = $value;