Make WordPress Core

Changeset 55560


Ignore:
Timestamp:
03/18/2023 03:45:39 PM (2 years ago)
Author:
joedolson
Message:

Quick/Bulk Edit: Show scheduled in status for future drafts.

Change the quick edit status select to use the 'Scheduled' status instead of the 'Published' status or posts where the date is in the future.

Props ipstenu, MrFlannagan, sabernhardt, oglekler.
Fixes #38834.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/inline-edit-post.js

    r54936 r55560  
    377377
    378378        // Handle the post status.
     379        var post_date_string = $(':input[name="aa"]').val() + '-' + $(':input[name="mm"]').val() + '-' + $(':input[name="jj"]').val();
     380        post_date_string += ' ' + $(':input[name="hh"]').val() + ':' + $(':input[name="mn"]').val() + ':' + $(':input[name="ss"]').val();
     381        var post_date = new Date( post_date_string );
    379382        status = $('._status', rowData).text();
    380         if ( 'future' !== status ) {
     383        if ( 'future' !== status && Date.now() > post_date ) {
    381384            $('select[name="_status"] option[value="future"]', editRow).remove();
     385        } else {
     386            $('select[name="_status"] option[value="publish"]', editRow).remove();
    382387        }
    383388
Note: See TracChangeset for help on using the changeset viewer.