• Hey guys,

    before reporting this as a bug I want to make sure it actually is one.

    When uploading a post via XML-RPC I have to upload the images first. I do so via wp.uploadFile.
    Later I update the actual blogpost via wp.newPost.

    WordPress is smart enough to look through all images in the markup and sets the correct post_parent in the database. But it forgets to make the post_status inherit.

    Getting more concrete, look in the file wp-includes/class-wp-xmlrpc-server.php and find the function attach_uploads. It sets the post_parent but doesn’t update the post_status.

    Because WordPress forgets about this you won’t be able to find the uploaded images in your media library. The images do count in the image count shown at the top, but you won’t get to see them in the actual file list.

    In my opinion this is a bug that can be easily fixed.
    What do you think?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have similar problems with XMLRPC and wp.editPost. I am uploading an image and changing some attributes (title, caption, …) with wp.editPost.

    File wp-includes/class-wp-xmlrpc-server.php calls to function _insert_post() to commit changes to the post representing the image. This function has a switch/case for the post_status parameter. This switch doesn’t have into account the ‘inherit’ status, and it writes draft as a default status for the post. As a consequence of this the image is not shown in the media library.

    Does Media Library show only ‘inherit’ elements? Why?
    Is a bug for XMLRPC server to avoid ‘inherit’ status when editing posts?

    Thread Starter DaEnno

    (@daenno)

    Well, I opened a ticket so the problem got initially solved. Yay 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug in XML-RPC interface?’ is closed to new replies.