Hi,
i need an option to use custom taxonomies in multiple forms.
At the moment i use a hook for adding custom taxonomies instead of tags.
Unfortunately the hook doesn't work if i use it in more than one form.
Is there an option to adress a specific form and the id of the tag-field?
For now, the input appears in two custom taxonomies based on the field id...
Here is the code:
<?php
//Tag to Taxonomy - A fix for gravity forms
function hyp_tag_to_taxonomy( $form ){
$id = $form['post_id'];
$raw_tag_list = $form['12'];
$tag_array = explode(',', $raw_tag_list);
foreach ($tag_array as $tag){
wp_set_object_terms( $id, $tag, 'collective',true);
}
}
add_action( 'gform_post_submission', 'hyp_tag_to_taxonomy' );
?>