Greetings !
It seems that the plugin does not include categories / terms / taxonomies in the revision , is there a way to do that ?
]]>So I just tried this and it did not work. The metadata that I am trying to store revisions of was added by CMB2, so that may mess this whole thing up.
I am on WordPress 5.1 and I added that code snippet to my functions changing the key to the real key. Should I do anything else?
]]>Does this plugin support advanced custom field?
]]>Hi,
This plugin works grate!!
We want to know how can we make functions and filters dynamic for all the custom fields.
We added this code for a single custom field revision.
//State that wp-post-meta-revisions should save our field
function add_meta_keys_to_revision( $keys ) {
$keys[] = ‘test’;
return $keys;
}
add_filter( ‘wp_post_revision_meta_keys’, ‘add_meta_keys_to_revision’ );
//Define the field on the revisions screen
function extrev_custom_fields($fields)
{
$fields[‘test’] = ‘Revision meta value’;
return $fields;
}
add_filter(‘_wp_post_revision_fields’,’extrev_custom_fields’);
//For some reason (havent looked into it) the value is in a array, just pick it out
function extrev_field( $value, $field ) {
$test = $value[0];
return $test;
}
add_filter( ‘_wp_post_revision_field_test’, ‘extrev_field’, 10, 2 );
Please let us know if we can do something to make it dynamic for all other fields.
Thanks!
Shweta
Hi,
Metadata for revisions is being collapsed into a serialised object, rather than kept in the same format as on the main post object.
This appears to be by design?
I’m not sure of the rationale for this; I’m guessing it’s an attempt to reduce the number of metadata rows, though in practice it’s likely to not have much effect as probably most meta keys aren’t multiples (at least in my experience).
However, this has a significant impact on the ability to use that data, as once serialised, it can’t be queried sensibly in SQL / wp_query, and must be deserialised before being used. It’s a general rule to avoid storing serialised data in a DB whenever possible, as it means queries can’t be done quickly in SQL, and all rows must be returned, deserialised, and the query run in code, which has many disadvantages.
In my case, I need to show historical versions of the metadata via the front-end, and I don’t want to have two versions of code to de-serialise the data if it’s a revision, it’s more logic to maintain and test. It also prevents queries on historical versions via SQL.
For my use, I’ve replaced this by code to copy the revisioned metadata from the post to revision exactly as it is on the parent post.
I suggest you adopt this approach for the plugin, as there seems to be no benefit and many drawbacks to the approach taken. Should this make it into WP core, it seems it’d be a very bad move.
So, getting to the question: is there any reason why this approach was taken, and can you switch to preserving the metadata in the same format it currently is?
]]>I’m getting this error when trying to update or publish any post of any post type.
]]>hI, we’re using this plugin and we love it. The only issue that we found is that not all revisions changes are showing on the UI on the backend of WP. We need that working and we’re willing to pay/hire you for that. Is that something that you can (or willing to ) do? Thanks
]]>Like this?
// post meta revison history BOOTING UP
function add_meta_keys_to_revision( $keys ) {
$keys[] = 'uname'; 'suspision'; 'profile_summary';
print_r($keys);
return $keys;
}
add_filter( 'wp_post_revision_meta_keys', 'add_meta_keys_to_revision' );
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Can you please include a template usage snippet in the description?
When viewing current, I want to list all revised meta for one meta field.
Thanks for creating this!
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Is it intentional that the revision of post meta is being stored as array?
Example of meta stored in DB from using the plugin – https://imgur.com/PvvVZiH
842 = post ID
843 = initial revision generated through Gravity Form
844 = current revision updated via ACF
It changes how you have to check / interact with get_post_meta when working with a revision compared to post.
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>WP Post Meta Revisions is installed, and I’ve added the filter for an array of meta_keys associated with a custom post type.
I’ve modified that meta data several times for a particular post, but the changes are not showing in the “Compare Revisions” UI for that post.
I checked the database and WP Post Meta Revisions is storing the revisions in the _postmeta table like it should, but for some reason the UI is not displaying the meta_value content differences for those revisions.
I wish it did, as this plugin is a great idea, but for now in WordPress 4.4.2 it is not working correctly.
After a quick look at /wp-admin/includes/revision.php, it almost seems like this plugin should be adding a filter for wp_get_revision_ui_diff, but I could easily be wrong about that.
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Hi,
I have a problem with this plugin, after any changes in custom meta fields when I click “Preview Post” button it shows the changes which is fine, but changes also apply to the original post as well which should not be happened.
Please help me.
Thanks & Regard
Joydeep
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Hi @adam,
Nice plugin!
What do you think about the best way to go about extending this to include Revisions ability for User Meta as well?
We want to be able to rollback changes made by mistake on user info.
Thanks,
Marc
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>hi
great plugin, are there any plans to expand this to handle other post types (ie custom post types) ?
Would be really useful.
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Many meta keys are throwing errors on line 158 for me, as there is no value found for $meta_value[0]. I have worked around it by adding an isset check.
if( isset( $meta_value[0] ) && '' !== $meta_value[0] ) {
I’m unsure if that is blocking the post meta revisions from working or not. I’m somewhat busy today, so just hacked that in as a temporary solution until I have time to check if it actually works or not.
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Is it possible to tell the plugin to store revisions of all meta keys? I realize this would be cumbersome on production machines but I’ve got a development use case where it would be helpful.
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Just tried installing and got “The plugin does not have a valid header.”
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Hi,
I installed your plugin however, I can’t get it to work. I followed you simple instructions:
function add_meta_keys_to_revision( $keys ) {
$keys[] = 'meta-key-to-revision';
return $keys;
}
add_filter( 'wp_post_revision_meta_keys', 'add_meta_keys_to_revision' );
I am trying to do this on a custom post type… is this the problem?
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Hi,
This plugin seems to be exactly what I need i.e. we have custom post types with LOTS of meta boxes/data that needs adding to the revision (not just the title!)
This appears to be working fine for us and am happy to start large scale testing – have about 1000 eager testers on a large multisite.
Can you please let me know what happens when this gets implemented into the core code? i.e. I’ll need to uninstall the plugin, and thats all? Just worried about the site crashing with duplicate functions etc.
Any idea on timescale for release? Thanks again for the timely release of this.
Alex
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>Hi,
This plugin seems to be exactly what I need i.e. we have custom post types with LOTS of meta boxes/data that needs adding to the revision (not just the title!)
This appears to be working fine for us and am happy to start large scale testing – have about 1000 eager testers on a large multisite.
Can you please let me know what happens when this gets implemented into the core code? i.e. I’ll need to uninstall the plugin, and thats all? Just worried about the site crashing with duplicate functions etc.
Any idea on timescale for release? Thanks again for the timely release of this.
Alex
https://www.ads-software.com/plugins/wp-post-meta-revisions/
]]>