Created
July 14, 2022 07:59
-
-
Save tdmrhn/28d98bb9aa47a34ed571b29376c32686 to your computer and use it in GitHub Desktop.
Blocksy Adding/Editing Products with Gutenberg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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