この配列内のWP_UserオブジェクトからIDを取得するにはどうすればよいですか。
Array
(
[0] => Array
(
[lid] => WP_User Object
(
[data] => stdClass Object
(
[ID] => 24
[user_login] => John Foo
[user_pass] => $P$BP0Qa4
[user_nicename] => john-foo
[user_email] => johnfoo@gmail.com
[user_url] =>
[user_registered] => 2012-10-10 11:16:24
[user_activation_key] =>
[user_status] => 0
[display_name] => John Foo
)
[ID] => 24
[caps] => Array
(
[commissie] => 1
)
[cap_key] => sa_wp_capabilities
[roles] => Array
(
[0] => commissie
)
[allcaps] => Array
(
[edit_posts] => 1
[read] => 1
[level_1] => 1
[level_0] => 1
[delete_posts] => 1
[commissie] => 1
)
[filter] =>
)
[lid_rol] => Voorzitter
)
)
そして、私は次のコードを使用します:
<?php
$rows = get_field('commissie_lid');
if($rows)
{
foreach($rows as $row)
{
$values = get_field('commissie_lid');
if($values)
{
echo '<ul>';
foreach($values as $value)
{
foreach ($value['lid'] as $liddata) {
echo $liddata->ID;
}
// allways good to see exactly what you are working with
echo '<pre>';
print_r($values);
echo '</pre>';
}
echo '</ul>';
}
}
}
?>
これはユーザーIDを返しますが、次の多くの通知も返します。
注意:で非オブジェクトのプロパティを取得しようとしています
誰かが私を助けることができますか?