I just found out that when I removed a Repeater item that WP did not save a Revision. I then tried adding a Repeater item and it still did not save a Revision. However, if I change the content within the Repeater item it does save a Revision. If I added a new Repeater Item then change the content in the item it did save the Revision.
I tested it many times even with other Plugins disabled and still got the same results.
While this might not be a large issue as Revisions are saved when content is changed it does mean that you can loose revisions based on layout when using the default values from repeater items. I think a revision should be created when the row number changes for repeater items.
If this is not possible to do in an Update, could someone offer some code that can achieve this.
I just started working the forums so hopefully you won’t have to go on a bump-frenzy anymore. We’re now a few people that will support you guys.
I’m not sure wether this should fall on ACF or WP Core. Triggering revisions saving in an edit-post screen is done by WP Core and it would seem it does not react to the creation of new input fields (not so strange).
I’m not sure there’s a possibility to even trigger revisions manually? That’d be a necessity if ACF would take a stab at it.
Have you tried this plugin? I haven’t looked at it closely but perhaps it does what you want: https://github.com/adamsilverstein/wp-post-meta-revisions
I agree with you but I’m not sure how one would tackle this. It’d be one thing if there was a way to manually trigger a revision save but there doesn’t seem to be one (from my findings).
Let me know if you find such a way, then we’d be able to actually do something about it!
wp_save_post_revision( $post_id );
That function will save a revision, combined with add_action( ‘save_post’, ‘FUNCTION ) it could be used to force a revision to save. Though wp_save_post_revision still checks if it should save (if any changes are present) you can filter a positive response using filter “wp_save_post_revision_post_has_changed”.
A complete solution would require some testing, it’s easy to end up with duplicate revisions or other issues.
I found this post when researching a different problem, when I manually make revisions that are essentially a clone of the current post all the ACF fields show in the revision history as changed even though they are not changed.
The topic ‘Adding/Removing Repeater rows does not save a Revision’ is closed to new replies.
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!