Programmatically execute a view without exposed filters

Public

When using views->execute for a view with exposed filters, views uses any suitable filter values from the current url, which might cause strange side effects. Here's how to avoid this.

Get raw version
php
  1. $view = views_get_view('view_name');
  2. $view->set_arguments(array(any arguments needed)));
  3. $view->set_exposed_input(array(NULL)); // Else the filters would be taken from $_GET!
  4. $view->execute('display_name'); // Or just use views->set_display()