Hide content type from node add list

Geschreven op 13 juni 2017 door Fabian van de Bor
/**
 * Implements hook_preprocess_node_add_list().
 */
function module_name_preprocess_node_add_list(&$variables) {
  // Remove add link for CONTENT TYPE.
  foreach ($variables['content'] as $key => $type) {
    $type_name = @reset(unserialize($type['page_arguments']));
    if ($type_name == 'CONTENT TYPE') {
      unset($variables['content'][$key]);
    }
  }
}

Reacties

Reactie toevoegen

Plaats hier uw naam.