Created
November 13, 2015 21:47
-
-
Save Deaner666/e8400edd1726fa3652fd to your computer and use it in GitHub Desktop.
Register "details" meta field on WooCommerce product_cat terms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'wpm_product_cat_register_meta' ); | |
/** | |
* Register details product_cat meta. | |
* | |
* Register the details metabox for WooCommerce product categories. | |
* | |
*/ | |
function wpm_product_cat_register_meta() { | |
register_meta( 'term', 'details', 'wpm_sanitize_details' ); | |
} | |
/** | |
* Sanitize the details custom meta field. | |
* | |
* @param string $details The existing details field. | |
* @return string The sanitized details field | |
*/ | |
function wpm_sanitize_details( $details ) { | |
return wp_kses_post( $details ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment