📜  wp 获取产品的所有变体 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:40.432000             🧑  作者: Mango

代码示例1
$product = wc_get_product($product_id);
$variations = $product->get_available_variations();
$variations_id = wp_list_pluck( $variations, 'variation_id' );