You are here

16 January 2012

How to remove views view filter programmatically in Drupal.

Source code viewer
  1. function HOOK_views_pre_view(&$view) { // don't forget to replace the HOOK
  2. if($view->name == 'view_name') { // conditions
  3. unset($view->display_handler->default_display->options['filters']['filter_name']); // replace filter_name with the name of your filter, print your array for filter names
  4. }
  5. }
Programming Language: PHP