Skip to content

Instantly share code, notes, and snippets.

@screamwork
Created April 27, 2011 19:30
Show Gist options
  • Save screamwork/944994 to your computer and use it in GitHub Desktop.
Save screamwork/944994 to your computer and use it in GitHub Desktop.
Drupal - Removing tabs
function themename_preprocess_page(&$vars) {
//dsm($variables['tabs']);
themename_removetab('TABNAME', $vars);
}
/* remove a primary tab */
function themename_removetab($label, &$vars) {
$i = 0;
if (is_array($vars['tabs']['#primary'])) {
foreach ($vars['tabs']['#primary'] as $primary_tab) {
if ($primary_tab['#link']['title'] == $label) {
unset($vars['tabs']['#primary'][$i]);
//dsm($vars['tabs']['#primary']);
break;
}
++$i;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment