Make WordPress Core

Ticket #38834: 38834.1.diff

File 38834.1.diff, 992 bytes (added by sabernhardt, 5 years ago)

patch refreshed

  • src/js/_enqueues/admin/inline-edit-post.js

     
    348348                });
    349349
    350350                // Handle the post status.
     351                var post_date_string = $(':input[name="aa"]').val() + '-' + $(':input[name="mm"]').val() + '-' + $(':input[name="jj"]').val();
     352                post_date_string += ' ' + $(':input[name="hh"]').val() + ':' + $(':input[name="mn"]').val() + ':' + $(':input[name="ss"]').val();
     353                var post_date = new Date( post_date_string );
    351354                status = $('._status', rowData).text();
    352                 if ( 'future' !== status ) {
     355                if ( 'future' !== status && Date.now() > post_date ) {
    353356                        $('select[name="_status"] option[value="future"]', editRow).remove();
     357                } else {
     358                        $('select[name="_status"] option[value="publish"]', editRow).remove();
    354359                }
    355360
    356361                pw = $( '.inline-edit-password-input' ).prop( 'disabled', false );