Ticket #16985: 16985-with-pages.diff
File 16985-with-pages.diff, 4.3 KB (added by , 12 years ago) |
---|
-
wp-includes/class-wp-xmlrpc-server.php
496 496 $page_date_gmt = mysql2date('Ymd\TH:i:s', $page->post_date_gmt, false); 497 497 498 498 // For drafts use the GMT version of the date 499 if ( $page->post_status == 'draft' )499 if ($page->post_status == 'draft' && strcmp($page_date_gmt, '19700101T00:00:00') !=0) 500 500 $page_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page->post_date ), 'Ymd\TH:i:s' ); 501 501 502 502 503 // Pull the categories info together. 503 504 $categories = array(); 504 505 foreach ( wp_get_post_categories($page->ID) as $cat_id ) { … … 682 683 $username = $this->escape($args[2]); 683 684 $password = $this->escape($args[3]); 684 685 $content = $args[4]; 685 $publish = $args[5]; 686 if ( isset($args[5]) ) 687 $publish = $args[5]; 688 else 689 $publish = false; 686 690 687 691 if ( !$user = $this->login($username, $password) ) 688 692 return $this->error; … … 762 766 $page_list[$i]->date_created_gmt = new IXR_Date($post_date_gmt); 763 767 764 768 // For drafts use the GMT version of the date 765 if ( $page_list[$i]->post_status == 'draft' ) {769 if ( $page_list[$i]->post_status == 'draft' && strcmp($post_date_gmt, '19700101T00:00:00') !=0) { 766 770 $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' ); 767 771 $page_list[$i]->date_created_gmt = new IXR_Date( $page_list[$i]->date_created_gmt ); 768 772 } … … 2382 2386 if ( !empty( $dateCreated ) ) { 2383 2387 $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); 2384 2388 $post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT'); 2385 } else {2389 } /*else { 2386 2390 $post_date = current_time('mysql'); 2387 2391 $post_date_gmt = current_time('mysql', 1); 2388 } 2392 }*/ 2389 2393 2390 2394 $post_category = array(); 2391 2395 if ( isset( $content_struct['categories'] ) ) { … … 2493 2497 $username = $args[1]; 2494 2498 $password = $args[2]; 2495 2499 $content_struct = $args[3]; 2496 $publish = $args[4]; 2497 2500 if ( isset($args[4]) ) 2501 $publish = $args[4]; 2502 else 2503 $publish = false; 2504 2498 2505 if ( !$user = $this->login($username, $password) ) 2499 2506 return $this->error; 2500 2507 … … 2710 2717 if ( !empty( $dateCreated ) ) { 2711 2718 $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); 2712 2719 $post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT'); 2713 } else {2720 }/* else { 2714 2721 $post_date = $postdata['post_date']; 2715 2722 $post_date_gmt = $postdata['post_date_gmt']; 2716 } 2723 }*/ 2717 2724 2718 2725 // We've got all the data -- post it: 2719 2726 $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template'); … … 2782 2789 $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false); 2783 2790 $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false); 2784 2791 2785 // For drafts use the GMT version of the post date2786 if ( $postdata['post_status'] == 'draft')2792 // For drafts use the GMT version 2793 if ( $entry['post_status'] == 'draft' && strcmp($post_date_gmt, '19700101T00:00:00') !=0 ) 2787 2794 $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ), 'Ymd\TH:i:s' ); 2788 2795 2789 2796 $categories = array(); 2790 2797 $catids = wp_get_post_categories($post_ID); 2791 2798 foreach($catids as $catid) … … 2909 2916 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false); 2910 2917 2911 2918 // For drafts use the GMT version of the date 2912 if ( $entry['post_status'] == 'draft')2919 if ( $entry['post_status'] == 'draft' && strcmp($post_date_gmt, '19700101T00:00:00') !=0 ) 2913 2920 $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' ); 2914 2921 2915 2922 $categories = array(); … … 3152 3159 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false); 3153 3160 3154 3161 // For drafts use the GMT version of the date 3155 if ( $entry['post_status'] == 'draft')3162 if ($entry['post_status'] == 'draft' && strcmp($post_date_gmt, '19700101T00:00:00') !=0) 3156 3163 $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' ); 3157 3164 3158 3165 $struct[] = array(