Mantle is configured in two places: PHP constants that must be defined before the plugin boots, and a settings option managed through the admin UI, the REST API, or WP-CLI.
Constants
mantle.php defines these constants at load time. Only the three guarded ones can be overridden from wp-config.php; the rest are fixed values the plugin uses internally.
Plugin constants
mantle.php. Constants marked overridable are wrapped in if ( ! defined( … ) ), so a value set earlier in wp-config.php wins.-
MANTLE_PLUGIN_DEBUGboolean -
Overridable. Enables plugin debug behaviour.
-
MANTLE_PLUGIN_DEV_MODEboolean -
Overridable. Enables development-mode behaviour.
-
MANTLE_SSO_PREFLIGHT_SALTstring -
Overridable. Salt used when signing SSO preflight requests. Change this per site.
-
MANTLE_PLUGIN_VERSIONstring -
Fixed. Managed by release-please; also drives the migration check.
-
MANTLE_PLUGIN_FILEstring -
Fixed. Absolute path to
mantle.php. -
MANTLE_PLUGIN_PATHstring -
Fixed. Plugin directory path from
plugin_dir_path(). -
MANTLE_PLUGIN_URLstring -
Fixed. Plugin directory URL from
plugin_dir_url(). -
MANTLE_PLUGIN_NAMEstring -
Fixed. Display name.
-
MANTLE_API_URLurl -
Fixed. Linchpin API base URL used for site reporting and connection.
-
MANTLE_SHOP_URIurl -
Fixed. Licence server used for activation and deactivation.
-
MANTLE_SHOP_PRODUCT_IDnumber -
Fixed. Mantle’s product ID on the licence server.
-
DISALLOW_FILE_EDITboolean -
WordPress core constant. Mantle forces this to
trueunless already defined, disabling the plugin and theme file editors.
No fields match this filter.
To override an overridable constant, define it in wp-config.php above the require_once ABSPATH . 'wp-settings.php'; line:
// Per-site SSO salt. Do not reuse across environments.define( 'MANTLE_SSO_PREFLIGHT_SALT', 'replace-with-a-unique-random-string' );// Keep the WordPress file editors available.define( 'DISALLOW_FILE_EDIT', false );require_once ABSPATH . 'wp-settings.php';
Settings
All module settings live in a single serialised WordPress option named mantle. The schema is assembled at runtime: Mantle\Model\Settings::get_settings_schema() applies a filter that every module hooks into, so the schema always describes exactly the modules present on the site.
How a settings key comes to exist
Reading a setting merges saved values over schema defaults, and any saved key absent from the schema is discarded on read. That means removing a module makes its keys inert rather than corrupting the option.
For the complete list of keys, see the settings reference.
Reading and writing settings
$settings = new \Mantle\Model\Settings();// Read one key.$enabled = $settings->get_setting( 'maintenance_enabled' );// Write one key.$settings->save_setting( 'maintenance_enabled', true );
# Audit the whole option against the schema.wp mantle settings audit# Toggle maintenance mode.wp mantle maintenance enable
# Read every setting the current user may see.curl --cookie "$COOKIE" \ -H "X-WP-Nonce: $NONCE" \ https://example.com/wp-json/mantle/v1/settings
Migrations
On every init (priority 100) Mantle compares the version setting with MANTLE_PLUGIN_VERSION. When the stored version is older, it runs its migrations and writes the new version back. It also ensures the AI chatbot conversations table exists; that check short-circuits on a single autoloaded option read when the schema is current.
Next steps
- First run — the setup wizard and enabling modules.
- Settings reference — every registered key.