Support

Account

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.