Created
April 27, 2011 19:30
-
-
Save screamwork/944994 to your computer and use it in GitHub Desktop.
Drupal - Removing tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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