Alter views 'Has taxonomy term' filter Programatically using views_get_view Im am having some problems setting TID filter values programatically. I have an array of term ids form a taxonomy field that I need apply to a views filter via views_get_view.

This is the code that I have within a DS field that Im trying to alter via the view's display_handler - Im not even sure if this is the best way to do this. Hopefully someone can explain how this can be done.

Any help would be much appreciated. 
Thanks

    $pager_count = field_get_items('node', $fields['entity'], 'field_pager_count');
    $pager_count = isset($pager_count[0]['value']) ? $pager_count[0]['value'] : 10;
    $node_tags = field_get_items('node', $fields['entity'], 'field_tags');
    $current_node = (arg(0) === 'node' &amp;&amp; is_numeric(arg(1))) ? arg(1) : '';
    $tags = array();

    // Alter view to set TID filter and pager
    $view = views_get_view('list_control');
    $view-&gt;set_display('block_1');
    $view-&gt;set_arguments(array($current_node)); // Remove current NID
    $view-&gt;set_items_per_page($pager_count); // Set pager Items
    $view-&gt;pre_execute();
    $view-&gt;execute();

    foreach($node_tags as  $node_tag) {
      $tags[] = $node_tag['tid'];
    }
    //Set filter values base on $tags array 
    $filters = $view-&gt;display_handler-&gt;get_option('filters');
    $filters['tid']['value'] = $tags;

    // Return DS field.
    $field =  $view-&gt;render();
I managed to achieve this using the following

$view = views_get_view('list_control');
$view-&gt;set_display('block_1');
$view-&gt;set_arguments(array($current_node)); // Remove current NID
$view-&gt;set_items_per_page($pager_count); // Set pager Items

// Set filter based on $tags.
$filter = $view-&gt;get_item($display_id, 'filter', 'tid');
$filter['value'] =  $tags;    
$view-&gt;set_item($display_id, 'filter', 'tid', $filter);
$view-&gt;pre_execute();
$view-&gt;execute();