Support

Account

Home Forums General Issues save_post After data import

Solved

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');
    
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.