我试图从灵活内容中的关系字段中获取ID,并将其推送到数组中
if (have_rows(\'studio_blocs\')) {
while(have_rows(\'studio_blocs\')) {
the_row();
$news = get_sub_field(\'studio_bio_list\');
if ($news) {
foreach($news as $item) {
$array[] = $item;
}
}
}
print_r($array);
}
就我得到这个输出的那一刻而言,我能得到一些帮助来获取ID并将其推送到我的数组中吗?Array
(
[0] =>
[1] => WP_Post Object
(
[ID] => 88
[post_author] => 1
[post_date] => 2019-11-07 14:52:40
[post_date_gmt] => 2019-11-07 13:52:40
[post_content] =>
[post_title] => Sébastien Arkange
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => sebastien-arkange
[to_ping] =>
[pinged] =>
[post_modified] => 2019-11-07 14:53:27
[post_modified_gmt] => 2019-11-07 13:53:27
[post_content_filtered] =>
[post_parent] => 0
[guid] => http://dev.mywebsite.com/?post_type=collaborateurs&p=88
[menu_order] => 8
[post_type] => collaborateurs
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
)