I believe changing your operator to ‘AND’ like below will work:
$selectedOptions = array('test-attribute', 'test3');
$args=array(
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'pa_filterable-attribute',
'terms' => $selectedOptions,
'field' => 'slug',
'operator' => 'AND'
)
)
);
Related Posts:
- WordPress tax query use operator LIKE
- tax_query will produce nothing
- Multiple, nested tax_query relation
- Can’t make a tax_query across different post types
- using multiple terms in tax_query
- in_category() and tax_query with custom post type
- OR for a single taxonomy in a tax_query
- simple tax_query intersection
- How to set `tax_query` with `query->set()`
- tax_query will produce nothing
- tax_query in get_posts() not working?
- Conditional arguments for WP_Query and tax_query depending on if $somevar has a value
- When tax_query used, results disappear (0 =1 produced)
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- Does tax_query really beats meta_query in all situations?
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Hidden woocommerce products still showing up in search results [closed]
- if wp_query taxonomy term have posts
- tax_query not working on main query
- Combine tax_query and meta_query in WP_Query
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- Ordering Posts with Custom Taxonomy Terms Array
- Get term by custom term meta and taxonomy
- How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero
- tax_query: What to pass when I want to have all terms?
- why do drafts return as part of wp_query?
- WP_Tax_Query with post_tag not working
- Query for custom post type objects in a taxonomy and with a meta value
- Display related products with custom output
- WP_Query with tax_query, order by most ‘matches’
- tax_query OR with empty result returns all posts
- pre_get_posts Tax Query not working for custom author page
- tax_query returning all posts instead of selective posts in WP_Query
- Use both meta query and tax query
- Get pages only with a specific taxonomy
- Get list of terms that have posts in another term
- Custom taxonomy query not working with switch_to_blog
- tax_query: Order by slug?
- ‘wp’ action hook not firing in admin and login?
- Tax query clause inside a meta query clause?
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- Using get_posts() with tax_query parameter set isn’t working with attachments
- Manipulate WP Query using a custom post type and multiple tax_query taxonomies
- Custom post taxonomies as tax_query terms?
- Taxonomy Query Relation field not behaving correctly?
- Tax Query for custom Taxonomy field
- Tax query in pre_get_posts not working
- More then one menu items are assigned with “current-menu-item” class
- Custom Widget WP_Query problem
- WordPress tax_query not showing private posts
- Set tax_query conditionally with new WP_Query
- Query with meta_query and tax_query together not working properly
- Adding a tax_query to a WP_Query Object
- How to get the id or url of the image in an image post?
- How to exclude a taxonomy from shop & search page wooCommerce?
- exclude product with available tag
- How to add tax_query to $args with concatenation
- get_posts( $args ) return empty data
- Is it possible to add relation between meta_query and tax_query?
- Create alphabetical Pagination for custom taxonomy?
- Custom arguments in WP_Query
- How to restrict search on a certain page to only return results against custom taxonomies?
- Exclude post type with pre_get_posts?
- Hi need update in my terms for other taxonomy
- Order WP_Query by The Order of an Array in Tax_Query
- How To Query For An Empty Taxonomy Field
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Facing problem with tax_query results
- Display related CPT with custom taxonomy
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- Tax query get first product with attribute value in pre_get_posts
- How to get rid of variations with unspecified attributes
- Can I create a tax query to return posts that match two slugs from same taxonomy
- How to search through all child taxonomies using WP_Query?
- how do you pull data from two taxonomies?
- Sort by an ACF field in a tax_query
- WordPress post_status and meta_query
- posts_per_page in a tax_query
- Tax_Query not working – connecting to second wordpress database
- Getting Custom Posts with Custom Taxonomy
- Optimal way to make tags in tax_query optional?
- Not able to get my custom search result using meta_query and tax_query together?
- in tax_query this Is the code correct? I need to access beginner video posts for different subject
- Error get_posts with Custom Taxonomy and OR relation
- How to display just video post format?
- modifying main query to query for ranges e.g. from 1999 to 2016
- How to show post which has the specific taxonomy terms?
- Woocommerce orderby rand with tax_query not random
- Custom taxonomy and query multi conditions
- Escaping WP_Query tax_query when term has special character(s)
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- WP_Query: Meta_Query with serialized value (or a workaround)
- Multiple tax_queries: display posts titles from several custom taxonomie
- Escaping WP_Query tax_query when term has special character(s)
- How to get hierarchical number of custom taxanomy
- Get the tax term in which is a post via wp_query
- How to limit posts to 1 from each term with tax_query?
- WP_Query with tax_query not working
- wp_get_object_terms count on taxonomies within an category archive
- Custom query with custom filtering returning incorrect results