From f3f2a222b94af2a5c3ebd57839bcd7067ce394c3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 21 Oct 2015 08:00:56 +0000 Subject: [PATCH] Reorder default arguments in `get_terms()` for consistency with the hash notation added in [29128]. See #33369. git-svn-id: https://develop.svn.wordpress.org/trunk@35321 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy-functions.php | 33 +++++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/taxonomy-functions.php b/src/wp-includes/taxonomy-functions.php index 77b6b8606e..d9b6dcd743 100644 --- a/src/wp-includes/taxonomy-functions.php +++ b/src/wp-includes/taxonomy-functions.php @@ -1069,13 +1069,34 @@ function get_terms( $taxonomies, $args = '' ) { } } - $defaults = array('orderby' => 'name', 'order' => 'ASC', - 'hide_empty' => true, 'exclude' => array(), 'exclude_tree' => array(), 'include' => array(), - 'number' => '', 'fields' => 'all', 'name' => '', 'slug' => '', 'parent' => '', 'childless' => false, - 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', 'description__like' => '', - 'pad_counts' => false, 'offset' => '', 'search' => '', 'cache_domain' => 'core', - 'update_term_meta_cache' => true, 'meta_query' => '' ); + $defaults = array( + 'orderby' => 'name', + 'order' => 'ASC', + 'hide_empty' => true, + 'include' => array(), + 'exclude' => array(), + 'exclude_tree' => array(), + 'number' => '', + 'offset' => '', + 'fields' => 'all', + 'name' => '', + 'slug' => '', + 'hierarchical' => true, + 'search' => '', + 'name__like' => '', + 'description__like' => '', + 'pad_counts' => false, + 'get' => '', + 'child_of' => 0, + 'parent' => '', + 'childless' => false, + 'cache_domain' => 'core', + 'update_term_meta_cache' => true, + 'meta_query' => '' + ); + $args = wp_parse_args( $args, $defaults ); + $args['number'] = absint( $args['number'] ); $args['offset'] = absint( $args['offset'] );