Yes it is. But you have to know the exact taxonomy’s slug, since colors are not like preserved terms to be generated programmatically. Here is an example of how to do it:
// run our function when a post is published
add_action('save_post','update_my_taxonomies');
function update_my_taxonomies($post_id){
// Check if the post has a particular taxonomy
if(has_term( 'blue', 'colors', $post_id )){
// Assign a term to our post
wp_set_object_terms( $post_id, 'blue', 'blue_bike' );
}
}
This will set the blue
for the blue_bike
if the post has the blue
term as its color
taxonomy.
Related Posts:
- Get terms by taxonomy AND post_type
- Display current taxonomy term when inside custom post type
- Get term slug of current post
- 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
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- Retrieve single 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
- Glossary with Custom Post Type
- Custom Post Type Archive Template
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Separate Custom Post Type Taxonomy by Comma
- Sort the main query in subcategories/terms?
- Get child terms of current term of the current post
- Get list of terms of current taxonomy archive for another taxonomy
- Dynamically create/remove terms in taxonomy when custom post type is published/trashed
- How to get the first term for the current taxonomy?
- 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 output wordpress custom tags separated by comma?
- How to check the terms in single custom post type template
- get_the_terms return only last term
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- How do I display tags for a custom post type single page?
- Get posts by querying taxonomy and certain terms of the taxonomy?
- Show posts from two or more custom taxonomy terms
- Display post as term id
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- Post count by month of taxonmy term
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- Display Custom Taxonomy Alphabetically
- Get terms that contain posts that in turn belong to other terms?
- How to get custom posts sub category link
- Custom while loop for hierarchical display of a taxonomy
- Displaying custom-taxonomy-terms sorted by parent/child-hierarchy?
- Listing all term items alphabetically / sorting loop
- Query posts with double taxonomy
- Adding predefined terms to a taxonomy
- Custom query – get_the_terms not work
- Custom Post Types Archives and Single Pages not showing custom taxonomy data
- Shared terms between taxonomies
- Get terms of a post but only if they’re also the child of a specific term
- How to get dropdown instance value in WordPress custom Widget
- Get taxonomy term by slug in post on archive page
- custom hierarchical taxonomy and custom post type list contains surplus posts
- How to display custom taxonomy term meta on custom post type
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- how to count the current posts terms
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- does wp_insert_term link the term to a certain post ID?
- Custom Taxonomy Terms in Menu lead to which page?
- Grab all Custom Posts by multiple taxonomies and terms
- Add custom post type taxonomy tag to article class
- Custom Taxonomy dont save in a frontend form for post a custom post
- Add filter to Admin list for all custom post types by their custom taxonomies
- Add the custom post term to the custom post title
- Retrieve Custom Taxonomies with Description and Slug
- How to list posts by term (custom taxonomy)
- Custom taxonomy not saving correctly
- Taxonomy terms with the same name are updated between separate custom post types
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Add a class to a div if custom post type has specific terms?
- Return multiples taxonomies with wp_get_object_terms
- Custom taxonomy terms hierarchical navigation
- How to list posts by terms
- Excluded Custom Taxonomy Term Posts Displaying in loop
- How to order taxonomy terms by most recent post?
- How to associate custom taxonomy terms with custom post type?
- get_the_terms child terms for current post/custom post only
- Pages of my taxonomy terms are showing all posts
- Saving Child Terms on front end not setting parent
- How to show terms used only for particular custom post type. Filter creation perpose
- Custom taxonomy- only output relevant terms
- order taxonomy alphabetical
- Filter Term By Parent Term – Custom Post Type
- Display all Custom taxonomy terms and their relevant custom posts
- WordPress get all post with like in terms [duplicate]
- Decrement term in for each
- Best way to group posts based on custom post type terms
- Custom Post Status & Taxonomies
- Get list of CPT posts in *current* post’s taxonomy term
- Prevent repetitive terms in get_the_term_list
- How to retrieve the permalink for a specific (custom) term?
- Exclude Custom Post Type from shared Custom Taxonomy
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Get a list of categories ids
- Get term_id for each instance of custom taxonomy
- List a custom taxonomy’s terms, with links, on the taxonomy page
- taxonomy terms array not working
- install.php Custom Taxonomy Term not being added to custom post
- get_the_term_list() wanting to loop through the returned values
- 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
- How to manage a bookstore
- Get term link of shared taxonomy between multiple post types
- How to use wp_set_object_terms depending on page ID?