From 36cf6d64b8784af7952e810b76efc18f22334d2a Mon Sep 17 00:00:00 2001 From: Gerhard Potgieter Date: Mon, 10 Sep 2018 11:23:12 +0200 Subject: [PATCH] Check the post status and set the hidden field based on that before submitting. --- assets/js/admin/meta-boxes-product-variation.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/js/admin/meta-boxes-product-variation.js b/assets/js/admin/meta-boxes-product-variation.js index e1e7fcf8e12..44f9d486292 100644 --- a/assets/js/admin/meta-boxes-product-variation.js +++ b/assets/js/admin/meta-boxes-product-variation.js @@ -524,7 +524,11 @@ jQuery( function( $ ) { * After saved, continue with form submission */ save_on_submit_done: function() { - $( 'form#post' ).append('').submit(); + if ( $( '#hidden_post_status' ).val() !== 'publish' ) { + $( 'form#post' ).append('').submit(); + } else { + $( 'form#post' ).append('').submit(); + } }, /**