WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Advanced custom fields acf_save_post hook in one of my functions. In that function I use the add_post_meta function. Does this call acf_save_post again and cause an endless loop?


share|improve this question
How about posting a link to the plugin you're talking about? Also please look at the WYSIWG editor and try to find the "code format" button. Thanks. – kaiser Nov 1 '12 at 20:16
This would be better suited for the ACF forums - Elliot (the main dev) can probably help you quicker than someone unfamiliar with the intricacies of the plugin. – Zach Nov 1 '12 at 20:29
Thanks, I will ask Elliot. Just checking to see if it was possible because my database is crashing a lot more than it should, so I feel there is a loop somewhere. – tyler Nov 1 '12 at 20:56
up vote 0 down vote accepted

add_post_meta doesn't call the same hook again but there are some other functions such as wp_update_post which call the hook again. In case it is going into infinite loop you'll have to call remove_action inside the function to not make it recursive

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.