Filter hook 'wp_sitemaps_taxonomies_query_args'

in WP Core File wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php at line 198

View Source

wp_sitemaps_taxonomies_query_args

Filter Hook
Description
Filters the taxonomy terms query arguments. Allows modification of the taxonomy query arguments before querying.

Hook Information

File Location wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php View on GitHub
Hook Type Filter
Line Number 198

Hook Parameters

Type Name Description
array $args Array of WP_Term_Query arguments.
string $taxonomy Taxonomy name.

Usage Examples

Basic Usage
<?php
// Hook into wp_sitemaps_taxonomies_query_args
add_filter('wp_sitemaps_taxonomies_query_args', 'my_custom_filter', 10, 2);

function my_custom_filter($args, $taxonomy) {
    // Your custom filtering logic here
    return $args;
}

Source Code Context

wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php:198 - How this hook is used in WordPress core
<?php
 193  		 * @since 5.5.0
 194  		 *
 195  		 * @param array  $args     Array of WP_Term_Query arguments.
 196  		 * @param string $taxonomy Taxonomy name.
 197  		 */
 198  		$args = apply_filters(
 199  			'wp_sitemaps_taxonomies_query_args',
 200  			array(
 201  				'taxonomy'               => $taxonomy,
 202  				'orderby'                => 'term_order',
 203  				'number'                 => wp_sitemaps_get_max_urls( $this->object_type ),

PHP Documentation

<?php
/**
		 * Filters the taxonomy terms query arguments.
		 *
		 * Allows modification of the taxonomy query arguments before querying.
		 *
		 * @see WP_Term_Query for a full list of arguments
		 *
		 * @since 5.5.0
		 *
		 * @param array  $args     Array of WP_Term_Query arguments.
		 * @param string $taxonomy Taxonomy name.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php
Related Hooks

Related hooks will be displayed here in future updates.