Opened 3 weeks ago
Closed 7 days ago
#65658 closed defect (bug) (fixed)
The On This Day Widget should handle untitled posts more nicely
| Reported by: | alshakero | Owned by: | joedolson |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | Widgets | Version: | trunk |
| Severity: | minor | Keywords: | has-patch has-unit-tests has-test-info has-screenshots commit |
| Cc: | Focuses: | administration |
Description
All details can be seen here: https://wordpress.org/support/topic/on-this-day-widget/
To summarize, when a post has no title, the widget should show a few words from the post's body instead of "(no title)".
Attachments (9)
Change History (26)
This ticket was mentioned in PR #12581 on WordPress/wordpress-develop by @alshakero.
3 weeks ago
#1
- Keywords has-patch has-unit-tests added; needs-patch removed
@bph commented on PR #12581:
3 weeks ago
#2
Thank you @alshakero for jumping right on it!
#3
@
3 weeks ago
- Milestone → 7.1
- Owner set to
- Status new → accepted
- Type enhancement → defect (bug)
- Version → trunk
I'm switching this to a bug, on the grounds that it's an inconsistency in how posts are represented between these two cases, and the content will be significantly more relevant in cases where it applies.
#4
@
3 weeks ago
- Keywords has-test-info has-screenshots added
Test report for PR 12581 against current trunk (7.1-beta3-src).
Environment: Windows host, wordpress-develop Docker environment, Chrome. Test data created via WP-CLI: a titled post and an untitled post backdated to today's date in 2024, plus a password-protected untitled post backdated to 2025.
Unit tests:
--filter OnThisDay:OK (15 tests, 36 assertions)— includes the PR's new coverage for the trimmed-excerpt and password-protected cases.--filter dashboard:OK (4 tests, 7 assertions). PHPUnit 9.6.35, no failures or errors.
Manual verification (trunk → PR 12581):
| Case | Trunk | With PR 12581 |
|---|---|---|
| Untitled post | bare "(no title)" | "(no title)" + trimmed ~15-word excerpt, matching the posts list table ✅ |
| Password-protected untitled post | bare "(no title)" | still bare "(no title)" — no excerpt ✅ |
| Titled post | normal | unchanged ✅ |
Password-protection guard, verified at output level: searched the rendered dashboard HTML via view-source — the protected post's content appears zero times anywhere in the page, so the guard holds in real rendering, not only in the unit tests.
Result: the fallback works as described and the protection guard holds. Tests well.
One observation for consideration (not a blocker): the Activity → Recently Published widget on the same dashboard still shows bare "(no title)" for the same untitled posts. If the rationale in comment:3 is consistency of untitled-post representation, Activity may be worth the same treatment in a follow-up.
This ticket was mentioned in Slack in #core-test by huzaifaalmesbah. View the logs.
3 weeks ago
@alshakero commented on PR #12581:
2 weeks ago
#6
Addressed all!
@alshakero commented on PR #12581:
13 days ago
#7
Hi @peterwilsoncc! Can we have this merged? I think it's good to go.
#8
@
12 days ago
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/12581
Environment
- WordPress: 7.1-beta3-20260727.223424
- Subdirectory: No
- PHP: 8.3.32
- Server: PHP.wasm
- Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
- Browser: Chrome 150.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.5
- MU Plugins: None activated
- Plugins:
- Test Reports 1.3.0
Steps taken
- Opened the WordPress Playground preview for PR #12581 and logged in to the admin dashboard.
- Created a new post with content and set its publication date to match the current month and day so it would appear in the On This Day dashboard widget.
- Removed the post title and published the post.
- Verified that, before applying the patch, the widget displayed only "(no title)" for the untitled post.
- Repeated the same steps with the patch applied.
- Confirmed that the widget displayed "(no title)" followed by a trimmed excerpt of the post content.
- Created another untitled post with password protection enabled and confirmed that only "(no title)" was displayed, with no excerpt exposed.
- Verified that posts with titles continued to display normally.
Result: ✅ Patch is solving the problem.
Expected result
- Untitled posts in the On This Day dashboard widget should display "(no title)" followed by a trimmed excerpt when the current user can read the post and the post is not password protected.
- Password-protected untitled posts should continue to display only "(no title)", without exposing any excerpt.
- Posts with titles should remain unchanged.
Additional Notes
Comparison of behavior before and after applying the patch:
- Untitled post
- Trunk: Displays only "(no title)".
- With PR #12581: Displays "(no title)" followed by a trimmed (~15-word) excerpt, matching the behavior of the Posts list table. ✅
- Password-protected untitled post
- Trunk: Displays only "(no title)".
- With PR #12581: Continues to display only "(no title)", with no excerpt exposed. ✅
- Titled post
- Trunk: Displays normally.
- With PR #12581: No change in behavior. ✅
No regressions or unexpected behavior were observed during testing.
Screenshots/Screencast with results
- Screenshot before applying the patch.
- Screenshot after applying the patch.
- Screenshot of the password-protected untitled post (optional).
Support Content
- WordPress Playground preview for PR #12581.
- Before/after screenshots demonstrating the fix.
#9
@
12 days ago
Test Report
Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/12581.diff
Environment
- WordPress: 7.1-beta3-62828-src
- Subdirectory: No
- PHP: 8.3.31
- Server: nginx/1.31.2
- Database: mysqli (Server: 9.7.2 / Client: mysqlnd 8.3.31)
- Browser: Chrome 150.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.5
- MU Plugins: None activated
- Plugins:
- WordPress Importer 0.9.5
- Test Reports 1.3.0
Steps taken
- Launched the WordPress environment via both Playground and Docker and verified the "On This Day" dashboard widget.
- Imported backdated test posts using the XML file.
- Edited a post to remove its title and returned to the dashboard to confirm it correctly renders as
(no title)followed by the 15-word excerpt fallback. - Created an untitled post with password protection enabled and verified that only
(no title)is displayed with no excerpt exposed.
- ✅ Patch is solving the problem
Expected result
- When a matching post in the "On This Day" widget has no title, it should display a
(no title)fallback followed by a trimmed excerpt (for readable, non-password-protected posts), matching the posts list table behavior.
Additional Notes
- Successfully tested and verified the patch.
Screenshots/Screencast with results
- Yes
Support Content
- Patch URL:
https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/12581.diff
#10
@
12 days ago
✅ After pulling the PR the on This Day widget is working as expected with protected posts as well.
@alshakero commented on PR #12581:
10 days ago
#11
@joedolson @t-hamano thanks for the reviews! Addressed.
@annezazu commented on PR #12581:
8 days ago
#12
Thanks so much for jumping right on this. I just managed to test this today and opened a trac issue prematurely only to find you all are all over it. It's looking great to me, UI wise.
#14
@
8 days ago
Test Report
This Report Validates that the indicated patch address the issue.✅
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/12581
Environment:
WordPress - 7.1-beta4-20260731.072215
OS - Windows
Browser - Chrome
Theme: Twenty Twenty Five
PHP - 8.2
Plugin - None
Actual Results:
- Issue Resolved with Patch ✅
Additional Notes
- With this PR, the issue is resolved. The only remaining item is to address the review feedback by adding the two requested test cases.
Supplemental Artifacts
- Attached
@alshakero commented on PR #12581:
8 days ago
#15
Hi @t-hamano! Addressed. Thank you so much for the review.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)


## Summary
Trac: https://core.trac.wordpress.org/ticket/65658
See: https://wordpress.org/support/topic/on-this-day-widget/
This adds the same untitled-post fallback used in the posts list table to the On This Day dashboard widget. When a matching post has no title, the widget now appends a trimmed excerpt after
(no title)when the current user can read the post and the post is not password protected.The change keeps protected post excerpts hidden and adds PHPUnit coverage for the trimmed excerpt and password-protected cases.
## Testing
(no title) 15 word excerpt.