WordPress.org

Ready to get started?Download WordPress

Forums

Bug in XML-RPC interface? (3 posts)

  1. DaEnno
    Member
    Posted 1 year ago #

    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?

  2. danielvg
    Member
    Posted 1 year ago #

    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?

  3. DaEnno
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags