我有一个用户ID数组,我想获取每个用户的数据。我第一次想到编写一个经典的SQL查询,但我发现WordPress为它提供了集成函数。然而get_users(...)
只返回1个用户,但应返回3个。我做错了什么?
var_dump($targetUsersIDs);
$targetUsers = get_users([\'include\' => $targetUsersIDs]);
var_dump($targetUsers);
的输出
var_dump($targetUsersIDs);
array (size=3)
0 =>
object(stdClass)[4785]
public \'ID\' => string \'1\' (length=1)
1 =>
object(stdClass)[4784]
public \'ID\' => string \'2\' (length=1)
2 =>
object(stdClass)[4783]
public \'ID\' => string \'4\' (length=1)
开始输出
var_dump(targetUsers);
array (size=1)
0 =>
object(WP_User) ...