WP_Sitemaps::add_robots() public WP 5.5.0
Adds the sitemap index to robots.txt.
{} Это метод класса: WP_Sitemaps{}
Хуков нет.
Возвращает
Строку. The robots.txt output.
Использование
$WP_Sitemaps = new WP_Sitemaps(); $WP_Sitemaps->add_robots( $output, $public );
- $output(строка) (обязательный)
- robots.txt output.
- $public(true/false) (обязательный)
- Whether the site is public.
Список изменений
С версии 5.5.0 | Введена. |
Код WP_Sitemaps::add_robots() WP Sitemaps::add robots WP 5.6.2
public function add_robots( $output, $public ) {
if ( $public ) {
$output .= "\nSitemap: " . esc_url( $this->index->get_index_url() ) . "\n";
}
return $output;
}