01Overview
| Approach | Who it’s for | Where |
|---|---|---|
| Visual builder | Site admins, no code | Option Builder menu item in WP Admin |
| PHP API | Theme / plugin developers | Sifency_Admin_Options_Framework:: static methods |
Both paths produce the same kind of panel: sections (tabs) containing fields, saved as one serialized array under a single option_name, sanitized per field type automatically, with an optional bridge into the WordPress Customizer.
The plugin makes no external requests and stores everything locally in the WordPress database — nothing is collected, transmitted, or shared.
02Installation
- Upload the
sifency-admin-option-builderfolder to/wp-content/plugins/, or install it via the Plugins screen. - Activate it from the Plugins screen.
- Open Option Builder in the WP Admin menu to create your first panel.
Only users with the manage_options capability (administrators on a standard single-site install) can access the builder or edit any panel’s saved values.
03Using the visual builder
Panels
- Create any number of panels, each with its own title and an option-name prefix — the
option_nameits values are saved under. - The panel-settings block (title, prefix, “Show On”, menu placement) collapses once a panel is set up, keeping it out of the way of the section/field builder below.
- Per panel, choose where it appears: its own admin page, the Customizer, or both.
Sections and fields
- Add sections (tabs) to a panel; nest a section under another as a sub-tab via “Nest as tab under.”
- Drag fields into a section from a type palette. Reorder sections and fields by drag-and-drop.
- For each field, set its ID, label, CSS class, default value, and description directly in the UI.
The visual builder currently exposes this subset of field types:
Save, deactivate, uninstall
- Deactivating the plugin keeps all saved data intact.
- Deleting it via the Plugins screen removes every builder-created panel’s values and the builder layout itself.
- This cleanup only touches builder-created panels — panels registered by a theme or plugin through the PHP API (§4) are left untouched, since that data belongs to whichever product created it.
04Developer API
For anything the visual builder doesn’t cover, register a panel directly in PHP — a separate registration path from builder-created panels.
createOptions( $prefix, $args )
Registers a new options page/panel. $prefix is the unique option_name every field in the panel is stored under, as one serialized array.
Sifency_Admin_Options_Framework::createOptions( 'my_plugin_options', array(
'menu_title' => 'My Plugin',
'framework_title' => 'My Plugin Settings',
'menu_icon' => 'dashicons-admin-generic',
'menu_position' => null,
'menu_parent' => null, // e.g. 'themes.php' to nest under Appearance
'capability' => 'manage_options',
'theme' => 'light',
'footer_text' => '',
'show_in_customizer' => false, // true to also bridge into the Customizer
'hide_admin_menu' => false, // true for a Customizer-only panel
) );
createSection( $prefix, $args )
Registers a section (top-level tab), or a nested sub-section when parent is supplied.
Sifency_Admin_Options_Framework::createSection( 'my_plugin_options', array(
'id' => 'general',
'title' => 'General',
'subtitle' => '',
'icon' => 'dashicons-admin-generic',
'fields' => array(
array( 'id' => 'my_field', 'type' => 'text', 'title' => 'My Field' ),
),
) );
Pass 'parent' => 'general' on a second call to nest it as a sub-tab inside general instead of creating a new top-level tab.
createField( $prefix, $section_id, $field )
Extension point: appends a field to an already-registered top-level section without editing the file that created it.
Sifency_Admin_Options_Framework::createField( 'my_plugin_options', 'general', array(
'id' => 'extra_field',
'type' => 'text',
'title' => 'Extra Field',
) );
Reading saved values
// Static framework call — needs the exact prefix.
$value = Sifency_Admin_Options_Framework::getOption( 'my_plugin_options', 'my_field', 'default' );
// Global helper — reads from the theme's own panel without hardcoding a prefix.
$value = sifency_option( 'my_field', 'default' ); // alias of sifency_options()
$all = sifency_options(); // every saved value for the resolved prefix
sifency_option() / sifency_options() resolve their prefix as {theme_slug}_options by default (or the parent theme’s slug on a child theme). Point them at a custom prefix with a filter instead of forking the functions:
add_filter( 'sifency_option_prefix', function () {
return 'my_custom_options';
} );
Call sifency_flush_options_cache() after a save/import/reset so subsequent reads in the same request see fresh data. It also purges common page caches (LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache) so a saved setting doesn’t stay invisible behind a stale cached page.
05Field types
The full engine supports more types than the visual builder currently exposes — composite types are PHP-API only for now.
| Category | Types |
|---|---|
| Basic input | text, textarea, number, select, button_set, image_select |
| Color | color, link_color |
| Composite (PHP API only) | background, border, dimensions, spacing, typography |
| Rich content | wp_editor, code_editor |
| Media / icon | media, icon |
| Date & links | datetime, link |
| Structural | fieldset, tabbed, group |
| Layout-only (no saved value) | heading, subheading, content, notice |
| Utility | backup (export/import) |
Every field type has its own server-side sanitizer that runs automatically on save — this isn’t something the implementer has to wire up.
Overriding or adding a field type
add_filter( 'sifency_fw_render_field_mytype', function ( $html, $field, $value, $name ) {
// return your own markup
return $html;
}, 10, 4 );
Sanitization is filterable the same way, via sifency_fw_sanitize_field_{type}.
06Customizer bridge
Set 'show_in_customizer' => true on a panel (or choose Customizer / Both in the visual builder) to have its compatible fields appear live in Appearance → Customize, alongside — or instead of, with hide_admin_menu — the dedicated settings page.
Only these field types currently bridge into the Customizer:
Fields of any other type remain editable only on the panel’s own settings page.
07Tabs & groups
fieldset— a pure UI wrapper: groups child fields visually without storing a value of its own.tabbed— lets a single section fan out into nested tabs, each with its ownfieldsarray, without a separatecreateSection()call per tab.group— a repeatable row of sub-fields, stored as one array under the group’s own field id. Unlikefieldset/tabbed, agroupis treated as a single leaf value, not flattened.
08FAQ
- Do I need a specific theme?
- No — the Option Builder screen works with any theme, out of the box.
- Who can access the builder or edit values?
- Users with the
manage_optionscapability. - Does the plugin send data externally?
- No. All settings are stored locally in the WordPress database; no external requests are made.
- Can I add my own panel as a developer?
- Yes, via
createOptions()/createSection()(§4) — entirely separate from panels made with the visual builder. - Will a built panel show up in the Customizer?
- Only if “Customizer” or “Both” is chosen for that panel, and only for the field types listed in §6.
- What happens on deactivate vs. uninstall?
- Deactivating preserves all data. Uninstalling removes every builder-created panel’s values and the builder layout itself — not panels registered via the PHP API by another theme/plugin.
09Changelog
- Initial release.