WordPress at a glance
функция не описана

WP_Sitemaps::add_robots() public WP 5.5.0

Adds the sitemap index to robots.txt.

It's a method of the class: WP_Sitemaps{}

Хуков нет.

Возвращает

String. The robots.txt output.

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

$WP_Sitemaps = new WP_Sitemaps();
$WP_Sitemaps->add_robots( $output, $public );
$output(string) (required)
robots.txt output.
$public(true/false) (required)
Whether the site is public.

Changelog

Since 5.5.0 Introduced.

Код WP_Sitemaps::add_robots() WP 5.5.1

<?php
public function add_robots( $output, $public ) {
	if ( $public ) {
		$output .= "\nSitemap: " . esc_url( $this->index->get_index_url() ) . "\n";
	}

	return $output;
}