mantle.php defines these constants when the plugin file loads, before any class is instantiated. Three are guarded with if ( ! defined( … ) ) and can therefore be overridden from wp-config.php; the rest are unconditional.
Overridable
Overridable constants
if ( ! defined( … ) ). Define these in wp-config.php before WordPress loads plugins.-
MANTLE_PLUGIN_DEBUGboolean -
Enables plugin debug behaviour.
-
MANTLE_PLUGIN_DEV_MODEboolean -
Enables development-mode behaviour.
-
MANTLE_SSO_PREFLIGHT_SALTstring -
Salt used when signing SSO preflight requests. The default is a literal committed to the repository, so it is identical on every site that does not override it.
No fields match this filter.
Fixed
These are defined unconditionally, so a value set earlier in wp-config.php produces a PHP notice about redefinition rather than taking effect.
Fixed constants
mantle.php.-
MANTLE_PLUGIN_VERSIONstring -
Managed by release-please via an inline marker comment. Compared against the stored
versionsetting to decide whether migrations run. -
MANTLE_PLUGIN_NAMEstring -
Display name.
-
MANTLE_PLUGIN_FILEstring -
Absolute path to
mantle.phpfrom__FILE__. -
MANTLE_PLUGIN_PATHstring -
Plugin directory path from
plugin_dir_path(). Trailing slash included. -
MANTLE_PLUGIN_URLstring -
Plugin directory URL from
plugin_dir_url(). -
MANTLE_API_URLurl -
Linchpin API base URL used for site reporting and connection.
-
MANTLE_SHOP_URIurl -
Licence server used for activation, deactivation, and uninstall.
-
MANTLE_SHOP_PRODUCT_IDnumber -
Mantle’s product ID on the licence server.
No fields match this filter.
WordPress constants Mantle sets
Core constants
-
DISALLOW_FILE_EDITboolean -
Mantle forces this to
trueunless it is already defined, disabling the plugin and theme file editors in the admin.
No fields match this filter.
Constants Mantle reads but never defines
The SSO module checks these with defined() at runtime. They exist nowhere in mantle.php, so a site that does not declare them simply takes the documented default.
SSO constants
wp-config.php. Each one overrides the equivalent stored setting, which is what makes them usable to recover a site whose settings are wrong.-
MANTLE_SSO_DISABLEboolean -
Registers none of the SSO hooks, whatever the module state says. The last resort when SSO itself is what is broken.
-
MANTLE_SSO_AUTO_REDIRECTboolean -
Pins the automatic wp-login.php to SSO redirect on or off, overriding the sso_auto_redirect setting. Ignored when the site has no site_secret.
-
MANTLE_SSO_BYPASS_TOKENstring -
Value the bypass query parameter must carry to reach the standard login form while the automatic redirect is on.
-
MANTLE_SSO_DISALLOW_ALL_DIRECT_LOGINboolean -
Rejects username and password authentication for every account and disables password resets. SSO becomes the only way in.
-
MANTLE_SSO_DEFAULT_ROLEstring -
Role given to an SSO user that org-unit mapping and the domain allowlist both decline to match.
-
MANTLE_SSO_GRANT_SUPER_ADMINboolean -
Multisite only. Grants super admin to newly provisioned SSO users.
No fields match this filter.
Overriding constants
// Unique per site and per environment.define( 'MANTLE_SSO_PREFLIGHT_SALT', 'replace-with-a-unique-random-string' );// Optional: verbose plugin debugging on a staging site.define( 'MANTLE_PLUGIN_DEBUG', true );// Optional: keep the WordPress file editors.define( 'DISALLOW_FILE_EDIT', false );/* That's all, stop editing! Happy publishing. */require_once ABSPATH . 'wp-settings.php';
-
Line 2Generate this with a password manager or
wp eval 'echo wp_generate_password( 64, false );'. -
Line 11Anything defined after this line is too late — plugins have already loaded.
Dependency loading
Two further behaviours in mantle.php are worth knowing when debugging a fatal error on boot.
-
Composer autoloader
If
vendor/autoload.phpexists it is included and the returnedClassLoaderis retained. -
AI Client de-shadowing
When WordPress core ships
wp-includes/php-ai-client/src/AiClient.phpand the plugin also has a copy, Mantle callssetPsr4( 'WordPress\\AiClient\\', [] )to unregister its own prefix so core’s copy wins. Loading both causes class and interface conflicts. -
Scoped dependencies
If
third-party/vendor/autoload.phpexists it is required. These are PHP-Scoper-prefixed dependencies, isolated to avoid clashing with other plugins. -
Boot
mantle_init()runs onplugins_loaded, instantiatesCore\Bootstrap, and callsrun().
See also
- Configuration — how these relate to the settings option.