Created
October 16, 2023 16:41
-
-
Save adamsilverstein/41472ca2fe301b50d55d5b449410f840 to your computer and use it in GitHub Desktop.
Filter revisioned meta fields to include the `product_price` field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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