From dd1098e7c52ca8974eb0ff0561902e8225e66dcc Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 26 Sep 2015 03:38:25 +0000 Subject: [PATCH] XML-RPC: In `wp_xmlrpc_server::mw_newPost()`, if `$dateCreated` is not set, don't set `post_date` and `post_date_gmt`. It calls `wp_insert_post()`, which will handle it correctly. The problem was drafts being created and GMT date being set. It shouldn't be. Adds unit test. Fixes #16985. Built from https://develop.svn.wordpress.org/trunk@34572 git-svn-id: http://core.svn.wordpress.org/trunk@34536 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-xmlrpc-server.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 3011b7a8e3..8ef72f89bc 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -4931,8 +4931,8 @@ class wp_xmlrpc_server extends IXR_Server { $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); $post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT'); } else { - $post_date = current_time('mysql'); - $post_date_gmt = current_time('mysql', 1); + $post_date = ''; + $post_date_gmt = ''; } $post_category = array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 9742b455be..70dc2a0c02 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34571'; +$wp_version = '4.4-alpha-34572'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.