Created
September 4, 2013 10:37
-
-
Save rubedell/6435355 to your computer and use it in GitHub Desktop.
Taxonomy views - language filter fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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