Changes between Initial Version and Version 1 of Ticket #32243, comment 3
- Timestamp:
- 05/04/2015 12:33:06 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32243, comment 3
initial v1 3 3 Your `$cap_final` logic doesn't look like it will work properly. Say I'm querying for three post types: `array( 'foo', 'bar', 'baz' )`. And let's say that I have the `read_private_posts` cap for 'baz' but not for 'foo' and 'bar'. In this situation, it looks like the last post type cap will overwrite the previous two, and private posts for all three post types will be returned. If we're going to add this improvement, the SQL will need to look like this: 4 4 5 `... WHERE ( 5 {{{ 6 ... WHERE ( 6 7 ( post_type = 'foo' AND post_status = 'publish' ) 7 8 OR … … 9 10 OR 10 11 ( post_type = 'baz' AND ( post_status = 'publish' OR post_status = 'private' ) ) 11 )` 12 ) 13 }}} 12 14 13 15 (You'll have to make sure the "users can view their own private posts" stuff works too.)