In wp_xmlrpc_server::_insert_post(), don't return an error if set_post_thumbnail() returns false when the attachment ID doesn't change.
Props picklepete fixes #22204 git-svn-id: http://core.svn.wordpress.org/trunk@22277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
43a1c703e0
commit
3d4470939d
|
@ -1099,8 +1099,9 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
// empty value deletes, non-empty value adds/updates
|
// empty value deletes, non-empty value adds/updates
|
||||||
if ( ! $post_data['post_thumbnail'] )
|
if ( ! $post_data['post_thumbnail'] )
|
||||||
delete_post_thumbnail( $post_ID );
|
delete_post_thumbnail( $post_ID );
|
||||||
elseif ( ! set_post_thumbnail( $post_ID, $post_data['post_thumbnail'] ) )
|
elseif ( ! get_post( absint( $post_data['post_thumbnail'] ) ) )
|
||||||
return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
|
return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
|
||||||
|
set_post_thumbnail( $post_ID, $post_data['post_thumbnail'] );
|
||||||
unset( $content_struct['post_thumbnail'] );
|
unset( $content_struct['post_thumbnail'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue