Merge pull request #15843 from woocommerce/fix/15834

Force date created on update if not set.
This commit is contained in:
Claudio Sanches 2017-06-28 11:11:40 -03:00 committed by GitHub
commit 70ae880f29
1 changed files with 5 additions and 0 deletions

View File

@ -143,6 +143,11 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
*/
public function update( &$product ) {
$product->save_meta_data();
if ( ! $product->get_date_created() ) {
$product->set_date_created( current_time( 'timestamp', true ) );
}
$new_title = $this->generate_product_title( $product );
if ( $product->get_name( 'edit' ) !== $new_title ) {