我有this插件。它显示了来自woocommerce的所有产品,但我想显示所有已完成用户订单的产品。
// Change product query settings here
$product_posts = get_posts( array(
'post_type' => 'product',
'post_status' => 'publish',
'numberposts' => -1,
) );
// Display product options
$values = array();
foreach ( $product_posts as $product ) {
$values[] = $product->post_title;
}
建议? 谢谢!