I would like to return all posts when the tax_query['terms'] is empty.
$args = array( 'post_type' => 'product', 'posts_per_page' => 15, 'paged' => $paged, 'post__not_in' => $exclude, 's' => $filter, 'tax_query' => array( array( 'taxonomy' => 'product_cat', 'field' => 'term_id', 'terms' => array(), ), ), );
Unfortunately I didn't find solution for the problem. As you can see the array is empty:
'terms' => array(),but I would like to return all posts. How can I achive that?