ComingSoonNotice
Corex\Config\Operations\ComingSoonNotice · class · Config layer
Tells somebody who is served the real site that visitors are not (spec 101, FR-016). The danger this exists for is a quiet one. An administrator in Coming soon sees their site exactly as it will look after launch, on every page, for weeks — and nothing on it says the public is being shown something else. The bar says so, on every front-end page, with the way to see what a visitor sees; in the admin the same message is a toolbar node. It is a bar of its own on the front end because WordPress’s toolbar can be switched off per user there, and a notice that depends on a preference is not persistent. In the admin the toolbar is always present, so the message goes in it. A browser that holds preview access gets the same bar with a different message and no links (FR-016a): it is a private preview, and the public cannot see it yet. Who sees the bar is not decided here. {@see ComingSoonDecision} names the bar a response carries, so “who is told” cannot drift from “who passes”. It cannot be dismissed.
Public API
Section titled “Public API”__construct(ComingSoonGuard $guard, OperationsModeStore $store)
Section titled “__construct(ComingSoonGuard $guard, OperationsModeStore $store)”register(): void
Section titled “register(): void”enqueue(): void
Section titled “enqueue(): void”render(): void
Section titled “render(): void”html(ComingSoonDecision $decision, bool $canChangeMode): string
Section titled “html(ComingSoonDecision $decision, bool $canChangeMode): string”The bar’s markup for a decided response, or an empty string when the response carries none.
addToolbarNode(WP_Admin_Bar $toolbar): void
Section titled “addToolbarNode(WP_Admin_Bar $toolbar): void”The same message in the admin, where the toolbar is always present.