WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I add some custom fields to specific taxonomy so when ever I call that taxonomy, custom fields attached to that taxonomy should also appear.

share|improve this question
up vote 2 down vote accepted

You can hook into the edit form field action of that specific taxonomy.

If you look in /wp-admin/edit-tag-form.php there are hooks for every taxonomy. Starting at Line 69:

        if ( 'category' == $taxonomy )
        do_action('edit_category_form_fields', $tag);
    elseif ( 'link_category' == $taxonomy )
        do_action('edit_link_category_form_fields', $tag);
        do_action('edit_tag_form_fields', $tag);

    do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy);

So for a custom taxonomy, it would be $taxonomy_edit_form_fields with $taxonomy being the taxonomies name. So you would add the hook, within the function, add your form fields. Then you also need to hook into the 'edit_term' action and if your form fields aren't empty then save it as an option using update_option().

This won't allow you to just "call the taxonomy" and have them already attached to the object, but you can loop through your terms once you get them and get the option associated with that term very easily.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.