wordpress在一个查询中更新多个帖子

I currently have a form which loops through a custom post type, listing out all posts like this:

<form action="" method="post">   
<table width="100%" border="0">
  <tr>
    <td><strong>Variation</strong></td>
    <td><strong>Price</strong></td>
    <td><strong>Sale Price</strong></td>
   <?php if(is_plugin_active($wwp) ) { echo '<td><strong>Wholesale Price</strong></td>'; } ?>
  </tr>

<?php query_posts(array('showposts' => -1, 'post_type' => 'product_variation', /*remove'year'=> date("Y"),*/ )); while (have_posts()) : the_post(); ?>
  <tr>
    <td><?php the_title(); ?></td>
    <td><input name="regular_price[]" type="text" value="<?php echo get_post_meta(get_the_id(), "_regular_price", true); ?>" /></td>
    <td><input name="sale_price[]" type="text" value="<?php echo get_post_meta(get_the_id(), "_sale_price", true); ?>" /></td>
    <?php if(is_plugin_active($wwp)){echo '<td><input name="wholesale_price[]" type="text" value="'.get_post_meta(get_the_id(), "_wholesale_price", true).'" /></td>';}?>
    <input name="item_id[]" type="hidden" value="<?php echo get_the_id(); ?>" />

  </tr>
<?php endwhile; wp_reset_query();?> 


  <tr>
    <td align="left"><br /><input name="save" type="submit" /></td>
    <td></td>
    <td></td>
   <td></td>
  </tr>

 </table> 
</form>

I would like to save all changes made within one query (one save button, and this will save all changes). What is the best way to approach this? I am looping through the results like this:

<?php
if (isset($_POST['save'])) {

    foreach ($_POST['wholesale_price'] as $price{

           echo $price;

        //update_post_meta($ids,'_wholesale_price',$_POST['send_to']);
    };

} ?>

But i am struggling to get to get the id of the post into that foreach. I would then like to update all posts using the update_post_meta function.

Any help to point me in the right direction is greatly appreciated.

You will need to add a unique identifier / id to the end of

$_POST['send_to']

Something like this where $id = something unique for instance product id:

$_POST['send_to'][$id]