Description

Determines whether Credit Card field will be displayed in form builder.

Parameters

$enable_cc
(bool) (Required) Determines whether field will display, default is false (do not display).

Source

wpforms/pro/includes/fields/class-payment-credit-card.php

More Information

The wpforms_field_credit_card_enable filter is applied when the form builder loads. Though the Credit Card field will by default only be available when the Stripe Addon is active, this filter can be used to enable the Credit Card field without any addon.

Example

/**
 * Determines whether Credit Card field will be displayed in form builder.
 *
 * @link   https://wpforms.com/developers/wpforms_field_credit_card_enable/
 *
 * @param  $enable_cc
 * @return bool
 */
function wpf_dev_field_credit_card_enable( $enable_cc ) {

	$enable_cc = true;
	
	return $enable_cc;
}

add_filter( 'wpforms_field_credit_card_enable', 'wpf_dev_field_credit_card_enable', 10, 1 );

Snippet Reference: How to Enable Credit Card Field Without Stripe Addon