尝试使用wordpressget_posts() 相反
$user_id = 22;
$orders = get_posts( array(
\'meta_key\' => \'_customer_user\',
\'meta_value\' => $user_id,
\'post_type\' => \'shop_order\',
\'post_status\' => array_keys( wc_get_order_statuses() ),
\'numberposts\' => -1
));
echo \'<pre>\';
print_r( $orders );
echo \'</pre>\';