REST API: Add finalize endpoint to `WP_REST_Attachments_Controller`.
Introduce a `POST /wp/v2/media/{id}/finalize` REST API endpoint that re-triggers the `wp_generate_attachment_metadata` filter with context `'update'` after client-side media processing completes. This ensures server-side plugins (watermarking, CDN sync, custom sizes, etc.) can post-process attachments when client-side processing is active.
The endpoint reuses `edit_media_item_permissions_check` for authorization and is only registered when `wp_is_client_side_media_processing_enabled()` returns true.
See https://github.com/WordPress/gutenberg/pull/74913.
See https://github.com/WordPress/gutenberg/issues/74358.
Props adamsilverstein, westonruter, mukesh27, divyeshpatel01.
Fixes #64804.
git-svn-id: https://develop.svn.wordpress.org/trunk@61982 602fd350-edb4-49c9-b593-d223f7449a82 A
Adam Silverstein committed
cc19ca7567e9e4c0769759cb9ae7c2214c52b57d
Parent: f29f594