[wp-trac] [WordPress Trac] #48556: Query for multiple post types not considering user permission to retrieve private posts

WordPress Trac noreply at wordpress.org
Fri Dec 13 16:42:01 UTC 2019


#48556: Query for multiple post types not considering user permission to retrieve
private posts
--------------------------+---------------------
 Reporter:  leogermani    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.4
Component:  Query         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by leogermani):

 There is another case where the same situation described in this ticket
 happens.

 If you query for multiple post_types, informing a private post_status,
 WP_Query will not check permissions for each post type and again rely on
 the `read_multiple_post_types` capability.

 All of this only if `perm=readable`.

 The expected behavior is for the query to check `read_private_posts`
 permission for each post type consider the informed post_status only when
 current user has permission.

 I don't think it is the case of opening another ticket because both things
 should be done together and the ticket title still applies. I'll edit the
 description.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48556#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list