0

I would like to run a function after a post is saved. That function takes a .txt file thats uploaded with Advanced Custom Field file field, makes it into an array to then a json data. I want the json data to be saved into the database.

I've read on update_post_meta() and I'm assuming that that's what might be the best option.

I'm confused on where I would place this function. Is it in my theme's function.php file? Is this technically a plugin? And if so, where would it go?

Thanks for the help.

  • How familiar are you with hooks and filters? You're correct in that update_post_meta is the correct function to do the work, the problem is not where in your theme you should place it, it's a problem of when not where – Tom J Nowell Aug 12 '14 at 15:07
  • @TomJNowell not really familiar with hooks and filters. So in my case when would you say? – PhDeOliveira Aug 12 '14 at 19:11

Your Answer

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

Browse other questions tagged or ask your own question.