Skip to content

Exclude archived/deleted/spammed sites from user notification settings picker#70

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/exclude-archived-sites-notifications
Draft

Exclude archived/deleted/spammed sites from user notification settings picker#70
Copilot wants to merge 2 commits into
masterfrom
copilot/exclude-archived-sites-notifications

Conversation

Copy link
Copy Markdown

Copilot AI commented May 1, 2026

On multisite networks, the user notification settings picker displayed all Falcon-enabled sites regardless of their status, causing archived, deleted, and spammed sites to clutter the UI.

Changes

  • filter_inactive_sites( $sites ) — new protected static helper on Falcon_Manager that intersects a list of enabled site IDs against available_sites() (which already queries wp_get_sites() with archived=false, deleted=false, spam=false)
  • user_profile_fields() — applies filter_inactive_sites() before passing sites to the network profile fields action, so inactive sites never render in the picker
  • save_profile_settings() — applies the same filter before dispatching the save action, keeping display and persistence consistent
protected static function filter_inactive_sites( $sites ) {
    $available_site_ids = wp_list_pluck( self::available_sites(), 'blog_id' );
    return array_values( array_intersect( $sites, $available_site_ids ) );
}

The falcon_enabled_sites option itself is unchanged — the filtering happens at runtime so it self-corrects as site statuses change without requiring any data migration.

Copilot AI changed the title [WIP] Fix displayed archived sites in user notifications picker Exclude archived/deleted/spammed sites from user notification settings picker May 1, 2026
Copilot finished work on behalf of rmccue May 1, 2026 21:18
Copilot AI requested a review from rmccue May 1, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Archived sites are displayed in the user notifications picker

2 participants