How to remove html tags clearing from description in wp_insert_term

Admin WordPress

When you use wp_insert_term it removes any html tags in description. But what to do when they are needed?

Example

This description:

<p style="text-align: center;">content</p>

In function wp_insert_term() will be:

<p>content</p>

How to fix

You need use pre_insert_term

Before function wp_insert_term() insert:

remove_filter('pre_term_description', 'wp_filter_kses');

Leave a Reply

Write your comment if you have something on the topic of the current article:
"How to remove html tags clearing from description in wp_insert_term"