--- tabbed_block.module	2011-01-25 11:20:35.000000000 +0000
+++ tabbed_block.module	2011-04-07 14:22:29.000000000 +0100
@@ -112,13 +112,16 @@ function tabbed_block_block( $op="list" 
         //tab headers
         //catch potential empty block, redirect user to overide title
         if ( $temp->subject ) {
-          $tab_subject .= "<li><a href='#' id='fragment". $module_delta ."-". $i ."'>". $temp->subject ."</a></li>";
-          //tabe content
-          if ( $temp->content ) {
-            $tab_content .= "<div id='content-fragment". $module_delta ."-". $i ."'>". $temp->content ."</div>";
-          }
-          else{
-            $tab_content .= "<div id='content-fragment". $module_delta ."-". $i ."'>Nothing here.</div>";
+          $hide_tab = (!$temp->content && $settings['settings']['hide_empty'])? TRUE : FALSE;
+          if(!$hide_tab){
+            $tab_subject .= "<li><a href='#' id='fragment". $module_delta ."-". $i ."'>". $temp->subject ."</a></li>";
+            //tabe content
+            if ( $temp->content ) {
+              $tab_content .= "<div id='content-fragment". $module_delta ."-". $i ."'>". $temp->content ."</div>";
+            }
+            else{
+              $tab_content .= "<div id='content-fragment". $module_delta ."-". $i ."'>Nothing here.</div>";
+            }
           }
         }
         else{
@@ -129,6 +132,10 @@ function tabbed_block_block( $op="list" 
         $i++;
       }
       $tab_subject .= "</ul>";
+      // if no tabs because they have no content, set tab subject to empty
+      if(empty($tab_content)){
+        $tab_subject = '';
+      }
 
     }
     elseif ( !variable_get( 'tabbed_block_list' , NULL) ) {
@@ -466,6 +473,12 @@ function tabbed_block_admin_settings( $f
     '#weight' => -4,
   );
   
+  $form['settings']['hide_empty'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Hide tabs without content'),
+    '#default_value' => ((!empty($settings['hide_empty']))? $settings['hide_empty'] : 0),
+  );
+  
   $form['settings']['effects'] = array(
     '#type' => 'textfield',
     '#title' => t('Effects'),
@@ -696,7 +709,7 @@ function tabbed_block_admin_settings_sub
   
   $variable = 'tabbed_block_settings'. arg(4);
   
-  $settings = array( 'effects' => $form_state['values']['effects'], 'ajax' => $form_state['values']['ajax'] );
+  $settings = array( 'effects' => $form_state['values']['effects'], 'ajax' => $form_state['values']['ajax'], 'hide_empty' => $form_state['values']['hide_empty'] );
   
   //init exists blocks from POST instead of database settings
   if ( $form_state['values']['exists'] ) {
