Repository navigation
feat: let a site switch off the Active Posts dashboard widget - #774
josephfusco merged 5 commits into
Conversation
Add a dashboard-widget feature and gate the Active Posts widget's hooks behind wp_presence_feature_enabled(), the way WordPress#724 did for post locks, so a site can switch it off on Settings > Presence API. Part of WordPress#710.
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
🛝 WordPress PlaygroundsBuilt from cb14b47
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #774 +/- ##
=========================================
Coverage 94.83% 94.84%
Complexity 268 268
=========================================
Files 29 29
Lines 4050 4054 +4
=========================================
+ Hits 3841 3845 +4
Misses 209 209
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Quick note on CI: the two red checks are the |
josephfusco
left a comment
There was a problem hiding this comment.
Merged main to clear the conflicts and moved the widget order filter into your block with a test, the last bit from the review. Thanks!

Adds a
dashboard-widgetfeature so a site can switch off the Active Posts dashboard widget on Settings > Presence API, following the pattern #724 set for post locks and #768 for the Editors column.What changed
includes/features.php: add thedashboard-widgetentry towp_presence_get_features().includes/default-filters.php: gatewp_dashboard_setup → WP_Presence_Widget_Active_Posts::registerandheartbeat_received → WP_Presence_Widget_Active_Posts::heartbeat_receivedbehindwp_presence_feature_enabled( 'dashboard-widget' ), leaving every file loaded.tests/test-features.php: assert the hooks follow the switch, and account for the feature in the sanitize, settings-field and network-save tests.README.md: note the switch on the feature and in thewp_presence_feature_enabledlist.How to test
Unchecking Dashboard widget on Settings > Presence API removes the Active Posts widget on the next Dashboard load, checking it brings it back, and the suite passes:
npm testFixes #730.
Implemented with AI assistance (Claude Code), mirroring the merged #724/#768 pattern; reviewed and verified before submitting.