1

I'm working on setting up an import using WP All Import, the idea is to update/add/remove posts within a custom post type which contain ACF fields.

The CSV we are importing contains a column called "Feed ID" which holds data like Apple12343, Banana98799, Carrot2198379, Onion1287361 and so on.

What I want to achieve is to populate an ACF select box value that has options like 'Fruit' and 'Vegetable', depending on the Feed ID value, using XPath. So essentially I need some sort of function that will take the first part of the feed ID (letters only), then assign the select box value based on that. Is this doable?

0

Looks like you can use the Variable Repeater Mode (CSV) to import your data:

If your repeating data is stored in a single column in your CSV file, and is separated by a separator character, use this option.

Then create a custom PHP function that would break up each value into the title and ID (Apple => 12343, etc.) and call your function from the text box:

[custom_function({feed_id[1]})]

As for the last part of actually creating a select box from titles and IDs - I don't know how to do that. Hopefully someone can build on this answer. Also please share if you figured it out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.