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',]);Reference
Section titled “Reference”| Option | Type | Default | Description |
|---|---|---|---|
prefix | string | Required | Used to derive slugs, hook names, JS handles, REST namespaces, and option keys. |
page_title | string | ucfirst($prefix) | Title shown in the admin menu and at the top of the page. |
menu_title | string | page_title | Alternate menu label (page header still uses page_title). |
option_key | string | {prefix}_settings (hyphens → underscores) | The single wp_options row that stores all field values. |
config | string|array | [] | Path to a PHP file that returns the config array, or the config array inline. |
version | string | '1.0.0' | Plugin version. Used for cache-busting and surfaced in some hooks. |
capability | string | 'manage_options' | Capability required to view, save, and reset the page. |
menu_icon | string | 'dashicons-admin-generic' | Dashicon, image URL, data: URI, inline <svg>, or .svg path. See Menu icon. Ignored when parent is set. |
menu_position | int | 80 | Position in the WP admin menu. |
parent | string | '' | Register as a submenu of the given parent. See Submenu Pages. |
pages | array | — | Register multiple pages under one prefix. See Multi-Page. |
assets_url | string | derived | Override the URL base for admin assets. Useful for symlinked vendor directories. |
config accepts a path or an inline array
Section titled “config accepts a path or an inline array”// 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
Section titled “Menu icon”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.
Multiple plugins, one framework
Section titled “Multiple plugins, one framework”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 AWireframe\App::boot(['prefix' => 'plugin-a', 'config' => /* … */]);
// Plugin BWireframe\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.