• Resolved Jordy Meow

    (@tigroumeow)


    Hello,

    I can’t find the “trash” link for the media, there is only a Delete Permanently, which I wouldn’t like to use.

    Also, in WP API, I found this:
    wp_delete_attachment( $attachmentid, $force_delete );

    I tried force_delete set to true and false, and it both cases it just deletes the media and all the files associated with it; there is no trash anywhere.

    Am I missing something?

Viewing 7 replies - 1 through 7 (of 7 total)
  • No, you’re not missing anything. There is no trash for media images. Once deleted, it’s gone.

    Thread Starter Jordy Meow

    (@tigroumeow)

    Thank you Christine for your quick reply!

    I believe you can enable Trash for Media by defining MEDIA_TRASH to be true in your wp-config.php

    Thread Starter Jordy Meow

    (@tigroumeow)

    I came across to this var some time ago. It seems it used to exist in older versions of WordPress but not anymore.

    Well, it ‘works’, but could easily be removed at some point with little regard. The other important thing is that the media items are still available through their URLs while they’re in the trash, which is kinda weird.

    Thread Starter Jordy Meow

    (@tigroumeow)

    Jason, you are talking about deleted media with the MEDIA_TRASH right? I have no idea since I have never used it but, yes, I think the files wouldn’t be deleted or moved if they are in the trash. They should just be marked/tagged as “trashed” and not shown in the Media Library but the files and database entries shouldn’t be removed at this point.

    Thread Starter Jordy Meow

    (@tigroumeow)

    I tried it and I was surprised to see that there is come kind of trash support for the images.

    The problem with it is that, like you said, it doesn’t delete or move the images. They are still at the same places. Therefore, your website will work the same way and even though the images are used somewhere or not, you will not see the difference. You will only see the difference when the trash is emptied and it will be too late.

    I don’t encourage to use this media trash and I can understand why it is not enabled by default.

    The plugin was updated yesterday : now, when you remove a media in the media cleaner screen, the files are moved to the trash and the database entry is deleted. If any problem appears, then the files can be retrieved. Not the DB entry however.

    There is an alternative way to do it on the plugin side : enable the MEDIA_TRASH then when a media is deleted, to actually move it to another directory, then “trash it” the way WordPress does it. The problem is I will probably have to hack a lot into WordPress since none of all this is accessible through the API. Too dangerous unfortunately but this is an idea.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘No "Trash" link for Media ?’ is closed to new replies.