wc_wp_theme_get_element_class_name()WC 7.0.1

Given an element name, returns a class name.

If the WP-related function is not defined or current theme is not a FSE theme, return empty string.

No Hooks.

Return

String.

Usage

wc_wp_theme_get_element_class_name( $element );
$element(string) (required)
The name of the element.

Changelog

Since 7.0.1 Introduced.

wc_wp_theme_get_element_class_name() code WC 9.4.2

function wc_wp_theme_get_element_class_name( $element ) {
	if ( wc_current_theme_is_fse_theme() && function_exists( 'wp_theme_get_element_class_name' ) ) {
		return wp_theme_get_element_class_name( $element );
	}

	return '';
}