From da157f16b143358e82b460dd8dd81fef13b49197 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 21 Oct 2015 08:08:25 +0000 Subject: [PATCH] Add `get_terms_defaults` filter for the default arguments of `get_terms()`. Fixes #33369. Built from https://develop.svn.wordpress.org/trunk@35322 git-svn-id: http://core.svn.wordpress.org/trunk@35288 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy-functions.php | 12 +++++++++++- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy-functions.php b/wp-includes/taxonomy-functions.php index d9b6dcd743..6c4a0b5b7e 100644 --- a/wp-includes/taxonomy-functions.php +++ b/wp-includes/taxonomy-functions.php @@ -1095,7 +1095,17 @@ function get_terms( $taxonomies, $args = '' ) { 'meta_query' => '' ); - $args = wp_parse_args( $args, $defaults ); + /** + * Filter the terms query default arguments. + * + * Use 'get_terms_args' to filter the passed arguments. + * + * @since 4.4.0 + * + * @param array $defaults An array of default get_terms() arguments. + * @param array $taxonomies An array of taxonomies. + */ + $args = wp_parse_args( $args, apply_filters( 'get_terms_defaults', $defaults, $taxonomies ) ); $args['number'] = absint( $args['number'] ); $args['offset'] = absint( $args['offset'] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index a837cd7321..473cfc3027 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35321'; +$wp_version = '4.4-alpha-35322'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.