You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let a site switch off the online filter and count on Users #727
Good First IssueIssue particularly suitable to be worked on by new contributors[Area] Admin UIIssues for the admin UI integrations[Type] EnhancementA suggestion for improvement of an existing feature
Users gets an Online view with a live count. A site that doesn't want it can't remove it without code.
How
#724 adds the switch and does post locks end to end; copy it. Start once it merges.
Add an entry to wp_presence_get_features() in includes/features.php: key user-list, a label and a one-sentence description of what switching it off removes.
In includes/default-filters.php, wrap the hooks below in if ( wp_presence_feature_enabled( 'user-list' ) ) { … } with the same "Plugin only" comment the post-locks block has. Leave every file loaded; only the hooks are gated.
Add tests to tests/test-features.php, following test_switching_post_locks_off_leaves_their_hooks_unregistered(): with the switch off none of these hooks are registered, and with it on each is back at its priority.
Mention the switch in the README section for the piece.
Hooks to gate
Hook
Callback
Priority
views_users
wp_presence_users_views
10
pre_get_users
wp_presence_filter_online_users
10
heartbeat_received
wp_presence_users_list_heartbeat_received
13
heartbeat_received
wp_presence_users_online_count_heartbeat_received
13
The network Users screen has its own hooks in ms-default-filters.php; those belong to the network admin switch, not this one.
How we will know it is done
Unchecking Users list on Settings > Presence API removes the piece on the next page load, checking it brings it back, and the suite passes:
Good First IssueIssue particularly suitable to be worked on by new contributors[Area] Admin UIIssues for the admin UI integrations[Type] EnhancementA suggestion for improvement of an existing feature
Activity