Skip to main content

fc_checkout_header_cart_link_label_html

Type: Filter

Filters the HTML label of the checkout header cart link.

Signature​

apply_filters( 'fc_checkout_header_cart_link_label_html', $link_label_html );

Parameters​

NameTypeDescription
$link_label_htmlstringLink label html.

Since​

  • 2.0.3

Source: inc/checkout-steps.php

Examples​

add_filter( 'fc_checkout_header_cart_link_label_html',
/**
* Add item count to cart link.
*
* @param string $link_label_html Link label html.
* @return string Filtered value.
*/
function( $link_label_html ) {
$item_count = WC()->cart->get_cart_contents_count();
return $link_label_html . sprintf( _n( ' (%d item)', ' (%d items)', $item_count, 'my-theme' ), $item_count );
},
10
);