wp_sitemaps_taxonomies_query_args
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_query_args
wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php 198-209
$args = apply_filters( 'wp_sitemaps_taxonomies_query_args', array( '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 );