我有一个名为“course\\u location”的CPT字段作为带有值的复选框。当我使用
$field = get_field_object(\'course_location\');
\'<pre>searchDateArray\'; print_r($field); echo \'</pre>\';
从而生成以下数组Array (
[key] => field_56056d11c5dd6
[label] => Course Location
[name] => course_location
[_name] => course_location
[type] => checkbox
[order_no] => 3
[instructions] =>
[required] => 0
[id] => acf-field-course_location
[class] => checkbox
[conditional_logic] => Array (
[status] => 0
[rules] => Array (
[0] => Array (
[field] => null
[operator] => ==
)
)
[allorany] => all
)
[choices] => Array (
[orange-county] => Orange County
[los-angeles-county] => Los Angeles County
[test] => Test
)
[default_value] =>
[layout] => vertical
[field_group] => 29
[value] => Array (
[0] => test
)
()我如何获取[选项]数组并遍历“选项”并进行回显?
<li>$label and $name</li>
输出:洛杉矶县和洛杉矶县
输出:测试和测试