I have one filter with options (taxonomy), and I want delete options (if they are too old).
How I can hook_views_pre_view
?
I see that http://yogeshchaugule.com/blog/2013/how-alter-views-exposed-filter-allowed-value-list but it doesn't work because I don't have index 'value' (probably because I use a select).
I would recommand using hook_form_alter
or hook_form_FORM_ID_alter
. Inside those hooks you can get to your filter and modify the options of your select. An exemple would be :
function mymodule_form_alter(&$form, &$form_state, $form_id) {
if($form_id == 'my_form_id'){
$my_options = array('key' => 'value');
$form['my_field']['#options'] = $my_options;
}
}