WP_Sitemaps_Taxonomies::get_taxonomies_query_args() WordPress Method

The WP_Sitemaps_Taxonomies::get_taxonomies_query_args() method is used to retrieve the taxonomies query arguments. These arguments are used to query the WordPress database for the registered taxonomies.

WP_Sitemaps_Taxonomies::get_taxonomies_query_args( string $taxonomy ) #

Returns the query args for retrieving taxonomy terms to list in the sitemap.


Parameters

$taxonomy

(string)(Required)Taxonomy name.


Top ↑

Return

(array) Array of WP_Term_Query arguments.


Top ↑

Source

File: wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php

	protected function get_taxonomies_query_args( $taxonomy ) {
		/**
		 * 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.
		 */
		$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
		);

		return $args;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.