我是wordpress中的新手,并且在任务中坚持了好几个小时而没有任何办法解决这个问题,那就是为什么我在这里......
我想基于元键和元值显示用户的排序列表,但我不知道我在搜索谷歌时出了什么问题并做了检索......
我正在尝试:
<?php
$args = array(
'fields' => 'all_with_meta',
'meta_query' => array(
array(
'key' => 'status', // the meta field (or key) we want to target
'value' => '1' // the value we want to target (optional)
)
));
$users = get_users($args);
foreach ($users as $client) {
echo '<li>' . $client->user_email . '</li>';
}
?>
并在wp meta用户表中: 的 meta_key =&GT; '状态' 和 三行的 meta_value =&gt;'1',但对于meta_value的任何值,它都显示常量结果。
请让我知道为什么我没有得到我的愿望输出...谢谢