开发者 | coffee2code |
---|---|
更新时间 | 2021年7月21日 14:54 |
捐献地址: | 去捐款 |
PHP版本: | 4.9 及以上 |
WordPress版本: | 5.7 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
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.
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 directorybin/
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_loaded
get_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 trash