I have a theme that imports data, creates multiple custom taxonomies and adds them to a custom post on the fly if they’re new with wp_set_post_terms($post_id, $company, 'company', false);
but now I also need to import a few more things in custom fields, but not with wp_set_post_terms apparently. Can anybody suggest a working solution be it acf specific or not?
I had to do something similar for a client once. They wanted a “product” import and in this case products was a CPT. They wanted to be able to import new product categories and set a category image when the product was imported.
I used WP All Import Pro to do the importing. In the spreadsheets the first product in a category had a column for category image. I had WPAI import this into a post meta field (not an ACF field) when it ran the import. There is an action hook in WPAI (don’t remember the exact hook) that is called after each item is imported. At this point I would test to see if the category image meta field had a value and if it did I would get the product category and update the ACF image field on the category with the image ID that was imported by WPAI and then delete the value from the post.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users