close
Skip to content

feat: let a site switch off the Active Posts dashboard widget - #774

Merged
josephfusco merged 5 commits into
WordPress:mainfrom
aldorizona10-glitch:feat/dashboard-widget-switch
Oct 8, 2026
Merged

josephfusco merged 5 commits into
WordPress:mainfrom
aldorizona10-glitch:feat/dashboard-widget-switch

Conversation

@aldorizona10-glitch

Copy link
Copy Markdown
Contributor

Adds a dashboard-widget feature 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 the dashboard-widget entry to wp_presence_get_features().
  • includes/default-filters.php: gate wp_dashboard_setup → WP_Presence_Widget_Active_Posts::register and heartbeat_received → WP_Presence_Widget_Active_Posts::heartbeat_received behind wp_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 the wp_presence_feature_enabled list.

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 test

Fixes #730.


Implemented with AI assistance (Claude Code), mirroring the merged #724/#768 pattern; reviewed and verified before submitting.

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.
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

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.

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

Props aldorza, joefusco.

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

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🛝 WordPress Playgrounds

Built from cb14b47

Post locks RTC Settings
Single site Launch post locks, single site Launch RTC, single site Launch settings, single site
Multisite Launch post locks, multisite Launch RTC, multisite Launch network settings, multisite

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.84%. Comparing base (a378d1f) to head (cb14b47).

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           
Flag Coverage Δ
multisite 94.84% <100.00%> (+<0.01%) ⬆️
phpunit 73.87% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aldorizona10-glitch

Copy link
Copy Markdown
Contributor Author

Quick note on CI: the two red checks are the e2e / Playwright (chromium-multisite) job failing at the Install Playwright system dependencies step (apt), so the e2e tests were skipped rather than failing — and the e2e / Playwright summary job went red as a result. The single-site e2e / Playwright (chromium), phpcs, phpstan and phpunit (7.4 / 8.3 / SQLite) are all green, so this looks like a transient runner/infra hiccup rather than anything in the change. A re-run of the failed jobs should clear it — I don't have permission to re-run myself. Thanks!

josephfusco

This comment was marked as outdated.

github-actions Bot added a commit that referenced this pull request Oct 7, 2026
github-actions Bot added a commit that referenced this pull request Oct 8, 2026
github-actions Bot added a commit that referenced this pull request Oct 8, 2026

@josephfusco josephfusco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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!

@josephfusco
josephfusco merged commit 62ed7b6 into WordPress:main Oct 8, 2026
25 checks passed
@github-actions github-actions Bot added this to the 0.17.0 milestone Oct 8, 2026
@josephfusco josephfusco added [Type] Enhancement A suggestion for improvement of an existing feature [Area] Widgets Issues for the dashboard widgets php Pull requests that update php code labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Widgets Issues for the dashboard widgets php Pull requests that update php code [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let a site switch off the Active Posts dashboard widget

2 participants