Closed janvitos closed 1 year ago
Found it!
In file functions.shared.php, line 173:
foreach ( xmlsf_get_index_archive_data( $post_type, $archive ) as $url ) {
Replace with:
foreach ( xmlsf_get_index_archive_data( $post_type, $archive ) as $url => $value ) {
With that change, this is the output I'm getting:
[0] => https://www.example.com/sitemap-news.xml
[1] => https://www.example.com/sitemap.xml
[2] => https://www.example.com/sitemap-root.xml
[3] => https://www.example.com/sitemap-author.xml
[4] => https://www.example.com/sitemap-custom.xml
[5] => https://www.example.com/sitemap-posttype-post.2023.xml
[6] => https://www.example.com/sitemap-posttype-post.2022.xml
[7] => https://www.example.com/sitemap-posttype-post.2021.xml
[8] => https://www.example.com/sitemap-posttype-post.2020.xml
[9] => https://www.example.com/sitemap-posttype-post.2019.xml
[10] => https://www.example.com/sitemap-posttype-post.2018.xml
[11] => https://www.example.com/sitemap-posttype-post.2017.xml
[12] => https://www.example.com/sitemap-posttype-post.2016.xml
[13] => https://www.example.com/sitemap-posttype-post.2015.xml
[14] => https://www.example.com/sitemap-posttype-page.xml
[15] => https://www.example.com/sitemap-posttype-saswp.2020.xml
[16] => https://www.example.com/sitemap-posttype-saswp.2019.xml
[17] => https://www.example.com/sitemap-taxonomy-category.xml
Cheers!
Hi @janvitos, the bug has already been fixed in the development version (5.4-beta9 on the main branch) so it will be coming with the major release. Still, great spot :) and thank you for your contribution!
Awesome!
Hi,
I'm using the xmlsf_nginx_helper_purge_urls function to get the sitemap URLs and purge them through CloudFlare. Today, I discovered that some of the URLs returned by the function are wrong.
Here's what the function returns for my website:
Here's what it should return:
As you can see, it seems like all of the public post types sitemaps URLs returned are wrong. It's also missing sitemap-posttype-page.xml.
I can help troubleshoot the issue if you want.
Thanks!