Bootstrap search form wrapper alter I am using the 7.x-3.0 version of Bootstrap and have sub themed it. I want to change wrapped div, add 'input-group-sm' to the class bit I can't not figure out how to override it. if I add search-block-form.tpl.php to my sub theme I can access and alter that but the code I need is in bootstrap-search-form-wrapper-func.php I have copied that to my sub theme with no success. I have tried replicating the same file structure as Bootstrap 'mytheme/theme/bootstrap/bootstrap-search-form-wrapper.func.php', I have tried putting just in my templates dir. 

My last attempt was trying to follow the instructions on theme registry alters: https://www.drupal.org/node/2224003 which I have as this: 

function CFbootstrap_theme(&amp;$existing, $type, $theme, $path) {
  $hooks['CFbootstrap_hook'] = array(
    'CFbootstrap_search_form_wrapper' =&gt; array(
      'render element' =&gt; 'element',
    ),
  );

  bootstrap_hook_theme_complete($existing, $theme, $path . '/theme');
  return $hooks;
}


Nothing works, what I am doing wrong? How do I override this *.func.php?
OK, I have this figured out, I think I just got confused by instructions and getting ramped up again on the ways of Drupal. Anyway just to leave a clear answer. All subthemes will be called MYTHEME. In my template.php in my subtheme I altered the form and then added hook to my new form wrapper:

function MYTHEME_form_alter(&amp;$form, &amp;$form_state, $form_id) {
if($form_id) {
    switch ($form_id) {
        case 'search_form':
            dpm($form);
            $form['basic']['keys']['#theme_wrappers'] = array('MYTHEME_search_form_wrapper');
            break;
    }
  }
}

function MYTHEME_theme(&amp;$existing, $type, $theme, $path) {
  $hooks = array(
      'MYTHEME_search_form_wrapper' =&gt; array(
      'render element' =&gt; 'element',
      'file' =&gt; 'MYTHEME-search-form-wrapper.func.php',
    ),
  );

  return $hooks;
}


In this I copied the original wrapper file and made my changes, you could just copy the method and add it to your template.php anyway here's that method, referenced earlier as 'MYTHEME-search-form-wrapper.func.php':

function MYTHEME_MYTHEME_search_form_wrapper($variables) {
  $output = '&lt;div class="input-group input-group-sm"&gt;';
  $output .= $variables['element']['#children'];
  $output .= '&lt;span class="input-group-btn"&gt;';
  $output .= '&lt;button type="submit" class="btn btn-default"&gt;';
  // We can be sure that the font icons exist in CDN.
  if (theme_get_setting('bootstrap_cdn')) {
    $output .= _bootstrap_icon('search');
  }
  else {
    $output .= t('Search');
  }
  $output .= '&lt;/button&gt;';
  $output .= '&lt;/span&gt;';
  $output .= '&lt;/div&gt;';
  return $output;
}


Key here is having the subtheme name twice in the method call. The instructions I found on this didn't give an explanation on why that needs to be. I'll try to find relevant information.