Builds the URL for the sitemap index.
public function get_index_url() {
global $wp_rewrite;
if ( ! $wp_rewrite->using_permalinks() ) {
return home_url( '/?sitemap=index' );
}
return home_url( '/wp-sitemap.xml' );
}
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_sitemaps_index/get_index_url