如何自定义付款方式的外观
本文档仅适用于 新支付体验
为提供最高级别的安全保障,用于收集敏感支付信息的表单字段均不会直接加载到您的网站上。而是通过 is embedded on the page and its contents are loaded directly from Stripe’s servers.
This is great for security, but prevents standard CSS from being applied to the form elements (CSS does not apply to an iframe). In order to customize the appearance of the payment method elements the Elements Appearance API can be used.
To modify the Elements configuration, the following filter can be used:
<?php
/**
* Plugin Name: WP Simple Pay - Custom Elements Appearance
*/
add_filter(
'simpay_elements_config',
function( $elements ) {
// Increase the base font size of the tabs to scale the icons.
$elements['appearance']['rules']['.Tab']['fontSize'] = '24px';
// Set the font size of the tab label to "reset" the font size.
$elements['appearance']['rules']['.TabLabel']['fontSize'] = '15px';
return $elements;
}
);
The above example increases the size of the payment method icons:

Still have questions? We're here to help!
Last Modified: