Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamsilverstein/41472ca2fe301b50d55d5b449410f840 to your computer and use it in GitHub Desktop.
Save adamsilverstein/41472ca2fe301b50d55d5b449410f840 to your computer and use it in GitHub Desktop.
Filter revisioned meta fields to include the `product_price` field
<?php
/**
* Enable revisions for product_price
*/
function enable_revisions_for_product_price_field( $revisioned_keys ) {
if ( ! in_array( 'product_price', $revisioned_keys ) ) {
$revisioned_keys[] = 'product_price';
}
return $revisioned_keys;
}
add_filter( `wp_post_revision_meta_keys`, `enable_revisions_for_product_price_field` );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment