* fix inconsistent button styling with TT3

* use wc_wp_theme_get_element_class_name

* add check to be sure that wc_wp_theme_get_element_class_name function exists
This commit is contained in:
Luigi Teschio 2022-10-28 19:07:56 +02:00 committed by GitHub
parent 7dd32d73c4
commit 030ebf8142
2 changed files with 3 additions and 1 deletions

View File

@ -162,6 +162,7 @@ const AddToCartButton = ( {
aria-label={ buttonAriaLabel }
className={ classnames(
'wp-block-button__link',
'wp-element-button',
'add_to_cart_button',
'wc-block-components-product-button__button',
colorStyles.className,
@ -206,6 +207,7 @@ const AddToCartButtonPlaceholder = ( {
<button
className={ classnames(
'wp-block-button__link',
'wp-element-button',
'add_to_cart_button',
'wc-block-components-product-button__button',
'wc-block-components-product-button__button--placeholder',

View File

@ -647,7 +647,7 @@ abstract class AbstractProductGrid extends AbstractDynamicBlock {
'data-product_id' => $product->get_id(),
'data-product_sku' => $product->get_sku(),
'rel' => 'nofollow',
'class' => 'wp-block-button__link add_to_cart_button',
'class' => 'wp-block-button__link ' . ( function_exists( 'wc_wp_theme_get_element_class_name' ) ? wc_wp_theme_get_element_class_name( 'button' ) : '' ) . ' add_to_cart_button',
);
if (