Formatting product attribute text (1 post)

  1. eMojster
    Posted 2 years ago #

    Hi all!

    I've been wondering if there is any way to format display of the attribute text? HTML markup is ignored and stripped after reloading/saving the backend product page.


    Attribute: color
    Value: red | green | blue
    Output on frontpage: red, green, blue

    I want the color attributes to be displayed as a unordered list - each parameter in its own line.

    I've found only some PHP code to append to the functions.php file, that should remove the filter ... but they are not working for me. It is used to enable HTML in category & tag descriptions - some reported it is working also with atributes, but not for me.

    remove_filter( 'pre_term_description', 'wp_filter_kses' );
    remove_filter( 'term_description', 'wp_kses_data' );


    $filters = array('pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description');
    foreach ( $filters as $filter ) {
    	remove_filter($filter, 'wp_filter_kses');
    foreach ( array( 'term_description' ) as $filter ) {
    	remove_filter( $filter, 'wp_kses_data' );

    Any ideas how to at least change the ", " (comma+space) seperator formatting to a line-break (<br />)?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic