woocommerce_template_loop_category_link_open()WC 1.0

Insert the opening anchor tag for categories in the loop.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

woocommerce_template_loop_category_link_open( $category );
$category(int|объект|строка) (обязательный)
Category ID, Object or String.

Код woocommerce_template_loop_category_link_open() WC 8.7.0

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' ) ) . '">';
}