Title: adding taxonomy edit form fields
Last modified: August 21, 2016

---

# adding taxonomy edit form fields

 *  [capecodvalet](https://wordpress.org/support/users/capecodvalet/)
 * (@capecodvalet)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/adding-taxonomy-edit-form-fields/)
 * I’m trying to add a new field or two to the taxonomy edit screen for one of my
   custom taxonomies (portfolio-project-type). I found the hooks for ${taxonomy}
   _edit_form_fields and edited_${taxonomy} and my action functions are getting 
   called, and my fields are properly getting added.
 * However, my update function is getting called but not working. I think I have
   it tracked down, but not sure why it’s not working.
 * According to wp-includes/taxonomy.php, it sure looks like I should be getting
   both the term_id and term_taxonomy_id passed to my function, yet term_taxonomy_id
   is blank in my function.
 * Any ideas what I might be doing wrong?

Viewing 1 replies (of 1 total)

 *  Thread Starter [capecodvalet](https://wordpress.org/support/users/capecodvalet/)
 * (@capecodvalet)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/adding-taxonomy-edit-form-fields/#post-4325383)
 * I think the problem is that my taxonomy has ‘-‘s in its name and this code in
   wp_update_term() (line 2574 of wp-includes/taxonomy.php):
 * `$tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb-
   >term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE
   tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id) );`
 * doesn’t put the taxonomy inside quotes, causing the query to just look only for
   the section of my taxonomy name up to the first ‘-‘ as the taxonomy name.
 * Does that make any sense? For now, I have a workaround.

Viewing 1 replies (of 1 total)

The topic ‘adding taxonomy edit form fields’ is closed to new replies.

## Tags

 * [custom taxonomy](https://wordpress.org/support/topic-tag/custom-taxonomy/)
 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [capecodvalet](https://wordpress.org/support/users/capecodvalet/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/adding-taxonomy-edit-form-fields/#post-4325383)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
