Make WordPress Core

Ticket #10432: 10432-2.diff

File 10432-2.diff, 1.3 KB (added by tw2113, 6 weeks ago)
  • src/wp-includes/category-template.php

     
    960960                $aria_label = true;
    961961        }
    962962
     963        global $wp_query;
     964        $queried_object_id = $wp_query->get_queried_object_id();
     965
    963966        // Assemble the data that will be used to generate the tag cloud markup.
    964967        $tags_data = array();
    965968        foreach ( $tags as $key => $tag ) {
     
    986989                        'font_size'       => $args['smallest'] + ( $count - $min_count ) * $font_step,
    987990                        'aria_label'      => $aria_label ? sprintf( ' aria-label="%1$s (%2$s)"', esc_attr( $tag->name ), esc_attr( $formatted_count ) ) : '',
    988991                        'show_count'      => $args['show_count'] ? '<span class="tag-link-count"> (' . $real_count . ')</span>' : '',
     992                        'current'         => ( $tag_id === $queried_object_id ),
    989993                );
    990994        }
    991995
     
    10031007        // Generate the output links array.
    10041008        foreach ( $tags_data as $key => $tag_data ) {
    10051009                $class = $tag_data['class'] . ' tag-link-position-' . ( $key + 1 );
     1010
     1011                if ( true === $tag_data['current'] ) {
     1012                        $class .= ' current-tag';
     1013                }
     1014
    10061015                $a[]   = sprintf(
    10071016                        '<a href="%1$s"%2$s class="%3$s" style="font-size: %4$s;"%5$s>%6$s%7$s</a>',
    10081017                        esc_url( $tag_data['url'] ),