在一个PHP网站(没有WordPress)我想检查当前访问者是否已经登录另一个WordPress博客(不同的文件夹或域名)。在当前域名之外检查WordPress登录
我用这个代码:
define('WP_USE_THEMES', false);
require('../wp-blog-header.php');
if(!is_user_logged_in())
{
exit('You do not have access');
}
它正常工作,如果PHP网站在这条道路
example.com/site/index.php
,但我得到错误500如果我使用它
SUBDOMAIN.example.com/index.php
define('WP_USE_THEMES', false);
require('httpS://www.example.com/wp-blog-header.php');
if(!is_user_logged_in())
{
exit('You do not have access');
}
是否有可能做一个跨域检查?