Changeset 10712
- Timestamp:
- 03/04/2009 11:49:21 PM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/bookmark-template.php
r10207 r10712 73 73 $the_link = clean_url($bookmark->link_url); 74 74 75 $rel = $bookmark->link_rel;76 if ( '' != $rel )77 $rel = ' rel="' . $rel . '"';78 79 75 $desc = attribute_escape(sanitize_bookmark_field('link_description', $bookmark->link_description, $bookmark->link_id, 'display')); 80 76 $name = attribute_escape(sanitize_bookmark_field('link_name', $bookmark->link_name, $bookmark->link_id, 'display')); … … 88 84 } 89 85 86 $alt = ' alt="' . $name . ( $show_description ? ' ' . $title : '' ) . '"'; 87 90 88 if ( '' != $title ) 91 89 $title = ' title="' . $title . '"'; 92 90 93 $alt = ' alt="' . $name . '"'; 91 $rel = $bookmark->link_rel; 92 if ( '' != $rel ) 93 $rel = ' rel="' . $rel . '"'; 94 94 95 95 $target = $bookmark->link_target; … … 97 97 $target = ' target="' . $target . '"'; 98 98 99 $output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>';99 $output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>'; 100 100 101 101 $output .= $link_before; 102 102 103 103 if ( $bookmark->link_image != null && $show_images ) { 104 if ( strpos($bookmark->link_image, 'http') !== false)104 if ( strpos($bookmark->link_image, 'http') === 0 ) 105 105 $output .= "<img src=\"$bookmark->link_image\" $alt $title />"; 106 106 else // If it's a relative path … … 122 122 $output .= $between . $desc; 123 123 124 if ( $show_rating) {124 if ( $show_rating ) 125 125 $output .= $between . sanitize_bookmark_field('link_rating', $bookmark->link_rating, $bookmark->link_id, 'display'); 126 }127 126 128 127 $output .= "$after\n"; -
trunk/wp-includes/widgets.php
r10697 r10712 749 749 extract($args, EXTR_SKIP); 750 750 751 $link_options = get_option('widget_links'); 752 $show_description = isset($link_options['description']) ? $link_options['description'] : false; 753 $show_name = isset($link_options['name']) ? $link_options['name'] : false; 754 $show_rating = isset($link_options['rating']) ? $link_options['rating'] : false; 755 $show_images = isset($link_options['images']) ? $link_options['images'] : true; 756 751 757 $before_widget = preg_replace('/id="[^"]*"/','id="%id"', $before_widget); 752 758 wp_list_bookmarks(apply_filters('widget_links_args', array( 753 759 'title_before' => $before_title, 'title_after' => $after_title, 754 760 'category_before' => $before_widget, 'category_after' => $after_widget, 755 'show_images' => true, 'class' => 'linkcat widget' 761 'show_images' => $show_images, 'show_description' => $show_description, 762 'show_name' => $show_name, 'show_rating' => $show_rating, 763 'class' => 'linkcat widget' 756 764 ))); 757 765 } 766 767 /** 768 * Display and process links widget options form. 769 * 770 * @since 2.8.0 771 */ 772 function wp_widget_links_control() { 773 $options = $newoptions = get_option('widget_links'); 774 775 //Defaults 776 if ( ! $newoptions ) 777 $newoptions = array( 'images' => true, 'name' => true, 'description' => false, 'rating' => false); 778 779 if ( isset($_POST['links-submit']) ) { 780 $newoptions['description'] = isset($_POST['links-description']); 781 $newoptions['name'] = isset($_POST['links-name']); 782 $newoptions['rating'] = isset($_POST['links-rating']); 783 $newoptions['images'] = isset($_POST['links-images']); 784 } 785 if ( $options != $newoptions ) { 786 $options = $newoptions; 787 update_option('widget_links', $options); 788 } 789 ?> 790 <p> 791 <label for="links-images"><input class="checkbox" type="checkbox" <?php checked($options['images'], true) ?> id="links-images" name="links-images" /> <?php _e('Show Link Image'); ?></label> 792 <br /> 793 <label for="links-name"><input class="checkbox" type="checkbox" <?php checked($options['name'], true) ?> id="links-name" name="links-name" /> <?php _e('Show Link Name'); ?></label> 794 <br /> 795 <label for="links-description"><input class="checkbox" type="checkbox" <?php checked($options['description'], true) ?> id="links-description" name="links-description" /> <?php _e('Show Link Description'); ?></label> 796 <br /> 797 <label for="links-rating"><input class="checkbox" type="checkbox" <?php checked($options['rating'], true) ?> id="links-rating" name="links-rating" /> <?php _e('Show Link Rating'); ?></label> 798 </p> 799 <input type="hidden" id="links-submit" name="links-submit" value="1" /> 800 <?php 801 } 802 758 803 759 804 /** … … 1924 1969 $widget_ops = array('classname' => 'widget_links', 'description' => __( "Your blogroll") ); 1925 1970 wp_register_sidebar_widget('links', __('Links'), 'wp_widget_links', $widget_ops); 1971 wp_register_widget_control('links', __('Links'), 'wp_widget_links_control' ); 1926 1972 1927 1973 $widget_ops = array('classname' => 'widget_meta', 'description' => __( "Log in/out, admin, feed and WordPress links") );
Note: See TracChangeset
for help on using the changeset viewer.