How can I get exposed filter for content type from the view programmatically? I want to customize an exposed filter for content types, how can I get the exposed filter for a view in the code? And to know exactly which content types need to be dispalyed? 

$route = explode('.', \Drupal::routeMatch()-&gt;getRouteName());
if (!empty($route) &amp;&amp; $route[0] == 'view') {

  if ($view = Views::getView($route[1])) {
       $filters = $view-&gt;getHandlers('filter');

  }
}
It might be easier to get the display settings from the View storage (the configuration of the view): 

$view = \Drupal\views\Views::getView('myview');
$storage = $view-&gt;storage;
$display = &amp;$storage-&gt;getDisplay('page_1');
$display['display_options']['filters']['nid']['value']['value'] = 123;
$storage-&gt;save();


Here you should be able to find all options configured in the Views UI.