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
- WordPress tax_query “and” operator not functioning as desired
- tax_query in get_posts() not working?
- Custom Taxonomy and Tax_Query
- Conditional arguments for WP_Query and tax_query depending on if $somevar has a value
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- pre_get_posts with tax_query causes empty result
- if wp_query taxonomy term have posts
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Tax_query not working on multisite
- Query set using tax_query with relation ‘OR’ modifies category object?
- Terms with more than one occurrence have current-menu-item class in menu
- tax_query not working on main 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
- How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero
- why do drafts return as part of wp_query?
- WP_Tax_Query with post_tag not working
- Dynamically tax_query terms
- Woocommerce change tax rate programmaticly
- 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
- Custom taxonomy query not working with switch_to_blog
- tax_query: Order by slug?
- ‘wp’ action hook not firing in admin and login?
- Query custom post type by category slug
- Taxonomy archive showing no results
- ?cat=-1 Indexed Versions Of Homepage
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to Filter custom post type by taxonomy?
- 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
- How do I display the grand child items of a taxonomy term?
- How can I hide uncategorized products from search results?
- 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
- Order or Orderby in tax_query (How to define order of terms in WP_Query)
- tax_query not working
- How to get the id or url of the image in an image post?
- Override tax_query with pre_get_posts to include other term_ids on a single category
- Very complex post query
- 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
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- Is it possible to add relation between meta_query and tax_query?
- Create alphabetical Pagination for custom taxonomy?
- Custom arguments in WP_Query
- 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
- List only parent attributes on woocommerce admin atrributes page
- How To Query For An Empty Taxonomy Field
- Facing problem with tax_query results
- PHP Warning: Attempt to read property “slug” on bool in tax query
- 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?
- WordPress post_status and meta_query
- Custom search for a custom post type in WordPress
- Tax_Query not working – connecting to second wordpress database
- tax_query not working?
- WordPress tax_query ignoring relation OR
- Optimal way to make tags in tax_query optional?
- in tax_query this Is the code correct? I need to access beginner video posts for different subject
- How to display just video post format?
- No results found for second level category
- modifying main query to query for ranges e.g. from 1999 to 2016
- Custom taxonomy and query multi conditions
- 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
- pre_get_posts main_query not displaying after applying tax_query filters
- Get the tax term in which is a post via wp_query
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Advanced AND tax_query in sidebar with 2 taxonomies
- How to update WordPress custom SQL Select query for custom taxonomies so that syntax is correct?
- WP_Query with tax_query not working
- Querying by post category slug with core/query block markup