WebpResetCommand
Corex\Media\WebpResetCommand · class · Add-ons layer
wp corex media reset-webp (spec 062): safely remove CoreX-generated WebP derivatives. It deletes ONLY files tracked in a _corex_webp record (so it never removes originals, manually-uploaded WebP, or any untracked file), clears the record afterwards, supports --dry-run, and reports scanned/deleted/skipped/ failed counts. The same tracked-only deletion runs on delete_attachment via {@see forgetAttachment()}.
Public API
Section titled “Public API”__invoke(array $args, array $assoc): void
Section titled “__invoke(array $args, array $assoc): void”forgetAttachment(int $attachmentId): void
Section titled “forgetAttachment(int $attachmentId): void”Delete the tracked derivative for one attachment (called on delete_attachment).
target(?array $record): ?string
Section titled “target(?array $record): ?string”The generated-WebP path to delete from a tracked record — or null when the record is missing, has no generated path, or that path is not a .webp (so only CoreX-generated WebP is ever targeted). Pure.