Ticket #13661: adds-new-options-to-fields-for-get_terms().diff
| File adds-new-options-to-fields-for-get_terms().diff, 1014 bytes (added by mikeschinkel, 3 years ago) |
|---|
-
trunk/wp-includes/taxonomy.php
984 984 $orderby = ''; 985 985 $order = ''; 986 986 $selects = array('COUNT(*)'); 987 case 'id=>name': 988 $selects = array('t.term_id', 't.name'); 989 break; 990 case 'id=>slug': 991 $selects = array('t.slug', 't.name'); 992 break; 987 993 } 988 994 $select_this = implode(', ', apply_filters( 'get_terms_fields', $selects, $args )); 989 995 … … 1045 1051 while ( $term = array_shift($terms) ) 1046 1052 $_terms[] = $term->name; 1047 1053 $terms = $_terms; 1054 } elseif ( 'id=>name' == $fields ) { 1055 while ( $term = array_shift($terms) ) 1056 $_terms[$term->term_id] = $term->name; 1057 $terms = $_terms; 1058 } elseif ( 'id=>slug' == $fields ) { 1059 while ( $term = array_shift($terms) ) 1060 $_terms[$term->term_id] = $term->slug; 1061 $terms = $_terms; 1048 1062 } 1049 1063 1050 1064 if ( 0 < $number && intval(@count($terms)) > $number ) {
