10+
July 21, 2021
May 13, 2014
This plugin records which user actually trashed a post, which in a multi-author environment may not always be the original post author. This helps to maintain accountability for who was ultimately responsible for deleting a post. It also records when the post got trashed.
The admin listing of trashed posts is amended with new “Trashed By” and “Trashed On” columns that shows the name of the person who trashed the post or page and the date the post was trashed, respectively.
The plugin makes no assumption about who trashed a post, or when, for posts that were trashed prior to the use of this plugin (since the plugin could not have directly recorded information about the post’s trashing). The “Trashed By” and “Trashed On” values for those posts will remain empty. Put another way, only posts or pages trashed while this plugin is active will have the user who trashed the post/page and that date recorded.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
trashed-by.zip inside the plugins directory for your site (typically wp-content/plugins/)The visibility of the “Trashed By” and “Trashed On” columns can be controlled by the “Screen Options” slide-down options panel available at the top right of the page when viewing the trash listing in the admin.
The user most recently responsible for trashing a post will be recorded as the trashing user.
This should only be the case for posts that were trashed prior to activating this plugin (or any time when the plugin wasn’t active).
No. Once a trashed post is restored and thus removed from the trash, the information about when and who trashed the post is deleted.
Just so everyone is clear, “Trashed” and “Permanently deleted” are two different things.
Trashed posts get assigned a post status of “trash” and then only appear in the “Trash” list of the page/post area of the admin. These posts still exist, they’re just hidden from public view. This operates like the trash feature in your operating system; you can still go into the trash to retrieve something before it is gone for good. As such, it is possible for the plugin to keep track of and report who trashed the post.
Permanently deleted posts (whether done so directly by a user or automatically by WordPress for posts that have been in the trash for a period of time) are completely deleted from the database. This plugin does not track who deleted those posts.
In the upper-right of the page is a “Screen Options” link that reveals a panel of options. In the “Columns” section, check (to show) or uncheck (to hide) the “Trashed By” and/or “Trashed On” options.
Yes.
Highlights:
This minor release reimplements how the plugin hooks into WordPress to handle when a post is trashed or untrashed, restructures unit test files, notes compatibility through WP 5.7, and more.
Details:
trash_post() to react when a post is trasheduntrash_post() to react when a post is untrashedtransition_post_status()__wakeup() method visibility from private to public to avoid warnings under PHP8tests/ top-level directory
bin/ into tests/tests/bootstrap.php into tests/phpunit/tests/*.php into tests/phpunit/tests/phpunit.xml to phpunit.xml.dist per best practicesis_protected_meta() to protect the meta key from being exposed as a custom fieldregister_meta() with a proper auth_callbackregister_post_meta() when availableinit action instead of plugins_loadedget_trashed_by() as the renamed replacement for the now-deprecated get_trasher_id()get_trashed_by() and get_trashed_on()create_user() to accept an array argument of user attributesupdate_post_meta() within create_user() instead of add_post_meta()get_trashed_by() and get_trashed_on() to indicate that meta values won’t be returned, even if present, if post isn’t in the trashFull changelog is available in CHANGELOG.md.