Skip to content

Instantly share code, notes, and snippets.

@Deaner666
Last active November 13, 2015 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deaner666/894732aec08d72e0fc4b to your computer and use it in GitHub Desktop.
Save Deaner666/894732aec08d72e0fc4b to your computer and use it in GitHub Desktop.
Add a textarea for the details meta field on WooCommerce product category terms
<?php
add_action( 'product_cat_add_form_fields', 'wpm_product_cat_add_details_meta' );
/**
* Add a details metabox to the Add New Product Category page.
*
* For adding a details metabox to the WordPress admin when
* creating new product categories in WooCommerce.
*
*/
function wpm_product_cat_add_details_meta() {
wp_nonce_field( basename( __FILE__ ), 'wpm_product_cat_details_nonce' );
?>
<div class="form-field">
<label for="wpm-product-cat-details"><?php esc_html_e( 'Details', 'wpm' ); ?></label>
<textarea name="wpm-product-cat-details" id="wpm-product-cat-details" rows="5" cols="40"></textarea>
<p class="description"><?php esc_html_e( 'Detailed category info to appear below the product list', 'wpm' ); ?></p>
</div>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment