Support » Plugin: CAPTCHA 4WP - Antispam CAPTCHA solution for WordPress » ‘wpcf7_add_shortcode’ error

  • I think you still got this code which is deprecated now in your plugin and even though I am not using yours with contact 7 and use their own capcha as you recommended it is still throwing an error.

    PHP Notice: wpcf7_add_shortcode is deprecated since Contact Form 7 version 4.6! Use wpcf7_add_form_tag instead. in /home/site/public_html/wp-content/plugins/contact-form-7/includes/functions.php on line 365

Viewing 4 replies - 1 through 4 (of 4 total)
  • I am getting this same error too! If I disable your plug-in, the message goes away. I too am not using this for ReCaptcha on CF7 since it has its own built-in ReCaptcha now.

    • This reply was modified 5 years, 5 months ago by RocketSMS.
    • This reply was modified 5 years, 5 months ago by RocketSMS.

    So I was able to fix it. In anr-captcha-class.php I changed:

    			
    			if ( function_exists( 'wpcf7_add_shortcode' )) {
    					wpcf7_add_shortcode('anr_nocaptcha', array($this, 'wpcf7_form_field'), true);
    					add_filter('wpcf7_validate_anr_nocaptcha', array($this, 'wpcf7_verify'), 10, 2);
    				}
    

    To this:

    
    			if ( function_exists( 'wpcf7_add_form_tag' )) {
    					wpcf7_add_form_tag('anr_nocaptcha', array($this, 'wpcf7_form_field'), true);
    					add_filter('wpcf7_validate_anr_nocaptcha', array($this, 'wpcf7_verify'), 10, 2);
    				}
    
    Thread Starter woomad

    (@woomad)

    I did the same thing to the code. However, what puzzles me is that according to the author this plugin doesn’t support contact form 7 anymore, so what is the need for this piece of code in the plugin?

    As CF7 now has its own recaptcha plugin, this plugin does not support CF7 anymore.
    In this plugin, still have CF7 deprecated code, so that users can get time to setup CF7 build in captcha.
    Deprecated notice will only show if your debug is active. So in live site this deprecated notice will not show. Also this plugin will not do anything for CF7 if you do not use its shortcode for CF7.

    This deprecated code will be removed in next major version of this plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘‘wpcf7_add_shortcode’ error’ is closed to new replies.