private function show_single_field($items, $field)
{
$key = null;
$values = array();
foreach ($items as $item) {
$item = (object) $item;
if (null === $key) {
$key = $this->find_item_key($item, $field);
}
if ('json' == $this->args['format']) {
$values[] = $item->{$key};
} else {
\WP_CLI::print_value($item->{$key}, array('format' => $this->args['format']));
}
}
if ('json' == $this->args['format']) {
echo json_encode($values);
}
}