Support » Plugin: File Gallery » [Plugin: File Gallery] Files not actually deleted

  • Resolved pheonixgh


    first off Great Plugin!
    has become staple of my wordpress builds.

    unfortunately i have found a small issue
    the “file_gallery_cancel_file_deletion_if_attachment_copies” function will always cancels the deletion as it modifies the $file variable
    to be relative to the uploads directory (e.g.”yyyy/mm/filename.ext”) rather than absolute.

    if there are no copies it simply returns this altered $file variable causing the wordpress function to look for files relative to the posts.php file where the function resides.

    simple fix is to use a copy of $file variable internaly and return the original at the bottom (and of course and empty string if there were copies).


    keep up the good work!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Aesqe


    Fixed in 1.6.7 which will be out by Monday – thanks for the bug report, pheonixgh! 🙂

    Plugin Author Aesqe


    I’ve uploaded v1.7 to the trunk (development version), so please download it from here: and see if everything works OK after upgrade.

    Please update like this:
    1) on the media settings page, make sure that the option “Delete all options on deactivation?” is NOT checked
    2) deactivate current version of the plugin
    3) delete current version of the plugin via WordPress interface, or just overwrite files on the server via FTP
    4) upload File Gallery 1.7 either via WordPress interface, or via FTP
    5) activate new version

    Thank you very much in advance, it helps me a lot when people test new versions before they are released to public 🙂


    All seems to be working well, code looks cleaner too, nice work.

    loving the new gallery class option makes my css a little cleaner!

    a major improvement for me would be improved mime type/file type detection and custom icon usage, i use this in an intranet setting and would love to be able to define custom file icon associations.

    i currently do it for the front end using a template with code derived from the way the “postie” plugin handles attachments using a combination of mime and file extension and some predefined lists.
    i dont want to have to modify your plugin code though and there isnt a filter/template option in all the places these thumbs are generated on the admin side. 🙁

    Alternatively and perhaps less work and ultimately more flexible/extensible would be to append mime and file extension strings as additional classes to the image/link tags so it could be handled by css.

    keep up the good work.



    Plugin Author Aesqe


    @pheonixgh: you can use the “file_gallery_crystal_url” filter to change the location of default file type icons.

    by default it’s: “get_bloginfo(‘wpurl’) . ‘/’ . WPINC . ‘/images/crystal’;”

    so just feed it your url without a trailing slash 🙂

    If you want to use generic file type icons instead of image thumbnails, then the simplest option would be to create your own template. You can then use $attachment->post_mime_type variable to check attachment mime type.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: File Gallery] Files not actually deleted’ is closed to new replies.