Enable product revisions in WooCommerce

add_filter( 'woocommerce_register_post_type_product', 'wpcb_enable_product_revisions', PHP_INT_MAX );
if ( ! function_exists( 'wpcb_enable_product_revisions' ) ) {
	/**
	 * wpcb_enable_product_revisions.
	 *
	 * @see https://wpcodebook.com/snippets/enable-product-revisions-in-woocommerce/
	 */
	function wpcb_enable_product_revisions( $args ) {
		$args['supports'][] = 'revisions';
		return $args;
	}
}

No comments yet.

Leave a Reply