우커머스 – 상품 편집에서 블록 에디터 사용하기

방법 1. 사이트팩 워커 사용

방법2. 스니펫 사용

<?php
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",
    20,
    2
);

// enable taxonomy fields for woocommerce with gutenberg on
function enable_taxonomy_rest($args)
{
    $args["show_in_rest"] = true;
    return $args;
}
add_filter("woocommerce_taxonomy_args_product_cat", "enable_taxonomy_rest");
add_filter("woocommerce_taxonomy_args_product_tag", "enable_taxonomy_rest");