REST API: Record the source attachment of an uploaded image edit. - #13372
REST API: Record the source attachment of an uploaded image edit.#13372adamsilverstein wants to merge 3 commits into
Conversation
Add a parent_image parameter to the media create endpoint so an image edited in the browser and uploaded as a new attachment relates to its source the way the edit endpoint's new attachment does: the parent_image metadata entry, the source's EXIF fields the new file lacks, and an upright orientation.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
The new `parent_image` argument on the media create endpoint changes the schema the QUnit client mocks, and that fixture is only refreshed by running `test_build_wp_api_client_fixtures`. Leaving it stale made every single-site PHPUnit job fail at the "Ensure version-controlled files are not modified" step, since the test rewrites the file in place during the run.
|
Manually tested against a local WP 7.1-trunk install (Studio site, real DB/uploads, no git checkout available so I hand-applied this diff — context matched cleanly). Ran the PR's own scenarios via
All 5 passed. 🤖 Generated with Claude Code |
Pass the metadata recorded for a client-side edit through the same filter edit_media_item() fires for its new attachment, so hooks see edits made in the browser too.
Companion to WordPress/gutenberg#82362.
Claude Code wrote this up from the Gutenberg change:
Trac ticket: https://core.trac.wordpress.org/ticket/66027
AI Use
Code and description both written with 🤖 Claude Code. I will review and test.