Changeset 32996 for trunk/src/wp-includes/category-template.php
- Timestamp:
- 06/29/2015 02:15:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r32568 r32996 809 809 $font_step = $font_spread / $spread; 810 810 811 $a = array();812 811 // Assemble the data that will be used to generate the tag cloud markup. 812 $tags_data = array(); 813 813 foreach ( $tags as $key => $tag ) { 814 $tag_id = isset( $tag->id ) ? $tag->id : $key; 815 814 816 $count = $counts[ $key ]; 815 817 $real_count = $real_counts[ $key ]; 816 $tag_link = '#' != $tag->link ? esc_url( $tag->link ) : '#';817 $tag_id = isset($tags[ $key ]->id) ? $tags[ $key ]->id : $key;818 $tag_name = $tags[ $key ]->name;819 818 820 819 if ( $translate_nooped_plural ) { 821 $title _attribute= sprintf( translate_nooped_plural( $translate_nooped_plural, $real_count ), number_format_i18n( $real_count ) );820 $title = sprintf( translate_nooped_plural( $translate_nooped_plural, $real_count ), number_format_i18n( $real_count ) ); 822 821 } else { 823 $title_attribute = call_user_func( $args['topic_count_text_callback'], $real_count, $tag, $args ); 824 } 825 826 $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( $title_attribute ) . "' style='font-size: " . 827 str_replace( ',', '.', ( $args['smallest'] + ( ( $count - $min_count ) * $font_step ) ) ) 828 . $args['unit'] . ";'>$tag_name</a>"; 822 $title = call_user_func( $args['topic_count_text_callback'], $real_count, $tag, $args ); 823 } 824 825 $tags_data[] = array( 826 'id' => $tag_id, 827 'url' => '#' != $tag->link ? $tag->link : '#', 828 'name' => $tag->name, 829 'title' => $title, 830 'slug' => $tag->slug, 831 'real_count' => $real_count, 832 'class' => 'tag-link-' . $tag_id, 833 'font_size' => $args['smallest'] + ( $count - $min_count ) * $font_step, 834 ); 835 } 836 837 /** 838 * Filter the data used to generate the tag cloud. 839 * 840 * @since 4.3.0 841 * 842 * @param array $tags_data An array of term data for term used to generate the tag cloud. 843 */ 844 $tags_data = apply_filters( 'wp_generate_tag_cloud_data', $tags_data ); 845 846 $a = array(); 847 848 // generate the output links array 849 foreach ( $tags_data as $key => $tag_data ) { 850 $a[] = "<a href='" . esc_url( $tag_data['url'] ) . "' class='" . esc_attr( $tag_data['class'] ) . "' title='" . esc_attr( $tag_data['title'] ) . "' style='font-size: " . esc_attr( str_replace( ',', '.', $tag_data['font_size'] ) . $args['unit'] ) . ";'>" . esc_html( $tag_data['name'] ) . "</a>"; 829 851 } 830 852
Note: See TracChangeset
for help on using the changeset viewer.