Gutenberg custom code and reviews
-
Hello,
Firstly I know Gutenberg isn’t officially supported by WooCommerce yet but I found an issue with a popular snippet that pretty much makes it work perfectly.
The code below turns the block editor and pretty much everything works apart from when the block editor is active you can no longer turn the reviews on or off under Product Data > Advanced. You can check and uncheck it and save but if you refresh the edit product screen the saves don’t take.
// enable gutenberg for woocommerce function activate_gutenberg_product( $can_edit, $post_type ) { if ( $post_type == 'product' ) { $can_edit = true; } return $can_edit; } add_filter( 'use_block_editor_for_post_type', 'activate_gutenberg_product', 10, 2 );
I have tested the other checkboxes like virtual and downloadable and they work, I have also made changes to price and other data sets in the product data box and not seen any issues when saving. It appears to only happen for this one enable reviews checkbox.
I have also replicated this on a second website to confirm it wasn’t something else.
Any ideas what’s different about this field that could be causing it not to save?
I’d appreciate your input. Thanks in advance.
- The topic ‘Gutenberg custom code and reviews’ is closed to new replies.