Import into ACF Repeater + multichoice taxonomies field

Closed

Import WP Pro Updated 1 year ago 3 Replies

Istvan asked 1 year ago on January 2, 2024 at 9:41 am

Hello,

here is the last issue I have encountered with during importing repeater fields. My custom post type has a repeating set of fields which consists of one text field and two taxonomy fields (see 01-xml-source.jpg). I added the corresponding ACF field (02-acf-field.jpg) and tried to set up the importer. In my attempts I have found that I must use the taxonomy importers (03-import-taxonomies.jpg) in order to record any values into the ACF field (04-import-acf-repeater.jpg).

In this case in the imported post all of the taxonomy terms were added to all of the ACF-rows (see 05-result.jpg and also the content of the array). In addition, I am unable to switch of the imported taxonomy terms. But it is possible that the ACF plugin could have caused that.

Any help would be greatly appreciated.

Istvan

J

James replied Support Agent

1 year ago on January 3, 2024 at 11:35 pm

I have written a custom plugin with a helper method that will allow you to select or insert taxonomy terms in the Fegyvernem, and Korszak fields.

I have attached a screenshot showing an example screenshot of my repeater field setup (Tax1 Field, and Tax2 Field).

If you can install and activate the custom plugin, then you can use the following custom method in the importer:

[iwp428_acf_tax_field("{/alakulat-fegyvernem}", "name", "category", "yes")]

In this example:
{/alakulat-fegyvernem} is the xml node selector
"name" is the part of the term to find existing records
"category" is the taxonomy used to search
"yes" means it can create new terms.

You would need to do this for every taxonomy acf field being imported, and remove the two rows you previously added to the taxonomy section.

James

 

IP

Istvan replied

1 year ago on January 7, 2024 at 10:56 am

Hello James,

thank you for your help. I tried to implement the plugin but when I importerd the same xml file, only the 2nd taxonomy term was saved for the Korszak field.

IP

Istvan replied

1 year ago on January 7, 2024 at 11:15 am

Hi,

I've changed the ACF field settinges according to this forum topic (https://support.advancedcustomfields.com/forums/topic/acf-taxonomy-single-term-per-repeater-row/) and now your plugin works perfectly! Thanks again!