Skip to content

Instantly share code, notes, and snippets.

@deeman
Created March 13, 2022 14:45
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 deeman/0abe7aac75271ff0da282a855a0e267f to your computer and use it in GitHub Desktop.
Save deeman/0abe7aac75271ff0da282a855a0e267f to your computer and use it in GitHub Desktop.
WooCommerce - Allow HTML In Category Description
/**
* Allow HTML in term (category, tag) descriptions
*/
foreach ( array( 'pre_term_description' ) as $filter ) {
remove_filter( $filter, 'wp_filter_kses' );
if ( ! current_user_can( 'unfiltered_html' ) ) {
add_filter( $filter, 'wp_filter_post_kses' );
}
}
foreach ( array( 'term_description' ) as $filter ) {
remove_filter( $filter, 'wp_kses_data' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment