node_type_reset
modules/node/content_types.inc, строка 367
- Версии
- 5 – 6
node_type_reset(&$type)
Resets all of the 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
resetted values. If there is no module-defined info for this node type,
then nothing happens.
Код
<?php
function node_type_reset(&$type) {
$info_array = module_invoke_all('node_info');
if (isset($info_array[$type->orig_type])) {
$info = _node_type_set_defaults($info_array[$type->orig_type]);
$info['type'] = $type->orig_type;
foreach ($info as $field => $value) {
$type->$field = $value;
}
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии