WP_Sitemaps_Taxonomies::get_taxonomies_query_args()protectedWP 5.5.0

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

Метод класса: WP_Sitemaps_Taxonomies{}

Хуки из метода

Возвращает

Массив. Array of WP_Term_Query arguments.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_taxonomies_query_args( $taxonomy );
$taxonomy(строка) (обязательный)
Taxonomy name.

Список изменений

С версии 5.5.0 Введена.

Код WP_Sitemaps_Taxonomies::get_taxonomies_query_args() WP 6.5.2

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;
}