Home › Forums › Backend Issues (wp-admin) › Pass data to javascript function on acf/save_post › Reply To: Pass data to javascript function on acf/save_post
When you’re acf/save_post is being called it is when the post is saved. This is the way that WP works.
1) You save your post
2) wp-admin/post.php runs to save the post, this does not create any output
3) ACF comes in here to save the custom fields
4) You are redirected back to the edit page for the post
If you want to pass data back so that is it run when the post edit page is reloaded you must save something to the database during the save, then when the post edit page is reloading you need to check for this value in the database and based on that output what you need somewhere in the page, not forgetting to remove your flag or value from the database so that it does not run on every page load.
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.