PHPackages                             wptechnix/wp-settings-builder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. wptechnix/wp-settings-builder

ActiveLibrary[Framework](/categories/framework)

wptechnix/wp-settings-builder
=============================

WordPress settings framework for easily creating plugin and theme options pages. Includes 30+ field types such as AJAX relational fields, date pickers, and media uploaders.

1.0.1(7mo ago)1553MITPHPPHP ^8.0CI passing

Since Oct 10Pushed 7mo agoCompare

[ Source](https://github.com/WPTechnix/wp-settings-builder)[ Packagist](https://packagist.org/packages/wptechnix/wp-settings-builder)[ RSS](/packages/wptechnix-wp-settings-builder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

WP Settings Builder Framework
=============================

[](#wp-settings-builder-framework)

WordPress settings framework for easily creating plugin and theme options pages. Includes 30+ field types such as AJAX relational fields, date pickers, and media uploaders.

Stop fighting the WordPress Settings API. This framework provides a modern, object-oriented, and fluent API that streamlines the creation of powerful and maintainable settings pages.

[![Latest Version](https://camo.githubusercontent.com/c1b92f74eeb2d38868c7a39b8e1acdc64d604cae16505f3bde7cb904ffef59ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7770746563686e69782f77702d73657474696e67732d6275696c6465722e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/wptechnix/wp-settings-builder)[![Total Downloads](https://camo.githubusercontent.com/3325f8d935d2b17d46de5dde6f1db1f89812bb132f670ff99fffe4590203d253/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7770746563686e69782f77702d73657474696e67732d6275696c6465722e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/wptechnix/wp-settings-builder)[![License](https://camo.githubusercontent.com/130b1cdbd519cf3b8ca80471217fbbdd8367c733610e5dbb4e4c76af7827f9a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7770746563686e69782f77702d73657474696e67732d6275696c6465722e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/wptechnix/wp-settings-builder)

---

Showcase
--------

[](#showcase)

Create anything from a simple plugin options page to a complex, tabbed interface for a theme, all with the same clean API.

#### **Simple Layout**

[](#simple-layout)

A single page with one or more sections of fields. Perfect for most plugins.

[![Simple Settings Page Example](docs/screenshot-01.png)](docs/screenshot-01.png)

#### **Tabbed Layout**

[](#tabbed-layout)

Organize a large number of settings into a clean, tabbed interface, complete with Dashicons for a native WordPress feel.

[![Tabbed Settings Page Example](docs/screenshot-02.png)](docs/screenshot-02.png)

Why This Framework?
-------------------

[](#why-this-framework)

- ✅ **Declarative &amp; Fluent API**: Define entire pages with a clean, chainable API that is easy to read and version control.
- 🚀 **Comprehensive Field Library**: Over 30 field types included, from basic inputs to advanced AJAX-powered relationship pickers.
- 🧠 **Built-in Conditional Logic**: Show or hide fields based on other fields' values without writing a single line of JavaScript.
- ⚙️ **Intelligent Asset Loading**: CSS and JS are loaded *only when a field that needs them is used*, keeping your admin pages lightweight and fast.
- ⚡ **High-Performance Relational Fields**: Add searchable fields for Posts, Users, and Terms that load data via AJAX, ensuring excellent performance even on sites with thousands of entries.
- 🔒 **Secure by Default**: Built-in sanitization for all standard field types and secure handling for sensitive data like password fields (values are never rendered in the HTML).
- 🧩 **Truly Extensible**: Designed from the ground up to be extended. Register your own custom field types to meet any project requirement.

The 3-Step Workflow
-------------------

[](#the-3-step-workflow)

The framework follows a simple and memorable pattern:

1. **`create()`**: Get a `Settings_Builder` instance and create a new `Settings_Page`.
2. **`configure()`**: Use the fluent methods (`set_page_title`, `add_section`, `add_field`, etc.) to define the entire structure and content of your page.
3. **`init()`**: Make one final call to `init()` to build the page and register all the necessary hooks with WordPress.

Installation
------------

[](#installation)

Install via Composer into your plugin or theme:

```
composer require wptechnix/wp-settings-builder
```

Ensure your project includes the Composer autoloader:

```
require_once __DIR__ . '/vendor/autoload.php';
```

Quick Start: A Practical Example
--------------------------------

[](#quick-start-a-practical-example)

This example creates a settings page with three powerful fields and shows how to retrieve a saved value.

#### 1. Create the Settings Page

[](#1-create-the-settings-page)

```
