fix: media usage check fails closed on database errors; refused deletes checked for partial state
MediaUsageFinder treats a failed query (null result or last_error) as a possible usage and an incomplete scan, so media-delete refuses without force. A refused wp_delete_attachment() is write_failed only when the attachment is intact, otherwise partial_write. media-update: re-read hint on write_failed, normalized ids in failures, documented lock resolution and kses on restore. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -12,6 +12,10 @@ use WP_Post;
|
||||
* Writes the editable metadata of an attachment (alt text, title, caption, description) and
|
||||
* restores it from a snapshot taken before (lit/media-update rolls a batch back with it).
|
||||
* Every failure is a RuntimeException with an internal message for the PHP error log.
|
||||
*
|
||||
* Both apply() and restore() save through wp_update_post(), which runs the kses filters again
|
||||
* for users without unfiltered_html: a caption or description with markup the current user may
|
||||
* not save comes back filtered on restore (like any save of that user in the media library).
|
||||
*/
|
||||
final class MediaMetaWriter
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user