Home › Forums › Front-end Issues › No revision when update from front end › Reply To: No revision when update from front end
My code’s not bullet proof for sure, but given a certain environment+process, it should work. So I’ll attempt to describe my setup to see if we differ.
First. Do not use the wp-post-meta-revisions
plugin. Even if you don’t use its required filter, I fear it creates a race condition with ACF. There may be a more elegant way to tie the two plugins together but I couldn’t find one. This could be an issue if it ever becomes part of core.
Ok, so as far as front end EDITS, acf_form_head()
must come before get_header()
as explained here. In fact, that basic code example should be all you need. I haven’t tested this where a specific post_id is passed to acf_form’s post_id argument although that should work too.
My code is only intended to be ran while processing an acf_form()
so it assumes $_POST['acf']
will exist.
As far as your 3 revisions, wordpress is kinda funny. I tested on a clean wordpress install with no plugins and the twentyfifteen theme and when you create a new post and publish, you won’t see the revisions meta box. Then if you change the content, title or except and click update, the revisions meta box will show (if you have it in screen options) and two revisions will be there. They are your first ‘publish’ and first ‘update’. This doesn’t explain why you see 3 after your first front end edit. Perhaps you could share more about your setup.
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.