Quick/Bulk Edit: Don't set publish date when editing drafts.

Ensure that quick edit does not define a publish date if the post status is one of 'draft', 'pending', or 'auto-draft'.

Props uxtremist, SergeyBiryukov, Denis-de-Bernardy, jane, rfischmann, mista-flo, rutviksavsani, oglekler, joedolson.
Fixes #19907.
Built from https://develop.svn.wordpress.org/trunk@56022


git-svn-id: http://core.svn.wordpress.org/trunk@55534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2023-06-25 15:20:22 +00:00
parent c2603744aa
commit 69692d50cb
4 changed files with 13 additions and 2 deletions

View File

@ -169,6 +169,10 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
} }
} }
if ( isset( $post_data['edit_date'] ) && 'false' === $post_data['edit_date'] ) {
$post_data['edit_date'] = false;
}
if ( ! empty( $post_data['edit_date'] ) ) { if ( ! empty( $post_data['edit_date'] ) ) {
$aa = $post_data['aa']; $aa = $post_data['aa'];
$mm = $post_data['mm']; $mm = $post_data['mm'];

View File

@ -449,6 +449,13 @@ window.wp = window.wp || {};
}; };
fields = $('#edit-'+id).find(':input').serialize(); fields = $('#edit-'+id).find(':input').serialize();
var status = $(':input[name="_status"]').val();
if ( [ 'draft', 'pending', 'auto-draft' ].includes( status ) ) {
params.edit_date = 'false';
}
params = fields + '&' + $.param(params); params = fields + '&' + $.param(params);
// Make Ajax request. // Make Ajax request.

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.3-alpha-56021'; $wp_version = '6.3-alpha-56022';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.