[wp-trac] [WordPress Trac] #48556: Query for multiple post types not considering user permission to retrieve private posts
WordPress Trac
noreply at wordpress.org
Thu Dec 24 21:29:11 UTC 2020
#48556: Query for multiple post types not considering user permission to retrieve
private posts
-------------------------------------------------+-------------------------
Reporter: leogermani | Owner:
| SergeyBiryukov
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 5.7
Component: Query | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests early | Focuses:
needs-dev-note |
-------------------------------------------------+-------------------------
Comment (by leogermani):
Hi @peterwilsoncc , @boonebgorges
I managed to put a fix together and created a new
[https://github.com/WordPress/wordpress-develop/pull/843 PR] (already
linked to this ticket).
I created a new test, making a request for a valid and an invalid post
type at the same time.
I believe this [https://github.com/WordPress/wordpress-
develop/pull/843/commits/e63d351c6f7ac5957b233a31672f0693447960c1 commit]
will fix the issue while keeping good backward compatibility.
Querying for an invalid post type won't invalidate the whole query. If
other valid post types are queried, they will still work. Also, if there
are posts saved with an unregistered post type, they will be returned.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48556#comment:38>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list