This PR tweaks the code slightly to use wc_wp_theme_get_element_class_name() instead of hardcoding the wp-element-button class name.
The wc_wp_theme_get_element_class_name() function was added to WooCommerce Core in v7.0.1 which is below our minimum supported version so no need to check this function exists.
How to test this PR
[!NOTE]
Since we already fixed the button styling issue in a previous PR, there won't be any noticeable issues to confirm are fixed in this PR. Instead we'll just be checking our sign up buttons contain the correct class names.
Activate the 2024 default theme
Visit a simple subscription and confirm the page is styled correctly.
Inspect the Sign up button and confirm it contains the 'wp-element-button' class name:
Product impact
[ ] Added changelog entry (or does not apply)
[ ] Will this PR affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
[ ] Will this PR affect WooCommerce Payments? yes/no/tbc, add issue ref
[ ] Added deprecated functions, hooks or classes to the spreadsheet
Fixes #569
Description
In https://github.com/Automattic/woocommerce-subscriptions-core/pull/574 we merged a small change to fix the styling of our "Sign up now" on subscription product pages for stores using a block theme (i.e. 2024 default theme).
This PR tweaks the code slightly to use
wc_wp_theme_get_element_class_name()
instead of hardcoding thewp-element-button
class name.The
wc_wp_theme_get_element_class_name()
function was added to WooCommerce Core in v7.0.1 which is below our minimum supported version so no need to check this function exists.How to test this PR
'wp-element-button'
class name:Product impact