You are here

function bynder_node_delete in Bynder 7

Implements hook_node_delete().

File

./bynder.module, line 299

Code

function bynder_node_delete($node) {
  $language = isset($node->language) ? $node->language : LANGUAGE_NONE;
  $item = array(
    $node,
  );
  foreach ($item['0'] as $field => $value) {
    if (is_array($value) && substr($field, 0, 5) == 'field') {
      foreach ($value[$language] as $newFile) {
        if (isset($newFile['fid'])) {
          bynder_delete_asset_usage_information($newFile['fid'], $node->nid);
        }
      }
    }
  }
}