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.
Related Posts:
- Recommended way to drop a pending query (in pre_get_posts)?
- Formulate a url to show posts with both taxonomy terms
- Complex WP SQL Query
- Combining categories (Query posts with multiple taxonomy terms)
- Query most popular terms by taxonomy over 2 week period
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- list all post who have mutual taxonomy as current taxonomy!
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- Combine Tax Archive and Meta_Query in WP_Query
- WP_Query on custom taxonomy -> Location and Activity
- When to use WP_query(), query_posts() and pre_get_posts
- WP_Query with “post_title LIKE ‘something%'”?
- Should I use Pre Get Posts or WP_Query
- Using pre_get_posts with WP_Query
- Pagination with custom SQL query
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- What is “main query”? [duplicate]
- Whats the difference between post_limits and pre_get_posts?
- Reduce or prevent calling of update_meta_cache
- How to add taxonomy filter on the query fly?
- Using OR conditions in meta_query for query_posts argument
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- How to uniquely identify queries?
- Is it possible to wrap Geo Location search around WP_Query?
- Order Search Results Page by meta_value If no Value Return Remaining Results
- pre_get_posts with get_posts
- How-to exclude terms from the main query the most performant way?
- Changing Posts Per Page and offset with pre_get_posts
- Is it possible to select against a post’s parent’s fields with WP_Query?
- Slow SQL_CALC_FOUND_ROWS Query
- Extending WP_Query — Optimise SQL query
- “pre_get_posts” firing on every query
- RSS feed with specific keyword
- How to filter sql only for a specific post type
- Using is_main_query to select custom post type on certain page
- WP_query taxonomy + get all posts with two terms from same taxonomy
- Multiple orderby parameters in pre_get_posts() action
- How to make an activities stream mixing posts and comments?
- Counting number of posts with Category B in Category A
- What is an efficient way to query based on post_meta?
- Custom archive page based on array of categories and tags
- SQL query equivalent to WP User Query
- Sorting Posts by custom field
- How to pass custom parameter to WP_Query for filtering in pre_get_posts
- Query with pre_get_posts to get pagination
- How do I search WordPress by different fields without a plugin?
- Single page theme that uses pages for the content
- how to retrieve specific product attribute value in an sql query?
- WordPress custom search form with pre_get_posts not work
- If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?
- Can not switch the queried post in pre_get_posts hook
- How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?
- order by multiple meta keys in pre_get_posts
- How to sort posts in admin by titles with dd.mm.yyyy format?
- tax_query shows no results if nothing is selected
- WP_Tax_Query with post_tag not working
- Filter WordPress posts by between parameter
- Splitting the main query in multiple loops with query_posts and/or pre_get_posts?
- Improving WP_Query performance for multiple taxonomies
- SQL User Query by Multiple Roles using PHP
- get complex results set according to category structure
- Advanced WP Query hogs the SQL server
- How to Modify Taxonomy Archive Page with Search Parameter?
- Using pre_get_posts on a specific core/query block
- SELECT * FROM $wpdb->posts WHERE ID > 160
- Searching through different categories on different pages code is not working
- How to display future posts – modified query still yields 404
- Get image of latest post from taxonomies/categories
- pre_get_posts filter meta_query without conflicting existing meta_query
- Including only current user’s posts in search
- When querying a combination of posts and other meta fields, is there a better solution than directly modifying the WHERE value?
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- How to change posts order on Category and Tag archives?
- Query post with meta_query where date is not in future
- Query Custom Post Type Order By Taxonomy Field
- WP User Query get all authors with last name starting with specific letter
- Select from wp_post and multiple meta_value from wp_postmeta
- My Main Query Modification is Messing up my dynamic main – why?
- Shortcode to show thumbnail and link for 3 random posts
- Offset Page Loops and Pagination
- pre_get_posts Remove tax_query Completely
- How to correctly pass values to wpdb->prepare()?
- pre_get_posts order by not working
- Sort users by “birthday” using WP_User_Query
- Adding a parameter to the default query
- Using WP_Query in “parse_query” or “pre_get_post” in Posts2Posts
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- $wpdb select date range of posts
- Single meta_query query using OR instead of AND in request’s WHERE statement
- How To Fix WP Query Returns Results But Shouldn’t?
- How to choose between hooking into per_get_posts or into parse_query
- List of the years with posts presented
- Store sticky post’s ids in a transient
- How to change main query based on post meta
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Slow WP_Query for custom post type
- new WP_Query to get max price meta value not working
- Display posts from only one post form in custom query and exclude in main query
- Show Sticky Post at the top but do not show again in the loop?
- WP_Query, pre_get_posts and offset