Change print icon programmically through template.php I'm using the Print module, version 7.2, and trying to change the icon through the template.php.
After researching, I have found the main functionality in the FAQ of the module, which provides this:

The example below is for the 6.x-1.x and 7.x-1.x branches. In 7.x-2.x
the theme function is theme_print_ui_format_link.
You will have to define a theme_print_format_link function which will replace
the module's function with the same name and where you can indicate your
custom-defined icon, and set the html element to true so that your
image tag is interpreted as HTML. See the following for an example:

function theme_print_format_link() {
  $print_html_link_class = variable_get('print_html_link_class', 'print-page');
  $print_html_new_window = variable_get('print_html_new_window', 0);
  $print_html_show_link = variable_get('print_html_show_link', 1);
  $print_html_link_text = filter_xss(variable_get('print_html_link_text', t('Printer-friendly version')));

  $img = local_path_to_your_img_file;
  $title = t('Display a printer-friendly version of this page.');
  $class = strip_tags($print_html_link_class);
  $new_window = $print_html_new_window;
  $format = _print_format_link_aux($print_html_show_link, $print_html_link_text, $img);

  return array('text' =&gt; $format['text'],
               'html' =&gt; $format['html'],
               'attributes' =&gt; print_fill_attributes($title, $class, $new_window),
              );
}


If I don't change the code at all, it never gets called.

If I change the first line to subtheme_print_ui_format_link() {, it gets called, but then I get the error
Fatal error: Call to undefined function _print_format_link_aux() in ...../public_html/sites/all/themes/subtheme/template.php on line ...


I have tried:

subtheme_print_format_link_aux()
_subtheme_print_format_link()
_print_ui_format_link_aux()
_print_ui_format_link()

and a bunch of others instead of _print_format_link_aux(), but error just replaces the first function with the one I tried.
Note: I have have changed local_path_to_your_img_file to 'images/print_icon.png'
blog.kalamuna.com helped me a lot. I just changed the $icon value.

Here is the code that I put in the PHP tags in my template file

//Change print icon in print icon
/**
 * Format the Printer-friendly link
 *
 * @return array
 *   An associative array containing:
 *   - text: The content of the link
 *   - html: TRUE if the text contains HTML tags, FALSE if it's plain text
 *   - attributes: several attributes of the link tag (title, class, target,
 *     onclick, rel)
 *
 * @see _print_ui_fill_attributes()
 * @ingroup themeable
 * @ingroup print_themeable
 */
function subtheme_print_ui_format_link($vars) {
  $format = $vars['format'];
  $path = '/images/print_icon.png'; //path to file, relative to theme YOUR_THEME


  foreach (module_implements('print_link') as $module) {
    $function = $module . '_print_link';
    if (function_exists($function)) {
      $link = call_user_func_array($function, array());

      if ($link['format'] == $format) {
        $link_class = variable_get('print_' . $link['format'] . '_link_class', $link['class']);

        $new_window = FALSE;
        $func = $module . '_print_new_window_alter';
        if (function_exists($func)) {
          $func($new_window, $link['format']);
        }

        $show_link = variable_get('print_' . $link['format'] . '_show_link', PRINT_UI_SHOW_LINK_DEFAULT);
        $link_text = filter_xss(variable_get('print_' . $link['format'] . '_link_text', $link['text']));

        if ($show_link &gt;= 2) {
          // Work out which icon we want to show based on the link's format.
          switch ($link['format']){
            case 'html':
              $icon_name = 'print';
              break;  

            case 'mail':
              $icon_name = 'envelope-o';
              break;

            case 'pdf':
              $icon_name = 'file-pdf-o';
              break;
          }

          // Build the icon.
          $path = '/' . drupal_get_path('theme', 'YOUR_THEME') . $path; //the path is relative to the theme 'YOUR_THEME'
          $icon = "&lt;img src='" . $path . "' class='print-icon " . $link_class . "' alt='Print this page' /&gt;";

          // Show the icon with or without text, depending on config settings.
          switch ($show_link) {
            case 2:
              $text = $icon;
              break;
            case 3:
              $text = $icon . ' ' . $link_text;
              break;
          }
          $html = TRUE;
        }
        else {
          $text = $link_text;
          $html = FALSE;
        }

        return array(
          'text' =&gt; $text,
          'html' =&gt; $html,
          'attributes' =&gt; _print_ui_fill_attributes($link['description'], strip_tags($link_class), $new_window),
        );
      }
    }
  }
}