You are here

function content_delete_revision in Content Construction Kit (CCK) 5

Same name and namespace in other branches
  1. 6.3 content.module \content_delete_revision()
  2. 6 content.module \content_delete_revision()
  3. 6.2 content.module \content_delete_revision()

delete node type fields for a revision.

1 call to content_delete_revision()
content_nodeapi in ./content.module
Implementation of hook_nodeapi().

File

./content.module, line 283
Allows administrators to associate custom fields to content types.

Code

function content_delete_revision(&$node) {
  $type = content_types($node->type);
  if (!empty($type['fields'])) {
    _content_field_invoke('delete revision', $node);
    _content_field_invoke_default('delete revision', $node);
  }
  $table = _content_tablename($type['type'], CONTENT_DB_STORAGE_PER_CONTENT_TYPE);
  if (db_table_exists($table)) {
    db_query('DELETE FROM {' . $table . '} WHERE vid = %d', $node->vid);
  }
  cache_clear_all('content:' . $node->nid . ':' . $node->vid, 'cache_content');
}