Print block-based css classes only on fse themes

This commit is contained in:
“Chris 2023-04-10 14:25:19 +03:00
parent 152f0d3793
commit 0bc31867a4
1 changed files with 2 additions and 2 deletions

View File

@ -527,7 +527,7 @@ function wc_current_theme_supports_woocommerce_or_fse() {
/**
* Given an element name, returns a class name.
*
* If the WP-related function is not defined, return empty string.
* If the WP-related function is not defined or current theme is not a FSE theme, return empty string.
*
* @param string $element The name of the element.
*
@ -535,7 +535,7 @@ function wc_current_theme_supports_woocommerce_or_fse() {
* @return string
*/
function wc_wp_theme_get_element_class_name( $element ) {
if ( function_exists( 'wp_theme_get_element_class_name' ) ) {
if ( wc_current_theme_is_fse_theme() && function_exists( 'wp_theme_get_element_class_name' ) ) {
return wp_theme_get_element_class_name( $element );
}