refactor(post-date): remove date features now handled by newspack-plugin#2652
refactor(post-date): remove date features now handled by newspack-plugin#2652rbcorrales merged 4 commits intotrunkfrom
Conversation
There was a problem hiding this comment.
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.
cf5ab87 to
d8c7584
Compare
|
Hey @rbcorrales, good job getting this PR merged! 🎉 Now, the 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! ❤️ |
|
🎉 This PR is included in version 2.21.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.21.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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 dedicatednewspack_theme_after_posted_onaction hook. This avoids interfering with other hooks onnewspack_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: