set multiple taxonomy values programmatically I have a view that has a "Has taxonomy term ID" contextual filter and also a nid contextual  filter.

I execute this view programmatically, but I need to pass also multiple values for the taxonomy contextual filter.

I tried this:

$view-&gt;set_arguments(array($tid, $nid));
$view-&gt;execute();


and it works only if $tid is only a number.

I tried to put more than one tid using "+", but it doesn't work. 
(example 3+5+8)

Any idea on how I can set a multiple taxonomy argument programmatically?
thank you in advance



I found a solution, but I don't like it. I removed the filter from contextual filter and I added an exposed filter for the same field. Then I changed the code in this way:

$view-&gt;set_arguments(array($nid));
$view-&gt;exposed_input['field_myfield_tid'] = $tid;  //note that $tid is an array of tid
$view-&gt;execute();
You could also implement the "hook_views_pre_view" function in order to alter the contextual filter arguments of your view and display. In order to add multiple taxonomy values for the same argument, you can change the $args[0] element from the $args variable of the hook.
For example: $args[0] = '22+14+64';
Remember to check the "Allow multiple values" option of the contextual filter.

Take into account that altering contextual filter arguments inside the previous hook may produce troubles when using a views exposed form. Specifically, the form "action" attribute may have a wrong URL. If that issue appears, you can solve it by implementing the "hook_form_views_exposed_form_alter" function and changing the $form['#action'] element with the correct URL.