woocommerce_template_loop_category_link_open()WC 1.0

Insert the opening anchor tag for categories in the loop.

No Hooks.

Return

null. Nothing (null).

Usage

woocommerce_template_loop_category_link_open( $category );
$category(int|object|string) (required)
Category ID, Object or String.

woocommerce_template_loop_category_link_open() code WC 8.6.1

function woocommerce_template_loop_category_link_open( $category ) {
	$category_term = get_term( $category, 'product_cat' );
	$category_name = ( ! $category_term || is_wp_error( $category_term ) ) ? '' : $category_term->name;
	/* translators: %s: Category name */
	echo '<a aria-label="' . sprintf( esc_attr__( 'Visit product category %1$s', 'woocommerce' ), esc_attr( $category_name ) ) . '" href="' . esc_url( get_term_link( $category, 'product_cat' ) ) . '">';
}