title: Woocommerce hook that fires after a product is updated via REST API
body: <p>I am using this hook to run some code after the product is updated:</p>
  
  <pre><code>add_action( 'updated_post_meta', 'attach_variation_images_on_product_save', 10, 4 );
  function attach_variation_images_on_product_save( $meta_id, $post_id, $meta_key, $meta_value ) {
      if ( $meta_key == '_edit_lock' ) { 
          if ( get_post_type( $post_id ) == 'product' ) {
             //do something
          }
      }
  }
  </code></pre>
  
  <p>This is working as expected, the function is executed after the product is updated. I want to run the same function when a product is getting updated via the REST API. I hooked my function to <code>woocommerce_rest_insert_product_object</code> like this but it did not work:</p>
  
  <pre><code> add_action( 'woocommerce_rest_insert_product_object', 'attach_variation_images_on_product_update_via_rest', 10, 3 ); 
  function attach_variation_images_on_product_update_via_rest( $post, $request, $true ) {
      if ( get_post_type( $post ) == 'product' ) {
          $product = wc_get_product( $post );
          //do something
      }
  }
  </code></pre>
  
  <p>Am I not using the right hook? Is there another hook I can use?</p>
  
  <p>EDIT 1: It seems that my code was not running because <code>get_post_type($post)</code> is type of <code>post</code> and not <code>product</code>. I am trying to attach an image to variations using <code>add_post_meta($variation_id, '_thumbnail_id', $image_id);</code> inside a loop. It seems the function <code>attach_variation_images_on_product_update_via_rest( $post, $request, $true )</code> is executed till the end but it does not attach the image to the variations.</p>