我有一个非常标准的脚本,用于查找预览或报告(自定义帖子类型),其中包含针对它们存储的数据(序列化数组),其形式为guid
.
guid显示在我的报告中,而不显示在预览中(这是为了捕获失败)。
但是,当我运行脚本进行预览时get_posts
返回一篇似乎是最新发布的文章。
$args = array(
"post_type" => array($type),
"posts_per_page" => 1,
"post_status" => "publish",
"orderby" => "date",
"order" => "DESC",
"meta_query" => array(
"key" => "_fixtures",
"value" => $fixguid, // IN THIS CASE IT SHOULD BE 12AB1324
"compare" => "="
)
);
$posts = get_posts($args);
return $posts;
报告(包含元数据
12AB1324
) 已成功返回,但预览将返回值为的最新故事
12AB3136
.
我想我的问题是:
Why does get_posts meta query return
a) the latest post and
b) a post with a guid that doesn\'t =
the given key
parameter.
谢谢