WordPress.org

Make WordPress Core

Ticket #6015: 6015.3.diff

File 6015.3.diff, 1.2 KB (added by DD32, 6 years ago)

[8540] broke the Tagcloud links

  • wp-includes/category-template.php

     
    394394                return; 
    395395 
    396396        $counts = array(); 
    397         foreach ( (array) $tags as $tag ) 
    398                 $counts[ $tag->name ] = $tag->count; 
     397        foreach ( (array) $tags as $key => $tag ) 
     398                $counts[ $key ] = $tag->count; 
    399399 
    400400        $min_count = min($counts); 
    401401        $spread = max($counts) - $min_count; 
     
    426426 
    427427        $rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? ' rel="tag"' : ''; 
    428428 
    429         foreach ( $counts as $tag => $count ) { 
    430                 $tag_link = clean_url( $tags[ $tag ]->link ); 
    431                 $tag_id = $tags[ $tag ]->id; 
     429        foreach ( $counts as $key => $count ) { 
     430                $tag_link = clean_url( $tags[ $key ]->link ); 
     431                $tag_id = $tags[ $key ]->id; 
     432                $tag_name = $tags[ $key ]->name; 
    432433                 
    433434                $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . attribute_escape( sprintf( __ngettext($single_text, $multiple_text, $count), $count ) ) . "'$rel style='font-size: " . 
    434435                        ( $smallest + ( ( $count - $min_count ) * $font_step ) ) 
    435                         . "$unit;'>$tag</a>"; 
     436                        . "$unit;'>$tag_name</a>"; 
    436437        } 
    437438 
    438439        switch ( $format ) :