小编khu*_*max的帖子

在 Woocommerce 单个产品页面中显示自定义分类

我使用以下代码向 Woocommerce 添加了一个名为“供应商”的新分类法:

// hook into the init action and call taxonomy when it fires

add_action( 'init', 'create_vendor_taxonomy', 0 );

// create and register vendor taxonomy (hierarchical)

function create_vendor_taxonomy() {

    $labels = array(
        'name'              => _x( 'Vendors', 'taxonomy general name', 'textdomain' ),
        'singular_name'     => _x( 'Vendor', 'taxonomy singular name', 'textdomain' ),
        'search_items'      => __( 'Search Vendors', 'textdomain' ),
        'all_items'         => __( 'All Vendors', 'textdomain' ),
        'parent_item'       => __( 'Parent Vendor', 'textdomain' ),
        'parent_item_colon' => __( 'Parent Vendor:', 'textdomain' ),
        'edit_item' …
Run Code Online (Sandbox Code Playgroud)

php wordpress product custom-taxonomy woocommerce

2
推荐指数
1
解决办法
5388
查看次数

标签 统计

custom-taxonomy ×1

php ×1

product ×1

woocommerce ×1

wordpress ×1