WP_Sitemaps_Index::get_index_url() WordPress Method
The WP_Sitemaps_Index::get_index_url() method is used to get the URL for the sitemap index.
WP_Sitemaps_Index::get_index_url() #
Builds the URL for the sitemap index.
Return
(string) The sitemap index URL.
Source
File: wp-includes/sitemaps/class-wp-sitemaps-index.php
public function get_index_url() {
global $wp_rewrite;
if ( ! $wp_rewrite->using_permalinks() ) {
return home_url( '/?sitemap=index' );
}
return home_url( '/wp-sitemap.xml' );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |