drupal函数:hook_delete

modules/node/node.api.php, 564行

版本
4.6 – 7
hook_delete(&$node)

回应节点删除

这是节点模块的一个钩子.它被调用的目的是当结点被从数据库删除的时候允许模块执行行为 , 例如,从相关数据表中 删除资料.

To take action when nodes of any type are deleted (not just nodes of the type defined by this module), use hook_nodeapi() instead.

For a detailed usage example, see node_example.module.

参数

&$node The node being deleted.

返回值

None.

相关主题

Hooks
Allow modules to interact with the Drupal core.

代码

<?php function hook_delete(&$node) { db_query('DELETE FROM {mytable} WHERE nid = %d', $node->nid); } ?>


同步内容