gform_stripe_elements_style

gform_stripe_elements_style

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This filter allows styles to be used with Stripe Elements to control the look of the Credit Card field.
For more information about which styles may be applied, check out the style reference in Stripe』s documentation.
Usage
add_filter( 'gform_stripe_elements_style', 'your_function_name', 10, 2);

Parameters

$cardStyles array
Array of the current styles applied.

$formId int
The current form id.

Examples
Check out Stripe』s documentation to see what options are available for the styles.
add_filter( 'gform_stripe_elements_style', 'set_stripe_styles', 10, 2 );
function set_stripe_styles( $cardStyles, $formId){
$cardStyles['base'] = array(
'color' => 'purple',
'fontSize' => '20px',
'fontFamily' => 'Comic Sans, fantasy',
'fontSmoothing' => 'antialiased'
);
$cardStyles['invalid'] = array(
'color' => '#e5424d',
':focus' => array( 'color' => 'red' )
);
return $cardStyles;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Stripe version 2.6.
Source Code
This filter is located in GFStripe::register_init_scripts() in gravityformsstripe/class-gf-stripe.php.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注