Changeset 20353
- Timestamp:
- 04/04/2012 09:32:28 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-xmlrpc-server.php
r20351 r20353 500 500 * 501 501 * @access protected 502 .*502 * 503 503 * @param array|object $taxonomy The unprepared taxonomy data 504 504 * @return array The prepared taxonomy data … … 516 516 * 517 517 * @access protected 518 .*518 * 519 519 * @param array|object $term The unprepared term data 520 520 * @return array The prepared term data … … 553 553 554 554 /** 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 555 570 * Prepares post data for return in an XML-RPC object. 556 571 * … … 569 584 'post_title' => $post['post_title'], 570 585 'post_date' => $this->_convert_date( $post['post_date'] ), 571 'post_date_gmt' => $this->_convert_date ( $post['post_date_gmt'] ),586 'post_date_gmt' => $this->_convert_date'] ), 572 587 'post_modified' => $this->_convert_date( $post['post_modified'] ), 573 'post_modified_gmt' => $this->_convert_date ( $post['post_modified_gmt'] ),588 'post_modified_gmt' => $this->_convert_date'] ), 574 589 'post_status' => $post['post_status'], 575 590 'post_type' => $post['post_type'], … … 1715 1730 1716 1731 // Format page date. 1717 $page_date = mysql2date('Ymd\TH:i:s', $page->post_date, false); 1718 $page_date_gmt = mysql2date('Ymd\TH:i:s', $page->post_date_gmt, false); 1719 1720 // For drafts use the GMT version of the date 1721 if ( $page->post_status == 'draft' ) 1722 $page_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page->post_date ), 'Ymd\TH:i:s' ); 1732 $page_date = $this->_convert_date( $page->post_date ); 1733 $page_date_gmt = $this->_convert_date_gmt( $page->post_date_gmt, $page->post_date ); 1723 1734 1724 1735 // Pull the categories info together. … … 1736 1747 1737 1748 $page_struct = array( 1738 'dateCreated' => new IXR_Date($page_date),1749 'dateCreated' => , 1739 1750 'userid' => $page->post_author, 1740 1751 'page_id' => $page->ID, … … 1757 1768 'wp_author_id' => (string) $author->ID, 1758 1769 'wp_author_display_name' => $author->display_name, 1759 'date_created_gmt' => new IXR_Date($page_date_gmt),1770 'date_created_gmt' => , 1760 1771 'custom_fields' => $this->get_custom_fields($page_id), 1761 1772 'wp_page_template' => $page_template … … 1976 1987 $num_pages = count($page_list); 1977 1988 for ( $i = 0; $i < $num_pages; $i++ ) { 1978 $post_date = mysql2date('Ymd\TH:i:s', $page_list[$i]->post_date, false); 1979 $post_date_gmt = mysql2date('Ymd\TH:i:s', $page_list[$i]->post_date_gmt, false); 1980 1981 $page_list[$i]->dateCreated = new IXR_Date($post_date); 1982 $page_list[$i]->date_created_gmt = new IXR_Date($post_date_gmt); 1983 1984 // For drafts use the GMT version of the date 1985 if ( $page_list[$i]->post_status == 'draft' ) { 1986 $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' ); 1987 $page_list[$i]->date_created_gmt = new IXR_Date( $page_list[$i]->date_created_gmt ); 1988 } 1989 $page_list[$i]->dateCreated = $this->_convert_date( $page_list[$i]->post_date ); 1990 $page_list[$i]->date_created_gmt = $this->_convert_date_gmt( $page_list[$i]->post_date_gmt, $page_list[$i]->post_date ); 1989 1991 1990 1992 unset($page_list[$i]->post_date_gmt); … … 2231 2233 2232 2234 // Format page date. 2233 $comment_date = mysql2date('Ymd\TH:i:s', $comment->comment_date, false);2234 $comment_date_gmt = mysql2date('Ymd\TH:i:s', $comment->comment_date_gmt, false);2235 $comment_date = ); 2236 $comment_date_gmt = ); 2235 2237 2236 2238 if ( '0' == $comment->comment_approved ) … … 2246 2248 2247 2249 $comment_struct = array( 2248 'date_created_gmt' => new IXR_Date($comment_date_gmt),2250 'date_created_gmt' => , 2249 2251 'user_id' => $comment->user_id, 2250 2252 'comment_id' => $comment->comment_ID, … … 2825 2827 2826 2828 // Format page date. 2827 $attachment_date = mysql2date('Ymd\TH:i:s', $attachment->post_date, false);2828 $attachment_date_gmt = mysql2date('Ymd\TH:i:s', $attachment->post_date_gmt, false);2829 $attachment_date = ); 2830 $attachment_date_gmt = ); 2829 2831 2830 2832 $link = wp_get_attachment_url($attachment->ID); … … 2832 2834 2833 2835 $attachment_struct = array( 2834 'date_created_gmt' => new IXR_Date($attachment_date_gmt),2836 'date_created_gmt' => , 2835 2837 'parent' => $attachment->post_parent, 2836 2838 'link' => $link, … … 3183 3185 $struct = array( 3184 3186 'userid' => $post_data['post_author'], 3185 'dateCreated' => new IXR_Date(mysql2date('Ymd\TH:i:s', $post_data['post_date'], false)),3187 'dateCreated' => ), 3186 3188 'content' => $content, 3187 3189 'postid' => (string) $post_data['ID'] … … 3228 3230 continue; 3229 3231 3230 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false);3232 $post_date ); 3231 3233 $categories = implode(',', wp_get_post_categories($entry['ID'])); 3232 3234 … … 3237 3239 $struct[] = array( 3238 3240 'userid' => $entry['post_author'], 3239 'dateCreated' => new IXR_Date($post_date),3241 'dateCreated' => , 3240 3242 'content' => $content, 3241 3243 'postid' => (string) $entry['ID'], … … 4124 4126 4125 4127 if ($postdata['post_date'] != '') { 4126 $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false); 4127 $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false); 4128 $post_modified = mysql2date('Ymd\TH:i:s', $postdata['post_modified'], false); 4129 $post_modified_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_modified_gmt'], false); 4130 4131 // For drafts use the GMT version of the post date 4132 if ( $postdata['post_status'] == 'draft' ) { 4133 $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ), 'Ymd\TH:i:s' ); 4134 $post_modified_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_modified'] ), 'Ymd\TH:i:s' ); 4135 } 4128 $post_date = $this->_convert_date( $postdata['post_date'] ); 4129 $post_date_gmt = $this->_convert_date_gmt( $postdata['post_date_gmt'], $postdata['post_date'] ); 4130 $post_modified = $this->_convert_date( $postdata['post_modified'] ); 4131 $post_modified_gmt = $this->_convert_date_gmt( $postdata['post_modified_gmt'], $postdata['post_modified'] ); 4136 4132 4137 4133 $categories = array(); … … 4186 4182 4187 4183 $resp = array( 4188 'dateCreated' => new IXR_Date($post_date),4184 'dateCreated' => , 4189 4185 'userid' => $postdata['post_author'], 4190 4186 'postid' => $postdata['ID'], … … 4205 4201 'wp_password' => $postdata['post_password'], 4206 4202 'wp_author_id' => (string) $author->ID, 4207 'wp_author_display_name' 4208 'date_created_gmt' => new IXR_Date($post_date_gmt),4203 'wp_author_display_name'=> $author->display_name, 4204 'date_created_gmt' => , 4209 4205 'post_status' => $postdata['post_status'], 4210 4206 'custom_fields' => $this->get_custom_fields($post_ID), 4211 4207 'wp_post_format' => $post_format, 4212 4208 'sticky' => $sticky, 4213 'date_modified' => new IXR_Date( $post_modified ),4214 'date_modified_gmt' => new IXR_Date( $post_modified_gmt )4209 'date_modified' => , 4210 'date_modified_gmt' => 4215 4211 ); 4216 4212 … … 4260 4256 continue; 4261 4257 4262 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false); 4263 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false); 4264 $post_modified = mysql2date('Ymd\TH:i:s', $entry['post_modified'], false); 4265 $post_modified_gmt = mysql2date('Ymd\TH:i:s', $entry['post_modified_gmt'], false); 4266 4267 // For drafts use the GMT version of the date 4268 if ( $entry['post_status'] == 'draft' ) { 4269 $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' ); 4270 $post_modified_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_modified'] ), 'Ymd\TH:i:s' ); 4271 } 4258 $post_date = $this->_convert_date( $entry['post_date'] ); 4259 $post_date_gmt = $this->_convert_date_gmt( $entry['post_date_gmt'], $entry['post_date'] ); 4260 $post_modified = $this->_convert_date( $entry['post_modified'] ); 4261 $post_modified_gmt = $this->_convert_date_gmt( $entry['post_modified_gmt'], $entry['post_modified'] ); 4272 4262 4273 4263 $categories = array(); … … 4306 4296 4307 4297 $struct[] = array( 4308 'dateCreated' => new IXR_Date($post_date),4298 'dateCreated' => , 4309 4299 'userid' => $entry['post_author'], 4310 4300 'postid' => (string) $entry['ID'], … … 4326 4316 'wp_author_id' => (string) $author->ID, 4327 4317 'wp_author_display_name' => $author->display_name, 4328 'date_created_gmt' => new IXR_Date($post_date_gmt),4318 'date_created_gmt' => , 4329 4319 'post_status' => $entry['post_status'], 4330 4320 'custom_fields' => $this->get_custom_fields($entry['ID']), 4331 4321 'wp_post_format' => $post_format, 4332 'date_modified' => new IXR_Date( $post_modified ),4333 'date_modified_gmt' => new IXR_Date( $post_modified_gmt )4322 'date_modified' => , 4323 'date_modified_gmt' => 4334 4324 ); 4335 4325 … … 4517 4507 continue; 4518 4508 4519 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false); 4520 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false); 4521 4522 // For drafts use the GMT version of the date 4523 if ( $entry['post_status'] == 'draft' ) 4524 $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' ); 4509 $post_date = $this->_convert_date( $entry['post_date'] ); 4510 $post_date_gmt = $this->_convert_date_gmt( $entry['post_date_gmt'], $entry['post_date'] ); 4525 4511 4526 4512 $struct[] = array( 4527 'dateCreated' => new IXR_Date($post_date),4513 'dateCreated' => , 4528 4514 'userid' => $entry['post_author'], 4529 4515 'postid' => (string) $entry['ID'], 4530 4516 'title' => $entry['post_title'], 4531 4517 'post_status' => $entry['post_status'], 4532 'date_created_gmt' => new IXR_Date($post_date_gmt)4518 'date_created_gmt' => 4533 4519 ); 4534 4520
Note: See TracChangeset
for help on using the changeset viewer.