wp-includes/sitemaps/class-wp-sitemaps.php:259Adds the sitemap index to robots.txt.
$outputstring$is_publicboolstring public function add_robots( $output, $is_public ) { if ( $is_public ) { $output .= "\nSitemap: " . esc_url( $this->index->get_index_url() ) . "\n"; } return $output; }Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/sitemaps/class-wp-sitemaps.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.