Reply To: Taxonomies in attachments

Home Forums TurboCSV Support Taxonomies in attachments Reply To: Taxonomies in attachments


OK, I think I understand what is happening. TurboCSV uses wp_insert_post and wp-update_posts to insert and update records.  These in turn distinguish between attachments and all other post types. For attachments they call wp_insert_attachment and wp_update_attachment which to do not process taxonomies.

To link attachments to taxonomies, I think that you would need to use something like wp_set_object_terms. The logic would seem to be simple. Once the normal insert/update is done, if the post_type is attachment and there are taxonomy fields to be added/updated call wp_set_object terms.

If this makes sense, could you let me know where to put this and and how to extract the tags and taxonomy parameters from the TurboCSV tables?