gform_square_card_style

This filter was removed from the Square Add-On and is no longer supported. From Gravity Forms Square Add-On version 1.7, the look of the Square field can be managed via the gform_square_card_details_style filter.

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

add_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.

add_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.