function node_type_reset

node_type_reset($type)

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

Parameters

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

File

modules/node/content_types.inc, line 398
Content type editing user interface.

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!node!content_types.inc/function/node_type_reset/7.x