Do you remember when we learned how to register a custom form-tag type in a previous recipe? We used the
wpcf7_add_form_tag() function and set the third parameter to
array( 'name-attr' => true ).
We call it features of a form-tag. Contact Form 7 has a set of predefined features (listed below), and, by specifying some of them through a form-tag type declaration, you can characterize each form-tag instance of the type.
Continue reading Form-tag features →
Stripe‘s payment parameters, such as the currency or the amount of money, are decided by the
[stripe] form-tag placed in the form template. You might want to customize the parameters by changing them dynamically based on the user’s selection or some sort of calculation.
You can do it by using the
Continue reading Customizing Stripe payment parameters →
wpcf7_stripe_payment_intent_parameters filter hook like in the following coding example:
To access user input posted through a contact form, you can refer to PHP’s native global variable
Continue reading Accessing user input data →
$_POST. Besides this, Contact Form 7’s
WPCF7_Submission class provides a different data source (
$posted_data) that can be used to access user input. What are the differences between
$posted_data? And which one should you use for your purpose?
Spam protection is mission-critical for web forms. The Contact Form 7 plugin provides several types of spam protection modules to effectively block submission by spammers.
Just like other parts of Contact Form 7, its spam-filtering feature is designed to be highly customizable. In this recipe, I’ll show you how to implement a custom spam filter with simple coding examples.
Continue reading Custom spam filtering →
With Contact Form 7’s reCAPTCHA (v3) integration ability, you can protect your contact forms from spambots. Since a spambot targets everything—not only contact forms—you may also want to protect other components on your website (such as comment forms) using reCAPTCHA technology.
Fortunately, Contact Form 7’s reCAPTCHA integration is designed to be open and accessible to other components. In this recipe, I’ll tell you how you can retrieve reCAPTCHA API keys and tokens from Contact Form 7 and reuse the data within your own reCAPTCHA plugin.
Continue reading Sharing reCAPTCHA API keys and tokens →
A mail-tag has a corresponding form-tag; when an email is composed, a mail-tag in the email template is replaced with the user input value that comes through the input field represented by the corresponding form-tag.
Continue reading Customizing mail-tag replacement →
Contact Form 7 provides several kinds of user-input validation by default, including:
- Is a required field filled in?
- Does an email field have an email address in the correct format?
- Is an uploaded file in an acceptable file type and size?
You can also add your own custom validation.
Continue reading Custom validation →
The previous recipe illustrated how you can add custom form-tags simply. In this recipe, you’ll learn how to retrieve values from a form-tag and use those values in the HTML output in a form.
Continue reading Using values from a form-tag →
This is the first entry in a series of articles to help developers customize Contact Form 7.
The first topic is expanding Contact Form 7’s form-tags. As you probably know, form-tags are code in a specific format within square brackets, usually representing form controls like text input fields and submit buttons. Currently, Contact Form 7 supports 30 different types of form-tags by default.
Continue reading Adding a custom form-tag →