diff -rupN ../views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid_node.inc ./modules/taxonomy/views_plugin_argument_default_taxonomy_tid_node.inc --- ../views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid_node.inc 1970-01-01 10:00:00.000000000 +1000 +++ ./modules/taxonomy/views_plugin_argument_default_taxonomy_tid_node.inc 2011-02-14 10:54:25.000000000 +1100 @@ -0,0 +1,39 @@ +argument->options['validate_type'] == 'taxonomy_term') { + $valid_vids = $this->argument->options['validate_argument_vocabulary']; + foreach ($node->taxonomy as $tid => $term) { + // This has VID => VID for selected ones, and VID => 0 otherwise. + if ($valid_vids[$term->vid]) { + $tids[] = $tid; + } + } + } + // Otherwise, take all terms from the node. + else { + $tids = array_keys($node->taxonomy); + } + + if ($tids) { + // Transform the argument to a string of comma-separated tids. + return implode(',', $tids); + } + } + // Views will just do nothing for this argument if we end up here. + } +} diff -rupN ../views/modules/taxonomy.views.inc ./modules/taxonomy.views.inc --- ../views/modules/taxonomy.views.inc 2011-01-12 10:45:14.000000000 +1100 +++ ./modules/taxonomy.views.inc 2011-02-14 11:04:11.341959999 +1100 @@ -466,6 +466,12 @@ function taxonomy_views_plugins() { // 'parent' => 'fixed', // ), // ), + 'taxonomy_tid_node' => array( + 'title' => t('Taxonomy Term ID from current node'), + 'handler' => 'views_plugin_argument_default_taxonomy_tid_node', + 'path' => drupal_get_path('module', 'views') . '/modules/taxonomy', + 'parent' => 'taxonomy_tid', + ), ); }