API / Minn\Admin / BootPayload

BootPayload final readonly class

Minn\Admin\BootPayload · public/minn/src/Minn/Admin/BootPayload.php · 245 lines

The window.MINN boot payload, assembled from the engine: the keys app.js needs to boot and drive the wp/v2 surface, with capabilities from the engine's own model.

Constants and properties

privatePLUGIN_KEYS_WITHHELD = array ( 0 => 'notices', )

Boot keys the plugin computes that point the app at wp-admin pages the engine does not serve.

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

privatereadonly Minn\Auth\Capabilities $capabilities

Promoted from the constructor.

privatereadonly Minn\Admin\App $app

Promoted from the constructor.

privatereadonly string $engineVersion

Promoted from the constructor.

privatereadonly Minn\Admin\Appearance $appearance

Promoted from the constructor.

privatereadonly Minn\Admin\HiddenIntegrations $hidden

Promoted from the constructor.

privatereadonly Minn\Content\SiteIcon $icon

Promoted from the constructor.

privatereadonly bool $blockTheme

Promoted from the constructor.

privatereadonly ?Minn\Admin\Translations $translations

Promoted from the constructor.

Public

new__construct(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Auth\Capabilities $capabilities, Minn\Admin\App $app, string $engineVersion, Minn\Admin\Appearance $appearance, Minn\Admin\HiddenIntegrations $hidden, Minn\Content\SiteIcon $icon, bool $blockTheme = false, ?Minn\Admin\Translations $translations = NULL)#
methodsiteName(): string#

The site's name, or Site when it has none.

methodbuild(Minn\Auth\Authenticated $session): array#

The window.MINN payload the app boots from, for one signed-in session.

Internals 7

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateuserSlice(Minn\Auth\Authenticated $session, string $role): array#
@return array<string, mixed>
privatesiteSlice(): array#
@return array<string, mixed>
privatecommerce(?array $plugin): bool#

Whether WooCommerce is running: the plugin's own answer when it gave one, else whether the runtime loaded the class.

$pluginarray<string, mixed>|null
privatecaps(int $userId, ?array $plugin): array#

What the app may show, each key a capability the reference gates the same view on. The commerce caps mirror the plugin's own conditions: WC loaded, the WC capability, and for coupons the store having them enabled.

@return array<string, bool>
privatepluginPayload(): ?array#

What Minn Admin's own boot_payload() computes when the plugin runs as code on the runtime, so the app boots with the same keys on both stacks (connectors, discussion defaults, roles, post formats, the adapter flags). Engine-owned keys win; the withheld ones would send the app to a wp-admin page the engine does not have.

privatestandHomeQuery(): void#

The reference serves the app shell from the home query, so the global post is the newest post while the payload is built; the comments feature check reads it through the comments_open filter (a site that closes comments on old posts reports the feature off when its newest post is old).

privateadapterSlices(): array#

What Minn Admin's own adapters contribute when the plugin runs as code on the runtime: plugin surfaces (Tools), editor panels, design sources, editor commands, block forms. Absent, the app's fallbacks apply.