wp_sitemaps_taxonomies_query_args filter-hookWP 5.5.0

Filters the taxonomy terms query arguments.

Allows modification of the taxonomy query arguments before querying.

Usage

add_filter( 'wp_sitemaps_taxonomies_query_args', 'wp_kama_sitemaps_taxonomies_query_args_filter', 10, 2 );

/**
 * Function for `wp_sitemaps_taxonomies_query_args` filter-hook.
 * 
 * @param array  $args     Array of WP_Term_Query arguments.
 * @param string $taxonomy Taxonomy name.
 *
 * @return array
 */
function wp_kama_sitemaps_taxonomies_query_args_filter( $args, $taxonomy ){

	// filter...
	return $args;
}
$args(array)
Array of WP_Term_Query arguments.
$taxonomy(string)
Taxonomy name.

Changelog

Since 5.5.0 Introduced.

Where the hook is called

WP_Sitemaps_Taxonomies::get_taxonomies_query_args()
wp_sitemaps_taxonomies_query_args
wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php 194-206
$args = apply_filters(
	'wp_sitemaps_taxonomies_query_args',
	array(
		'fields'                 => 'ids',
		'taxonomy'               => $taxonomy,
		'orderby'                => 'term_order',
		'number'                 => wp_sitemaps_get_max_urls( $this->object_type ),
		'hide_empty'             => true,
		'hierarchical'           => false,
		'update_term_meta_cache' => false,
	),
	$taxonomy
);

Where the hook is used in WordPress

Usage not found.