ACF 中的多个复选框选择不起作用
Multible checkbox selection in ACF does not work
我的价值观
s1 : red
s2 : blue
s3 : green
我想 select s1 和 s2
update_field( "eigenschaften_sicherheit", array("s2", "s1"), 5268 );
此代码仅设置最新的 s2
值而不是 s1
例如,此代码只会 select s3
update_field( "eigenschaften_sicherheit", array("s1", "s3"), 5268 );
docs这样说
// save a checkbox or select value
$field_key = "field_1234567";
$value = array("red", "blue", "yellow");
update_field( $field_key, $value, $post_id );
有什么想法我的代码有什么问题吗?
我明白了。我使用的是字段名称,而不是字段键。
信息:
要查看字段键,在编辑字段组时,单击“屏幕选项”(右上角)并选中“字段键”选项。
我的价值观
s1 : red
s2 : blue
s3 : green
我想 select s1 和 s2
update_field( "eigenschaften_sicherheit", array("s2", "s1"), 5268 );
此代码仅设置最新的 s2
值而不是 s1
例如,此代码只会 select s3
update_field( "eigenschaften_sicherheit", array("s1", "s3"), 5268 );
docs这样说
// save a checkbox or select value
$field_key = "field_1234567";
$value = array("red", "blue", "yellow");
update_field( $field_key, $value, $post_id );
有什么想法我的代码有什么问题吗?
我明白了。我使用的是字段名称,而不是字段键。
信息: 要查看字段键,在编辑字段组时,单击“屏幕选项”(右上角)并选中“字段键”选项。