You’re mixing up arrays. In your “my implode”, $checkedBundeslaenderList
varies between a string and an array, depending on the number of items.
And then in your query args, you nest it in an array:
'terms' => array( $checkedBundeslaenderList ),
So what you could end up with is either:
array( array( 1 ) );
…or:
array( '1,2,3,4' );
Neither are valid formats. Instead, always use an array:
if ( ! empty( $_POST['checkedBundeslaender'] ) ) {
$checkedBundeslaenderList = wp_unslash( ( array ) $_POST['checkedBundeslaender'] );
} else {
$checkedBundeslaenderList = array();
}
And then just pass it straight to your query:
'terms' => $checkedBundeslaenderList,
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
- How to write a Tax Query that matches all terms in an array?
- 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
- Nested meta_query with multiple relation keys
- “tax_query” parameter not working with WP_Query
- Multiple relationship for multiple tax_query in WP_Query
- Query posts by custom taxonomy ID
- Does tax_query really beats meta_query in all situations?
- Including all terms in wordpress tax_query
- Tax_query terms ID’s using variable
- The Operator “NOT IN” Does Not Work In tax_query
- How to tax query X number of posts related by tag first, then by category if not enough in tag-related
- Why is my WP_Query not working when tax_query terms are an array?
- get_terms with posts that have a different taxonomy with term x
- template_include for search.php makes WordPress think its on the home page
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Hidden woocommerce products still showing up in search results [closed]
- How to create a WP_Query to search the Title or Tag?
- Count number of posts which exist in 2 taxonomies?
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- Find all product that contain terms with %keywords% in WP_Query
- Get term by custom term meta and taxonomy
- WP_Query tax_query on ACF post_object
- How to add terms to my tax_query based off of the current post
- How to output content based on same custom taxonomy?
- Query all posts in a given taxonomy
- Change default ordering of taxonomy terms – pre_get_terms
- WP_Query, tax_query and term_meta: How to?
- Is it possible to dynamically get queried term AND taxonomy?
- How can i simulate “taxonomy__in” in query?
- Get pages only with a specific taxonomy
- How to add autocomplete to custom taxonomy for CPT
- pre_get_posts: using tax_query only for certain post type
- pre_get_posts Remove tax_query Completely
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query Multiple Taxominies Across Multiple Post type’s
- Meta Query relation “AND” not working
- Nested tax_query that allows specified categories OR tags, but NOT other categories
- How can I add multiple ‘tax_query’ arrays via a loop?
- Get taxonomy parent using child slug (from merged taxonomies)
- Fetch posts that match term slug first two letters (wp query)
- Manipulate WP Query using a custom post type and multiple tax_query taxonomies
- WP_Query tax query part of slug
- Searching in title or meta, with a tax query too!
- Taxonomy Query Relation field not behaving correctly?
- Why is this query not working? (Standard posts + custom post type)
- Tax query AND/OR meta query [duplicate]
- Custom Taxonomy Not Working When added to WordPress Search
- Exclude posts which have any term in a certain taxonomy from the query
- WP_query – Filter by tax_query and meta_query using multiple select
- How to get the id or url of the image in an image post?
- Tax Query only returns for the first of several terms
- get_posts( $args ) return empty data
- Set both meta_query and tax_query using wp_query->set
- tax_query: Don’t show posts with parent term when they have a corresponding child term applied
- $query->is_main_query() is causing query’s tax_query to be ignored
- Loop posts based on permalink term
- tax_query (if the terms are empty)
- tax query shortcode
- How to restrict search on a certain page to only return results against custom taxonomies?
- Function using get_posts() with tax_query not working when called from functions.php
- Running a custom query inside another cpt single and trying to grab a variable
- WP_Query tax_query – Show results if child has parent X
- how to use tax_query to apply both terms or one if one is empty
- Show multiple tax_query from 2 or more post_type in a single code
- Query all posts under one taxonomy? Why is my code not working?
- Get Posts Related to Category By category id or slug
- 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
- Display just the Post’s parent Category, not child
- Show posts from two specific category in WP_Query
- 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
- Sort by an ACF field in a tax_query
- Why pagination is not working with tax_query param?
- Query child posts with tax query on parents
- posts_per_page in a tax_query
- Getting Custom Posts with Custom Taxonomy
- Not able to get my custom search result using meta_query and tax_query together?
- Error get_posts with Custom Taxonomy and OR relation
- 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)
- Display related posts with same category or same tag return blank
- WordPress hiding posts without content on custom taxonomy query. How to solve?
- Custom Query Arguments
- How to limit posts to 1 from each term with tax_query?
- How to pass >= condition filter to my year custom tax_query
- wp_get_object_terms count on taxonomies within an category archive
- Custom query for certain post type OR another post type with a certain category
- WP Query Conditionally query meta and taxonomy
- Complex Taxonomy scheme