Woocommerce有两种属性类型(text,select)!
如何添加新属性类型复选框
我宁愿不使用插件:)
提示:如果您想将其添加到函数中.php或者我更喜欢使用单个责任模式拆分我的代码,然后创建类并实例化它。
add_filter("product_attributes_type_selector" , function( $array ){
$array["checkbox"] = __( 'Checkbox', 'woocommerce' );
return $array ;
});