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