Repository navigation
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +160 B (0%) Total Size: 8.58 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. should place the caret at the click position when clicking a block that is not selected in
|
|
Not sure if this the right way to go about this. I think the current state of things is confusing for users, who should be able to clear a field. |
What?
Let users clear and replace attachment titles while editing, and require a title containing at least one non-space character before saving in the media editor.
Why?
The attachment title field uses a display helper that substitutes
(no title)for an empty value, so the controlled input immediately puts that text back when the user clears it. Returning the actual editable value fixes that behavior, while explicit validation prevents saving an empty or whitespace-only title.2026-11-03.11.16.40.mp4
How?
Read the raw attachment title with the existing raw-content helper. Add the field’s required rule and a custom validator for whitespace-only values. Use DataViews’ existing
useFormValidityhook for editable fields in the media editor, pass the resulting feedback toMediaForm, and disable and guard Save while those fields are invalid. Read-only metadata is excluded from validation because users cannot correct it in this form.2026-11-03.11.54.07.mp4
Testing Instructions
Validation
Use of AI Tools
Codex prepared the code changes, ran validation, and wrote this pull request description.