SiteScopeManager
Corex\Multisite\SiteScopeManager · class · Core layer
Treats switches and restores identically because WordPress emits switch_blog for both directions with the same signature. Acting only on a changed current id is symmetric, idempotent, and immune to an unbalanced WordPress switch stack.
Public API
Section titled “Public API”__construct(MultisiteContext $multisite, SiteContext $site, EventDispatcher $events, ListenerProvider $listeners)
Section titled “__construct(MultisiteContext $multisite, SiteContext $site, EventDispatcher $events, ListenerProvider $listeners)”listen(): void
Section titled “listen(): void”Self-gated on the install shape rather than trusting the caller to check, so a single-site request can never acquire a switch_blog callback however this is wired (spec FR-004, SC-008). Priority zero is deliberate: every future CoreX switch_blog listener must use priority 10 or later so it observes post-invalidation state.