Repository navigation
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
|
Tested on 7.2-beta3-64990 over REST as a subscriber (
Before the patch the totals tell a real slug apart from a made-up one. With the patch they look the same, and authors of viewable posts still match. |
jorgefilipecosta
left a comment
There was a problem hiding this comment.
The change looks good thank you for the fix 👍
|
@propsbot add laurisaarni |
…ost types Prevent pagination totals from revealing author slugs through non-viewable post types. Add regression coverage. Developed in #15181. Follow-up to [64688]. Props gziolo, laurisaarni, jorgefilipecosta, sadmansakibnadvi. See #66268. git-svn-id: https://develop.svn.wordpress.org/trunk@65045 602fd350-edb4-49c9-b593-d223f7449a82
|
Comitted with https://core.trac.wordpress.org/changeset/65045. |
…ost types Prevent pagination totals from revealing author slugs through non-viewable post types. Add regression coverage. Developed in WordPress/wordpress-develop#15181. Follow-up to [64688]. Props gziolo, laurisaarni, jorgefilipecosta, sadmansakibnadvi. See #66268. Built from https://develop.svn.wordpress.org/trunk@65045 git-svn-id: http://core.svn.wordpress.org/trunk@64195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When an author's only published posts belong to a non-viewable post type exposed to abilities, a subscriber can confirm the author's slug through
core/content-query: the query returns no items but nonzero pagination totals. An unknown slug returns zero totals.Filter the post types used by
get_visible_author()throughis_post_type_viewable(), retaining theshow_in_abilitiesrequirement. This applies the viewability check used bycore/users-query. Update the existing positive fixture and add a focused regression test verifying that hidden and unknown slugs both return zero totals. Existing tests cover public author names and slugs.Follow-up to WordPress/ai#1241 and core changeset r64688. The plugin can sync this change after it lands in core.
Trac ticket: https://core.trac.wordpress.org/ticket/66268 (original implementation).
Testing
npm run test:php -- --filter 'Tests_Abilities_API_WpRegisterCore(Content|Users)Ability'— 346 tests, 1574 assertions passed.vendor/bin/phpcs --standard=phpcs.xml.dist src/wp-includes/abilities/class-wp-abilities-content.php tests/phpunit/tests/abilities-api/wpRegisterCoreContentAbility.php— passed.git diff --check— passed.Use of AI Tools
AI assistance: Yes.
Tool: OpenAI Codex.
Used for: Investigating the issue, implementing the fix and regression coverage, running validation, and drafting this PR description.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request.