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
- 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
- What is “main query”? [duplicate]
- Whats the difference between post_limits and pre_get_posts?
- How to add taxonomy filter on the query fly?
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- How to uniquely identify queries?
- Order Search Results Page by meta_value If no Value Return Remaining Results
- pre_get_posts with get_posts
- RSS feed with specific keyword
- 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
- SQL query equivalent to WP User Query
- 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
- WordPress custom search form with pre_get_posts not work
- order by multiple meta keys in pre_get_posts
- WP_Tax_Query with post_tag not working
- Advanced WP Query hogs the SQL server
- Using pre_get_posts on a specific core/query block
- When querying a combination of posts and other meta fields, is there a better solution than directly modifying the WHERE value?
- 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
- Shortcode to show thumbnail and link for 3 random posts
- Offset Page Loops and Pagination
- pre_get_posts order by not working
- 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
- How To Fix WP Query Returns Results But Shouldn’t?
- List of the years with posts presented
- How to change main query based on post meta
- Display posts from only one post form in custom query and exclude in main query
- Optional Meta Query
- Sorting events by descending date, and ascending time if multiple events on a date
- Editing the default wordpress search
- How to extract specific post
- Woocommerce – Changing the order of the upsell products [closed]
- Changing sort order for presentation by Jetpack infinite scroll
- Filtering out child category posts from parent category archive not working
- Include data from custom table in WP_Query
- Woocommerce – exclude only older out-of-stock items
- Is it possible to query from external database? [duplicate]
- WP Query – order posts by meta field first and then order the rest
- Make a SQL query with wpdb in WordPress
- List of ways to access WordPress database?
- Getting rid of unwanted nonSQL syntax characters when debugging a query
- Query where ANDing slug values not working
- WP_Query – How to get all posts of specific days of week by custom field date?
- How to avoid filling up an array each time I run a WP_query?
- How to SQL query posts IDs by categories AND authors?
- tax_query in pre_get_posts
- Elementor posts custom query based on tag [closed]
- Exclude post with taxonomy and from the terms (taxonomy & tag) posts count
- `offset` WP_Query argument dont work via `pre_get_posts`
- Replace wp_query with wp_user_query
- SQL query injection with fifu image
- Make a products only viewable to a specific user ID in meta_query pre_get_posts
- pre_get_posts pagination not working
- WP Query – grouping posts by same meta key, adding together values from another key
- meta_query is overriding default search
- What is the equivalent WP_Query of a SQL Query?
- Translating WP query into to SQL query
- Filtering posts for unique titles, only the most recent
- Order posts by title and custom field value?
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- How to search CPTs in draft using get_page_by_title()
- Limit default Search query to post_title
- Taxonomy Terms That Don’t Exist Display Results
- why doesn’t this pre_get_posts code work?
- pre_get_posts with WP_Query to prevent posts from specific tags
- What argument does my function need to echo get_results() query results
- Using the same WP_Query for shop and widgets in WooCommerce shop
- Custom taxonomy and query multi conditions
- Adding a Theme Customizer Control for Posts_Per_Page
- Order posts by custom column using pre_get_posts
- WP_Query on “property” in the options table
- Custom query to order by multiple taxonomies
- Custom WP_Query with SQL directives for getting posts by authors and terms
- orderby in WP_query doesn’t works
- Looking for a way to exclude frontpage and nav menu from query filter
- pre_get_posts redirecting
- Convert a WP Query into a simpler SQL query to fetch only COUNT of posts
- Search query alteration not working for meta values
- How to put posts with some taxonomy on top of others in `pre_get_posts`
- How to make OR condition in WP_Query