wc_get_account_menu_item_classes()WC 2.6.0

Get account menu item classes.

Hooks from the function

Return

String.

Usage

wc_get_account_menu_item_classes( $endpoint );
$endpoint(string) (required)
Endpoint.

Changelog

Since 2.6.0 Introduced.

wc_get_account_menu_item_classes() code WC 9.4.2

function wc_get_account_menu_item_classes( $endpoint ) {
	$classes = array(
		'woocommerce-MyAccount-navigation-link',
		'woocommerce-MyAccount-navigation-link--' . $endpoint,
	);

	if ( wc_is_current_account_menu_item( $endpoint ) ) {
		$classes[] = 'is-active';
	}

	$classes = apply_filters( 'woocommerce_account_menu_item_classes', $classes, $endpoint );

	return implode( ' ', array_map( 'sanitize_html_class', $classes ) );
}