Skip to content

Instantly share code, notes, and snippets.

@rubedell
Created September 4, 2013 10:37
Show Gist options
  • Save rubedell/6435355 to your computer and use it in GitHub Desktop.
Save rubedell/6435355 to your computer and use it in GitHub Desktop.
Taxonomy views - language filter fix
/**
* Implements hook_views_query_alter
* FIX TAXONOMY
* Add language filter to views
*/
function the_aim_custom_views_query_alter(&$view, &$query) {
if ($view->name == 'homepage_taxonomy_spotlight') {
$query->where[] = array(
'conditions' => array(array(
'field' => 'taxonomy_term_data.language',
'value' => array('***CURRENT_LANGUAGE***'),
'operator' => 'in',
)),
'args' => array(),
'type' => 'AND',
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment