Forum Replies Created

Viewing 1 replies (of 1 total)
  • There are quite a few hooks you can use depending on where you want to add in your form fields.
    Open up edit-tags.php and edit-tag-form.php and look for any of the non deprecated do_action hooks like do_action($taxonomy . ‘the hook name’);

    The ones i found useful fire just before the submit button:
    On your Custom Taxonomy Add page you can use:
    add_action($taxonomy.’_add_form_fields’, ‘callback_function’);
    On your Custom Taxonomy Edit page you can use:
    add_action($taxonomy.’_edit_form’, ‘callback_function’);

    They pass the current $taxonomy_term to the callback function.

    In my case is did this:
    add_action(‘product-category_edit_form’, ‘category_meta_fields’);
    add_action(‘product-category_add_form_fields’, ‘category_meta_fields’);

    function category_meta_fields($term){
    print_r($term); // to see what you get passed
    }

    Hope that helps someone, as i spent a good hour trying to find this out.

Viewing 1 replies (of 1 total)