here is how to do it:
<form action="#" method="post">
<input type="checkbox" name="checklist[]" value="1"><label>Blue</label>
<input type="checkbox" name="checklist[]" value="2"><label>Red</label>
...
<input type="submit" name="submit" value="submit"/>
</form>
<?php
if(isset($_POST['submit'])){
if(!empty($_POST['checklist'])){
$selectArr = array();
foreach($_POST['checklist'] as $selected){
$selectedInt = (int)$selected;
$selectArr[] = $selectedInt;
wp_set_object_terms( $thePostId, $selectArr, 'color');
}
}
}
?>
where the values in input tags are taxonomies IDs (color IDs)
and I used my theme functions to define current Post ID ($thePostId)
Related Posts:
- Get Posts Under Custom Taxonomy
- Front-End Post Submission
- Displaying the category name of a custom post type
- Show WordPress Custom Taxonomy Items Based On a Selected Item From Another Custom Taxonomy
- How to upload post thumbnail while wp_insert_post?
- Publish pending article from front end with a button?
- Get names of authors who have edited a post
- Edit a post from frontend. post_tags get saved, but not separated
- Developing a secure front end posting form
- How can I edit a post from the frontend?
- Developing a secure front end post editing form
- Create new category upon save based on post information
- Post from front-end only by logged in users, form posts as “posted by:
- upload featured image from front end using wordpress add media button
- Post & edit a post from front end along with upload, dropdown, and other inputs
- meta_box or custom_field as a second tinymce post-instance?
- Custom Taxonomies Incorrectly Counting Revisions?
- wp_update_term is always launched after wp_insert_term
- Adding Multiple Values to a Post Meta Key
- How do I get the slug of a custom taxonomy category of a post?
- How to display different single post template based on author?
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- Frontend Post Excerpt field mapping
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- Frontend Post Form Validation
- wp query with dynamic taxonomies and terms?
- Get Posts via Taxonomy Term Name with Space
- Why won’t my taxonomy query show up?
- How to set up multiple taxonomies for groups of posts
- Sidebar links for different pages
- Preserve term order per post in a non-hierarchical taxonomy
- Get posts by name and taxonomy term
- Redirection not working in this front end post submission form?
- Choose whether to automatically add a taxonomy with the same name as the post
- How to insert 2 args into 1 Wp_Query for a slideshow
- Help with Taxonomies
- Posts list in custom taxonomy
- Get Posts Under Custom Taxonomy
- How to change the color theme per post?
- How to render taxonomy in loop of custom post_type
- Adding an image to a non existing post
- How to make a bilingual front-end post using the plugin WP User Frontend and Polylang or qTranslate?
- Change Post Status From Front End
- How to allow visitors to filter posts by multiple taxonomies
- How to add tags (custom taxonomy) to post class css?
- 404 error on default post type and default taxonomy fronted page
- Saving custom fields to a custom taxonomy
- How to get Tags with specific post id
- Displaying posts that belong to a specific author
- Get posts and include taxonomy term
- Display posts of specific category term
- Form to post new post with custom taxonomies
- Lock post editing to one user at a time – wp_check_post_lock
- Front end post submission form with duplicate type fields
- How to show a custom taxonomy in the theme?
- Replace image name on upload to the new post name on front-end form
- Edit the post title from the frontend
- Check if current user has a post and that post has any term/s from a specific custom taxonomy outside the loop
- Programatically adding custom filters to post list
- Can i have more than one form for front end posting in one template [closed]
- Limiting post list by taxonomy
- Get Users Post ID
- WordPress wp_editor to post and edit
- How to Rearrange WordPress Tags list on frontend using Shortcode with specific order?
- How to associate a custom taxonomy to a post multiple times
- How to limit post (Exception pages) for current user in each role in front end?
- Query to fetch custom taxonomy along with post title
- Create posts by any logged in users
- How to generate an HTML link automatically from URL in a users’ post
- If taxonomy has more than 6 posts, display show all
- filter buddypress users posts by user ‘xprofile’ custom fields
- Customizing URL slugs of Custom Post Type and Taxonomy make posts/pages 404
- Allow reader to reorder posts for themselves (oldest first)
- My custom query is displaying random posts in random order
- How to get post count including nested categories
- Custom Taxonomy From Database
- Send the post id to a front end edit post form
- Post/Edit/Delete Post From Frontend… How?
- Send/Publish a Post front end
- How Can I Limit Users to Post Creation For My Frontend Theme?
- Multiple loops on a Search result page?
- User driven content problems
- display post according to the term
- Create post from form with image
- Stop Authors from submitting spam post
- Display all search results
- Add default content to post (for specific category)
- blog page showing only first post
- Display taxonomy term only if there’s a value
- Including text at the end of every post
- How to set post expiration date and time and move the page to archive after expiration [closed]
- .current-menu-item class on custom post type children pages – again?
- How to create a sub post?
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- How to auto strip hyperlinks & images in wordpress post
- marking a post that was sticky on category template
- How show custom message after post pulished or update
- How do I scope out why I have two “posts” menus in an admin?
- insert post fails after multiple postings
- why my post not redirecting to custom created single-show.php file?