WordPress身份验证过滤器运行多次

时间:2015-10-14 06:15:58

标签: wordpress authentication login filter

我目前正试图通过使用Authenticate过滤器覆盖Wordpress add_filter( 'authenticate', 'myplugin_auth_signon', 30, 3 ); function myplugin_auth_signon( $user, $username, $password ) { if(isset($_POST['wp-submit'])){ $creds = array(); $creds['user_login'] = $_POST['log']; $creds['user_password'] = $_POST['pwd']; $creds['remember'] = true; $my_error = new WP_Error(); $userid = get_user_by( 'login', $_POST['log'] ); echo $userid = $userid->ID; $meta = get_usermeta( $userid, 'is_active' ); if($meta == '0'){ echo "please verify account first |||||"; return 0; }else{ return $user; } } } ,一切看起来都很完美,但功能总是运行多次。

Machine ec-2 M3 Medium on AWS 
RAM : 4GB
DISK : 30GB
Processors : Intel Xeon E5-2670 v2 (Ivy Bridge) Processors

0 个答案:

没有答案