• capecodvalet

    (@capecodvalet)


    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

    (@capecodvalet)

    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.