diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-index.php b/src/wp-includes/sitemaps/class-wp-sitemaps-index.php
index d558870bb0..4ec1b07d92 100644
|
a
|
b
|
class WP_Sitemaps_Index { |
| 75 | 75 | global $wp_rewrite; |
| 76 | 76 | |
| 77 | 77 | if ( ! $wp_rewrite->using_permalinks() ) { |
| 78 | | return add_query_arg( 'sitemap', 'index', home_url( '/' ) ); |
| | 78 | return home_url( '/?sitemap=index' ); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | return home_url( '/wp-sitemap.xml' ); |
diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-provider.php b/src/wp-includes/sitemaps/class-wp-sitemaps-provider.php
index 924aca068c..4a879c4f38 100644
|
a
|
b
|
abstract class WP_Sitemaps_Provider { |
| 145 | 145 | public function get_sitemap_url( $name, $page ) { |
| 146 | 146 | global $wp_rewrite; |
| 147 | 147 | |
| | 148 | // Accounts for cases where name is not included, ex: sitemaps-users-1.xml. |
| | 149 | $params = array_filter( |
| | 150 | array( |
| | 151 | 'sitemap' => $this->name, |
| | 152 | 'sitemap-subtype' => $name, |
| | 153 | 'paged' => $page, |
| | 154 | ) |
| | 155 | ); |
| | 156 | |
| 148 | 157 | if ( ! $wp_rewrite->using_permalinks() ) { |
| 149 | | return add_query_arg( |
| 150 | | // Accounts for cases where name is not included, ex: sitemaps-users-1.xml. |
| 151 | | array_filter( |
| 152 | | array( |
| 153 | | 'sitemap' => $this->name, |
| 154 | | 'sitemap-subtype' => $name, |
| 155 | | 'paged' => $page, |
| 156 | | ) |
| 157 | | ), |
| 158 | | home_url( '/' ) |
| | 158 | array_walk( |
| | 159 | $params, |
| | 160 | function ( &$value, $key ) { |
| | 161 | $value = "$key=$value"; |
| | 162 | } |
| 159 | 163 | ); |
| 160 | | } |
| 161 | 164 | |
| 162 | | $basename = sprintf( |
| 163 | | '/wp-sitemap-%1$s.xml', |
| 164 | | implode( |
| 165 | | '-', |
| 166 | | // Accounts for cases where name is not included, ex: sitemaps-users-1.xml. |
| 167 | | array_filter( |
| 168 | | array( |
| 169 | | $this->name, |
| 170 | | $name, |
| 171 | | (string) $page, |
| 172 | | ) |
| 173 | | ) |
| 174 | | ) |
| 175 | | ); |
| | 165 | $basename = sprintf( |
| | 166 | '/?%1$s', |
| | 167 | implode( '&', $params ) |
| | 168 | ); |
| | 169 | } else { |
| | 170 | $basename = sprintf( |
| | 171 | '/wp-sitemap-%1$s.xml', |
| | 172 | implode( '-', $params ) |
| | 173 | ); |
| | 174 | } |
| 176 | 175 | |
| 177 | 176 | return home_url( $basename ); |
| 178 | 177 | } |
diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php
index c313585d22..0069b11126 100644
|
a
|
b
|
class WP_Sitemaps_Renderer { |
| 67 | 67 | $sitemap_url = home_url( '/wp-sitemap.xsl' ); |
| 68 | 68 | |
| 69 | 69 | if ( ! $wp_rewrite->using_permalinks() ) { |
| 70 | | $sitemap_url = add_query_arg( 'sitemap-stylesheet', 'sitemap', home_url( '/' ) ); |
| | 70 | $sitemap_url = home_url( '/?sitemap-stylesheet=sitemap' ); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
| … |
… |
class WP_Sitemaps_Renderer { |
| 98 | 98 | $sitemap_url = home_url( '/wp-sitemap-index.xsl' ); |
| 99 | 99 | |
| 100 | 100 | if ( ! $wp_rewrite->using_permalinks() ) { |
| 101 | | $sitemap_url = add_query_arg( 'sitemap-stylesheet', 'index', home_url( '/' ) ); |
| | 101 | $sitemap_url = home_url( '/?sitemap-stylesheet=index' ); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |