Hi, (sorry for my english)
surfing the net I could find the code that converts the "Tag" in "Taxonomy":
http://code.hyperspatial.com/104/gravity-forms-taxonomy-fix/
This works well, but unfortunately saves all the data (value) even in the "Tag" (default).
I have 3 fields ID: 45, 46, 47
function hyp2_tag_to_taxonomy( $form ){
$id = $form['post_id'];
$raw_tag_list = $form['45'];
$tag_array = explode(',', $raw_tag_list);
foreach ($tag_array as $tag){
wp_set_object_terms( $id, $tag, 'regista',true);
}
}
add_action( 'gform_post_submission', 'hyp2_tag_to_taxonomy' );
function hyp_tag_to_taxonomy( $form ){
$id = $form['post_id'];
$raw_tag_list = $form['46'];
$tag_array = explode(',', $raw_tag_list);
foreach ($tag_array as $tag){
wp_set_object_terms( $id, $tag, 'attore',true);
}
}
add_action( 'gform_post_submission', 'hyp_tag_to_taxonomy' );
function hyp3_tag_to_taxonomy( $form ){
$id = $form['post_id'];
$raw_tag_list = $form['47'];
$tag_array = explode(',', $raw_tag_list);
foreach ($tag_array as $tag){
wp_set_object_terms( $id, $tag, 'anno',true);
}
}
add_action( 'gform_post_submission', 'hyp3_tag_to_taxonomy' );
There is no way to save data in the "Tag" box (default wordpress)?
I ask your help.
PS: If possible, I will not use the plugin "Gravity + Forms Custom Post Types" for only 3 fields
thanks,
Fabio