(For the full post explaining the reasoning behind these code snippets see here.)
Register a “details” field on product category terms
We need to let WordPress know that we’d like to store an extra bit of info along with our product category term data. These extra bits of info are known as meta data, and since we’re adding it to a taxonomy term, WordPress calls this “custom term meta”. It’s very easy to register our new meta field, let’s call it “details”:
Add the details field to the Add New Product Category page
Next, let’s add a text area to the product categories page that will let us enter extra juicy detail about a product category term as we create it. Because this form is quite narrow we won’t make it a full-on WYSIWYG visual editor. We’ll save that for in a moment.
Add a WYSIWYG “details” field to the Edit Product Category page
Next we’ll add the details field to the edit product category page. This time, because we’ve got more space, we’ll use a proper WordPress visual editor. That way you can use headings, blockquotes and include images and other media as if you were editing a page or post.
Save the details field content to the database
We need to save the details field when a product category is first added and after it has been edited.