Skip to content

Commit

Permalink
add login val
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records committed Jun 15, 2019
1 parent be9e9df commit 3ec587b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion wp-geetest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: wp-geetest
Plugin URI: https://github.com/sy-records/wp-geetest
Description: 基于极验3.0,在WordPress的登录和评论时加入极验验证。
Version: 1.0.0
Version: 1.0.1
Author: 沈唁志
Author URI: https://qq52o.me
License: Apache 2.0
Expand All @@ -25,6 +25,15 @@ function add_captcha_style(){
}
add_action('login_form','add_captcha_style');

function add_geetest_login_val() {
if (!empty($_POST)){
if (!$_POST['geetest_challenge'] || !$_POST['geetest_validate'] || !$_POST['geetest_seccode']) {
return new WP_Error('broke', __("验证未通过"));
}
}
}
add_action('login_form_login','add_geetest_login_val');

function add_login_captcha_API1(){
echo '<script>
var handlerEmbed = function (captchaObj) {
Expand Down

0 comments on commit 3ec587b

Please sign in to comment.