Commit Graph

7 Commits

Author SHA1 Message Date
Pascal Birchler
2c92383b8d Sitemaps: Ensure entry for ‘page’ post type sitemap in index.
If there are no pages and no static homepage, there will still be one sitemap including the homepage URL.

This change ensures that this sitemap is correctly listed in the sitemap index.

Props Chouby, pacifika, elrae.
Fixes #50571.
Built from https://develop.svn.wordpress.org/trunk@48476


git-svn-id: http://core.svn.wordpress.org/trunk@48245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-14 12:26:02 +00:00
Pascal Birchler
acca036e88 Sitemaps: Exclude post types and taxonomies that are not publicly queryable.
Props Cybr.
Fixes #50607.
Built from https://develop.svn.wordpress.org/trunk@48474


git-svn-id: http://core.svn.wordpress.org/trunk@48243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-14 11:57:06 +00:00
Pascal Birchler
7757fe0b0c Sitemaps: Add missing slash when calling home_url() for consistency.
Props Chouby.
Fixes #50570.
Built from https://develop.svn.wordpress.org/trunk@48472


git-svn-id: http://core.svn.wordpress.org/trunk@48241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-14 11:54:06 +00:00
Pascal Birchler
69e876747d Sitemaps: Do not unnecessarily call WP_Query::get_posts() in posts provider.
The posts have already been fetched at this point, no need to do it again.

Props Chouby.
Fixes #50463.
Built from https://develop.svn.wordpress.org/trunk@48282


git-svn-id: http://core.svn.wordpress.org/trunk@48051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-03 12:03:01 +00:00
Sergey Biryukov
e13c363b17 Docs: Capitalize "ID", when referring to a post ID, term ID, etc. in a more consistent way.
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48104


git-svn-id: http://core.svn.wordpress.org/trunk@47873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-20 12:02:12 +00:00
John Blackbourn
fe823d698f Docs: Corrections and improvements to inline docs related to XML sitemaps.
See #50117, #49572
Built from https://develop.svn.wordpress.org/trunk@48098


git-svn-id: http://core.svn.wordpress.org/trunk@47867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-19 22:26:10 +00:00
Pascal Birchler
609dd1d14f Sitemaps: Add XML sitemaps functionality to WordPress.
While web crawlers are able to discover pages from links within the site and from other sites, XML sitemaps supplement this approach by allowing crawlers to quickly and comprehensively identify all URLs included in the sitemap and learn other signals about those URLs using the associated metadata.

See https://make.wordpress.org/core/2020/06/10/merge-announcement-extensible-core-sitemaps/ for more details.

This feature exposes the sitemap index via `/wp-sitemap.xml` and exposes a variety of new filters and hooks for developers to modify the behavior. Users can disable sitemaps completely by turning off search engine visibility in WordPress admin.

This change also introduces a new `esc_xml()` function to escape strings for output in XML, as well as XML support to `wp_kses_normalize_entities()`.

Props Adrian McShane, afragen, adamsilverstein, casiepa, flixos90, garrett-eclipse, joemcgill, kburgoine, kraftbj, milana_cap, pacifika, pbiron, pfefferle, Ruxandra Gradina, swissspidy, szepeviktor, tangrufus, tweetythierry.
Fixes #50117.
See #3670. See #19998.

Built from https://develop.svn.wordpress.org/trunk@48072


git-svn-id: http://core.svn.wordpress.org/trunk@47839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-17 15:24:07 +00:00