Ticket #11691: 11691.diff
| File 11691.diff, 3.7 KB (added by trick77, 3 years ago) |
|---|
-
wp-includes/default-widgets.php
977 977 function widget( $args, $instance ) { 978 978 extract($args); 979 979 $title = apply_filters('widget_title', empty($instance['title']) ? __('Tags') : $instance['title']); 980 $use_nofollow_tag = $instance['use_nofollow_tag'] ? '1' : '0'; 980 981 981 982 echo $before_widget; 982 983 if ( $title ) 983 984 echo $before_title . $title . $after_title; 984 985 echo '<div>'; 985 wp_tag_cloud(apply_filters('widget_tag_cloud_args', array())); 986 $tag_cloud_args = array('use_nofollow_tag' => $use_nofollow_tag); 987 wp_tag_cloud(apply_filters('widget_tag_cloud_args', $tag_cloud_args)); 986 988 echo "</div>\n"; 987 989 echo $after_widget; 988 990 } 989 991 990 992 function update( $new_instance, $old_instance ) { 991 993 $instance['title'] = strip_tags(stripslashes($new_instance['title'])); 994 $instance['use_nofollow_tag'] = $new_instance['use_nofollow_tag'] ? 1 : 0; 992 995 return $instance; 993 996 } 994 997 995 998 function form( $instance ) { 999 // Defaults 1000 $use_nofollow_tag = isset( $instance['use_nofollow_tag'] ) ? (bool) $instance['use_nofollow_tag'] : false; 1001 996 1002 ?> 997 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label> 998 <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset ( $instance['title'])) {echo esc_attr( $instance['title'] );} ?>" /></p> 999 <?php 1003 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label> 1004 <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset ( $instance['title'])) {echo esc_attr( $instance['title'] );} ?>" /></p> 1005 1006 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('use_nofollow_tag'); ?>" name="<?php echo $this->get_field_name('use_nofollow_tag'); ?>"<?php checked( $use_nofollow_tag ); ?> /> 1007 <label for="<?php echo $this->get_field_id('use_nofollow_tag'); ?>"><?php _e( 'Use nofollow tag' ); ?></label><br /><?php 1000 1008 } 1001 1009 } 1002 1010 -
wp-includes/category-template.php
618 618 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 0, 619 619 'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC', 620 620 'topic_count_text_callback' => 'default_topic_count_text', 621 'topic_count_scale_callback' => 'default_topic_count_scale', 'filter' => 1, 621 'topic_count_scale_callback' => 'default_topic_count_scale', 'filter' => 1, 'use_nofollow_tag' => false, 622 622 ); 623 623 624 624 if ( !isset( $args['topic_count_text_callback'] ) && isset( $args['single_text'] ) && isset( $args['multiple_text'] ) ) { … … 680 680 $tag_link = '#' != $tag->link ? esc_url( $tag->link ) : '#'; 681 681 $tag_id = isset($tags[ $key ]->id) ? $tags[ $key ]->id : $key; 682 682 $tag_name = $tags[ $key ]->name; 683 $ a[]= "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( $topic_count_text_callback( $real_count ) ) . "' style='font-size: " .683 $href_tag = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( $topic_count_text_callback( $real_count ) ) . "' style='font-size: " . 684 684 ( $smallest + ( ( $count - $min_count ) * $font_step ) ) 685 . "$unit;'>$tag_name</a>"; 685 . "$unit;'"; 686 if ($args['use_nofollow_tag']) 687 $href_tag = $href_tag . " rel='nofollow'"; 688 $href_tag = $href_tag . ">$tag_name</a>"; 689 $a[] = $href_tag; 686 690 } 687 691 688 692 switch ( $format ) :
