Skip to content

Let a site switch off the admin bar faces #726

Closed

Description

@josephfusco

The admin bar shows the faces of who is online. 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.

  1. Add an entry to wp_presence_get_features() in includes/features.php: key admin-bar, a label and a one-sentence description of what switching it off removes.
  2. In includes/default-filters.php, wrap the hooks below in if ( wp_presence_feature_enabled( 'admin-bar' ) ) { … } with the same "Plugin only" comment the post-locks block has. Leave every file loaded; only the hooks are gated.
  3. 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.
  4. Mention the switch in the README section for the piece.

Hooks to gate

Hook Callback Priority
admin_bar_menu wp_presence_admin_bar_node 80
admin_enqueue_scripts wp_presence_admin_bar_assets 10
wp_enqueue_scripts wp_presence_admin_bar_assets 10
heartbeat_received wp_presence_admin_bar_heartbeat_received 13

Leave wp_refresh_nonces → wp_presence_refresh_screen_token ungated. It lives in admin-bar.php, but it hands a fresh screen token to presence-ping.js, which every admin page runs whether or not the admin bar shows faces.

How we will know it is done

Unchecking Admin bar on Settings > Presence API removes the piece on the next page load, checking it brings it back, and the suite passes:

npm test

Part of #710.

Activity

  1. added
    [Type] Enhancement
    [Area] Admin UI
    Good First Issue
    on Oct 5, 2026
  2. guzel commented on Oct 6, 2026

    @guzel
    Contributor

    Hi @josephfusco, I'd like to work on this if it's not taken.

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

Metadata

Metadata

Assignees

Labels

Good First Issue[Area] Admin UI[Type] Enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions