将PHP变量转换为WordPress用户登录

时间:2017-06-24 07:01:00

标签: php wordpress

我的PHP代码中有以下代码,这是在另一个使用WordPress进行博客部分的CMS中的WordPress之外完成的。

$user_info = get_logged_in_user_info($_SERVER['REMOTE_USER']);
define("USERINFO_MEMBERID", $user_info['memberid']);
define("USERINFO_USERNAME", $user_info['username']);
define("USERINFO_EMAIL", $user_info['email']);
define("USERINFO_TRIAL", $user_info['trial']);

我想使用此信息在用户进入WordPress页面时将用户登录到WordPress。

警告如果没有设置此信息,只需让他们不登录。

提前致谢。

1 个答案:

答案 0 :(得分:0)

您可以使用int登录用户信息。

N = 3