Skip to content

Proposal: Add On This Day Widget#11630

Open
alshakero wants to merge 9 commits intoWordPress:trunkfrom
alshakero:add/on-this-day-widget
Open

Proposal: Add On This Day Widget#11630
alshakero wants to merge 9 commits intoWordPress:trunkfrom
alshakero:add/on-this-day-widget

Conversation

@alshakero
Copy link
Copy Markdown

@alshakero alshakero commented Apr 22, 2026

Summary

Adds a new On This Day dashboard widget to WordPress core that surfaces the current user's posts published on today's month and day in previous years, so returning authors see a friendly nudge of what they wrote one, five, or ten years ago.

The widget is implemented as a first-class core feature, following the same pattern as Site Health.

User-facing behavior

  • Widget title reads On This Day · <Month Day> and appears in the dashboard grid for users with edit_posts.
  • Each year is shown with a year badge (e.g. 2023 · 3 yrs) and the posts published that day as cards with excerpt, time, categories, and Edit/View links.
  • Draft and private posts are included for the author and visually distinguished; public posts link to the edit screen with a View link to the permalink.
  • Empty state messaging encourages the author when today has no historical posts.

Screenshots

image

Different color scheme

image

RTL

image

Testing

  • Checkout this PR locally and run npm run env:start, then npm run env:install.
  • Go to Dashboard (admin:password), you should see the widget.
  • Insepect its empty state.
  • Import this file to create backdated posts: filexml
  • Use the widget.

Notes for reviewers

  • The WP_Query call intentionally uses a posts_where filter scoped to a single query to match MM-DD in an index-friendly way rather than inflating meta_query/date_query.
  • The class is loaded lazily inside wp_dashboard_setup() (basically copied the Site Health loader) so it has no cost on non-dashboard admin screens.

Trac ticket: https://core.trac.wordpress.org/ticket/65116#ticket

Use of AI Tools

AI assistance: Yes
Tool(s): Cursor
Model(s): Claude Opus 4.7
Used for: The code is 100% written with AI, but I guided it every step of the way and reviewed every line.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@alshakero alshakero marked this pull request as ready for review April 22, 2026 22:19
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

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 props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @escapemanuele.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core Committers: Use this line as a base for the props when committing in SVN:

Props alshakero.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@escapemanuele
Copy link
Copy Markdown

image

Nice, nice! I must have some CSS issue here as I do not see the dates on the left.

@alshakero
Copy link
Copy Markdown
Author

alshakero commented Apr 23, 2026

Nice, nice! I must have some CSS issue here as I do not see the dates on the left.

It looks like the Playground is running an outdated build. I rebased to rebuilt. Hopefully that will fix it.

Edit: It's a playground issue, I updated the testing steps.

@escapemanuele
Copy link
Copy Markdown

Tested locally and it loads just fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants