title: Scheduling wp_cron job to update products meta daily
body: <p>I get scrap price in woocommerce product backend these price I want to save in database.
  Currently price change in backend but till we update product meta not update in database.
  If update product daily that will save scraped values daily in database.<br>
  I see an example how to update post with wp_cron <a href="https://wordpress.stackexchange.com/questions/112767/scheduling-posts-to-update-once-per-day-with-wp-cron">https://wordpress.stackexchange.com/questions/112767/scheduling-posts-to-update-once-per-day-with-wp-cron</a>
  but this not working for me anymore.</p>
  
  <p>Here is my code in theme functions.php</p>
  
  <pre><code>    if( !wp_next_scheduled( 'update_products' ) ) {  
         wp_schedule_event( time(), 'daily', 'update_products' );  
      }  
  
      add_action( 'update_products', 'update_product_meta' ); 
  
  add_action( 'update_post_meta', 'update_product_meta', 10, 3 );
  function update_product_meta($meta_id, $post_id, $meta_key, $meta_value) {
      global $post;
  $active = array( 
      'post_type'=&gt;'product',
      'posts_per_page'=&gt;'-1',
      'post_status '=&gt; 'publish',
  
  );
  $query   = new WP_Query($active);
  if ($query-&gt;have_posts()) {
      while ($query-&gt;have_posts()) {
          $query-&gt;the_post();
              $update =  get_the_ID();
  
  
              update_product_meta( $update );
      }
  }
  wp_reset_postdata();
  
  }
  </code></pre>
  
  <p>Please Help me to set auto update of products!
  Thanks in Advance!</p>