Skip to content
Corex

SubmissionDeletionGuard

Corex\Config\Submissions\SubmissionDeletionGuard · class · Config layer

Stands between WordPress and a submission that is being trashed or deleted by something other than the inbox (spec 105, FR-019 and FR-020). WordPress’s daily trash clean-up deletes any trashed post it has a date for, and the retention panel trashed submissions WordPress’s way before the inbox had a trash. So a submission that is trashed that way is taken onto CoreX’s clock at once, and the clean-up is refused one it still has a date for: a trashed submission goes when CoreX’s clock says, and not before. Anything can also call wp_delete_post(): a command, another plugin. That cannot be refused without breaking whoever asked, so what is tied to the submission is removed with it. A file uploaded with it would otherwise stay on disk with nothing left that knows where it is.

__construct(SubmissionTrashService $trash, SubmissionTrashStore $store)

Section titled “__construct(SubmissionTrashService $trash, SubmissionTrashStore $store)”

adoptWhenTrashedByWordPress(int $postId): void

Section titled “adoptWhenTrashedByWordPress(int $postId): void”

keepFromWordPressCleanUp(mixed $delete, mixed $post): mixed

Section titled “keepFromWordPressCleanUp(mixed $delete, mixed $post): mixed”

forgetTiedData(int $postId, mixed $post): void

Section titled “forgetTiedData(int $postId, mixed $post): void”