我创建了一个用户类型为user with multiselect的字段,所以当admin添加帖子时,他会选择多个用户,以便如何在自定义帖子类型循环中获取多个用户ID,这是我使用的代码
$args = array(
'post_type' => 'offers',
'orderby' => 'title',
'order' => 'ASC'
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();
echo $variable = get_field('select_user');
endwhile; endif;