Repository navigation
Post summary: Show "Immediately" and relative publish dates in the Date row - #86367
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: +445 B (+0.01%) Total Size: 8.61 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. moves selected text within a paragraph in
|
| /* | ||
| * The publish date wording of the post summary, as the editor's | ||
| * `getPostScheduleLabel()` and `getFullPostScheduleLabel()` have it. This | ||
| * script module can't import the editor, so the strings keep their source and | ||
| * context to share its translations. | ||
| */ |
There was a problem hiding this comment.
This file matches packages/editor/src/components/post-schedule/label.js (how labels are computed in the old inspector) line by line.
There was a problem hiding this comment.
🟡 Changes recommended
The bulk-edit date summary incorrectly shows “Immediately” when no date edit is supplied, misleading users because saving preserves the selected posts’ existing dates.
1 open issue
What changed in this PR
Restores publish-date wording in the DataForm-based post inspector as part of aligning it with Quick Edit, while preserving DataViews date columns.
Changes:
- Adds a read-only
publish_datefield with “Immediately,” relative dates, and timezone-aware labels. - Uses the new field to summarize default post-form Date panels.
- Adds JavaScript and PHP coverage for labels, registration, and form configuration.
| File | Description |
|---|---|
phpunit/view-config-api-test.php |
Tests default Date summaries and custom-form exclusions. |
phpunit/entity-fields-api-test.php |
Updates expected field registration. |
packages/core-fields/src/test/publish-date-view.jsdom.test.tsx |
Tests reset dates, floating dates, and saved status. |
packages/core-fields/src/test/post-type-supports.jsdom.test.ts |
Includes the new field in registration expectations. |
packages/core-fields/src/test/get-publish-date-label.jsdom.test.ts |
Tests relative labels and timezone formatting. |
packages/core-fields/src/post_type_supports/publish_date/view.tsx |
Renders the publish-date summary using saved status. |
packages/core-fields/src/post_type_supports/publish_date/get-publish-date-label.ts |
Implements publish-date label formatting. |
packages/core-fields/src/post_type_supports/publish_date/field.tsx |
Connects the date value and summary renderer. |
packages/core-fields/src/post_type_supports/publish_date/field.php |
Defines the read-only summary field. |
packages/core-fields/src/post_type_supports/index.ts |
Registers the JavaScript field extension. |
packages/core-fields/src/index.php |
Registers the field and excludes design post types. |
lib/compat/wordpress-7.2/view-config-api.php |
Configures default Date panels to use the new summary. |
Review effort: Balanced
A read-only field for every post type but the design ones that shows "Immediately" while the post has no date of its own (reset to `null`, or a draft or pending post still floating) and the status-worded date otherwise. It can't be hidden, sorted, or filtered by, so lists never offer it: it only exists to summarize the `date` panel of a form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The post summary showed "Immediately" for a post without a date of its own until it moved to the form, which shows the date field as lists do. Declaring `publish_date` as the summary of the `date` member restores it in the form only, while lists keep the `date` field. Consumers without the field fall back to the `date` field's own render. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The field showed "Immediately" or the status-worded date of the list. It now uses the wording of the 7.1 post summary: the full date with the site's timezone when the user's timezone differs, "Today at", "Tomorrow at", the date without its year within the current year, and the full date otherwise. The editor's label can't be imported by the script module, so it is copied with its strings and contexts, which keeps the existing translations, along with its tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `date` panel of the post form is now summarized by the `publish_date` field, which words the date as the post summary did: the full month and the site timezone when the browser's differs, and "Today at …" or a date without the year for recent dates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ulk edit Bulk Quick Edit passes only the edits made so far, so before the date is edited it is absent, and the summary read "Immediately" for posts that keep their own dates on save. A reset date is `null`, and still reads "Immediately". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d63a473 to
7cbd4d9
Compare
|
|
||
| // The row renders the date in the site timezone, so the wall time | ||
| // entered above must come back unshifted regardless of the | ||
| // browser timezone. |
There was a problem hiding this comment.
Now that the row reads "Immediately" again, should we bring back the two e2e tests I removed in 85081?
| await expect( dateEl ).toContainText( yy ); | ||
| // A recent date reads as "Today at 10:28 am" or "November | ||
| // 3 10:28 am", without the year, but always has the time. | ||
| await expect( dateEl ).toContainText( /\d{1,2}:\d{2}/ ); |
There was a problem hiding this comment.
Maybe also assert that it doesn't contain Published:?
ntsekouras
left a comment
There was a problem hiding this comment.
Tested manually and code also looks good, thanks! I've left a couple of minor comments about adding/updating tests.
Thanks! These can be follow-ups to |
…te row (#86367) Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.2 branch to get it included in the next release: 5e0cea9 |
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90 - [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269) - Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293) - Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294) - Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295) - Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306) - [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303) - Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308) - Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311) - DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369) - Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329) - [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379) - Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424) - Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359) - Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416) - DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426) - Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367) - [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450) - Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423) - Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491) - URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477) - Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395) - Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463) - Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809) - Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549) - Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968) - i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967) - Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263) - UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501) - Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578) - Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327) - Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511) - iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461) Props mamaduka, wildworks. See #66340. git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90 - [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269) - Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293) - Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294) - Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295) - Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306) - [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303) - Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308) - Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311) - DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369) - Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329) - [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379) - Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424) - Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359) - Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416) - DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426) - Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367) - [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450) - Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423) - Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491) - URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477) - Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395) - Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463) - Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809) - Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549) - Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968) - i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967) - Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263) - UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501) - Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578) - Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327) - Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511) - iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461) Props mamaduka, wildworks. See #66340. Built from https://develop.svn.wordpress.org/trunk@65379 git-svn-id: http://core.svn.wordpress.org/trunk@64518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90 - [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269) - Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293) - Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294) - Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295) - Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306) - [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303) - Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308) - Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311) - DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369) - Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329) - [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379) - Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424) - Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359) - Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416) - DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426) - Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367) - [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450) - Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423) - Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491) - URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477) - Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395) - Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463) - Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809) - Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549) - Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968) - i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967) - Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263) - UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501) - Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578) - Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327) - Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511) - iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461) Props mamaduka, wildworks. See #66340. git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82

Part of #76076
What?
Restores the 7.1 publish date wording ("Immediately", "Today at…", "Tomorrow at…", etc.) in the post editor's DataForm-driven inspector, while DataViews lists keep showing the date as they do today.
Why?
Since the post inspector moved to DataForm, the Date row shows the same value as the DataViews
datecolumn, e.g. "Published: Nov 5, 2026 9:24 am". That's a regression from 7.1, where the row read "Immediately" for a post whose date was reset (null) or still floating, and a relative label ("Today at 9:24 am", "Tomorrow at…") otherwise. Showing a concrete date for anulldate is misleading: the post gets the date of the save.The
datefield can't simply render "Immediately", because it's also the column in DataViews lists, where a floating date is still a date. So the form and the list need different renders for the same data.How?
New
publish_datefield in@wordpress/core-fields, registered for every post type but the design ones (likedate). It's read-only and can't be hidden, sorted, or filtered by, so DataViews never offers it in its properties.Its render ports the editor's
getPostScheduleLabel()/getFullPostScheduleLabel()(the script module can't import@wordpress/editor). The first case that applies wins:nullor floating (draft/auto-draft/pending whose date equals its modified date — checked against the saved status, like the date control does);The strings keep the editor's text and contexts, so existing translations apply.
In a bulk Quick Edit, the summary stays empty until the date is edited: the form only gets the edits made so far, and each post keeps its own date on save. A date reset to
nullstill reads "Immediately".View config (
lib/compat/wordpress-7.2/view-config-api.php): thedatemember of the default post type form getslayout: { type: 'panel', summary: 'publish_date' }. Post types providing their own form are skipped. A consumer without thepublish_datefield falls back to thedatefield's own render, since unresolved summary ids are dropped. Backported to Core in View Config: Summarize the post formdatepanel withpublish_datewordpress-develop#15517.E2E tests: the datepicker and Page List Quick Edit specs expect the new wording ("March 15, 2025 10:00 am …", "Today at …") instead of the list format.
Testing Instructions
npm run test:unit -- packages/core-fields/src/testandnpm run test:unit:php:base -- --filter 'View_Config|Entity_Fields'.Screenshots or screencast
A published post on November 5, 2026, with its date changed to each case. Case 2 was captured with the site at UTC+0 and the browser at UTC+1.
null) or floatingUse of AI Tools
Claude Code (Claude Opus 5.5) wrote the code, tests, and this description under my direction; I reviewed the changes.