Repository navigation
Abilities API: Return the empty result for an author_slug that names no user - #14643
jorgefilipecosta wants to merge 1 commit into
Conversation
|
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:
|
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. |
…s no user. The `core/content-query` ability rejected an `author_slug` filter that names no user as an invalid filter, and looked the slug up against the users the current user may see, with a rule of its own. The other filters, such as `ids` and `slugs`, give the empty result when nothing matches their value. Treat `author_slug` the same way, to fix possible inconsistencies: a slug that names no user now matches no post, like a user without posts the current user may read, and the lookup of visible users is removed. A value that is not a string is still rejected. Follow-up to [64388]. See #66268.
8d15a19 to
72e77ad
Compare
author_slug that names no userauthor_slug that names no user
|
One question before I start reviewing it: should we make |
Good point I'm doing the shape change at #14673. |
|
Does #14673 contain also changes from this PR? |
Follow up to https://core.trac.wordpress.org/changeset/64388.
What
author_slugfilter ofcore/content-querythat names no user now matches no post and gives the empty result, like theidsandslugsfilters when nothing matches their value. A user without posts the current user may read gives the same empty result.Why
How
get_author_by_slug()and its visibility rules are removed; the ability looks the user up withget_user_by()and returns the empty result when there is none.author_sluginput description says so.The change was drafted with AI assistance and reviewed by me.
Trac ticket: https://core.trac.wordpress.org/ticket/66268
Testing
Verify unit tests are passing: