Make WordPress Core


Ignore:
Timestamp:
03/04/2009 11:49:21 PM (16 years ago)
Author:
ryan
Message:

Links widget options. Props DD32. see #9196

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/bookmark-template.php

    r10207 r10712  
    7373            $the_link = clean_url($bookmark->link_url);
    7474
    75         $rel = $bookmark->link_rel;
    76         if ( '' != $rel )
    77             $rel = ' rel="' . $rel . '"';
    78 
    7975        $desc = attribute_escape(sanitize_bookmark_field('link_description', $bookmark->link_description, $bookmark->link_id, 'display'));
    8076        $name = attribute_escape(sanitize_bookmark_field('link_name', $bookmark->link_name, $bookmark->link_id, 'display'));
     
    8884            }
    8985
     86        $alt = ' alt="' . $name . ( $show_description ? ' ' . $title : '' ) . '"';
     87
    9088        if ( '' != $title )
    9189            $title = ' title="' . $title . '"';
    9290
    93         $alt = ' alt="' . $name . '"';
     91        $rel = $bookmark->link_rel;
     92        if ( '' != $rel )
     93            $rel = ' rel="' . $rel . '"';
    9494
    9595        $target = $bookmark->link_target;
     
    9797            $target = ' target="' . $target . '"';
    9898
    99         $output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
     99        $output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>';
    100100
    101101        $output .= $link_before;
    102102
    103103        if ( $bookmark->link_image != null && $show_images ) {
    104             if ( strpos($bookmark->link_image, 'http') !== false )
     104            if ( strpos($bookmark->link_image, 'http') === 0 )
    105105                $output .= "<img src=\"$bookmark->link_image\" $alt $title />";
    106106            else // If it's a relative path
     
    122122            $output .= $between . $desc;
    123123
    124         if ($show_rating) {
     124        if ( $show_rating )
    125125            $output .= $between . sanitize_bookmark_field('link_rating', $bookmark->link_rating, $bookmark->link_id, 'display');
    126         }
    127126
    128127        $output .= "$after\n";
Note: See TracChangeset for help on using the changeset viewer.