Can`t alter views filter option I need to alter my view filter option!

The view must display some comments. Every comment, that I need, has  custom field "node reference". And I want to filter comments by this field.

E.g. if my view displays on page with node 9(nid), view should return me all comments where "node reference" = 9; 

I have found such solution: http://www.drupaldump.com/view-3-alter-filters-programmatically

And try to rewrite for me:

function mymodule_views_pre_view(&amp;$view) {

  if ($view-&gt;name === 'contest_winners') {
    $view_filters = $view-&gt;display_handler-&gt;get_option('filters');

    $node_id = arg(1);


    $view_filters['field_for_contest_nid']['value'] = null;
    $view_filters['field_for_contest_nid']['value'][$node_id] = inttostr($node_id);
    $overrides = array();
    $overrides['filters'] = $view_filters;
    foreach ($overrides as $option =&gt; $definition) {
      $view-&gt;display_handler-&gt;override_option($option, $definition);
    }

    dpm($view_filters); // here value = node_id, but view use default value

  }

}


But this does not help: view uses default value.

Maybe i have made some stupid mistake?
It seems you read not complete article :(. before this method getting call we should tell hey views we want use your hooks

something like in your .module file

/**
* Implements hook_views_api().
*/
function yourmodule_views_api() {
  return array(
    'api' =&gt; 3,
    'path' =&gt; drupal_get_path('module', 'yourmodule') . '/views',
  );
}


Then create a views directory, create yourmodule..views.inc file there and put your code there ( please be sure your code getting execution with some dsm or die() ).

I know your change your way but I think it help you in another task.

take a look  at : this article