WP_Sitemaps_Index::get_index_url()publicWP 5.5.0

Builds the URL for the sitemap index.

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

Хуков нет.

Возвращает

Строку. The sitemap index URL.

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

$WP_Sitemaps_Index = new WP_Sitemaps_Index();
$WP_Sitemaps_Index->get_index_url();

Заметки

  • Global. WP_Rewrite. $wp_rewrite WordPress rewrite component.

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

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

Код WP_Sitemaps_Index::get_index_url() WP 6.5.2

public function get_index_url() {
	global $wp_rewrite;

	if ( ! $wp_rewrite->using_permalinks() ) {
		return home_url( '/?sitemap=index' );
	}

	return home_url( '/wp-sitemap.xml' );
}