Answer the question
In order to leave comments, you need to log in
Why does a query with mutually exclusive parameters work?
Hello!
In one of the places in the theme code, WP found a snippet:
<?php
$args = array(
'post_type' => 'post',
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => array( 'some-tag' )
)
)
);
Answer the question
In order to leave comments, you need to log in
It is necessary to look at the SQL query itself, which turned out. I suspect that something like "if there are posts for this tax_query - return them, otherwise - standard results" because of the OR operator. I can be wrong, but debugging without the SQL query itself is unrealistic. Install the Query Monitor plugin - everything will be decided in a couple of minutes.
What is a "category in the database"?
If you mean columns, then WP probably has an extra. a handler that converts these parameters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question