Skip to content

Instantly share code, notes, and snippets.

@stborchert
Created July 16, 2013 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stborchert/6006878 to your computer and use it in GitHub Desktop.
Save stborchert/6006878 to your computer and use it in GitHub Desktop.
<?php
/**
* Implements hook_views_pre_view().
*/
function MYMODULE_views_pre_view(&$view, &$display_id, &$args) {
if (!in_array($view->name, array('NAME_OF_VIEW', 'NAME_OF_VIEWS_DISPLAY'))) {
return;
}
foreach (array('type') as $filter) {
if (!empty($_GET[$filter]) && (is_array($_GET[$filter])) && reset($_GET[$filter]) == 'All') {
// Remove the filter value because it is manually added and thus
// unknown to Views.
unset($_GET[$filter]);
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment