You would use the save_post hook, in your hooked function use wp_insert_term as described here:
http://codex.wordpress.org/Function_Reference/wp_insert_term
Then use wp_set_object_terms on the post to assignt he taxonomy term you just created as follows:
http://codex.wordpress.org/Function_Reference/wp_set_object_terms
for example:
function my_save($post_id) {
wp_insert_term( 'bannanapost', 'fruit');
wp_set_object_terms( $post_id, 'bannanapost', 'fruit', true )
}
add_action('save_post','my_save');
The above code, placed in functions.php of your theme, would add the term ‘bannanapost’ to each post when saved, in the fruit taxonomy
Related Posts:
- Better way to enforce category hierarchy in post_categories_metabox?
- Add additional data to a specific taxonomy term when used in a post
- How to show a hierarchical terms list?
- Why does get_term() require taxonomy? Are term_ids not unique?
- Automatically Assign Parent Terms When A Child Term is Selected
- get term by id without taxonomy
- Taxonomy terms sort by… Last name!
- WordPress – Creating multiple versions of the same single-customtype.php depending on selected taxonomy categories
- Exclude custom taxonomy from search results and archive pages
- get_terms with posts that have a different taxonomy with term x
- check if tag exists in wp database
- How to update taxonomy custom field with wp_update_term()?
- Add Thumbnail to wp_list_categories()
- Count posts for each taxonomy term for each month
- What hooks/filters are there to alter selected terms on post save?
- Filter blog archive by category in URL
- Trying to list terms of a custom taxonomy using get_categories
- Unable to delete a Category and Tag that share same slug
- taxonomy/category term in URL slug irrelevant for post?
- How to use a Term Meta Field as a link
- Embed YouTube video on category description
- Manually query posts by taxonomy with MySQL
- Custom Taxonomy leads to 404 page
- Show only, when taxonomy has posts?
- Want to hide some categories from the categories meta box in the post editor for the two specific user roles
- Convert Custom Post Types to Custom Taxonomies
- How do I query a taxonomy term range
- How can i list the categories of a post type, the taxonomy
- get_terms problem : related articles
- Why “Warning: Invalid argument supplied for foreach()”
- WordPress User Taxonomy Saved Values
- Display Taxonomy Description on edit-tags screen?
- get_the_terms error
- How can I find the taxonomy in edited_{taxonomy}?
- Searching in wordpress using wp_term_taxonomy table
- Pulling Data from CSV vs. pulling data from database
- Attaching taxonomy data to taxonomy with wp_insert_post
- Problem with orderby
- Problem with Query on Taxonomy
- How can I edit the ‘Most Used’ tab in the categories meta-box to show another custom taxonomy?
- Taxonomy archive + query attachments = duplicate results
- Exclude posts which have any term in a certain taxonomy from the query
- Comma separated tax terms, with “and” before last item [duplicate]
- How to add and display a taxonomy term image in any template? (Taxonomy Images)
- Get Link to Feed On Term or Taxonomy
- Categorize wordpress tags
- Creating links to a page displaying posts from a particular category
- HTML in category name
- How to get my register taxonomy
- How can I completely hide a taxonomy term from “frontend”? [closed]
- Blogroll links sorted by category in a table
- How to display taxonomy term custom meta (using wp_get_object_terms?)?
- How to get if child category of this category is empty?
- How to show taxonomy terms from wordpress database?
- Adding inline help to category/taxonomy checkboxes in admin sidebar
- Taxonomy vs Post Status
- Automatically show ‘taxonomy’ meta box by default in Appearance > Menus?
- Retrieve all term IDs of post
- Prevent certain subscribers from seeing specific taxonomies (changes frequently)
- child_of not working in wp_dropdown_categories
- How to display posts from two taxonomies?
- Using taxonomies to handle layout?
- How to embed the Taxonomy Admin screen in to a Tab of a Settings Page in a plugin
- update_term_meta not working
- Getting more info about the taxonomy?
- Assign Multiple Values from Post Fields to Taxonomy Terms
- how can send a parameter by click on gender-link to filter a post by gender and product taxo
- How to make HTML select options searchable
- Why doesn’t ‘post__not_in’ work with ‘cat’?
- How best to add Author or Artist to product
- Different Sidebar for same Taxonomy
- How Do I Register Two Taxonomies with one Parent of the Other?
- I want to change the slugs of my terms dynamically
- taxonomy_edit_form_fields output after term fields
- Make/create a category for every page
- All tag/category/custom taxonomy archives 404
- transfer two existing taxonomy terms into one custom metabox
- Get a specific category in multiple categories
- Create multidimensional array of taxonomies
- $product->ID in has_term() not working, but manually inputting the ID works, why?
- how do you get one specific term from a shortcode attribute?
- Fatal error Call to a member function filter()
- Using is_tax with multiple taxonomies
- Taxonomy pages, stop them indexing or being generated?
- Looking for suggestions on creating simple database (Help!!)
- Categorizing posts by location
- How to filter the terms to a special custom taxonomy?
- Pages throwing 404 error on server load
- Display yesterday’s last post’s Custom field from Unique terms of one Taxonomies
- Apply custom taxonomy archive template to children
- Why does my taxonomy code display the first alphabetical term?
- Custom Taxonomy link out the loop
- Why can’t I exclude a term ID from either get_terms or WP_Term_query?
- IF taxonomy archive is hierarchical THEN
- What is the ‘selected’ parameter in wp_dropdown_categories() for?
- Taxonomy works in local XAMPP but doesn’t work live
- Add URL field to wordpress taxonomy
- Using autocomplete with post_tag taxonomy on attachments
- Display taxonomy terms when adding a link in the admin
- Bulk import in custom taxonomy