Wp_login操作挂钩不起作用

时间:2018-01-29 15:38:07

标签: php wordpress

我在functions.php文件中有这个功能

add_action( 'wp_login', 'the_function', 99 );
function the_function( $login ) {
    $user = get_user_by('login',$login);
    $user_ID = $user->ID;
    //do something with the User ID
    echo "<script type='text/javascript'>alert('first authentication ran successfully for " . $user->user_email. "!')</script>";
}

一旦用户登录,它应该显示一个弹出框,但似乎根本没有发生任何事情。不确定我做错了什么。挂钩是否不会立即触发该功能?

0 个答案:

没有答案
相关问题