WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Sitemaps_Provider::get_sitemap_type_data() public WP 5.5.0

Gets data about each sitemap type.

Это метод класса: WP_Sitemaps_Provider{}

Хуков нет.

Возвращает

Массив[]. Array of sitemap types including object subtype name and number of pages.

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

$WP_Sitemaps_Provider = new WP_Sitemaps_Provider();
$WP_Sitemaps_Provider->get_sitemap_type_data();

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

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

Код WP_Sitemaps_Provider::get_sitemap_type_data() WP 5.5.1

wp-includes/sitemaps/class-wp-sitemaps-provider.php
<?php
public function get_sitemap_type_data() {
	$sitemap_data = array();

	$object_subtypes = $this->get_object_subtypes();

	// If there are no object subtypes, include a single sitemap for the
	// entire object type.
	if ( empty( $object_subtypes ) ) {
		$sitemap_data[] = array(
			'name'  => '',
			'pages' => $this->get_max_num_pages(),
		);
		return $sitemap_data;
	}

	// Otherwise, include individual sitemaps for every object subtype.
	foreach ( $object_subtypes as $object_subtype_name => $data ) {
		$object_subtype_name = (string) $object_subtype_name;

		$sitemap_data[] = array(
			'name'  => $object_subtype_name,
			'pages' => $this->get_max_num_pages( $object_subtype_name ),
		);
	}

	return $sitemap_data;
}