| @@ -3703,9 +3703,22 @@ | ||
| 3703 | 3703 | // business sitemap and the sitemaps other plugins register both land |
| 3704 | 3704 | // here for the same reason, so they go through one list (#104). |
| 3705 | 3705 | $extra = []; |
| 3706 | 3706 | |
| 3707 | - if (file_exists(ABSPATH . 'local-sitemap.xml')) { | |
| 3707 | + // Not a file test. Under dynamic delivery the local sitemap is | |
| 3708 | + // served from PHP and no file is ever written, so file_exists() | |
| 3709 | + // silently dropped a sitemap the site really does publish (#752). | |
| 3710 | + // On static sites the file is still what proves it, so both count. | |
| 3711 | + $local_sitemap_published = file_exists(ABSPATH . 'local-sitemap.xml'); | |
| 3712 | + | |
| 3713 | + if (!$local_sitemap_published && class_exists('ThinkRank\\SEO\\Sitemap_Generator')) { | |
| 3714 | + $generator = new \ThinkRank\SEO\Sitemap_Generator(false); | |
| 3715 | + | |
| 3716 | + $local_sitemap_published = 'dynamic' === $generator->resolve_delivery_mode() | |
| 3717 | + && $generator->publishes_local_sitemap(); | |
| 3718 | + } | |
| 3719 | + | |
| 3720 | + if ($local_sitemap_published) { | |
| 3708 | 3721 | $extra[] = '/local-sitemap.xml'; |
| 3709 | 3722 | } |
| 3710 | 3723 | |
| 3711 | 3724 | foreach (\ThinkRank\SEO\Sitemap_Generator::additional_sitemaps() as $path) { |