- Timestamp:
- 08/03/2019 03:34:54 AM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r45654 r45723 152 152 153 153 $results = get_terms( 154 $taxonomy,155 154 array( 155 'taxonomy' => $taxonomy, 156 156 'name__like' => $s, 157 157 'fields' => 'names', … … 1086 1086 1087 1087 $tags = get_terms( 1088 $taxonomy,1089 1088 array( 1090 'number' => 45, 1091 'orderby' => 'count', 1092 'order' => 'DESC', 1089 'taxonomy' => $taxonomy, 1090 'number' => 45, 1091 'orderby' => 'count', 1092 'order' => 'DESC', 1093 1093 ) 1094 1094 ); -
trunk/src/wp-admin/includes/class-wp-terms-list-table.php
r45583 r45723 215 215 $this->callback_args, 216 216 array( 217 'taxonomy' => $taxonomy, 217 218 'page' => 1, 218 219 'number' => 20, … … 238 239 $args['offset'] = $args['number']; 239 240 } 240 $terms = get_terms( $taxonomy, $args ); 241 242 $terms = get_terms( $args ); 241 243 242 244 if ( empty( $terms ) || ! is_array( $terms ) ) { -
trunk/src/wp-admin/includes/export.php
r45603 r45723 160 160 161 161 $custom_taxonomies = get_taxonomies( array( '_builtin' => false ) ); 162 $custom_terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) ); 162 $custom_terms = (array) get_terms( 163 array( 164 'taxonomy' => $custom_taxonomies, 165 'get' => 'all', 166 ) 167 ); 163 168 164 169 // Put categories in order with no child going before its parent. -
trunk/src/wp-admin/includes/nav-menu.php
r45583 r45723 664 664 665 665 $args = array( 666 'taxonomy' => $taxonomy_name, 666 667 'child_of' => 0, 667 668 'exclude' => '', … … 676 677 ); 677 678 678 $terms = get_terms( $ taxonomy_name, $args );679 $terms = get_terms( $args ); 679 680 680 681 if ( ! $terms || is_wp_error( $terms ) ) { … … 775 776 <?php 776 777 $popular_terms = get_terms( 777 $taxonomy_name,778 778 array( 779 'taxonomy' => $taxonomy_name, 779 780 'orderby' => 'count', 780 781 'order' => 'DESC', … … 813 814 $searched = esc_attr( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ); 814 815 $search_results = get_terms( 815 $taxonomy_name,816 816 array( 817 'taxonomy' => $taxonomy_name, 817 818 'name__like' => $searched, 818 819 'fields' => 'all', -
trunk/src/wp-admin/includes/post.php
r45583 r45723 2042 2042 2043 2043 $_term = get_terms( 2044 $taxonomy,2045 2044 array( 2045 'taxonomy' => $taxonomy, 2046 2046 'name' => $term, 2047 2047 'fields' => 'ids', -
trunk/src/wp-admin/includes/template.php
r45667 r45723 126 126 $args['selected_cats'] = array(); 127 127 } 128 128 129 if ( is_array( $parsed_args['popular_cats'] ) ) { 129 130 $args['popular_cats'] = $parsed_args['popular_cats']; 130 131 } else { 131 132 $args['popular_cats'] = get_terms( 132 $taxonomy,133 133 array( 134 'taxonomy' => $taxonomy, 134 135 'fields' => 'ids', 135 136 'orderby' => 'count', … … 140 141 ); 141 142 } 143 142 144 if ( $descendants_and_self ) { 143 145 $categories = (array) get_terms( 144 $taxonomy,145 146 array( 147 'taxonomy' => $taxonomy, 146 148 'child_of' => $descendants_and_self, 147 149 'hierarchical' => 0, … … 152 154 array_unshift( $categories, $self ); 153 155 } else { 154 $categories = (array) get_terms( $taxonomy, array( 'get' => 'all' ) ); 156 $categories = (array) get_terms( 157 array( 158 'taxonomy' => $taxonomy, 159 'get' => 'all', 160 ) 161 ); 155 162 } 156 163 … … 208 215 209 216 $terms = get_terms( 210 $taxonomy,211 217 array( 218 'taxonomy' => $taxonomy, 212 219 'orderby' => 'count', 213 220 'order' => 'DESC', … … 267 274 268 275 $categories = get_terms( 269 'link_category',270 276 array( 277 'taxonomy' => 'link_category', 271 278 'orderby' => 'name', 272 279 'hide_empty' => 0, -
trunk/src/wp-includes/bookmark-template.php
r45667 r45723 238 238 if ( $parsed_args['categorize'] ) { 239 239 $cats = get_terms( 240 'link_category',241 240 array( 241 'taxonomy' => 'link_category', 242 242 'name__like' => $parsed_args['category_name'], 243 243 'include' => $parsed_args['category'], -
trunk/src/wp-includes/category-template.php
r45668 r45723 385 385 $get_terms_args = $parsed_args; 386 386 unset( $get_terms_args['name'] ); 387 $categories = get_terms( $ parsed_args['taxonomy'], $get_terms_args );387 $categories = get_terms( $get_terms_args ); 388 388 389 389 $name = esc_attr( $parsed_args['name'] ); … … 702 702 703 703 $tags = get_terms( 704 $args['taxonomy'],705 704 array_merge( 706 705 $args, -
trunk/src/wp-includes/category.php
r45590 r45723 27 27 $defaults = array( 'taxonomy' => 'category' ); 28 28 $args = wp_parse_args( $args, $defaults ); 29 30 $taxonomy = $args['taxonomy'];31 29 32 30 /** … … 38 36 * @param array $args An array of arguments. See get_terms(). 39 37 */ 40 $ taxonomy = apply_filters( 'get_categories_taxonomy', $taxonomy, $args );38 $args['taxonomy'] = apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args ); 41 39 42 40 // Back compat … … 52 50 ) 53 51 ); 54 $taxonomy = 'link_category'; 55 $args['taxonomy'] = $taxonomy; 56 } 57 58 $categories = get_terms( $taxonomy, $args ); 52 $args['taxonomy'] = 'link_category'; 53 } 54 55 $categories = get_terms( $args ); 59 56 60 57 if ( is_wp_error( $categories ) ) { … … 137 134 } 138 135 $categories = get_terms( 139 'category',140 136 array( 141 'get' => 'all', 142 'slug' => $leaf_path, 137 'taxonomy' => 'category', 138 'get' => 'all', 139 'slug' => $leaf_path, 143 140 ) 144 141 ); … … 280 277 */ 281 278 function get_tags( $args = '' ) { 282 $tags = get_terms( 'post_tag', $args ); 279 $defaults = array( 'taxonomy' => 'post_tag' ); 280 $args = wp_parse_args( $args, $defaults ); 281 282 $tags = get_terms( $args ); 283 283 284 284 if ( empty( $tags ) ) { -
trunk/src/wp-includes/class-walker-category.php
r44957 r45723 201 201 // 'current_category' can be an array, so we use `get_terms()`. 202 202 $_current_terms = get_terms( 203 $category->taxonomy,204 203 array( 204 'taxonomy' => $category->taxonomy, 205 205 'include' => $args['current_category'], 206 206 'hide_empty' => false, -
trunk/src/wp-includes/class-wp-customize-nav-menus.php
r45442 r45723 211 211 } elseif ( 'taxonomy' === $type ) { 212 212 $terms = get_terms( 213 $object,214 213 array( 214 'taxonomy' => $object, 215 215 'child_of' => 0, 216 216 'exclude' => '', … … 366 366 $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'names' ); 367 367 $terms = get_terms( 368 $taxonomies,369 368 array( 369 'taxonomies' => $taxonomies, 370 370 'name__like' => $args['s'], 371 371 'number' => 20, -
trunk/src/wp-includes/class-wp-term-query.php
r45590 r45723 429 429 $excluded_children, 430 430 (array) get_terms( 431 reset( $taxonomies ),432 431 array( 432 'taxonomy' => reset( $taxonomies ), 433 433 'child_of' => intval( $extrunk ), 434 434 'fields' => 'ids', -
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r45599 r45723 1558 1558 if ( is_taxonomy_hierarchical( $taxonomy ) ) { 1559 1559 $tax_term_names = get_terms( 1560 $taxonomy,1561 1560 array( 1561 'taxonomy' => $taxonomy, 1562 1562 'fields' => 'names', 1563 1563 'hide_empty' => false, … … 2391 2391 } 2392 2392 2393 $query = array( );2393 $query = array( 'taxonomy' => $taxonomy->name ); 2394 2394 2395 2395 if ( isset( $filter['number'] ) ) { … … 2419 2419 } 2420 2420 2421 $terms = get_terms( $ taxonomy->name, $query );2421 $terms = get_terms( $query ); 2422 2422 2423 2423 if ( is_wp_error( $terms ) ) { -
trunk/src/wp-includes/deprecated.php
r45674 r45723 1288 1288 1289 1289 if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) { 1290 $cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') ); 1290 $cat_ids = get_terms( 1291 array( 1292 'taxonomy' => 'category', 1293 'fields' => 'ids', 1294 'get' => 'all', 1295 ) 1296 ); 1291 1297 wp_cache_add( 'all_category_ids', $cat_ids, 'category' ); 1292 1298 } -
trunk/src/wp-includes/nav-menu.php
r45656 r45723 598 598 function wp_get_nav_menus( $args = array() ) { 599 599 $defaults = array( 600 'taxonomy' => 'nav_menu', 600 601 'hide_empty' => false, 601 602 'orderby' => 'name', … … 613 614 * @param array $args An array of arguments used to retrieve menu objects. 614 615 */ 615 return apply_filters( 'wp_get_nav_menus', get_terms( 'nav_menu',$args ), $args );616 return apply_filters( 'wp_get_nav_menus', get_terms( $args ), $args ); 616 617 } 617 618 … … 728 729 foreach ( array_keys( $terms ) as $taxonomy ) { 729 730 get_terms( 730 $taxonomy,731 731 array( 732 'taxonomy' => $taxonomy, 732 733 'include' => $terms[ $taxonomy ], 733 734 'hierarchical' => false, -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r45590 r45723 185 185 ); 186 186 187 $prepared_args = array( );187 $prepared_args = array( 'taxonomy' => $this->taxonomy ); 188 188 189 189 /* … … 250 250 $prepared_args['object_ids'] = $prepared_args['post']; 251 251 } else { 252 $query_result = get_terms( $ this->taxonomy, $prepared_args );252 $query_result = get_terms( $prepared_args ); 253 253 } 254 254 -
trunk/src/wp-includes/taxonomy.php
r45711 r45723 1132 1132 * parameter will be interpreted as `$args`, and the first function parameter will 1133 1133 * be parsed as a taxonomy or array of taxonomies. 1134 * @return array|int|WP_Error List of WP_Term instances and their children. Will return WP_Error, if any of $taxonomies1134 * @return array|int|WP_Error List of WP_Term instances and their children. Will return WP_Error, if any of taxonomies 1135 1135 * do not exist. 1136 1136 */ … … 1686 1686 */ 1687 1687 function wp_count_terms( $taxonomy, $args = array() ) { 1688 $defaults = array( 'hide_empty' => false ); 1688 $defaults = array( 1689 'taxonomy' => $taxonomy, 1690 'hide_empty' => false, 1691 ); 1689 1692 $args = wp_parse_args( $args, $defaults ); 1690 1693 … … 1697 1700 $args['fields'] = 'count'; 1698 1701 1699 return get_terms( $ taxonomy, $args );1702 return get_terms( $args ); 1700 1703 } 1701 1704 … … 2192 2195 */ 2193 2196 $name_matches = get_terms( 2194 $taxonomy,2195 2197 array( 2198 'taxonomy' => $taxonomy, 2196 2199 'name' => $name, 2197 2200 'hide_empty' => false, … … 2220 2223 if ( is_taxonomy_hierarchical( $taxonomy ) ) { 2221 2224 $siblings = get_terms( 2222 $taxonomy,2223 2225 array( 2226 'taxonomy' => $taxonomy, 2224 2227 'get' => 'all', 2225 2228 'parent' => $parent, … … 3471 3474 $children = array(); 3472 3475 $terms = get_terms( 3473 $taxonomy,3474 3476 array( 3477 'taxonomy' => $taxonomy, 3475 3478 'get' => 'all', 3476 3479 'orderby' => 'id', -
trunk/src/wp-includes/widgets/class-wp-widget-links.php
r45590 r45723 138 138 ) 139 139 ); 140 $link_cats = get_terms( 'link_category');140 $link_cats = get_terms( array( 'taxonomy' => 'link_category' ) ); 141 141 $limit = intval( $instance['limit'] ); 142 142 if ( ! $limit ) {
Note: See TracChangeset
for help on using the changeset viewer.