You are here

function dynamic_background_node_node_delete in Dynamic Background 7

Same name and namespace in other branches
  1. 7.2 modules/dynamic_background_node/dynamic_background_node.module \dynamic_background_node_node_delete()

Implements hook_node_delete(), that ensures that dynamic background information is delete during node deletion.

File

modules/dynamic_background_node/dynamic_background_node.module, line 186
This module provides the node adminitrators with the option to use different dynamic background images for each node.

Code

function dynamic_background_node_node_delete($node) {
  $settings = variable_get('dynamic_background_node', array());
  if (isset($settings['content_types'][$node->type]) && $settings['content_types'][$node->type]) {
    db_delete('dynamic_background_node')
      ->condition('nid', $node->nid)
      ->condition('vid', $node->vid)
      ->execute();
  }
}