| @@ -482,18 +482,15 @@ | ||
| 482 | 482 | $removal = $this->sitemap_generator->delete_published_sitemaps(); |
| 483 | 483 | $stuck = is_array($removal['failed'] ?? null) ? $removal['failed'] : []; |
| 484 | 484 | |
| 485 | 485 | // A stale file shadows the dynamic route, so this is a real |
| 486 | - // failure rather than a tidy-up that did not matter. | |
| 486 | + // failure rather than a tidy-up that did not matter. Worded by | |
| 487 | + // the generator so this and its own rebuild paths cannot | |
| 488 | + // describe the same stuck files differently (#764). | |
| 487 | 489 | if (!empty($stuck)) { |
| 488 | 490 | return new WP_Error( |
| 489 | 491 | 'sitemap_stale_files', |
| 490 | - sprintf( | |
| 491 | - /* translators: 1: comma-separated file names, 2: absolute path to the WordPress root. */ | |
| 492 | - __('The sitemap is served by WordPress, but these files are still in the site root and your web server will keep serving them instead: %1$s. They could not be removed because %2$s is not writable.', 'thinkrank'), | |
| 493 | - implode(', ', $stuck), | |
| 494 | - untrailingslashit(ABSPATH) | |
| 495 | - ), | |
| 492 | + $this->sitemap_generator->stuck_files_message($stuck), | |
| 496 | 493 | ['status' => 500] |
| 497 | 494 | ); |
| 498 | 495 | } |
| 499 | 496 | |