How do I overwrite the text value? I want to overwrite the $link['text'] value in theme('rate_button', $link['text'], $link['href'], 'rate-btn'), a theme function defined from the Rate module, under a specific content type in template.php. Is there a way to get that? How can I do that?

function rate_preprocess_rate_widget(&amp;$variables) {
  extract($variables);

  $buttons = array();
  foreach ($links as $link) {
    $button = theme('rate_button', $link['text'], $link['href'], 'rate-btn');
    $buttons[] = $button;
  }
  $variables['buttons'] = $buttons;

  $info = array();
  if ($mode == RATE_CLOSED) {
    $info[] = t('Voting is closed.');
  }
  if ($mode != RATE_COMPACT &amp;&amp; $mode != RATE_COMPACT_DISABLED) {
    if ($results['user_vote']) {
      $info[] = t('You voted \'@option\'.', array('@option' =&gt; t($results['user_vote'])));
    }
  }
  $variables['info'] = implode(' ', $info);
}


This is the code of theme_rate_button().

function theme_rate_button($text, $href, $class = NULL) {
  static $id = 0;
  $id++;

  $classes = 'rate-button';
  if ($class) {
    $classes .= ' ' . $class;
  }
  if (empty($href)) {
    // Widget is disabled or closed.
    return
      '&lt;span class="' . $classes . '" id="rate-button-' . $id . '"&gt;' .
      check_plain($text) .
      '&lt;/span&gt;';
  }
  else {
    return
      '&lt;a class="' . $classes . '" id="rate-button-' . $id . '" rel="nofollow" href="' . htmlentities($href) . '"&gt;' .
      check_plain($text) .
      '&lt;/a&gt;';
  }
}


The reason I am asking is that I have installed the rate module, and created the emotion vote (only one), which is used in two content types ("story", and "company"). In the "story" content type, the vote button should show two buttons labelled "best" and "bad," but in the "company" content type I want to set the buttons to "up" and "down."  

The local variable $links used in rate_preprocess_rate_widget() contain the data for two buttons, of which I want to change the label basing on the content type of the node where those buttons appear.
You will need to implement mytheme_preprocess_rate_widget() and write your own version.

Notice how $variables['buttons'] is set halfway down the function in the original question. Since preprocess functions for a particular theme ALL get run, you can't (that I know of) stop the rate module running its preprocess function, but by re-assigning $variables['buttons'] in your own mytheme_preprocess_rate_widget() function, you will be able to control the output there. I would suggest something like:

function mymodule_preprocess_rate_widget(&$vars) {
  extract($vars);

  $buttons = array();
  foreach ($links as $link) {
    $button = theme('rate_button', 'my custom text here', $link['href'], 'rate-btn');
    $buttons[] = $button;
  }
  $vars['buttons'] = $buttons;
}