Quick Start
Three files. About fifteen lines of bootstrap.
File layout
Section titled “File layout”Directorymy-plugin/
- my-plugin.php (boot call)
Directoryconfig/
- settings.php (field definitions)
Directoryvendor/
Directorywp-wireframe/ (the library)
- …
-
Create your plugin file
Section titled “Create your plugin file”<?php/*** Plugin Name: My Plugin* Description: A plugin with settings powered by WP Wireframe.* Version: 1.0.0*/if (! defined('ABSPATH')) {exit;}// Composer autoloader — use the manual path// (vendor/wp-wireframe/vendor/autoload.php) if you installed without Composer.require_once __DIR__ . '/vendor/autoload.php';add_action('init', function () {Wireframe\App::boot(['prefix' => 'my-plugin','page_title' => __('My Plugin', 'my-plugin'),'option_key' => 'my_plugin_settings','config' => __DIR__ . '/config/settings.php',]);}); -
Create
Section titled “Create config/settings.php”config/settings.php<?phpreturn ['tabs' => [['id' => 'general','title' => __('General', 'my-plugin'),'sections' => [['id' => 'main','title' => __('Main Settings', 'my-plugin'),'description' => __('Configure the basics.', 'my-plugin'),'fields' => [['id' => 'site_name','type' => 'text','label' => __('Site Name', 'my-plugin'),'required' => true,'columns' => 6,'args' => ['placeholder' => __('My Website', 'my-plugin')],],['id' => 'contact_email','type' => 'email','label' => __('Contact Email', 'my-plugin'),'columns' => 6,],['id' => 'notifications','type' => 'toggle','label' => __('Enable Notifications', 'my-plugin'),'description' => __('Send alerts when settings change.', 'my-plugin'),'default' => true,],],],],],],]; -
Use settings in your plugin
Section titled “Use settings in your plugin”Every
Settings::call takes your plugin’soption_keyas the first argument, so multiple plugins sharing the framework can’t collide.use Wireframe\Settings;$name = Settings::get('my_plugin_settings', 'site_name', 'Default');$email = Settings::string('my_plugin_settings', 'contact_email');if (Settings::bool('my_plugin_settings', 'notifications')) {// send notification...}Activate your plugin and the settings page appears in the admin menu.
Where to next
Section titled “Where to next”- Configuration → all the boot options (overview), multi-page setups, submenu placement.
- Field Types → the full reference for every field type the framework ships.
- Features → conditional visibility, role-based access, validation.