more than one content type in a condition? I'm using this as below described in my subtheme (Thanks to @4k4 and @Berdir):

function kanu_preprocess_node(&amp;$variables) {
  if($variables['node']-&gt;getType() != 'test') {
    return;
 }
  $field = $variables['node']-&gt;field_where_to_publish;

  if (!$field-&gt;isEmpty() &amp;&amp; $field-&gt;entity-&gt;label() == 'public') {
     $variables['display_submitted'] = FALSE;
     $variables['content']['comment']['#access'] = FALSE;
  }
}


How to write it for 3 different content type (with same field names)?
You can use in_array.

$types = array('one', 'two', 'three');

if (!in_array($variables['node']-&gt;getType(), $types)) {
  // code
}