hook_node_type

  1. drupal
    1. drupal6 node.php
    2. drupal7
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.

Übergabeparameter

$op What is being done to $info. Possible values:

  • "delete"
  • "insert"
  • "update"

$info The node type object on which $op is being performed.

Rückgabewert

None.

Verwandte Themen

Code

modules/node/node.api.php, line 600

<?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

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen