Repository navigation
Status field: Own the rules that clear the date and the password - #87547
Conversation
The status field's `setValue` already clears a scheduled post's future date when it leaves `future`, and the password when it becomes `private`. The quick edit modals of the site editor (v1 and v2) repeated both rules in their `onChange`, so drop them there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The post summary's `onChange` cleared the future date and the password on status changes, as the status field's `setValue` already does. Keep only the routing of namespaced edits to their entities. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 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: -130 B (0%) Total Size: 8.73 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 display legacy widgets in
|
…side effects to the status field (WordPress#87547)
What?
Removes the status side effects that three forms repeated in their
onChange, since the status field already applies them in itssetValue:packages/edit-site/src/components/post-list/quick-edit-modal.tsx);routes/post-list/quick-edit-modal.tsx);packages/editor/src/components/sidebar/dataform-post-summary.jsx), which keeps its routing of namespaced edits to their entities.Related: #87541, which moves another rule of the quick edit modals (the template of the front page and the posts page) into its field. And #85947 (comment)
Why?
The status field in
@wordpress/core-fieldsclears a scheduled post's future date when the post leavesfuture, and the password when the post becomesprivate(#86065). The radio control of the field sends every change throughsetValue, so by the time a form'sonChangeruns, those edits are already in it. The copies in the forms only duplicated the rule, and could drift from it.How?
Each
onChangenow passes the edits on as they come. The forms render the same data the field reads (the record merged with the local edits), so the outcome is the same.The field compares the date with
isInTheFuture()from@wordpress/date, which uses the site's timezone, while the forms comparednew Date( date ) > new Date()in the browser's timezone. That only mattered when the field's edits were overridden by the form's, so the field's rule now applies everywhere.Testing Instructions
Unschedule:
Screen.Recording.2026-11-27.at.12.11.22.mov
Remove password:
gutenberg-extensible-site-editorexperiment on) and in the inspector of the editor.The rules themselves are covered by the unit tests of the field (
packages/core-fields/src/test/post-type-supports.jsdom.test.ts).Screen.Recording.2026-11-27.at.12.12.44.mov
Testing Instructions for Keyboard
No UI changes.
Use of AI Tools
Written with Claude Code (Claude Opus 5.5), reviewed by the author.