Change Media Attachment Parent: WordPress Plugin

Change Attachment Parent allows you to edit the parent value of anything in the media library.

This becomes useful if you have uploaded images you’d like to place in a post’s gallery that are not currently children of that post.

I’ve also found that sometimes you add a new post with photos and they are not added to the gallery because you hadn’t saved the post when you uploaded them. This allows you to associate those photos with the post.

The interface isn’t that user friendly, you must enter the post ID, and I’d appreciate feedback on how to improve this.

Installation

1. Extract change-post-attachment.zip and place change-post-attachment.php `/wp-content/plugins/` directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress

Download

Download the plugin from the wordpress plugins page.

Donate





15 Responses

  1. Mike Says:

    Hey, I tried out your plugin, but it doesn’t seem to work.

    I have tried changing the parent-attachment ID of an image I have attached to page ID 508 to ID 11 (which exists) .. and when go to update it, the image still shows up as being attached to post ID 508. I have tried this for a number of different attachments and different post IDs and it doesn’t seem to work.

    Using WordPress 2.8.3.

    Any help would be much appreciated.

    Thanks,
    // mike

  2. laqrhead Says:

    @Mike Thanks for pointing that out. I have no idea how this happened but the update portion of the plugin somehow got removed in the version I posted to the WordPress plugin gallery. I’ve updated it to version 0.3 and it should all be good now.

  3. Mike Says:

    Works perfectly!
    Awesome!
    It’s one of the 3 top plugins I’m using in particular with the Media Library, I think I am going to write a post on my site about it!

    Cheers!
    // mike

  4. laqrhead Says:

    I’m glad it’s working for you now! I’d like to make it a bit easier to use, but the site it was designed for has thousands of posts, which makes it difficult to do something like a dropdown box. Any suggestions for improvement are welcome.

  5. Make it Blason : Wiesel.lu Says:

    [...] liebe Mikro-Plugins! Z.B. Change Attachment Parent von Joel Sholdice, es hat nur 30 Zeilen Code, davon gehören 8 zum Header und zwei sind [...]

  6. hevangel Says:

    Thanks for the plug-in. It solved my problem of how to add and delete existing picture from a gallery.

  7. William Lindley Says:

    WordPress 2.9 includes the ability to locate and attach media which are currently un-attached; but it does not include the ability to change the parent of an already-attached file. THANK YOU for this!

    You might look into using the “locate post or page” logic that WP 2.9 uses, in addition to being able to specify an ID directly.

  8. matt Says:

    Great plugin. You know what would be great is if you could do the edit from the Library list instead of having to click into every attachment. That would make bulk changes much easier. Even without this it’s a big help, thanks!

  9. Fabio Says:

    Great plugin. Instead of change, it would be perfect if you can ‘add’ the image to a 2nd (and 3rd, 4th, 5th…) post. So that the same image is attached to many posts.

    In a way more user friendly, if you can.

    Thanks

  10. Donna McMaster Says:

    Thanks for this plugin! I can’t believe WP doesn’t include the functionality already. One tip: set the parent to zero to unattach the file. You can then leave it in the library for later, or use the standard Media Library dialog to find the page you want to attach it to.

  11. Alex (Viper007Bond) Says:

    Hi Joel,

    I ran across your plugin and really like it. However I was looking for some additional functionality (such as being able to bulk change parents using the checkboxes).

    However rather than just writing my own version of this plugin, I thought I’d ask first if you accept patches or are looking for additional people to work on this plugin. No sense in having two plugins that do similar things if you’re open to the idea.

    If not, no worries. I have no problem doing my own take on this feature. :)

    BTW — the theme you’re using is inserting spammy links into your footer.

  12. Alex (Viper007Bond) Says:

    (If you are interested, hit me up at the e-mail address I used to leave these comments.)

  13. twincascos Says:

    Hello, I just wanted to mention, that I’ve used some of the code in your plugin to build a plugin with more features, such as mass detach / change parent. available here: http://wordpress.org/extend/plugins/superslider-media-pop/

  14. laqrhead Says:

    I’ve been neglecting the comments made here, sorry about that. I know that this plugin has some major usability issues, I had hoped that the WP core would address the problem this plugin does by now, unfortunately it hasn’t. I don’t have the time to maintain this or add more features, but if anyone wishes to use the code in a more usable plugin, leave a link here. Thanks twincascos for doing just that.

  15. SuperSlider-Media-Pop | Best Plugins - wordpress – widgets – plugin 2012 Says:

    [...] post attachment” feature is based on: Change Attachment Parent, by Joel Sholdice :Change Attachment Parent *The mass edit image properties is based on: Faster Image Insert, by David Frank :Faster Image [...]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.