Advertisement
tommyosheawebdesign

Enable Gutenburg for WooCommerce

Aug 2nd, 2021
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Add this to functions.php
  2.  
  3. // enable gutenberg for woocommerce
  4. function activate_gutenberg_product( $can_edit, $post_type ) {
  5. if ( $post_type == 'product' ) {
  6. $can_edit = true;
  7. }
  8. return $can_edit;
  9. }
  10. add_filter( 'use_block_editor_for_post_type', 'activate_gutenberg_product', 10, 2 );
  11.  
  12. // enable taxonomy fields for woocommerce with gutenberg on
  13. function enable_taxonomy_rest( $args ) {
  14. $args['show_in_rest'] = true;
  15. return $args;
  16. }
  17. add_filter( 'woocommerce_taxonomy_args_product_cat', 'enable_taxonomy_rest' );
  18. add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' );
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement