Yoast\WP\SEO\Llms_Txt\Infrastructure\Markdown_Services

Sitemap_Link_Collector::get_linkpublicYoast 1.0

Gets the link for the sitemap.

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

Хуков нет.

Возвращает

Link. The link for the sitemap.

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

$Sitemap_Link_Collector = new Sitemap_Link_Collector();
$Sitemap_Link_Collector->get_link(): ?Link;

Код Sitemap_Link_Collector::get_link() Yoast 28.4

public function get_link(): ?Link {
	if ( WPSEO_Options::get( 'enable_xml_sitemap' ) ) {
		$sitemap_url = WPSEO_Sitemaps_Router::get_base_url( 'sitemap_index.xml' );
		return new Link( 'Sitemap index', $sitemap_url );
	}

	$sitemap_url = \get_sitemap_url( 'index' );

	if ( $sitemap_url !== false ) {
		return new Link( 'Sitemap index', $sitemap_url );
	}

	return null;
}