Changeset 28435
- Timestamp:
- 05/15/2014 05:47:21 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r28434 r28435 686 686 687 687 $args = wp_parse_args( $args, $defaults ); 688 extract( $args, EXTR_SKIP ); 689 690 $return = ( 'array' === $format ) ? array() : ''; 688 689 $return = ( 'array' === $args['format'] ) ? array() : ''; 691 690 692 691 if ( empty( $tags ) ) { … … 730 729 unset( $tags_sorted ); 731 730 } else { 732 if ( 'RAND' === $ order) {731 if ( 'RAND' === $args['order'] ) { 733 732 shuffle( $tags ); 734 733 } else { 735 734 // SQL cannot save you; this is a second (potentially different) sort on a subset of data. 736 if ( 'name' === $ orderby) {735 if ( 'name' === $args['orderby'] ) { 737 736 uasort( $tags, '_wp_object_name_sort_cb' ); 738 737 } else { … … 740 739 } 741 740 742 if ( 'DESC' === $ order) {741 if ( 'DESC' === $args['order'] ) { 743 742 $tags = array_reverse( $tags, true ); 744 743 } … … 746 745 } 747 746 748 if ( $ number> 0 )749 $tags = array_slice( $tags, 0, $number);747 if ( $args['number'] > 0 ) 748 $tags = array_slice( $tags, 0, $args['number'] ); 750 749 751 750 $counts = array(); … … 753 752 foreach ( (array) $tags as $key => $tag ) { 754 753 $real_counts[ $key ] = $tag->count; 755 $counts[ $key ] = $topic_count_scale_callback($tag->count);754 $counts[ $key ] = call_user_func( $args['topic_count_scale_callback'], $tag->count ); 756 755 } 757 756 … … 760 759 if ( $spread <= 0 ) 761 760 $spread = 1; 762 $font_spread = $ largest - $smallest;761 $font_spread = $args['largest'] - $args['smallest']; 763 762 if ( $font_spread < 0 ) 764 763 $font_spread = 1; … … 777 776 $title_attribute = sprintf( translate_nooped_plural( $translate_nooped_plural, $real_count ), number_format_i18n( $real_count ) ); 778 777 } else { 779 $title_attribute = call_user_func( $ topic_count_text_callback, $real_count, $tag, $args );778 $title_attribute = call_user_func( $args['topic_count_text_callback'], $real_count, $tag, $args ); 780 779 } 781 780 782 781 $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( $title_attribute ) . "' style='font-size: " . 783 str_replace( ',', '.', ( $ smallest+ ( ( $count - $min_count ) * $font_step ) ) )784 . "$unit;'>$tag_name</a>";785 } 786 787 switch ( $ format) :782 str_replace( ',', '.', ( $args['smallest'] + ( ( $count - $min_count ) * $font_step ) ) ) 783 . $args['unit'] . ";'>$tag_name</a>"; 784 } 785 786 switch ( $args['format'] ) : 788 787 case 'array' : 789 788 $return =& $a; … … 795 794 break; 796 795 default : 797 $return = join( $ separator, $a );796 $return = join( $args['separator'], $a ); 798 797 break; 799 798 endswitch; 800 799 801 if ( $ filter) {800 if ( $args['filter'] ) { 802 801 /** 803 802 * Filter the generated output of a tag cloud.
Note: See TracChangeset
for help on using the changeset viewer.