Media Editor Route Experiment: Override media edit links to point to the new experimental media editor - #81559
Merged
andrewserong merged 2 commits intoAug 13, 2026
Conversation
…the experimental media editor route Wire the route-based media editor into the places WordPress sends people to edit an attachment, so the experiment can be used in place of the classic Edit Media screen rather than only reached by hand-typed URL. - Filter `get_edit_post_link` for attachments, so the Media Library list table, the media modal's "Edit more details" and "Edit Image" links, and the admin bar navigate straight to the route with no redirect hop. - Redirect the classic screen on `load-post.php` to catch bookmarks and hard-coded links. GET and `action=edit` only, so the save handlers run untouched, and bail on missing capability or a trashed post so post.php keeps rendering its own errors. - Gate both on `upload_files`, which the media editor page requires but `edit_post` does not imply — a contributor can own an attachment without being able to upload, and would otherwise be sent to a screen that refuses them. - Give `MediaEditor` a `scope` prop so each frame keeps its own persisted details-sidebar visibility. The modal and the route previously shared one preference, so collapsing the sidebar in the modal permanently defeated `isActiveByDefault` on the route. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Size Change: +24 B (0%) Total Size: 7.72 MB 📦 View Changed
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ramonjd
approved these changes
Aug 13, 2026
ramonjd
left a comment
Member
There was a problem hiding this comment.
Looks like a safe change. load.php is gated behind the experiment.
I tested manually and it works as described.
Contributor
Author
|
Thanks for the review! 🙇 |
andrewserong
deleted the
update/media-editor-route-experiment-to-hook-edit-links
branch
August 13, 2026 05:38
ramonjd
added a commit
that referenced
this pull request
Aug 21, 2026
None of the three entries were breaking. `scope` is still accepted and still compiles; `HistoryActions` rendering nothing under a condition is not an API change; and `MediaEditor.ImageControls` was added in #81563 and has never shipped, so no released caller can reference it. The two that describe real API movement move to Enhancements. The `scope` entry from #81559 goes: it described the same work the `ComplementaryArea` line above it already covers.
ramonjd
added a commit
that referenced
this pull request
Aug 24, 2026
None of the three entries were breaking. `scope` is still accepted and still compiles; `HistoryActions` rendering nothing under a condition is not an API change; and `MediaEditor.ImageControls` was added in #81563 and has never shipped, so no released caller can reference it. The two that describe real API movement move to Enhancements. The `scope` entry from #81559 goes: it described the same work the `ComplementaryArea` line above it already covers.
ramonjd
added a commit
that referenced
this pull request
Aug 24, 2026
None of the three entries were breaking. `scope` is still accepted and still compiles; `HistoryActions` rendering nothing under a condition is not an API change; and `MediaEditor.ImageControls` was added in #81563 and has never shipped, so no released caller can reference it. The two that describe real API movement move to Enhancements. The `scope` entry from #81559 goes: it described the same work the `ComplementaryArea` line above it already covers.
ramonjd
added a commit
that referenced
this pull request
Aug 27, 2026
None of the three entries were breaking. `scope` is still accepted and still compiles; `HistoryActions` rendering nothing under a condition is not an API change; and `MediaEditor.ImageControls` was added in #81563 and has never shipped, so no released caller can reference it. The two that describe real API movement move to Enhancements. The `scope` entry from #81559 goes: it described the same work the `ComplementaryArea` line above it already covers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of:
What?
Override edit post links, i.e. those used in the core media library to point to the experimental media editor, when the "Media Editor (Route)" experiment is active.
Why?
While the media editor is very far from being feature complete (see the parity gaps in #72734) to help those of us working on this to test out the editor and get a feel for those gaps, this PR proposes wiring up the editor so that it's part of the flow of editing and managing media (when the experiment is on).
How?
'get_edit_post_link'and point to the URL for the experimental new media editor.scopeprop that allows a consumer to pass in a custom scope for the editor — this could arguably be its own PR but while testing this PR out, I noticed that in the route-based approach if I'd had the sidebar closed in the media editor modal closed, then it'd be closed in the route-based editor. I think these should be separate scopes and we really want this editor to default to the sidebar being open.Testing Instructions
Enable the Media Editor (Route) experiment:
Go to the Media library screen in wp-admin and click on an image or its "Edit" link:
This should navigate you to the new media editor screen, instead of the core screen.
Then, disable the experiment and double-check that when you use the above link it takes you back to the old screen.
Screenshots or screencast
2026-08-13.14.42.53.mp4
Use of AI Tools
Claude Code (Opus 5) to generate the change, reviewed and tested by me.