You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We experience two issues regarding HTML in the product category description.
When creating or updating a product category using the REST API, most HTML is removed from the category description. However, the description supports more HTML when creating or editing a product category in the WordPress Admin, so I would say that the description field in the REST API should also support the same HTML options.
HTML is also removed from the category description when the description field is not included in the update request. In that case, I would expect that the description field remains unchanged.
Steps to reproduce:
Given the current state of the description:
After updating the category (with or without the description field present):
The description is stripped from most HTML:
The text was updated successfully, but these errors were encountered:
We also experience this behaviour. Nevertheless when you switch Yoast SEO off you are not able to add any tags like <h1> in it. So it seems the Woo rEST API just follows the IDE way.
There is a fix:
/**
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' );
}
}
We experience two issues regarding HTML in the product category description.
When creating or updating a product category using the REST API, most HTML is removed from the category description. However, the description supports more HTML when creating or editing a product category in the WordPress Admin, so I would say that the description field in the REST API should also support the same HTML options.
HTML is also removed from the category description when the description field is not included in the update request. In that case, I would expect that the description field remains unchanged.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: