Below, you’ll find a detailed guide on how to add the Contact Form 7 Image Captcha Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Contact Form 7 Image Captcha Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Contact Form 7 Image Captcha Plugin and the shortcodes it provides:
"Contact Form 7 Image CAPTCHA is a vital plugin that adds an extra layer of security to your forms. It prevents spam while ensuring GDPR compliance. Compatible with both Contact Form 7 and WPForms."
- [cf7ic-demo]
Contact Form 7 Image Captcha [cf7ic-demo] Shortcode
The Contact Form 7 Image Captcha shortcode is used to invoke the CAPTCHA functionality in a form. It integrates image-based CAPTCHA to enhance form security. This shortcode calls the ‘call_cf7ic_pro’ function, which enqueues necessary styles and scripts, and generates the CAPTCHA.
Shortcode: [cf7ic-demo]
Examples and Usage
Basic example – A simple usage of the shortcode to call the Contact Form 7 Image Captcha plugin.
[cf7ic-demo /]
PHP Function Code
In case you have difficulties debugging what causing issues with [cf7ic-demo]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('cf7ic-demo', 'call_cf7ic_pro');
Shortcode PHP function:
function call_cf7ic_pro($tag)
{
wp_enqueue_style('cf7ic_style'); // Enqueue CSS
wp_enqueue_style('cf7ic_fontawesome_style'); // Enqueue CSS
wp_enqueue_script('cf7ic_script'); // Enqueue script
return cf7ic_generate_CAPTCHA();
}
Code file location:
contact-form-7-image-captcha/contact-form-7-image-captcha/includes/module-wpforms.php
Conclusion
Now that you’ve learned how to embed the Contact Form 7 Image Captcha Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply