Add `get_terms_defaults` filter for the default arguments of `get_terms()`.

Fixes #33369.

git-svn-id: https://develop.svn.wordpress.org/trunk@35322 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-10-21 08:07:12 +00:00
parent f3f2a222b9
commit 5bba750579
1 changed files with 11 additions and 1 deletions

View File

@ -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'] );