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:
parent
c2603744aa
commit
69692d50cb
|
@ -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'] ) ) {
|
||||
$aa = $post_data['aa'];
|
||||
$mm = $post_data['mm'];
|
||||
|
|
|
@ -449,6 +449,13 @@ window.wp = window.wp || {};
|
|||
};
|
||||
|
||||
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);
|
||||
|
||||
// Make Ajax request.
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @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.
|
||||
|
|
Loading…
Reference in New Issue