diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index 307c8c214d..2afd7ec4d2 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -387,6 +387,10 @@ jQuery(document).ready( function($) { } function updateText() { + + if ( ! $('#timestampdiv').length ) + return true; + var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'), optPublish = $('option[value="publish"]', postStatus), aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(); @@ -534,6 +538,16 @@ jQuery(document).ready( function($) { return false; }); + $('#post').on( 'submit', function(e){ + if ( ! updateText() ) { + e.preventDefault(); + $('#timestampdiv').show(); + $('#publishing-action .spinner').hide(); + $('#publish').prop('disabled', false).removeClass('button-primary-disabled'); + return false; + } + }); + $('#post-status-select').siblings('a.edit-post-status').click(function() { if ($('#post-status-select').is(":hidden")) { $('#post-status-select').slideDown('fast');