Sitemaps: do not list users who only authored pages.

Author archives are only generated for users who created at least one post.
Prevent adding author archives to the XML sitemap for users who only authored pages
as the links would otherwise result in a 404.

Props zodiac1978, huzaifaalmesbah.
Fixes #57816.
Built from https://develop.svn.wordpress.org/trunk@56708


git-svn-id: http://core.svn.wordpress.org/trunk@56220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2023-09-26 12:42:19 +00:00
parent 534f200e48
commit 72460848c9
2 changed files with 3 additions and 2 deletions

View File

@ -136,8 +136,9 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
)
);
// We're not supporting sitemaps for author pages for attachments.
// We're not supporting sitemaps for author pages for attachments and pages.
unset( $public_post_types['attachment'] );
unset( $public_post_types['page'] );
/**
* Filters the query arguments for authors with public posts.

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4-alpha-56707';
$wp_version = '6.4-alpha-56708';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.