Skip to content

Instantly share code, notes, and snippets.

View alvar0hurtad0's full-sized avatar
💭
Happy 😄

Alvaro J. Hurtado Villegas alvar0hurtad0

💭
Happy 😄
View GitHub Profile
@rafinskipg
rafinskipg / query_search_alter.php
Created November 2, 2012 13:23
Drupal 7 Default query search alter
function mymodule_query_alter(QueryAlterableInterface $query){
$is_search = FALSE;
foreach ($query->getTables() as $table) {
if ($table['table'] == 'search_index') {
$is_search = TRUE;
}
}
if ($is_search) {
global $language;