mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://wordpress.stackexchange.com/questions/238905/adding-revision-support-to-woocommerce-product-content https://github.com/woocommerce/woocommerce/issues/2178
12 lines
360 B
Text
12 lines
360 B
Text
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' );
|