Home Forums General Issues Callback for update succes Reply To: Callback for update succes

  • update_field returns true on success and false on failure, but considers a useless update (meaning the value has not changed) failure.

    You could call update_field, and then compare the new value in $_POST to the value returned by get_field to see if the update actually took place correctly, and return a message based on that test.

    The underlying code is using WordPress’ update_metadata function; you could probably get the last MySQL error (maybe using $wpdb->last_error?) to get a more detailed error message on why an UPDATE statement failed.