I have a page view with exposed filters. One of the filters is term vocabulary, and that's dropdown list, user can select only one category (term).
I want to set programmatically one term from dropdown list when I came from specific URL. I tried with views_query_alter
where $category
is tid
.
$set_exposed_input = array();
$set_exposed_input['field_category_tid'] = $category;
if ($set_exposed_input) {
$view->set_exposed_input($set_exposed_input);
}