mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
XML-RPC: Make sure editing a draft post with wp.editPost
does not unintentionally cause its published date to be set.
Props redsweater. Fixes #45322. Built from https://develop.svn.wordpress.org/trunk@45906 git-svn-id: http://core.svn.wordpress.org/trunk@45717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
27a384caa4
commit
e0adbf69ff
@ -1708,6 +1708,16 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||||||
$post['post_date_gmt'] = $this->_convert_date( $post['post_date_gmt'] );
|
$post['post_date_gmt'] = $this->_convert_date( $post['post_date_gmt'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the API client did not provide post_date, then we must not perpetuate the value that was
|
||||||
|
* stored in the database, or it will appear to be an intentional edit. Conveying it here as if
|
||||||
|
* it was coming from the API client will cause an otherwise zeroed out post_date_gmt to get set
|
||||||
|
* with the value that was originally stored in the database when the draft was created.
|
||||||
|
*/
|
||||||
|
if ( ! isset( $content_struct['post_date'] ) ) {
|
||||||
|
unset( $post['post_date'] );
|
||||||
|
}
|
||||||
|
|
||||||
$this->escape( $post );
|
$this->escape( $post );
|
||||||
$merged_content_struct = array_merge( $post, $content_struct );
|
$merged_content_struct = array_merge( $post, $content_struct );
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.3-alpha-45905';
|
$wp_version = '5.3-alpha-45906';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
Loading…
Reference in New Issue
Block a user