gform_square_card_style

gform_square_card_style

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This filter allows you to pass CSS-like properties and values to Square to control the look of the Square field.
For more information about which styles may be applied, check out the style reference in Square』s documentation.
Usage
1add_filter( 'gform_square_card_style', 'your_function_name', 10, 2 );

Parameters

$default_styles array
Array that contains css properties and their values, property names and values should match inputStyle documentation here.

$form_id int
The current form id.

Examples
Changes the card details field background to black and text color to white.
123456add_filter( 'gform_square_card_style', 'change_style', 10, 2 );function change_style( $default_styles, $form_id ) {    $default_styles['backgroundColor'] = '#000000';    $default_styles['color'] = '#ffffff';    return $default_styles;}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Square version 1.0.
Source Code
This filter is located in GF_Square::register_init_scripts() in gravityformssquare/class-gf-stripe.php.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註