Check the post status and set the hidden field based on that before submitting.

This commit is contained in:
Gerhard Potgieter 2018-09-10 11:23:12 +02:00
parent cb693a5ccd
commit 36cf6d64b8
1 changed files with 5 additions and 1 deletions

View File

@ -524,7 +524,11 @@ jQuery( function( $ ) {
* After saved, continue with form submission
*/
save_on_submit_done: function() {
$( 'form#post' ).append('<input type="hidden" name="publish" value="1" />').submit();
if ( $( '#hidden_post_status' ).val() !== 'publish' ) {
$( 'form#post' ).append('<input type="hidden" name="save-post" value="1" />').submit();
} else {
$( 'form#post' ).append('<input type="hidden" name="publish" value="1" />').submit();
}
},
/**