Changeset 59697
- Timestamp:
- 01/24/2025 12:02:08 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r59680 r59697 5144 5144 $post_date_gmt = current_time( 'mysql', 1 ); 5145 5145 5146 $post_data = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status' ); 5146 $post_data = compact( 5147 'post_author', 5148 'post_date', 5149 'post_date_gmt', 5150 'post_content', 5151 'post_title', 5152 'post_category', 5153 'post_status' 5154 ); 5147 5155 5148 5156 $post_id = wp_insert_post( $post_data ); … … 5596 5604 } 5597 5605 5598 $postdata = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template' ); 5606 $postdata = compact( 5607 'post_author', 5608 'post_date', 5609 'post_date_gmt', 5610 'post_content', 5611 'post_title', 5612 'post_category', 5613 'post_status', 5614 'post_excerpt', 5615 'comment_status', 5616 'ping_status', 5617 'to_ping', 5618 'post_type', 5619 'post_name', 5620 'post_password', 5621 'post_parent', 5622 'menu_order', 5623 'tags_input', 5624 'page_template' 5625 ); 5599 5626 5600 5627 $post_id = get_default_post_to_edit( $post_type, true )->ID; … … 5778 5805 $this->escape( $postdata ); 5779 5806 5780 $ ID= $postdata['ID'];5807 $post_id = $postdata['ID']; 5781 5808 $post_content = $postdata['post_content']; 5782 5809 $post_title = $postdata['post_title']; … … 5980 6007 5981 6008 // We've got all the data -- post it. 5982 $newpost = compact( 'ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'edit_date', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template' ); 6009 $newpost = compact( 6010 'post_id', 6011 'post_content', 6012 'post_title', 6013 'post_category', 6014 'post_status', 6015 'post_excerpt', 6016 'comment_status', 6017 'ping_status', 6018 'edit_date', 6019 'post_date', 6020 'post_date_gmt', 6021 'to_ping', 6022 'post_name', 6023 'post_password', 6024 'post_parent', 6025 'menu_order', 6026 'post_author', 6027 'tags_input', 6028 'page_template' 6029 ); 5983 6030 5984 6031 $result = wp_update_post( $newpost, true ); … … 6023 6070 $this->add_enclosure_if_new( $post_id, $enclosure ); 6024 6071 6025 $this->attach_uploads( $ ID, $post_content );6072 $this->attach_uploads( $post_id, $post_content ); 6026 6073 6027 6074 // Handle post formats if assigned, validation is handled earlier in this function. … … 6459 6506 6460 6507 // Save the data. 6461 $ id = wp_insert_attachment( $attachment, $upload['file'], $post_id );6462 wp_update_attachment_metadata( $ id, wp_generate_attachment_metadata( $id, $upload['file'] ) );6508 $attachment_id = wp_insert_attachment( $attachment, $upload['file'], $post_id ); 6509 wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $upload['file'] ) ); 6463 6510 6464 6511 /** … … 6467 6514 * @since 3.4.0 6468 6515 * 6469 * @param int $ idID of the new attachment.6470 * @param array $args An array of arguments to add the attachment.6516 * @param int $attachment_id ID of the new attachment. 6517 * @param array $args An array of arguments to add the attachment. 6471 6518 */ 6472 do_action( 'xmlrpc_call_success_mw_newMediaObject', $ id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase6473 6474 $struct = $this->_prepare_media_item( get_post( $ id ) );6519 do_action( 'xmlrpc_call_success_mw_newMediaObject', $attachment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase 6520 6521 $struct = $this->_prepare_media_item( get_post( $attachment_id ) ); 6475 6522 6476 6523 // Deprecated values.
Note: See TracChangeset
for help on using the changeset viewer.