我对Acf Pro中的repeater字段有问题。我想检索foreach中的字段,但它给了我“null”值。
有人能帮我吗?
我的代码:
function label_text( $post_id = \'\' ) {
while( have_rows(\'description\', $post_id) ): the_row();
$description .= get_sub_field(\'label\') . get_sub_field(\'text\');
endwhile;
return $description;
}
foreach ( $query->posts as $id ) {
$label_text = label_text( $id );
$logo = get_field(\'logo\', $id);
$results[ get_the_title( $id ) ] = array(
\'id\' => $id,
\'description\' => $label_text,
\'logo\' => $logo[\'url\'],
\'type\' => get_post_type($id),
);
}