Title: wonkavator's Replies | WordPress.org

---

# wonkavator

  [  ](https://wordpress.org/support/users/wonkavator/)

 *   [Profile](https://wordpress.org/support/users/wonkavator/)
 *   [Topics Started](https://wordpress.org/support/users/wonkavator/topics/)
 *   [Replies Created](https://wordpress.org/support/users/wonkavator/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/wonkavator/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/wonkavator/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/wonkavator/engagements/)
 *   [Favorites](https://wordpress.org/support/users/wonkavator/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Attachment Parent](https://wordpress.org/support/topic/attachment-parent/)
 *  [wonkavator](https://wordpress.org/support/users/wonkavator/)
 * (@wonkavator)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/attachment-parent/#post-543398)
 * 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)