When I manually make a post revision using wp_save_post_revision( $post_id ); the revision history appears to show all the ACF fields associated with that post as being empty. Yet if we restore the revision, the ACF fields are not empty. It appears the fields are thought by the diff checker to be empty, even though they are not.
I’m wondering if this is something to do with how keys are handled in ACF? Because AFAIK the data is there in the meta data. And to be clear if there are 20 ACF fields, it shows them all as changed (cleared of values) even though none have changed, so it’s not just happening sometimes, it’s every single field across the board.
I am having a similar problem, only this is happening to me (randomly, it seems) when a post is saved in the WordPress admin. A new revision is created, but it shows that all the custom fields have been emptied, when they haven’t been. Publishing the post again puts all the custom field values back in a new revision.
@goldhat did you ever discover the root cause of your issue?
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users