如何从 Contact form 7 google recaptcha 更改验证码错误语言?
How to change captcha error language from Contact form 7 google recaptcha?
如果在联系表 7 中未选中,我们如何更改验证码错误消息?
Please verify that you are not a robot.
我正在使用 C7 的默认 Google 验证码集成方法。有什么方法可以在不编辑插件文件的情况下过滤这些消息吗?
一个站点使用 Ceceppa Multilingua 提供英语和法语翻译,而另一个站点仅提供法语。
经过不断的研究,找到了解决办法
<?php $err_mg = (get_lang() === 'en') ? "Sorry, captcha not solved. Please try again." : "S\'il vous plaît vérifier l\' Captche."; ?>
jQuery(document).ready(function(){
jQuery('.wpcf7').on('.wpcf7:spam', function(event){
jQuery('.wpcf7-recaptcha').append('<span class="captcha-error"><?=$err_mg?></span>');
jQuery('.captcha-error').css('color','red');
setTimeout(function(){
jQuery('.captcha-error').remove();
}, 5000);
});
});
有新的自定义事件用于联系表 7。
新 jQuery 自定义事件触发器
- wpcf7:invalid
- wpcf7:spam
- wpcf7:mailsent
- wpcf7:mailfailed
- wpcf7:submit
如果在联系表 7 中未选中,我们如何更改验证码错误消息?
Please verify that you are not a robot.
我正在使用 C7 的默认 Google 验证码集成方法。有什么方法可以在不编辑插件文件的情况下过滤这些消息吗?
一个站点使用 Ceceppa Multilingua 提供英语和法语翻译,而另一个站点仅提供法语。
经过不断的研究,找到了解决办法
<?php $err_mg = (get_lang() === 'en') ? "Sorry, captcha not solved. Please try again." : "S\'il vous plaît vérifier l\' Captche."; ?>
jQuery(document).ready(function(){
jQuery('.wpcf7').on('.wpcf7:spam', function(event){
jQuery('.wpcf7-recaptcha').append('<span class="captcha-error"><?=$err_mg?></span>');
jQuery('.captcha-error').css('color','red');
setTimeout(function(){
jQuery('.captcha-error').remove();
}, 5000);
});
});
有新的自定义事件用于联系表 7。
新 jQuery 自定义事件触发器
- wpcf7:invalid
- wpcf7:spam
- wpcf7:mailsent
- wpcf7:mailfailed
- wpcf7:submit