Update: In WordPress 2.1.x, the code below is now in the file wp-includes/bookmark-template.php

I wanted to put an image in the sidebar of this blog, but the default code puts a border around the image, because it's also a link. I think that's generally unattractive, but even the link editor didn't allow me to set the border to 0, so into the code we go.

In wp-includes/links.php, lines 247-249, change this:

PHP:
  1. $output .= "<img src=\"$bookmark->link_image\" $alt $title />";
  2. else // If it's a relative path
  3. $output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title />";

to this:

PHP:
  1. $output .= "<img src=\"$bookmark->link_image\" $alt $title border=\"0\" />";
  2. else // If it's a relative path
  3. $output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title border=\"0\" />";

and now the images under the Links sidebar won't have a border around them. Yes, I understand the border is supposed to be a visual cue that the image is also a link, but these days, most people know that things in the sidebar are generally links, plus the visual cue of the pointer changing when a user hovers over the image seems to be enough.