provide span wrapper for category list item name (https://github.com/woocommerce/woocommerce-blocks/pull/6574)

will enable adding text overflow of other effects that user might not want to interfere with the image element
This commit is contained in:
Tomasz Tunik 2022-06-15 11:37:21 +02:00 committed by GitHub
parent 1ba3ca2ba1
commit 0dfc1ad58b
1 changed files with 6 additions and 3 deletions

View File

@ -322,9 +322,12 @@ class ProductCategories extends AbstractDynamicBlock {
foreach ( $categories as $category ) { foreach ( $categories as $category ) {
$output .= ' $output .= '
<li class="wc-block-product-categories-list-item"> <li class="wc-block-product-categories-list-item">
<a style="' . esc_attr( $link_color_style ) . '" href="' . esc_attr( get_term_link( $category->term_id, 'product_cat' ) ) . '">' . $this->get_image_html( $category, $attributes ) . esc_html( $category->name ) . '</a> <a style="' . esc_attr( $link_color_style ) . '" href="' . esc_attr( get_term_link( $category->term_id, 'product_cat' ) ) . '">'
' . $this->getCount( $category, $attributes ) . ' . $this->get_image_html( $category, $attributes )
' . ( ! empty( $category->children ) ? $this->renderList( $category->children, $attributes, $uid, $depth + 1 ) : '' ) . ' . '<span class="wc-block-product-categories-list-item__name">' . esc_html( $category->name ) . '</span>'
. '</a>'
. $this->getCount( $category, $attributes )
. ( ! empty( $category->children ) ? $this->renderList( $category->children, $attributes, $uid, $depth + 1 ) : '' ) . '
</li> </li>
'; ';
} }