SQL Statement generated by WP_Query not producing expected results

It looks like this section:

AND (wptom_posts.post_status="publish" 
OR wptom_posts.post_author = 1 
AND wptom_posts.post_status="private") 

is not tied in at all to the two different query conditions…

Perhaps the original code should be three conditions for part 1:

array( 
    'relation' => 'AND',
    array(  'taxonomy' => 'category',
            'field' => 'slug',
            'operator' => 'IN'),
    array( 'taxonomy' => 'post_tag',
            'field' => 'slug',
            'operator' => 'IN'),
    array( 'terms' => array('private') )
),

I am guessing a bit here without testing it, but that’s what I’d try.

Leave a Comment