联系ACF支持,以下是我得到的:
我已经做了进一步的实验,对于Q1,我提出了一个递归函数,它为所有由
field_
和自定义命名空间,
that way I can define my ACF fields with simple keys (eg "url") and have them automatically converted to a proper value before the ACF gets generated.
function my_acf_key_prefix(&$value, $key)
{
if ($key == \'key\') {
$value = \'field_myacf_\' . $value;
}
}
array_walk_recursive($acf_definition, \'my_acf_key_prefix\');
acf_add_local_field_group($acf_definition);
对于Q2,结果是
there is still an impact of using fields with the same key within repeaters: 这与外部中继器的行为基本相同,
each field with a given key is assigned a given ACF configuration, 这有
no impact for fields such as "text" 但是,由于没有对其进行处理
if you use processed fields with the same key but different config you have an issue (例如,如果使用具有相同键但不同“选项”配置的多个“选择”字段,则UI中存在渲染问题,其中仅应用了1个字段配置,因此渲染的选项不匹配)。