WordPress/wp-includes/sitemaps/providers
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
..
class-wp-sitemaps-posts.php Sitemaps: add `lastmod` for individual posts and the homepage. 2023-10-23 15:42:22 +00:00
class-wp-sitemaps-taxonomies.php Coding Standards: Restore more descriptive variable names in a few class methods. 2023-09-14 12:46:20 +00:00
class-wp-sitemaps-users.php Sitemaps: do not list users who only authored pages. 2023-09-26 12:42:19 +00:00