Forum Replies Created

Viewing 1 replies (of 1 total)
  • Forum: Fixing WordPress
    In reply to: Attachment Parent

    Bumping this topic up because I just encountered the same thing in WP 2.2.1.

    I have some code that takes a post, looks to see if it has children of type ‘attachment’ and then does stuff with it. This means that the post_parent relationship between an uploaded file and the post it was uploaded to is very important to the success of my code.

    However, I have noticed that I can successfully ‘attach’ a file to a post by uploading it. However, if I go back to that file (in the Browse tab of the parent post) and edit its Title or Description, suddenly the connection between the attachment and the parent post is gone. I checked the database and the post_parent field for the attachment post is set to 0 instead of the correct post_parent id.

    So it seems that the initial upload correctly sets the post_parent for the attachment post, but any subsequent changes breaks it. Can we have a fix in the next patch?

    As for temporary solutions, I’m considering using a Hook/Filter approach if possible.

Viewing 1 replies (of 1 total)