我正在尝试按元值查询帖子类型,但该值是数组中的 [0] 字段。
$args = array('post_type'=>'event','meta_query' => array(
array(
'key' => 'my_post_multicheckbox',
// The right value should be my_post_multicheckbox[0]
// and it's serialized
'value' => serialize($current_post_ID)
)
));
$events = new WP_Query($args);
while ($events->have_posts()):$events->the_post();
the_title();
endwhile;
wp_reset_query();
显然它没有显示任何帖子,有什么想法吗?