The fourth parameter to wp_set_object_terms()
is an “append” argument.
$append
(bool) (required) If true, tags will be appended to the object. If false, tags will replace existing tagsDefault: False
http://codex.wordpress.org/Function_Reference/wp_set_object_terms
Your code should work if you pass true
as that fourth argument.
wp_set_object_terms(
$post->ID,
explode( ',', $_POST['postTags'] ),
'product_tag',
true
);
Related Posts:
- get_terms by custom post type
- Get terms by taxonomy AND post_type
- Get Posts by Custom Post Type ,Taxonomy, and Term
- Get The Post Type A Taxonomy Is Attached To
- Display current taxonomy term when inside custom post type
- Get term slug of current post
- How to limit the number of terms (terms acts like categories)
- How do I list custom taxonomy terms without the links?
- query multiple taxonomies
- wp_set_object_terms() is not replacing term, but creating a new one
- Get terms that contain posts that in turn belong to other terms?
- wp_insert_term doesn’t work with custom post type’s taxonomy
- show tags of custom post type ONLY
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- How to get term link that crosses different custom post types?
- wp_get_object_terms(): count relative to passed IDs?
- Count posts that have specific taxonomy term attached
- Retrieve single term slug
- Not Able to Insert Taxonomy Term Using wp_insert_post()
- array_pop() expects array, boolean given for $event_type_term ->slug
- How can I add programmatically custom taxonomy terms to a custom type post when saving posts?
- post count is wrong when using same taxonomy for 2 different CPT
- How to hook get_terms() to only show count of posts that have custom meta
- display multiple term post from taxonomy in a single page
- Glossary with Custom Post Type
- Custom Post Type Archive Template
- Maintaining strict one-to-one association between terms and custom posts
- Displaying custom post type by first letter through custom taxonomy
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- If on term-page -> get the current term?
- Separate Custom Post Type Taxonomy by Comma
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Custom Search | Wrong output & question
- Sort the main query in subcategories/terms?
- Trouble adding custom featured image for custom taxonomy TERMS
- Get child terms of current term of the current post
- Get list of terms of current taxonomy archive for another taxonomy
- List all custom post type posts from a given category?
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Output the slug and name of a CPT single post taxonomy term
- Get all taxonomies for all post types
- Get the terms of a custom taxonomy for a specific author in author template
- Dynamically create/remove terms in taxonomy when custom post type is published/trashed
- get_terms won’t display product_cat or any other custom taxonomies when specified
- How to get the first term for the current taxonomy?
- How do I provide a “show all posts” link in a paginated term archive?
- How to get category image custom post type taxonomy in wordpress?
- Category page only displaying the posts from a custom type
- Output the content of a term organised by each of the CPT?
- How to filter the taxonomy terms based on another taxonomy term
- How to get posts from multiple custom post types according to it’s custom taxonomy terms?
- How to output wordpress custom tags separated by comma?
- Have a Custom Post Type index page display taxonomy items instead of posts
- How to check the terms in single custom post type template
- Displaying a custom post types custom taxonomy value?
- get_the_terms return only last term
- Does WordPress limit the length of slug names for Post Meta or Terms?
- get_post_meta returns empty array for terms
- how to get URL of media uploaded to WordPress via media_handle_sideload()
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Update post terms with custom taxonomy
- How do I display tags for a custom post type single page?
- Custom Post Type Archive Page Filtering
- Filtering WP_Query Dynamically on the Front-End
- wp_insert_term in a multisite installation
- Get template part using a custom taxonomy term
- Get posts by querying taxonomy and certain terms of the taxonomy?
- How to restrict users and admin from creating new taxonomy terms?
- Custom Post Type archive loop separated by term, in specific term order
- using $wpdb to get custom post type with term
- Show posts from two or more custom taxonomy terms
- Allow user to set custom order to a list of custom taxonomies?
- Displaying custom taxonomy in the admin list of a custom post type
- Which post does a taxonomy term belongs to?
- Display post as term id
- How do I display the taxonomy term alongside the post type post title?
- Custom post taxonomies as tax_query terms?
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- Post count by month of taxonmy term
- get_the_term_list() wanting to loop through the returned values
- List custom taxonomy terms
- show 10 most recent custom post types excluding the one(s) from specific custom taxonomy
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Navigation links to posts in current term shortcode
- Display associated taxonomy child name on single CPT page
- How to manage a bookstore
- Get all terms assigned to a post from different taxonomies
- Issue On Listing Woocommerce Parent Tag List
- Get term link of shared taxonomy between multiple post types
- How to use wp_set_object_terms depending on page ID?
- Rewrite rule taxonomy url with different values in one function
- Taxonomy Archive URL + Template
- Search and filter terms of a custom post type only and display results
- Get a custom post type’s taxonomy type term names displayed as checkboxes and filter
- Display posts from Custom Post Type, group by term, arrange term groups and arrange items within groups by menu order
- Is it possible to get_terms by taxonomy AND post_type?
- How to list custom taxonomy terms without the hyperlinks?
- Is there a way to edit non-custom term attributes?
- Can’t retrieve custom post type taxonomy term to custom post type editor
- How to determ a custom post type url?