Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove users from user-sitemap #4846

Conversation

nirav7707
Copy link

Trac Ticket -> https://core.trac.wordpress.org/ticket/57816
This PR addresses the issue of including users in the user sitemap who have not published any posts but have published pages.

To resolve this, we have implemented a modification. By using the unset( $public_post_types['page'] ); function, we remove the public post type "page" from the query arguments. This ensures that users who have only published pages are not included in the 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
@swissspidy
Copy link
Member

Thanks for your contribution!

As this change needs an accompanying unit test, I have just opened another PR to add one: #4900

I'm closing yours in favor of the new one. But don't worry, you should still get props for your contribution! 🙂

@swissspidy swissspidy closed this Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants