【发布时间】:2018-04-07 22:02:45
【问题描述】:
我有一个包含这个选项的数组
$choices = array(
'-- Make a Selection --' => '',
'Choice 1' => 'Choice 1',
'Choice 2' => 'Choice 2',
'Choice 3' => 'Choice 3',
'Choice 4' => 'Choice 4',
'Choice 5' => 'Choice 5'
);
return $choices;
我需要使用自定义字段重复器(高级自定义字段)填充的选项
if(have_rows('lista_de_variables')) : while(have_rows('lista_de_variables')) : the_row();
$choice = get_sub_field('dimension');
endwhile; endif;
// this function returns an array of
// label => value pairs to be used in
// a the select field
$choices = array(
'-- Make a Selection --' => '',
$choice => $choice,
);
return $choices;
【问题讨论】:
-
尝试使用array_merge