Changeset 32591
- Timestamp:
- 05/25/2015 06:24:27 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r32586 r32591 5020 5020 $postdata = get_post( $post_ID, ARRAY_A ); 5021 5021 5022 // If there is no post data for the give post id, stop 5023 // now and return an error. Other wise a new post will be 5024 // created (which was the old behavior). 5022 /* 5023 * If there is no post data for the give post id, stop now and return an error. 5024 * Otherwise a new post will be created (which was the old behavior). 5025 */ 5025 5026 if ( ! $postdata || empty( $postdata[ 'ID' ] ) ) 5026 5027 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); … … 5215 5216 } 5216 5217 5217 // Do some timestamp voodoo 5218 // Do some timestamp voodoo. 5218 5219 if ( !empty( $content_struct['date_created_gmt'] ) ) 5219 // We know this is supposed to be GMT, so we're going to slap that Z on there by force 5220 // We know this is supposed to be GMT, so we're going to slap that Z on there by force. 5220 5221 $dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z'; 5221 5222 elseif ( !empty( $content_struct['dateCreated']) ) … … 5230 5231 } 5231 5232 5232 // We've got all the data -- post it :5233 // We've got all the data -- post it. 5233 5234 $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'); 5234 5235 … … 5252 5253 5253 5254 if ( isset ( $content_struct['wp_post_thumbnail'] ) ) { 5254 // empty value deletes, non-empty value adds/updates 5255 5256 // Empty value deletes, non-empty value adds/updates. 5255 5257 if ( empty( $content_struct['wp_post_thumbnail'] ) ) { 5256 5258 delete_post_thumbnail( $post_ID ); … … 5262 5264 } 5263 5265 5264 // Handle enclosures 5266 // Handle enclosures. 5265 5267 $thisEnclosure = isset($content_struct['enclosure']) ? $content_struct['enclosure'] : null; 5266 5268 $this->add_enclosure_if_new($post_ID, $thisEnclosure); … … 5268 5270 $this->attach_uploads( $ID, $post_content ); 5269 5271 5270 // Handle post formats if assigned, validation is handled 5271 // earlier in this function 5272 // Handle post formats if assigned, validation is handled earlier in this function. 5272 5273 if ( isset( $content_struct['wp_post_format'] ) ) 5273 5274 set_post_format( $post_ID, $content_struct['wp_post_format'] );
Note: See TracChangeset
for help on using the changeset viewer.