Uses
Uses | Description |
---|---|
wp-includes/formatting.php: esc_url() | Checks and cleans a URL. |
Adds the sitemap index to robots.txt.
(string) (Required) robots.txt output.
(bool) (Required) Whether the site is public.
(string) The robots.txt output.
File: wp-includes/sitemaps/class-wp-sitemaps.php
public function add_robots( $output, $public ) { if ( $public ) { $output .= "\nSitemap: " . esc_url( $this->index->get_index_url() ) . "\n"; } return $output; }
Version | Description |
---|---|
5.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_sitemaps/add_robots