PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Fix Tag to Taxonomy Help

  1. Fabio
    Member

    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

    Posted 12 years ago on Monday July 23, 2012 | Permalink
  2. Fabio
    Member

    ok I found the solution, thanks

    http://www.gravityhelp.com/forums/topic/custom-taxonomies

    Posted 12 years ago on Monday July 23, 2012 | Permalink
  3. Very good. Thank you for your response.

    Posted 12 years ago on Monday July 23, 2012 | Permalink

This topic has been resolved and has been closed to new replies.