Ticket #9004: get_terms_fields_as_array.9004.diff
File get_terms_fields_as_array.9004.diff, 2.6 KB (added by , 16 years ago) |
---|
-
wp-includes/taxonomy.php
526 526 * The 'list_terms_exclusions' filter passes the compiled exclusions along with 527 527 * the $args. 528 528 * 529 * The 'get_terms_orderby' filter passes the ORDER BY clause for the query 530 * along with the $args array. 531 532 * The 'get_terms_fields' filter passes the fields for the SELECT query 533 * along with the $args array. 534 * 529 535 * The list of arguments that $args can contain, which will overwrite the defaults: 530 536 * 531 537 * orderby - Default is 'name'. Can be name, count, or nothing (will use … … 673 679 $orderby = 't.term_group'; 674 680 else 675 681 $orderby = 't.term_id'; 682 $orderby = apply_filters( 'get_terms_orderby', $orderby, $args ); 676 683 677 684 $where = ''; 678 685 $inclusions = ''; … … 757 764 $where .= " AND (t.name LIKE '%$search%')"; 758 765 } 759 766 760 $select _this = '';767 $selects = array(); 761 768 if ( 'all' == $fields ) 762 $select _this = 't.*, tt.*';769 $selects = array('t.*', 'tt.*'); 763 770 else if ( 'ids' == $fields ) 764 $select _this = 't.term_id, tt.parent, tt.count';771 $selects = array('t.term_id', 'tt.parent', 'tt.count'); 765 772 else if ( 'names' == $fields ) 766 $select_this = 't.term_id, tt.parent, tt.count, t.name'; 773 $selects = array('t.term_id', 'tt.parent', 'tt.count', 't.name'); 774 $select_this = implode(', ', apply_filters( 'get_terms_fields', $selects, $args )); 767 775 768 776 $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"; 769 777 -
wp-includes/category-template.php
573 573 * 'format' argument will format the tags in a UL HTML list. The array value for 574 574 * the 'format' argument will return in PHP array type format. 575 575 * 576 * The 'tag_cloud_sort' filter allows you to override the sorting done 577 * by the 'orderby' argument; passed to the filter: $tags array and $args array. 578 * 576 579 * The 'orderby' argument will accept 'name' or 'count' and defaults to 'name'. 577 580 * The 'order' is the direction to sort, defaults to 'ASC' and can be 'DESC' or 578 581 * 'RAND'. … … 618 621 else 619 622 uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') ); 620 623 624 $tags = apply_filters( 'tag_cloud_sort', $tags, $args ); 625 621 626 if ( 'DESC' == $order ) 622 627 $tags = array_reverse( $tags, true ); 623 628 elseif ( 'RAND' == $order ) {