| Versionen | |
|---|---|
| drupal6 – drupal7 | hook_node_type($op, $info) |
Act on node type changes.
This hook allows modules to take action when a node type is modified.
$op What is being done to $info. Possible values:
$info The node type object on which $op is being performed.
None.
modules/
<?php
function hook_node_type($op, $info) {
switch ($op) {
case 'delete':
variable_del('comment_' . $info->type);
break;
case 'update':
if (!empty($info->old_type) && $info->old_type != $info->type) {
$setting = variable_get('comment_' . $info->old_type, COMMENT_NODE_OPEN);
variable_del('comment_' . $info->old_type);
variable_set('comment_' . $info->type, $setting);
}
break;
}
}
?>
Kommentare
Kommentar hinzufügen