Just needs a little array manipulation.
$def = array(
'taxonomy' => 'cities',
'field' => 'slug',
'operator' => 'NOT IN'
);
$cities = array(
'boston',
'chicago'
);
$args = array('relation' => 'OR');
foreach ($cities as $c) {
$args[] = wp_parse_args(array('terms'=>$c),$def);
}
print_r($args);
The $cities
array you need to build from your $_POST
or $_GET
form data, or just create the $args
array as you loop through the form data in the first place.
Related Posts:
- How to prevent new terms being added to a custom taxonomy?
- How to add images to taxonomies?
- Read-only taxonomy (user can assign term but can’t create or edit existing terms)
- Include and Exclude Taxonomies From Archives & Feeds Using ‘pre_get_posts’
- Taxonomy menu with post count and multiple parents
- Sort Custom Post Type Archive by Taxonomy Term [duplicate]
- How to get the singular name of a custom taxonomy?
- Is it possible to have a taxonomy archive that lists taxonomy terms?
- Archive template for taxonomy terms
- pre_get_posts OR relation between taxonomy and author
- Non-hierarchical custom taxonomy using checkboxes on edit-screen -> saving issue
- Dynamic page slug for Custom Taxonomies?
- show term description instead of list terms of custom taxonomy
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Listing child terms of parent term
- Display the taxonomy name of the current term
- Advanced Tax Query
- Require a Custom Taxonomy to be checked
- Last posts from custom taxonomy
- How to add a body class based on a custom taxonomy term
- Can I create custom taxonomy what dont creates slug pages?
- User role permissions based on taxonomies
- Search by type posts and taxonomy
- get_the_terms() to show all custom taxonomies
- Get Taxonmy Term ID For Current Post
- Can I limit term selection to one plus parent?
- Insert form checkbox at bottom of taxonomy edit term page
- Changing stylesheet depending on custom taxonomy terms
- Taxonomy with_front causes all
- Why is my taxonomy template not shown?
- cannot get multiple loops using tax_query
- How Can I Change a Taxonomy URL Based On The Originating URL?
- How to add a Rewrite Rule / Category Structure
- Hide posts having children terms when display posts by category in edit.php
- Get posts by term slug only
- How to have two different versions of a tag/category/taxonomy archive page?
- Custom Taxonomy Term Caching?
- Controlling Taxonomy Category listings to hide and unhide specifics
- How do I create a custom archive page depending on the custom taxonomy type?
- Rewrite Rule Working for all but one of the taxonomies created
- How to Rewrite Taxonomy URL to Include the Post Type as the Second Segment of the URL?
- Add Custom Taxonomy for Blog Meta Info
- Include parent and child in category url
- woocommerce custom product category template
- Custom taxonomy multiples
- Is there a template file to list all terms of a given custom taxonomy?
- Assign terms to new capability for all taxonomies
- List of users inside custom taxonomy
- Rewrite Rules returning wrong data
- Output unique taxonomy terms of posts inside a loop
- how does the wordpress rest API work
- Taxonomy terms can still be added when only assign_terms capability has been granted
- Use an HTML Element To Filter Taxonomies In WP Search
- tax_query not working
- Weekdays as terms – How to order taxonomy terms by ID in admin panel?
- How to display ACF taxonomy checkbox links on WooCommerce product category archive
- wp_query not resetting, last post hanging
- custom taxonomy not showing in Gutenberg
- Can I add other Custom Taxonomy to my syntax (functions.php)
- Display children category images
- Dropdown taxonomy lists in admin menu
- How to show post for a particular term of custom taxonomy?
- Is there a way to change select-list for new custom taxonomy?
- How to define %category% for custom taxonomies?
- How to list terms by first letter, as in A’s then B’s etc
- Taxonomy hide not working
- How do I get the correct URL?
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- Query all images with certain tag in media library using visual portfolio plugin
- See double taxonomy inputs in WP editor
- How to change custom categories term links?
- Body class to each level of a hierarchical custom taxonomy
- Problem with wp_list_category with custom taxomy
- Restructuring permalink with more than one taxonomies
- How to limit custom post category
- Custom order of taxonomy using wp_get_object_terms and woocommerce_term_meta
- ajax drop down change second drop down data
- Redirect or Prevent Viewing of Custom Taxonomy’s Archives?
- Display taxonomy term slugs
- Automatically Populate Post Taxonomy Data Based on Post Author Meta Data?
- Get Posts by tag from a custom taxonomy
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Tax query array terms display out of order
- How to change taxonomy slug?
- Taxonomy to WordPress Permalinks of custom post type
- Advanced AND tax_query in sidebar with 2 taxonomies
- Function code problem
- Permalinks not working on MU network with domain mapping
- Create WordPress taxonomies based on theme settings
- Alternative for is_taxonomy() to workaround theme’s default sidebar
- Get custom taxonomy term url on archive page
- I’ve got a function that auto creates taxonomy terms – Can it auto delete them as well?
- Get custom taxonomy value of post and output posts in same taxonomy
- Head Code for Custom Taxonomy
- Adding new terms to custom taxonomy
- Add Gutenberg editor to edit taxonomy (category) page
- post_type_link not working for posts without terms
- Why my archive title isn’t showing?
- Two taxonomies with the same slug
- Hook function when taxonomy terms change