The question is "How do I add one or more fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?" This question was asked on the wp-hackers list August 1st 2010 and I offered a solution later that day. The original asker discussed the issue again today (Aug 21) which reminded me of the solution. Since it could be a common need I decided to post the solution including code up here for others to find in the future.
|
|
I added new field 'picture' (input type file) to category with help of these
You are free to use any taxonomy, just replace |
|||||||||
|
|
...also if you want to add that field into the custom taxonomy form you just substitute category with the custom taxonomy name in the add_action function. Example: add_action('{custom_taxonomy}_edit_form_fields','category_edit_form_fields'); add_action('{custom_taxonomy}_edit_form', 'category_edit_form'); add_action('{custom_taxonomy}_add_form_fields','category_edit_form_fields'); add_action('{custom_taxonomy}_add_form','category_edit_form'); |
|||
|
|
|
You need to add your code in to your themes functions.php file - also if you want to add that field into the custom taxonomy form you just substitute category with the custom taxonomy name in the add_action function. Example : add_action('category_edit_form_fields','category_edit_form_fields'); will be add_action('custom_taxonomy_name_form_fields','function_name_to_hook_on'); |
|||
|
|
|
I use the Category Meta PLugin. Works on all custom taxonomy's, tags & categorys |
|||
|
|