Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #32243, comment 3


Ignore:
Timestamp:
05/04/2015 12:33:06 AM (11 years ago)
Author:
boonebgorges
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32243, comment 3

    initial v1  
    33Your `$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:
    44
    5 `... WHERE (
     5{{{
     6... WHERE (
    67  ( post_type = 'foo' AND post_status = 'publish' )
    78  OR
     
    910  OR
    1011  ( post_type = 'baz' AND ( post_status = 'publish' OR post_status = 'private' ) )
    11 )`
     12)
     13}}}
    1214
    1315(You'll have to make sure the "users can view their own private posts" stuff works too.)