Skip to content

Commit b88206a

Browse files
XML-RPC: Correctly pass the ID value to wp_update_post() in ::mw_editPost().
Follow-up to [59697]. Props johnbillion. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59699 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0f6707d commit b88206a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/wp-includes/class-wp-xmlrpc-server.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6005,9 +6005,11 @@ public function mw_editPost( $args ) {
60056005
$post_date_gmt = $postdata['post_date_gmt'];
60066006
}
60076007

6008-
// We've got all the data -- post it.
6009-
$newpost = compact(
6010-
'post_id',
6008+
$newpost = array(
6009+
'ID' => $post_id,
6010+
);
6011+
6012+
$newpost += compact(
60116013
'post_content',
60126014
'post_title',
60136015
'post_category',
@@ -6028,6 +6030,7 @@ public function mw_editPost( $args ) {
60286030
'page_template'
60296031
);
60306032

6033+
// We've got all the data -- post it.
60316034
$result = wp_update_post( $newpost, true );
60326035
if ( is_wp_error( $result ) ) {
60336036
return new IXR_Error( 500, $result->get_error_message() );

0 commit comments

Comments
 (0)