Ticket #19733: patch-core-19733.diff

File patch-core-19733.diff, 2.4 KB (added by koke, 17 months ago)
Line 
1Index: wp-includes/class-wp-xmlrpc-server.php
2===================================================================
3--- wp-includes/class-wp-xmlrpc-server.php      (revision 44854)
4+++ wp-includes/class-wp-xmlrpc-server.php      (working copy)
5@@ -495,7 +495,7 @@
6                        $page_date_gmt = mysql2date('Ymd\TH:i:s', $page->post_date_gmt, false);
7 
8                        // For drafts use the GMT version of the date
9-                       if ( $page->post_status == 'draft' )
10+                       if ( in_array( $page->post_status, array( 'draft', 'pending', 'auto-draft' ) ) )
11                                $page_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page->post_date ), 'Ymd\TH:i:s' );
12 
13                        // Pull the categories info together.
14@@ -761,7 +761,7 @@
15                        $page_list[$i]->date_created_gmt = new IXR_Date($post_date_gmt);
16 
17                        // For drafts use the GMT version of the date
18-                       if ( $page_list[$i]->post_status == 'draft' ) {
19+                       if ( in_array( $page_list[$i]->post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) {
20                                $page_list[$i]->date_created_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page_list[$i]->post_date ), 'Ymd\TH:i:s' );
21                                $page_list[$i]->date_created_gmt = new IXR_Date( $page_list[$i]->date_created_gmt );
22                        }
23@@ -2780,7 +2780,7 @@
24                        $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false);
25 
26                        // For drafts use the GMT version of the post date
27-                       if ( $postdata['post_status'] == 'draft' )
28+                       if ( in_array( $postdata['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) )
29                                $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ), 'Ymd\TH:i:s' );
30 
31                        $categories = array();
32@@ -2906,7 +2906,7 @@
33                        $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false);
34 
35                        // For drafts use the GMT version of the date
36-                       if ( $entry['post_status'] == 'draft' )
37+                       if ( in_array( $entry['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) )
38                                $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' );
39 
40                        $categories = array();
41@@ -3157,7 +3157,7 @@
42                        $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false);
43 
44                        // For drafts use the GMT version of the date
45-                       if ( $entry['post_status'] == 'draft' )
46+                       if ( in_array( $entry['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) )
47                                $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' );
48 
49                        $struct[] = array(