Site icon Hip-Hop Website Design and Development

Enable Gutenberg for Woocommerce

Via a php snippet I have enabled Gutenberg for Woocommerce. Works perfect but sometimes when I want edit product, I get a white screen on some product pages. Any idea how this happen? (Could be a JS conflict?) I’m not sure or there is a better way to enable the Gutenberg editor for Woocommerce or this a little bit unstable tweak.

WP vers: 5.8.2

PHP ver: 7.4.26

   if($post_type == 'product'){
       $can_edit = true;
   }
   
   return $can_edit;
}
add_filter('use_block_editor_for_post_type', 'wplook_activate_gutenberg_products', 10, 2);```