Ticket #9004: term-sort.diff
File term-sort.diff, 2.2 KB (added by , 16 years ago) |
---|
-
category-template.php
611 611 * 'format' argument will format the tags in a UL HTML list. The array value for 612 612 * the 'format' argument will return in PHP array type format. 613 613 * 614 * The 'tag_cloud_sort' filter allows you to override the sorting done 615 * by the 'orderby' argument; passed to the filter: $tags array and $args array. 616 * 614 617 * The 'orderby' argument will accept 'name' or 'count' and defaults to 'name'. 615 618 * The 'order' is the direction to sort, defaults to 'ASC' and can be 'DESC' or 616 619 * 'RAND'. … … 656 659 else 657 660 uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') ); 658 661 662 $tags = apply_filters( 'tag_cloud_sort', $tags, $args ); 663 659 664 if ( 'DESC' == $order ) 660 665 $tags = array_reverse( $tags, true ); 661 666 elseif ( 'RAND' == $order ) { -
taxonomy.php
520 520 * The 'list_terms_exclusions' filter passes the compiled exclusions along with 521 521 * the $args. 522 522 * 523 * The 'get_terms_orderby' filter passes the ORDER BY clause for the query 524 * along with the $args array. 525 526 * The 'get_terms_fields' filter passes the fields for the SELECT query 527 * along with the $args array. 528 * 523 529 * The list of arguments that $args can contain, which will overwrite the defaults: 524 530 * 525 531 * orderby - Default is 'name'. Can be name, count, or nothing (will use … … 667 673 $orderby = 't.term_group'; 668 674 else 669 675 $orderby = 't.term_id'; 676 $orderby = apply_filters( 'get_terms_orderby', $orderby, $args ); 670 677 671 678 $where = ''; 672 679 $inclusions = ''; … … 758 765 $select_this = 't.term_id, tt.parent, tt.count'; 759 766 else if ( 'names' == $fields ) 760 767 $select_this = 't.term_id, tt.parent, tt.count, t.name'; 768 $select_this = apply_filters( 'get_terms_fields', $select_this, $args ); 761 769 762 770 $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $limit"; 763 771