Skip to content

Instantly share code, notes, and snippets.

@lukecav
Created August 14, 2018 13:50
Show Gist options
  • Save lukecav/6a99b1e58e0176c13ec8eb2c9d2daa64 to your computer and use it in GitHub Desktop.
Save lukecav/6a99b1e58e0176c13ec8eb2c9d2daa64 to your computer and use it in GitHub Desktop.
Enable revisions on products in WooCommerce
add_filter( 'woocommerce_register_post_type_product', 'wc_modify_product_post_type' );
function wc_modify_product_post_type( $args ) {
$args['supports'][] = 'revisions';
return $args;
}
@TomasHurtz
Copy link

I was not able to get that snippet working. Instead I used this

// allow product revisions
function pddwc_enable_product_revisions() {
    add_post_type_support('product', 'revisions');
}
add_action('init', 'pddwc_enable_product_revisions', 100);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment