Home › Forums › General Issues › Field Group Revisions
Hey folks,
We have a small team of developers working on one master set of ACF field groups. It would be great to have something like post revisions for any changes that we make. Does anyone know of an add-on or some custom code to show something like post revisions per field group?
I’m not sure if this could be a feature request or not, as I am not 100% sure how the revisions would be displayed. Maybe the field group could be displayed as a php or json array?
Thanks,
Jamie
Further to this thread, we’ve just had a client discover (to their horror) that ACF fields aren’t saved in WP revisions unless the_content field is visible and USED.
Some info on how to get around this issue —
https://www.sumydesigns.com/help-cant-find-revisions-wordpress-post-page/
Having to show the standard content field on a page where we’ve made heavy use of Flexible Content is a real pain. Having to put dummy content into the_content in order for ACF to save revisions is an even bigger one.
Is there some way around this? I realise this is more of a WP issue than ACF, but having to keep the_content on the edit page in order to save meta data revisions seems really inelegant.
Thanks in advance,
James
To the OP, I’m not sure this is possible (but I’m not the developer.) Each field group is a post and each field in the field group is also a separate post. Not at all sure how revisions would work for this or how they could possibly be shown. Probably the reason that revisions are not supported. For things like this I use a github repo to hold changes to JSON files.
To the follow up question, I just did a quick test with a field group attached to the page post type that hides the content editor and revisions are being saved and can be restored. including custom fields.
Hey John
Aside from looking in the database how do you get access to the revisions though? The revisions count/link doesn’t show unless the_content is included.
Or am I being dumb here? I searched ways of accessing the link but came up short.
Thanks
James
? It is just in the publish box. So I didn’t do anything special. I just did a quick test on pages. The site I tested it on is using the latest version of WP, ACF and Classic Editor, but nothing else. The only thing I can think of is that the post type you’re looking at does not support revisions? There are also ways that revisions can be disabled even when the post type supports them define('WP_POST_REVISIONS', false);
would do it or even define('WP_POST_REVISIONS', 0);
Hmmm odd. Yeah I know where it should be, because it appears once I enable the_content. It’s just the page post type. Latest ACF etc.
I’ve got a LOT of fields on the go but only two switched on and assigned to pages, the rest are disabled as they’re cloned into the main one, which is a flexible content field.
I’ll try those functions you mention. Thank you.
The topic ‘Field Group Revisions’ 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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.