Home › Forums › General Issues › save_post After data import
Hello,
Per John Huebner’s advice (here), I’ve setup rows of my repeater to save some additional meta info in the database on acf/save_post to make them easier to query (which is working great, thanks John!).
Problem: I just did an import of data into the repeaters of a large number of Posts and none of those additional meta items were added into the database (so I effectively can’t query the repeaters I Imported).
Question: Is there a way for me to trigger the acf/save_post filter for all the Posts I added the repeater data for (aside from physically going to the page and clicking “Update”)?
Any help anyone can provide would be greatly appreciated, thanks!
That depends on what you are using to do the import. Are you using a plugin?
🙂 that’s what I use.
WPAI has a hook ‘pmxi_saved_post’, you can see all their hooks here http://www.wpallimport.com/documentation/advanced/action-reference/
This hook passes the post ID the same as ACF, basiclly, you just need to add the same filter to this hook the same way you add the acf/save_post hook.
Well now, that was almost too easy!
I added that action and used the exact same function as my acf/save_post filter; now I’m running an Import updating the content (which is unused) and all of the “_wp” meta entries are getting added. Thanks for your help John! Also, WPAI is great.
Hey graphix, any chance you have the function you used for acf/save_post that worked for pmxi_saved_post as well? I have the same setup (ACF and WP AI) and am hitting the same issue of triggering the acf/save_post filter for imported entries (aside from physically going to the page and clicking “Update”)?
You don’t need a new function, you just need to set your filter to run on the WPAI hook.
add_action( 'pmxi_saved_post', 'my_saved_post');
The topic ‘save_post After data import’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.