Home › Forums › General Issues › Dynamically create vcard from ACF data and download with button click? › Reply To: Dynamically create vcard from ACF data and download with button click?
You issue probably comes down to the issue of using the ‘save_post’ hook. ACF fields are saved on this hook with a priority of 10. Your filter also runs on the same hook with a priority of 10. If your action is called before the acf action is called then the acf fields have not been saved yet. This will cause errors on new posts because all of the get_field() calls will return NULL.
Increase the priority or your add_action() call to > 10
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.