Skip to content

refactor(post-date): remove date features now handled by newspack-plugin#2652

Merged
rbcorrales merged 4 commits intotrunkfrom
feat/post-date
Mar 24, 2026
Merged

refactor(post-date): remove date features now handled by newspack-plugin#2652
rbcorrales merged 4 commits intotrunkfrom
feat/post-date

Conversation

@rbcorrales
Copy link
Copy Markdown
Member

@rbcorrales rbcorrales commented Mar 18, 2026

All Submissions:

Changes proposed in this Pull Request:

Removes date features (time-ago relative dates, updated date display, Customizer settings, per-post meta toggles, related JS and CSS) from the classic theme. These features are now centralized in newspack-plugin, which handles rendering for both classic and block themes.

newspack_posted_on() was simplified to output a single <time> element with the publish date only. The plugin handles the updated date via the dedicated newspack_theme_after_posted_on action hook. This avoids interfering with other hooks on newspack_theme_entry_meta.

See the companion plugin PR for full details and testing steps: Automattic/newspack-plugin#4579

Closes NPPD-1277, NPPD-1278.

Companion PRs:

How to test the changes in this Pull Request:

See the plugin PR linked above for comprehensive testing steps covering both themes.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes classic-theme date-related functionality (relative “time ago” dates, updated-date display, Customizer settings, post meta toggles, and related assets) now centralized in newspack-plugin, and ensures the theme continues to expose the newspack_theme_entry_meta hook for plugin-rendered meta.

Changes:

  • Removes “time ago” + updated-date features across PHP, Customizer, JS, and Sass.
  • Simplifies newspack_posted_on() to output only the publish date.
  • Adds do_action( 'newspack_theme_entry_meta' ) to the sponsored + authors header path for parity.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
phpcs-rco.xml Adds an additional PHPCS ruleset for repo checks/linting.
newspack-theme/template-parts/header/entry-header.php Adds newspack_theme_entry_meta action to the sponsored+authors header branch.
newspack-theme/sidebar.php Removes temporary disabling of the (now-removed) time-ago date filter around sidebar rendering.
newspack-theme/sass/site/primary/_posts-and-pages.scss Removes styles related to updated-date UI (label/visibility toggles).
newspack-theme/js/src/relative-time.js Removes the frontend relative-time implementation.
newspack-theme/js/src/post-meta-toggles.js Removes editor toggles for updated-date behavior.
newspack-theme/js/src/customize-controls.js Removes Customizer control behavior for time-ago/updated-date settings.
newspack-theme/inc/template-tags.php Simplifies newspack_posted_on() to a single publish-date <time>.
newspack-theme/inc/template-functions.php Removes time-ago filters and updated-date decision logic.
newspack-theme/inc/customizer.php Removes Customizer settings/controls and inline CSS for date features.
newspack-theme/functions.php Removes constants, script enqueue/localization, and post meta registration for removed date features.
newspack-theme/footer.php Removes temporary disabling of the (now-removed) time-ago date filter in the footer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread phpcs-rco.xml Outdated
Comment thread phpcs-rco.xml Outdated
Comment thread newspack-theme/inc/template-tags.php Outdated
Comment thread newspack-theme/template-parts/header/entry-header.php
@rbcorrales rbcorrales marked this pull request as ready for review March 18, 2026 06:42
@rbcorrales rbcorrales requested a review from a team as a code owner March 18, 2026 06:42
@rbcorrales rbcorrales added the [Status] Needs Review The issue or pull request needs to be reviewed label Mar 18, 2026
@github-actions github-actions Bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Mar 22, 2026
@rbcorrales rbcorrales merged commit aae6ec8 into trunk Mar 24, 2026
11 checks passed
@rbcorrales rbcorrales deleted the feat/post-date branch March 24, 2026 03:01
@github-actions
Copy link
Copy Markdown

Hey @rbcorrales, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

🎉 This PR is included in version 2.21.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.21.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants