Checkbox support in the acf importer

Pending
ImportWP Pro - WordPress XML & CSV Importer ImportWP Pro - WordPress XML & CSV Importer November 11, 2020
Login to reply
James Collings Support Agent
2 weeks ago

Thank you for your input, i will look into how this works with all the checkbox field types and possibly add this in the next importwp-acf addon release.

James

Tilo Pätzold
2 weeks ago

I strongly needed for my acf import the checkbox field, where you import multiple selections in one field.

I implemented it myself and it was quite simple to do. I want to share it with everyone.

Just open the class AdvancedCustomFields class and add the following to the process method:

            case 'checkbox':

                $value = explode(',', $value);

                if (update_field($field_key, $value, $this->prefix($post_id))) {

                    return $value;

                }

                break;

The separator is a comma but you can change it to anything you want.