I’m struggling with this and the documentation doesn’t really make it clear…
I have the following field types in a field group placed on a Taxonomy “company”…
How do I save values in to those checkboxes?
$org_id_prefixed = 'company_'. $organisation->term_id; already gives the prefixed ID.
Elsewhere, I’m successfully using the following to save to a Checkbox that is NOT in a Group…
// Save "tags" (array) in ACF "org_tags" (checkbox) update_field('org_tags', $json_string->tags, $org_id_prefixed);
What I want to save to
Most of the documentation around
update_sub_field refers to Repeater. I’m unclear if I need to use
array(‘org_categories’, 1, ‘org_cat_sector’), // Selector
$json_string->category->industryGroup, // Value
$org_id_prefixed // Object ID
… results in PHP throwing:
( ! ) Warning: Invalid argument supplied for foreach() in /home/myfolder/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-checkbox.php on line 490
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.