I have to import posts through CSV.
I have Checkbox type custom fields, Which should have multiple values. I am using csv import plugin.
Suppose, Custom field meta_key => ‘checkbox_key_name’ which has multiple ‘meta_value’
I am doing below code
$items = array_map('trim', explode(',', $v));
echo '<pre>';
print_r($items);
foreach ($items as $item) {
add_post_meta($post_id, $k, $item);
}
But it is not setting 2 checked value for Checkbox custom field
Hi @denishvachhani
ACF expects an array to be saved.
Please use the update_field function and send through an array of values to be saved as the $value param
Please also read the docs for this function before using it