説明

wpforms_integrations_stripe_api_payment_intents_set_element_appearanceフィルターは、WPFormsのメールで使用される「差出人」名をカスタマイズできます。たとえば、サイト名ではなく、特定のメールテンプレート用にブランド名や特定のラベルに置き換えることができます。

このフィルターを使用して、Stripeのデフォルトの外観オブジェクトを上書きできます。オプションはStripeのElements Appearance APIに準拠しているため、サイトに合わせて色、フォント、レイアウトを調整できます。

パラメータータイプ説明
$外観arrayStripe Payment Elementの外観設定。

ソース

wpforms\src\Integrations\Stripe\Api\PaymentIntents.php

// Change Stripe Payment Element to use floating labels and a custom theme.
function wpf_stripe_payment_element_appearance() {
    return [
        'theme'  => 'stripe',
        'labels' => 'floating',
        'variables' => [
            'colorPrimary'   => '#EFC078',
            'colorText'      => '#ffffff',
            'borderRadius'   => '8px',
        ],
    ];
}
add_filter(
    'wpforms_integrations_stripe_api_payment_intents_set_element_appearance',
    'wpf_stripe_payment_element_appearance'
);

参考記事