Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdmrhn/28d98bb9aa47a34ed571b29376c32686 to your computer and use it in GitHub Desktop.
Save tdmrhn/28d98bb9aa47a34ed571b29376c32686 to your computer and use it in GitHub Desktop.
Blocksy Adding/Editing Products with Gutenberg
<?php
add_filter('use_block_editor_for_post_type', function ($gutenproduct, $post_type) {
if($post_type == 'product'){
$gutenproduct = true;
}
return $gutenproduct;
}, 10, 2);
add_filter( 'woocommerce_taxonomy_args_product_cat', 'enable_taxonomy_rest' );
add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' );
function enable_taxonomy_rest( $args ) {
$args['show_in_rest'] = true;
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment