function references_dialog_term_reference_views_query in References dialog 7
View query callback for term references.
1 string reference to 'references_dialog_term_reference_views_query'
File
- ./
references_dialog.dialog_widgets.inc, line 401 - Implements dialogs for node reference and user reference fields.
Code
function references_dialog_term_reference_views_query($view, $instance, $field) {
// We need to make sure that no entries that we can't add to our field shows
// up, so we need to limit the data here.
$vocabulary = taxonomy_vocabulary_machine_name_load($field['settings']['allowed_values'][0]['vocabulary']);
$types = array(
$vocabulary->vid,
);
$view->query
->add_where(0, "{$view->base_table}.vid", $types);
}