From d58fb0dd24ce99b8b1bc4b5919cc26cd4b40d1e2 Mon Sep 17 00:00:00 2001 From: Nirav Sherasiya Date: Fri, 14 Jul 2023 15:22:36 +0530 Subject: [PATCH] Add unset statement to remove the user from user-sitemap unset statement will remove the page post-type from the public_post_types array to prevent to fetch the user who has published page but not published any post yet --- src/wp-includes/sitemaps/providers/class-wp-sitemaps-users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/sitemaps/providers/class-wp-sitemaps-users.php b/src/wp-includes/sitemaps/providers/class-wp-sitemaps-users.php index a241f2468e71e..bdc1fae6c2d45 100644 --- a/src/wp-includes/sitemaps/providers/class-wp-sitemaps-users.php +++ b/src/wp-includes/sitemaps/providers/class-wp-sitemaps-users.php @@ -138,7 +138,7 @@ protected function get_users_query_args() { // We're not supporting sitemaps for author pages for attachments. unset( $public_post_types['attachment'] ); - + unset( $public_post_types['page'] ); /** * Filters the query arguments for authors with public posts. *