Use GMT in XML-RPC dateCreated fields. Props Joseph Scott. fixes #4158 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
eb2b42e800
commit
be8f80d6d2
18
xmlrpc.php
18
xmlrpc.php
|
@ -202,7 +202,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
$allow_pings = ("open" == $page->ping_status) ? 1 : 0;
|
||||
|
||||
// Format page date.
|
||||
$page_date = mysql2date("Ymd\TH:i:s", $page->post_date);
|
||||
$page_date = mysql2date("Ymd\TH:i:s", $page->post_date_gmt);
|
||||
|
||||
// Pull the categories info together.
|
||||
$categories = array();
|
||||
|
@ -423,7 +423,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
SELECT ID page_id,
|
||||
post_title page_title,
|
||||
post_parent page_parent_id,
|
||||
post_date
|
||||
post_date_gmt
|
||||
FROM {$wpdb->posts}
|
||||
WHERE post_type = 'page'
|
||||
ORDER BY ID
|
||||
|
@ -432,10 +432,10 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
// The date needs to be formated properly.
|
||||
$num_pages = count($page_list);
|
||||
for($i = 0; $i < $num_pages; $i++) {
|
||||
$post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date);
|
||||
$post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date_gmt);
|
||||
$page_list[$i]->dateCreated = new IXR_Date($post_date);
|
||||
|
||||
unset($page_list[$i]->post_date);
|
||||
unset($page_list[$i]->post_date_gmt);
|
||||
}
|
||||
|
||||
return($page_list);
|
||||
|
@ -1033,7 +1033,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
if (!empty($dateCreatedd)) {
|
||||
$dateCreated = $dateCreatedd->getIso();
|
||||
$post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
|
||||
$post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
|
||||
$post_date_gmt = iso8601_to_datetime($dateCreated. "Z", GMT);
|
||||
} else {
|
||||
$post_date = current_time('mysql');
|
||||
$post_date_gmt = current_time('mysql', 1);
|
||||
|
@ -1223,7 +1223,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
if (!empty($dateCreatedd)) {
|
||||
$dateCreated = $dateCreatedd->getIso();
|
||||
$post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
|
||||
$post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
|
||||
$post_date_gmt = iso8601_to_datetime($dateCreated . "Z", GMT);
|
||||
} else {
|
||||
$post_date = $postdata['post_date'];
|
||||
$post_date_gmt = $postdata['post_date_gmt'];
|
||||
|
@ -1263,7 +1263,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
|
||||
if ($postdata['post_date'] != '') {
|
||||
|
||||
$post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']);
|
||||
$post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt']);
|
||||
|
||||
$categories = array();
|
||||
$catids = wp_get_post_categories($post_ID);
|
||||
|
@ -1331,7 +1331,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
|
||||
foreach ($posts_list as $entry) {
|
||||
|
||||
$post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']);
|
||||
$post_date = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']);
|
||||
$categories = array();
|
||||
$catids = wp_get_post_categories($entry['ID']);
|
||||
foreach($catids as $catid) {
|
||||
|
@ -1516,7 +1516,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
|
||||
foreach ($posts_list as $entry) {
|
||||
|
||||
$post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']);
|
||||
$post_date = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']);
|
||||
|
||||
$struct[] = array(
|
||||
'dateCreated' => new IXR_Date($post_date),
|
||||
|
|
Loading…
Reference in New Issue