Revision history for pod fields #6666
Replies: 23 comments 1 reply
-
see https://de.wordpress.org/plugins/wp-post-meta-revisions/ maybe that's all you need ;) |
Beta Was this translation helpful? Give feedback.
-
Does it support custom post types? From reading this I'm not sure: https://wordpress.org/support/topic/custom-post-types-235?replies=1 How would I now use it for pods plugin?
|
Beta Was this translation helpful? Give feedback.
-
if anyone is looking for a way to achieve this, I've made a gist that might help someone. Good luck! |
Beta Was this translation helpful? Give feedback.
-
Hi @JimSRush and others on this thread. I added the gist mentioned above to our functions.php and custom field changes are still not triggering revisions (although title, author, and excerpt do). I have also tried these plugins, no luck: |
Beta Was this translation helpful? Give feedback.
-
@jaycollier I'd suggest you start by looking at what's happening in the Also, another thing you could try is double checking that this function is working properly, since this is the bit where it adds the list of fields to check changes against - if it's not working, it won't trigger a revision.
In this case, our pod name was 'story' so you'll need to change it to whatever the name of your pod is - apologies I didn't make this clear. I'll update the gist. |
Beta Was this translation helpful? Give feedback.
-
@jaycollier I've updated the gist with some more in depth comments - sorry about that - there's a couple of other things that you'll need to update. Please post your code here with your field names etc and I can take a closer look if you'd like? |
Beta Was this translation helpful? Give feedback.
-
Thanks, most of that makes sense to me (I missed the post type definition), except for one thing. I actually have over a dozen custom fields in the post type. Is there a method for checking and comparing that alleviates the need to duplicate those lines? (I am decidedly not a coder, just trying to fix this major problem with CPT/custom field revisions.) |
Beta Was this translation helpful? Give feedback.
-
@JimSRush thank you for doing this. I didn't expect it would take so long for the team or someone else to take note of this feature request and work something out but I'm very happy someone did that now. Haven't tested your gist yet but hope to do that soon. I hope it works out for you @jaycollier! |
Beta Was this translation helpful? Give feedback.
-
There would definitely be a way, you'd need to loop through the request object and look for object keys that start with The good thing is, you'll see it working after just one so you'll know you're on the right track. That being said, we have about 8 custom fields, so if I end up refactoring to loop through I'll post the gist here and tag you. Anyway, here's what it'll look like with multiples:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @bustapaladin ! Let me know if you hit any issues, and we can work through them and I'll update the gist/instructions if needed. edit: just to clarify, not a pods team member but part of a team using pods who had this exact need :-) |
Beta Was this translation helpful? Give feedback.
-
Hi, JimSRush. I have to admit, as a non-coder, I've not been able to grok this. I'm still disappointed that, even though Edit Pods > Advanced Options > Supports > Revisions is checked, it still doesn't include revisions of custom fields defined in Pods > Manage Fields. As I wrote before, we have a half dozen Pods custom post types, each with 5-15 custom fields, and so an ad hoc method isn't sustainable. We're looking for programmatic method, either within the Pods plug-in or an add on. I've been scouring the web for solutions and have tried each with no luck, perhaps because they were developed with earlier WP or Pods version. We're so very hopeful that this will be seen as a priority. Our multiple editors need to see what changes their colleagues made to those custom fields in the past. Pods is getting a bad name with them, and I wish it didn't, because I love it! Thanks to anyone who may have an update. |
Beta Was this translation helpful? Give feedback.
-
Hello @jaycollier This isn't supported because WordPress simply doesn't support this. You'd have to submit a ticket here: https://core.trac.wordpress.org/ but I guess there are already numerous tickets on this topic. Pods merely lets you enable revisions for post types (which is a WordPress function, not Pods). Taxonomies, Users, etc. all do not support revisions. Unless @sc0ttkclark thinks differently I'd have to mark this as out of scope. Third party plugins/solutions/integrations like created by @JimSRush are always welcome of course! UPDATE: I've marked it as "Need Votes" to let the community decide whether we look into this. |
Beta Was this translation helpful? Give feedback.
-
Thank you, Jory. We are planning to try out PublishPress Revisions Pro (it used to be Revisionary). They are already supporting ACF and the developer has support for Pods custom fields in queue. https://wordpress.org/plugins/revisionary/ -Jay |
Beta Was this translation helpful? Give feedback.
-
@jaycollier Sounds good! |
Beta Was this translation helpful? Give feedback.
-
Follow up: We've also learned about a MetaBox extension that does pretty much exactly what we're looking for. Not sure if it supports custom fields created by non-MetaBox methods. https://docs.metabox.io/extensions/mb-revision/ FYI: Sadly, not having revision history for custom fields — which we never expected — is turning into a showstopper for our clients who are pretty frustrated we chose Pods to develop our site. |
Beta Was this translation helpful? Give feedback.
-
There are solutions that can do this in a simple way for all custom fields, like this one: https://github.com/vavrecan/custom-fields-revisions That could help you in the interim since it supports Pods. |
Beta Was this translation helpful? Give feedback.
-
I'm sorry to hear that, but as you can see from all the plugins that are created for this functionality, this isn't something that is provided though WordPress core, Pods or other custom fields plugins unless specifically mentioned in the features list (I don't know of any). |
Beta Was this translation helpful? Give feedback.
-
Thank you, @sc0ttkclark. My lack of experience developing plugins may be the reason that, when I downloaded the master branch zip ("custom-fields-revisions-master.zip") from https://github.com/vavrecan/custom-fields-revisions and uploaded it, I received this error:
Perhaps someone might point out the error of my ways. |
Beta Was this translation helpful? Give feedback.
-
You have to re-zip the "custom-fields-revisions" folder from within the master zip you've downloaded or manually upload that folder with FTP. |
Beta Was this translation helpful? Give feedback.
-
Thanks so much for the obvious tip. Unfortunately, after installing and making 3 revisions to a Pods CPT, a revision appears, but not the changed custom fields. We'll keep looking. |
Beta Was this translation helpful? Give feedback.
-
A follow-up: Given the many challenges of saving revisions of custom fields in postmeta, we took another tack, using the Publish Press Revisions Pro plugin (which used to be Revisionary). It stores a revision of the entire page, including all custom fields, and provides a compare feature for the most recent revision. The developer is working on an enhancement that stores multiple revisions but, for the moment, it works well and avoids the problem in WP core. Thanks to everyone who has supported the various attempted work-arounds. |
Beta Was this translation helpful? Give feedback.
-
Given the relative seemingly relative simplicity of the 2 code solutions mentioned above I have no idea why this isn't at least a "Pods Revision" plugin! |
Beta Was this translation helpful? Give feedback.
-
Anyway, none of the code suggestions above seems to be working for WP 6.2 so I forked one of the above and fixed it (at least for viewing revisions, haven't tested restoring): https://github.com/dbareis/custom-fields-revisions There is a minor issue if you use the CSS I suggested, that is a Wordpress issue I hope to be able to workaround. |
Beta Was this translation helpful? Give feedback.
-
Pretty much what these fine folk here are asking:
https://wordpress.org/support/topic/add-revision-history-to-custom-fields?replies=2
But then for the pods plugin and the fields it creates. So if someone edits a custom field on a custom post type it tracks the changes somewhere.
Also be able to clear the history and set the limit of how much is stored ,etc..
It could be packaged as a module you can enable or disable.
Beta Was this translation helpful? Give feedback.
All reactions