WordPress/wp-includes/sitemaps
Pascal Birchler 1555e715f6 Sitemaps: add `lastmod` for individual posts and the homepage.
When the XML sitemaps feature was originally introduced, the `lastmod` field was omitted because guidance at the time indicated it was less important for search engines, plus for some entities it was computationally expensive to add. Now that the guidance has slightly changed, we are revisiting this and adding `lastmod` where easily possible.

- Adds `lastmod` to all individual post objects (of any post type) in the sitemap
- Adds `lastmod` to the homepage sitemap entry if the homepage is set to display the latest posts.

No `lastmod` is added for the individual sitemap pages in the sitemap index, nor for term archives or user archives. Those enhancements require additional changes, such as storing the modified date for a taxonomy term when something is added to that term. They can be revisited in separate follow-up tickets.

Props swissspidy, joemcgill.
Fixes #52099
Built from https://develop.svn.wordpress.org/trunk@56985


git-svn-id: http://core.svn.wordpress.org/trunk@56496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-23 15:42:22 +00:00
..
providers Sitemaps: add `lastmod` for individual posts and the homepage. 2023-10-23 15:42:22 +00:00
class-wp-sitemaps-index.php Code Modernization: Add `AllowDynamicProperties` attribute to all (parent) classes. 2022-09-12 15:47:14 +00:00
class-wp-sitemaps-provider.php Docs: Replace multiple single line comments with multi-line comments. 2023-07-10 23:19:23 +00:00
class-wp-sitemaps-registry.php Code Modernization: Add `AllowDynamicProperties` attribute to all (parent) classes. 2022-09-12 15:47:14 +00:00
class-wp-sitemaps-renderer.php Coding Standards: Remove redundant ignore annotations, take 4. 2023-10-01 00:22:27 +00:00
class-wp-sitemaps-stylesheet.php Coding Standards: Remove redundant ignore annotations, take 4. 2023-10-01 00:22:27 +00:00
class-wp-sitemaps.php Code Modernization: Rename parameters that use reserved keywords in `wp-includes/sitemaps/class-wp-sitemaps.php`. 2022-12-16 10:43:16 +00:00