AI要約
説明
wpforms_stripe_api_payment_intents_set_config_element_styleフィルターを使用すると、Stripeカード要素のスタイルオブジェクトを上書きできます。これにより、Stripeクレジットカードフィールドのフォント、色、サイズ、プレースホルダーのスタイルを調整できます。
スタイルオブジェクトは、Stripe ElementsのStyle APIに直接マッピングされるCSSライクなプロパティを使用します。baseスタイルと、complete、empty、focus、invalidなどの状態を定義できます。
| パラメーター | タイプ | 説明 |
|---|---|---|
$スタイル | array | Stripeカード要素のスタイルオブジェクト。 |
ソース
wpforms\src\Integrations\Stripe\Api\PaymentIntents.php
例
// Customize placeholder text color and font for the Stripe Card Element.
function wpf_dev_stripe_card_field_style( $styles ) {
$styles['base'] = [
'fontFamily' => 'Roboto, sans-serif',
'fontSize' => '16px',
'color' => '#333333',
'::placeholder' => [
'color' => '#b95d52',
],
];
return $styles;
}
add_filter( 'wpforms_stripe_api_payment_intents_set_config_element_style', 'wpf_dev_stripe_card_field_style' );