Home Forums Backend Issues (wp-admin) Update ACF fields in WordPress admin using Ajax Reply To: Update ACF fields in WordPress admin using Ajax

  • Your AJAX function is updating the values in the database but this will not show these updated values without doing something more. You are expecting the live page to automatically be updated but that will never happen.

    1) Refresh the page

    2) Return all of the updated field values in the response and a JSON array (field key => value pairs) and they in your jQuery code for success: update the values on the page using the ACF JS API

    In fact, you should not be updated the database values at all, you should be requesting the values for the post and populating the fields and then letting ACF do the updating when the post is saved, it’s going to happen anyway a second time. The only think you’re accomplishing by updating it is slowing the response time down.