override theme function in facetapi module I am trying to change the markup of links created by the facetapi module.  The theme function is here

function theme_facetapi_link_inactive($variables) {
  $accessible_vars = array(
    'text' =&gt; $variables['text'],
    'active' =&gt; FALSE,
  );
  $accessible_markup = theme('facetapi_accessible_markup', $accessible_vars);
  $sanitize = empty($variables['options']['html']);
  $variables['text'] = ($sanitize) ? check_plain($variables['text']) : $variables['text'];
  if (isset($variables['count'])) {
    $variables['text'] .= ' ' . theme('facetapi_count', $variables);
  }
  $variables['text'] .= $accessible_markup;
  $variables['options']['html'] = TRUE;
  return theme_link($variables);
}


I am trying to override this function so I can change the markup without editing the module files.  I've tried MYTHEME_preprocess_facetapi_link_inactive and using a custom module but both times I can print the variables and they are correct but the links are still displayed wrong.

function MYTHEME_preprocess_facetapi_link_inactive($variables) {
  $accessible_vars = array(
    'text' =&gt; $variables['text'],
    'active' =&gt; FALSE,
  );
  $accessible_markup = theme('facetapi_accessible_markup', $accessible_vars);
  $sanitize = empty($variables['options']['html']);
  $variables['text'] = ($sanitize) ? check_plain($variables['text']) : $variables['text'];
  if (isset($variables['count'])) {
    $variables['text'] .= ' &lt;strong&gt;' . theme('facetapi_count', $variables) . '!!!&lt;/strong&gt;';
  }
  $variables['text'] .= $accessible_markup;
  $variables['options']['html'] = TRUE;
  return theme_link($variables);
}


Am I going about this the wrong way?
You're nearly there, but a preprocess function doesn't look applicable to what you're trying to do. A preprocess function is used to set up variables for a theme function, not to actually produce the markup. 

What it looks like you're trying to do is to override theme_facetapi_link_inactive() completely, in which case you don't use a preprocess function, but instead you call the function MYTHEME_theme_function_name() and the theme engine will use that instead of the original function.

So all you need to is change the name of your function like so:

function MYTHEME_facetapi_link_inactive($variables) {
  // Same code as in your example
}


After you clear the caches Drupal will start using that function in place of theme_facetapi_link_inactive() whenever it's called.