How do I overwrite the variables in my theme? function rate_preprocess_test(&amp;$variables) {
  extract($variables);
  $buttons = array();
  foreach ($links as $link) {
    $button = theme('rate', $link['text'], $link['href']);
    $button .= $link['votes'];
    $buttons[] = $button;
  }
  $variables['buttons'] = $buttons;
}


I want to overwrite the $link['votes'] variable to add a &lt;span&gt; tag around $link['votes'].

This is the code I added to template.php, but it doesn't contain the &lt;span&gt; tags that I  added.

function mytheme_preprocess_test(&amp;$variables){
    $link['votes']='&lt;span&gt;'.$link['votes'].'&lt;/span&gt;';
}


I want to add the span tags around $link['votes'].
If you are wondering why the &lt;span&gt; tags don't appear in the button output from rate_preprocess_test(), that is probably because mytheme_preprocess_test() is called after rate_preprocess_test().
I take rate_preprocess_test() is defined inside a module; in that case the preprocess function defined inside the module is invoked before the implementation of the preprocess function contained in the theme, as reported in the documentation for theme(), which lists the preprocess functions in the following order:


template_preprocess(&amp;$variables)
template_preprocess_HOOK(&amp;$variables)
MODULE_preprocess(&amp;$variables)
ENGINE_engine_preprocess(&amp;$variables)
ENGINE_engine_preprocess_HOOK(&amp;$variables)
ENGINE_preprocess(&amp;$variables)
ENGINE_preprocess_HOOK(&amp;$variables)
THEME_preprocess(&amp;$variables) 
THEME_preprocess_HOOK(&amp;$variables)