WooCommerce 产品属性分类法不再是正常分类法了吗?

WooCommerce Product Attribute Taxonomies not normal taxonomies anymore?

由于一些 WooCommerce 更新显然 WooCommerce 产品属性分类法不再列为正常分类法。 数据库 table wp_woocommerce_attribute_taxonomies 包含产品分类名称,这些名称也列为产品属性。

$attrName = 'floor';
$taxonomyName = wc_attribute_taxonomy_name( $attrName );
var_dump(taxonomy_exists( $taxonomyName ));
=> false

在之前的 WooCommerce 版本中,这工作得很好,taxonomy_exists 返回 trueglobal $wp_taxonomies; 也不再包含 WooCommerce 产品属性。

抱歉,wp_woocommerce_attribute_taxonomies table 自 (可能自 WooCommerce 版本 3 起) 以来一直没有更改,与此问题无关。

这似乎是一个来自 WordPress taxonomy_exists() 条件函数的错误,就好像您查看 wp_term_taxonomy 相关的 table 一样,您会看到分类法 pa_floor 已注册,所以问题来自WordPress。