Title: [Plugin: File Un-Attach] attach/unattach button fix
Last modified: August 20, 2016

---

# [Plugin: File Un-Attach] attach/unattach button fix

 *  [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-file-un-attach-attachunattach-button-fix/)
 * In Media Library->Edit Media (i.e. media.php) the attach/unattach buttons shouldn’t
   be appearing IMO, as there’s no post/page context to refer to, and the way they
   seem to work now is confusing (un-attach and get a blank edit media page). These
   buttons should appear in the inline Media Library only (i.e. media-upload.php).
   Suggested fix as follows:
 * `file-un-attach\admin.php li ~104`
 *     ```
       function attachment_fields($form_fields, $post){
   
       	//[alx359] added. If media.php do not create attach/unattach buttons
       	if (empty($this->tab)) return $form_fields;
       ```
   
 * [http://wordpress.org/extend/plugins/file-un-attach/](http://wordpress.org/extend/plugins/file-un-attach/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Hax](https://wordpress.org/support/users/hax/)
 * (@hax)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-file-un-attach-attachunattach-button-fix/#post-2207356)
 * thanks for the code and feedback, I will add the code for next releae

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: File Un-Attach] attach/unattach button fix’ is closed to new
replies.

 * ![](https://ps.w.org/file-un-attach/assets/icon-256x256.jpg?rev=1070689)
 * [File Un-Attach](https://wordpress.org/plugins/file-un-attach/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/file-un-attach/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/file-un-attach/)
 * [Active Topics](https://wordpress.org/support/plugin/file-un-attach/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/file-un-attach/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/file-un-attach/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Hax](https://wordpress.org/support/users/hax/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-file-un-attach-attachunattach-button-fix/#post-2207356)
 * Status: not resolved