对于同一个职位,我突然有一种奇怪的行为single.php
普通用户和管理员之间的文件。
在循环开始时,我执行:
echo \'<pre dir="ltr">\';
print_r($GLOBALS[\'wp_query\']);
echo \'</pre>\';
结果是不同的。
In the case of administrator:
[queried_object_id] => 603
[request] => SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = \'test\' AND wp_posts.post_type = \'aya-bi-aya\' ORDER BY wp_posts.post_date DESC
In the case of non-administrator:
[queried_object_id] => 0
[request] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = \'aya-bi-aya\' AND (wp_posts.post_status = \'publish\') ORDER BY wp_posts.post_date DESC LIMIT 0, 10
我花了一天半的时间试图找出这种功能障碍背后的原因,但没有成功。你的时间真的很宝贵。