Activation sets a flag rather than doing work immediately, then the setup wizard connects the site and records client details. This page describes what happens and what you control.
What activation does
WordPress redirects immediately after register_activation_hook fires, so Mantle cannot run its real setup there. Instead the activation hook records two options and lets the next request act on them.
-
Activation hook runs
mantle_activation()addsmantle_activated, records the activating user inmantle_activation_user_id, and setsmantle_flush_rewrite_rules. -
Next request, on init
Bootstrap checks
mantle_activatedat priority 99, fires themantle_activatedaction, then deletes both options so this runs once. -
Conditional redirect
If the request is in the admin, is not a multi-activation (
activate-multiis absent), and the current user is the activating user, Mantle redirects to the setup wizard. -
Migrations
At init priority 100, Mantle compares the stored
versionsetting againstMANTLE_PLUGIN_VERSIONand runs migrations if it is behind.
The wizard lives at:
/wp-admin/admin.php?page=mantle&view=setupComplete setup
The wizard is a React view backed by its own REST namespace, separate from ordinary settings:
| Route | Methods | Purpose |
|---|---|---|
/mantle/v1/setup | GET, POST | Read and write the setup payload |
/mantle/v1/setup/<setting_key> | GET, POST | Read and write a single setup key |
/mantle/v1/pin | POST | Begin PIN-based verification |
/mantle/v1/pin/<pin> | POST | Submit a four-digit PIN |
/mantle/v1/connector | GET | Start the connection flow |
/mantle/v1/connector/callback | GET | OAuth callback |
Setup data is stored separately from the main settings option and is read through Mantle\Model\Setup, which supports dot notation for nested keys such as authentication.steps.pin.status.
Enable modules
Three modules — client_info, dashboard, and welcome — are type core and are always enabled; is_enabled() returns true for them unconditionally and they cannot be switched off. The other thirteen are functional and default to whatever is recorded in the mantle_modules option.
/wp-json/mantle/v1/modules
Accept application/jsonX-WP-Nonce REPLACE_WITH_REST_NONCE
[
{ "slug": "client_info", "name": "Client Info", "active": true, "type": "core" },
{ "slug": "monitoring", "name": "Monitoring", "active": false, "type": "functional" }
]The response shape is the mantle_modules option: each entry carries slug, name, active, and type. Toggle a module by posting to /mantle/v1/modules/<module_id>.
Enabling a module takes effect on the next request: Module_Loader::update_module_status() writes the option, clears its in-memory module list, and re-fires mantle_register_module.
Verify
wp mantle settings auditOption: mantle
Schema keys: 102
Saved keys: 102
Missing schema keys: 0
Orphaned saved keys: 0
Success: Settings audit passed. Saved keys match the registered schema.
Mantle is installed, setup is complete, and the settings option matches the registered schema. Continue with the module guides or the reference section.
Next steps
- Managing modules
- Capability reference — what Mantle grants to which roles.