Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function YOUR_MODULE_views_query_alter(&$view, &$query) {
- if ($view->name = 'YOUR_VIEW' && !empty($view->exposed_raw_input['YOUR_FIELD']) {
- $transliterated = transliteration_get($view->exposed_raw_input['YOUR_FIELD']);
- // Traverse through the 'where' part of the query.
- foreach ($query->where as &$condition_group) {
- foreach ($condition_group['conditions'] as &$condition) {
- // If this is the part of the query filtering on your field, change the
- // condition value to the transliterated string.
- if ($condition['field'] == 'YOUR FIELD') {
- $condition['value'] = $transliterated;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement