[wp-trac] [WordPress Trac] #52094: Queries with perm readable/editable will not work for multiple post types and status queries
WordPress Trac
noreply at wordpress.org
Tue Jun 14 19:59:58 UTC 2022
#52094: Queries with perm readable/editable will not work for multiple post types
and status queries
--------------------------------------+------------------------------
Reporter: leogermani | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+------------------------------
Comment (by leogermani):
I've created a brand new patch for this ticket:
https://github.com/WordPress/wordpress-develop/pull/2810
cc @peterwilsoncc
What this patch does is it joins the situations where `post_status` query
is used with the multiple post type logic fixed in #48556.
So now it's possible to query for multiple post types and multiple
post_status at the same time and it will work as expected.
# Bug or feature
There's one thing that I'm not fixing here because I'm not sure it's a bug
or feature.
If you query for `post_status=any`, the `perm=readable` param is ignored.
Meaning that if you query for any post status, all post statuses will be
returned regardless of the permission the current user has. Protected
statuses will be removed, but private statuses will be included. This is
how it behaves now and I didn't change it.
Should we change it? Or should we just update the docs to make it more
explicit?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52094#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list