Adding Custom Meta Box to Taxonomies

There are three main functions to add the meta box for taxonomy.Which are invoked through following hooks:

1. {taxonomy_name}_add_form_fields
2. {taxonomy_name}_edit_form_fields
3. edited_{taxonomy_name}
4. create_{taxonomy_name}

Here , you can change the taxonomy_name with any predefined or custom taxonomy accordingly.I am using “Woocommerce product taxonomy” and created a plugin for same.Please review following functions to add custom field:

{taxonomy_name}_add_form_fields add new custom field to add new term page form.Here I am creating a field to add a Class for term.

 

 

{taxonomy_name}_edit_form_fields add a field on term edit page

 

 

 

The next and last function to save to value passed through add or edit form:

 

 

 

4 Comments

Add a Comment

Your email address will not be published. Required fields are marked *

Skip to toolbar