XML-RPC: Correctly pass the ID value to wp_update_post() in ::mw_editPost().

Follow-up to [59697].

Props johnbillion.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59699


git-svn-id: http://core.svn.wordpress.org/trunk@59041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2025-01-24 12:30:24 +00:00
parent 4de28b054d
commit e28810b49b
2 changed files with 7 additions and 4 deletions

View File

@ -6005,9 +6005,11 @@ class wp_xmlrpc_server extends IXR_Server {
$post_date_gmt = $postdata['post_date_gmt'];
}
// We've got all the data -- post it.
$newpost = compact(
'post_id',
$newpost = array(
'ID' => $post_id,
);
$newpost += compact(
'post_content',
'post_title',
'post_category',
@ -6028,6 +6030,7 @@ class wp_xmlrpc_server extends IXR_Server {
'page_template'
);
// We've got all the data -- post it.
$result = wp_update_post( $newpost, true );
if ( is_wp_error( $result ) ) {
return new IXR_Error( 500, $result->get_error_message() );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59698';
$wp_version = '6.8-alpha-59699';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.