L
L
ligisayan2020-12-04 11:54:24
Internationalization and localization
ligisayan, 2020-12-04 11:54:24

How to update acf wordpress extra fields when loading excel spreadsheet?

Hello!
There is a site on wordpress with localization in 3 languages ​​( wmpl ), it also uses additional fields acf .

Is it possible to periodically download updated data from acf fields through an excel table (csv), comparing them by an additional id field ?

Yes, there are plugins like WP Import Export Lite and WP All Import , but I could be wrong, but none of them seems to know how to set up a filter for uploaded data comparing by acf field + I need to update data on all localized versions of posts.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Zolin, 2020-12-04
@ligisayan

I somehow looked for a solution and ended up writing by hand. In general, the logic looked like this:
1. I took the old PHPExcel library . It converts the excel file into a regular array
2. The array into a loop, in the loop through the column from the post id you get the desired field using get_post_meta()
3. Compare with the data from the table, if different, push new ones withupdate_post_meta()

O
Orkhan Hasanli, 2020-12-04
@azerphoenix

Is it possible to periodically download updated data from acf fields through an excel table (csv), comparing them by an additional id field?

I haven't seen any ready-made solutions. Unless the WP All Import plugin has the ability to add a PHP script. However, I don't know if it's enough.
And so, I propose to write your own custom solution. Artem Zolin has already answered you how this can be implemented

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question