You can change an array of get_terms()
arguments with two filters:
-
get_terms_defaults
filters the terms query default arguments; -
get_terms_args
filters the terms query passed arguments.
For example, this code will change the default value for the pad_counts
parameter for all queries related to categories and called from the administrative part of the site.
add_filter( 'get_terms_defaults', 'custom_get_terms_defaults', 10, 2 );
function custom_get_terms_defaults( $defaults, $taxonomies ) {
if ( is_admin() && in_array( 'category', $taxonomies ) ) {
$defaults['pad_counts'] = true;
}
return $defaults;
}