Skip to content

Instantly share code, notes, and snippets.

@Muetze42
Last active March 29, 2022 20:52
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 Muetze42/dd86af9a96506ad60d074331383124e2 to your computer and use it in GitHub Desktop.
Save Muetze42/dd86af9a96506ad60d074331383124e2 to your computer and use it in GitHub Desktop.
WordPress WooCommerce: Add Revisions For Products
<?php
add_filter( 'woocommerce_register_post_type_product', 'wc_add_revision_support' );
function wc_add_revision_support( $args ) {
$args['supports'][] = 'revisions';
return $args;
}
function wpcodex_add_excerpt_support_for_pages() {
add_post_type_support( 'product', 'revisions' );
}
add_action( 'init', 'wpcodex_add_excerpt_support_for_pages' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment