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.

Add a Term to a Taxonomy via Forms

  1. Hello,

    I had found this code that was a bit older but claimed to do what I wanted:

    function hyp_tag_to_taxonomy( $form ){
         $id = $form['post_id'];
         $raw_tag_list = $form['input_7'];
         $tag_array = explode(',', $raw_tag_list);
         wp_set_object_terms( $id, $tag, 'TAXONOMY' , true);
    
    }
    
    add_action( 'gform_post_submission', 'hyp_tag_to_taxonomy' );

    Essentially, I want one of my form fields to be able to inject a taxonomy term into a specific taxonomy.

    Actually, what I'd REALLY love is a field that does 2 things..... Uses some sort of auto-complete to query all the current terms for a specific taxonomy and give those as suggestions for the field.... if then the term doesn't exist, it add the new term... but I'm sure that's a much larger request ;)

    Posted 13 years ago on Sunday July 10, 2011 | Permalink
  2. I want this too... any updates?

    Posted 13 years ago on Sunday August 28, 2011 | Permalink
  3. clc
    Member

    I'd LOVE this as well.

    Posted 13 years ago on Sunday August 28, 2011 | Permalink