-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editing ACF fields then Publish ignores changes #1
Comments
Excellent! |
I fixed this (if you have ACF) by changing the hook to |
@thegaffney Will this change continue to work without ACF? If so, care to create a PR? Thanks for looking into a workable solution! |
I'd imagine no, but I think you could just do a simple check like this to see if ACF is installed
That change still works with ACF, but I won't be able to test it on a site without it, but it seems like it would be the correct way to do it. Then of course have two on_publish_post functions, one for ACF users |
Thanks for the help @thegaffney. I had to modify your changes a bit to make it work with scheduled posts. Will get this up onto WP.org. |
Yeah no problem! Glad I could help, thanks for making it in the first place
…________________________________
From: jamiechong <[email protected]>
Sent: Wednesday, May 31, 2017 2:49 PM
To: jamiechong/revisionize
Cc: thegaffney; Mention
Subject: Re: [jamiechong/revisionize] Editing ACF fields then Publish ignores changes (#1)
Thanks for the help @thegaffney<https://github.com/thegaffney>. I had to modify your changes a bit to make it work with scheduled posts. Will get this up onto WP.org.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AIfuRjvti8JPFXD1g-N3Wd9JWUhqAuExks5r_eBrgaJpZM4Khg41>.
|
Result: The revision is published, but the ACF fields aren't.
Reason:
transition_post_status
hook fires too early. The revision$post
content has been saved, but itsmeta fields
have not (they're saved shortly after). So themeta fields
of the revision aren't updated when wecopy_post
over top of the original.Fix: Need to hook into an action later on. Possibly publish_post.
Work Around
The text was updated successfully, but these errors were encountered: