A view I wrote has bugged handlers so I want to alter the query manually. How do I get the current view display?
If you already know the machine name of the view then you can wrap your code in an if statement.

function hook_views_query_alter(&amp;$view, &amp;$query){
    if($view-&gt;name == 'name_of_view_to_alter'){
        //do stuff to the query
    }
}


hook_views_query_alter takes two arguments &amp;$view and &amp;$query. If you don't already know the machine name, of course install devel and use dsm($view) to find what you need. Also very helpful calling that on the $query variable as well. I just did something very similar.