Commit Graph

11 Commits

Author SHA1 Message Date
Peter Wilson
2db137784b Sitemaps: Prevent incorrect redirection of paged sitemap requests.
Update `redirect_canonical()` to account for custom pagination and URL format used by sitemaps in order to follow standard practices.

Introduce the function `get_sitemap_url()` to simplify getting the index and provider URLs as needed.

Props jonathanstegall, pbiron, GamerZ, salvoaranzulla, peterwilsoncc.
Fixes #50910.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 01:30:04 +00:00
John Blackbourn
0bf9b04c53 Docs: Various formatting improvements to inline docblocks.
See #49572
Built from https://develop.svn.wordpress.org/trunk@48574


git-svn-id: http://core.svn.wordpress.org/trunk@48336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-23 00:52:05 +00:00
Sergey Biryukov
00861d91dc Sitemaps: Rename wp_register_sitemap() to wp_register_sitemap_provider().
Follow-up to [48536], [48540], [48541].

Props pbiron.
Fixes #50724.
Built from https://develop.svn.wordpress.org/trunk@48553


git-svn-id: http://core.svn.wordpress.org/trunk@48315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-21 20:15:02 +00:00
Sergey Biryukov
830f0b6563 Sitemaps: Rename wp_get_sitemaps_providers() to wp_get_sitemap_providers().
Follow-up to [48536], [48540].

Props pbiron, swissspidy, SergeyBiryukov.
See #50724.
Built from https://develop.svn.wordpress.org/trunk@48541


git-svn-id: http://core.svn.wordpress.org/trunk@48303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-21 16:06:04 +00:00
Pascal Birchler
694b407297 Sitemaps: Rename wp_get_sitemaps() to wp_get_sitemaps_providers()
Following [48536], rename the function to match the rest of the sitemaps logic.

Also eliminates some dead code after [48523].

Props pbiron.
See #50724. See #50643.
Built from https://develop.svn.wordpress.org/trunk@48540


git-svn-id: http://core.svn.wordpress.org/trunk@48302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-21 15:57:04 +00:00
Sergey Biryukov
12daeec1f7 Sitemaps: Rename 'sitemap' to 'provider' in WP_Sitemaps_Registry class.
This class is for registering sitemap providers, not individual sitemaps.

Props swissspidy.
Fixes #50724.
Built from https://develop.svn.wordpress.org/trunk@48536


git-svn-id: http://core.svn.wordpress.org/trunk@48298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-21 15:29:02 +00:00
whyisjake
7f92797960 Sitemaps: Ensure correct HTTP status when sitemaps are disabled
If sitemaps are disabled, previously there would be a rewrite rule for the sitemap endpoint. This endpoint would display the homepage since there was a rewrite rule. Now, Sitemaps are loaded, and the proper HTTP headers are returned.

Fixes #50643.
Props swissspidy, kraftbj, donmhico.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-21 00:57:05 +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
Sergey Biryukov
896436f1b9 Sitemaps: Rename the wp_sitemaps_is_enabled filter to wp_sitemaps_enabled.
This makes it more consistent with the other filters of the similar purpose.

Props arpitgshah.
Fixes #50428. See #50117.
Built from https://develop.svn.wordpress.org/trunk@48094


git-svn-id: http://core.svn.wordpress.org/trunk@47861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-19 18:00:07 +00:00
Sergey Biryukov
a15912561e Docs: Document globals in WP_Sitemaps_* classes the same way they are documented in the rest of core.
See #49572, #50117.
Built from https://develop.svn.wordpress.org/trunk@48093


git-svn-id: http://core.svn.wordpress.org/trunk@47860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-19 17:56:09 +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