Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 72b0a0a

Browse files
authored
provide span wrapper for category list item name (#6574)
will enable adding text overflow of other effects that user might not want to interfere with the image element
1 parent fc753e4 commit 72b0a0a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/BlockTypes/ProductCategories.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,12 @@ protected function renderListItems( $categories, $attributes, $uid, $depth = 0 )
322322
foreach ( $categories as $category ) {
323323
$output .= '
324324
<li class="wc-block-product-categories-list-item">
325-
<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>
326-
' . $this->getCount( $category, $attributes ) . '
327-
' . ( ! empty( $category->children ) ? $this->renderList( $category->children, $attributes, $uid, $depth + 1 ) : '' ) . '
325+
<a style="' . esc_attr( $link_color_style ) . '" href="' . esc_attr( get_term_link( $category->term_id, 'product_cat' ) ) . '">'
326+
. $this->get_image_html( $category, $attributes )
327+
. '<span class="wc-block-product-categories-list-item__name">' . esc_html( $category->name ) . '</span>'
328+
. '</a>'
329+
. $this->getCount( $category, $attributes )
330+
. ( ! empty( $category->children ) ? $this->renderList( $category->children, $attributes, $uid, $depth + 1 ) : '' ) . '
328331
</li>
329332
';
330333
}

0 commit comments

Comments
 (0)