【发布时间】:2016-12-13 22:44:29
【问题描述】:
我目前正在使用来自谷歌的普通 noCaptcha reCaptcha 和 WordPress 插件“密码保护”,它工作正常。仍然有一些访问者对他们必须点击“我不是机器人”感到困惑。我的站点密钥已被 Google 列入其新的隐形 reCaptcha。
我在提交按钮中添加了必要的参数:
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large g-recaptcha" data-sitekey="mySiteKey" data-callback="" data-badge="inline" value="<?php esc_attr_e( 'Log In', 'password-protected' ); ?>" tabindex="100" />
并且响应通过以下方式验证:
if ( ( $this->encrypt_password( $password_protected_pwd ) == $pwd && $pwd != '' && isset($_POST['g-recaptcha-response']) && $_POST['g-recaptcha-response'] ) || apply_filters( 'password_protected_process_login', false, $password_protected_pwd ) ) {
验证码本身已显示,但在解决验证码正确后,没有任何反应。就像我从来没有提交过按钮或者recaptcha中的回调函数没有正确回答一样。
那么,我做错了什么?或者我必须在代码中更改什么?
【问题讨论】:
标签: php wordpress callback recaptcha