Skip to content

Boot Options

App::boot() accepts a single config array. Only prefix is required — everything else has a sensible default.

Wireframe\App::boot([
'prefix' => 'my-plugin', // Required. Derives slugs, hooks, handles.
'page_title' => 'My Plugin', // Admin menu label.
'option_key' => 'my_plugin_settings', // wp_options key for storage.
'config' => __DIR__ . '/config/settings.php', // Path to a config file — OR an inline array.
'version' => '1.0.0', // Plugin version.
'menu_icon' => 'dashicons-admin-generic',
'menu_position' => 80,
'parent' => 'tools', // Optional. Register as a submenu.
'capability' => 'manage_options',
]);
OptionTypeDefaultDescription
prefixstringRequiredUsed to derive slugs, hook names, JS handles, REST namespaces, and option keys.
page_titlestringucfirst($prefix)Title shown in the admin menu and at the top of the page.
menu_titlestringpage_titleAlternate menu label (page header still uses page_title).
option_keystring{prefix}_settings (hyphens → underscores)The single wp_options row that stores all field values.
configstring|array[]Path to a PHP file that returns the config array, or the config array inline.
versionstring'1.0.0'Plugin version. Used for cache-busting and surfaced in some hooks.
capabilitystring'manage_options'Capability required to view, save, and reset the page.
menu_iconstring'dashicons-admin-generic'Dashicon, image URL, data: URI, inline <svg>, or .svg path. See Menu icon. Ignored when parent is set.
menu_positionint80Position in the WP admin menu.
parentstring''Register as a submenu of the given parent. See Submenu Pages.
pagesarray—Register multiple pages under one prefix. See Multi-Page.
assets_urlstringderivedOverride the URL base for admin assets. Useful for symlinked vendor directories.
// File path
'config' => __DIR__ . '/config/settings.php',
// Inline
'config' => [
'tabs' => [ /* … */ ],
],

A file lets you keep large configs out of the boot call. Inline is convenient for small pages and one-off scripts. Either way, the resulting array shape is the same — see Config Structure.

menu_icon accepts anything add_menu_page() does — a dashicon slug, an image URL, a data: URI, or 'none' — plus two custom-SVG conveniences:

// Inline SVG markup.
'menu_icon' => '<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="..."/></svg>',
// Path to an .svg file shipped with your plugin.
'menu_icon' => __DIR__ . '/assets/icon.svg',

Both are base64-encoded into a data:image/svg+xml URI for you. Use fill="currentColor" (or no fill at all) so the icon inherits the admin colour scheme and highlight states, exactly like a dashicon.

Every consuming plugin calls App::boot() with its own prefix. The framework boots once; each plugin registers its pages independently under its prefix. There’s no global state to coordinate.

// Plugin A
Wireframe\App::boot(['prefix' => 'plugin-a', 'config' => /* … */]);
// Plugin B
Wireframe\App::boot(['prefix' => 'plugin-b', 'config' => /* … */]);

Each plugin gets its own admin page, REST namespace (/plugin-a/v1/…), hooks (plugin-a/settings_saved), and option key — no collisions. When the plugins bundle different versions, all of them run on the newest — see Multi-plugin setup.