PHPackages                             iniznet/wp-option-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. iniznet/wp-option-builder

ActiveLibrary[Framework](/categories/framework)

iniznet/wp-option-builder
=========================

Easy to use Options and Metabox framework for WordPress

1.0.5(3y ago)069GPL-2.0-or-laterPHPPHP &gt;=5.3

Since Sep 19Pushed 3y agoCompare

[ Source](https://github.com/iniznet/wp-option-builder)[ Packagist](https://packagist.org/packages/iniznet/wp-option-builder)[ RSS](/packages/iniznet-wp-option-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

WP Option Builder
=================

[](#wp-option-builder)

Lightweight and simple way to create Plugin and Theme options and also Metaboxes for WordPress. Inspired by OptionTree

Description
-----------

[](#description)

WP Option Builder attempts to bridge the gap between WordPress developers, designers and end-users by creating fully responsive option panels and meta boxes with an ease unlike any other plugin. OptionBuilder has many advanced features with well placed hooks and filters to adjust every aspect of the user experience.

#### Contributing

[](#contributing)

To contribute or report bugs, please go to the [WP Option Builder](https://github.com/ignitekit/wp-option-builder)repository.

#### Option Types

[](#option-types)

This is a complete list of all the available option types that come shipped with WP Option Builder.

- Background
- Border
- Box Shadow
- Category Checkbox
- Category Select
- Checkbox
- Colorpicker
- Colorpicker Opacity
- CSS
- Custom Post Type Checkbox
- Custom Post Type Select
- Date Picker
- Date Time Picker
- Dimension
- Gallery
- Google Fonts
- JavaScript
- Link Color
- List Item
- Measurement
- Numeric Slider
- On/Off
- Page Checkbox
- Page Select
- Post Checkbox
- Post Select
- Radio
- Radio Image
- Select
- Sidebar Select
- Slider
- Social Links
- Spacing
- Tab
- Tag Checkbox
- Tag Select
- Taxonomy Checkbox
- Taxonomy Select
- Text
- Textarea
- Textarea Simple
- Textblock
- Textblock Titled
- Typography
- Upload

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

[](#installation)

```
composer require ignitekit/wp-option-builder

```

or without Composer as follows:

```
require_once '/path/to/wp-option-builder/autoload.php';
```

How to use
----------

[](#how-to-use)

Assuming that you already loaded the library you need instance of the Framework class:

```
use IgniteKit\WP\OptionBuilder\Framework;
$framework = new Framework();
```

Then you can register option pages and metaboxes as follows:

### Option pages

[](#option-pages)

```
$settings = array(
	'id'    => 'custom_options',
	'pages' => array(
		array(
			'id'              => 'test_page',
			'parent_slug'     => 'themes.php',
			'page_title'      => __( 'Theme Options', 'your-text-domain' ),
			'menu_title'      => __( 'Theme Options', 'your-text-domain' ),
			'capability'      => 'edit_theme_options',
			'menu_slug'       => 'demo-theme-options',
			'icon_url'        => null,
			'position'        => null,
			'updated_message' => __( 'Options updated!', 'your-text-domain' ),
			'reset_message'   => __( 'Options reset!', 'your-text-domain' ),
			'button_text'     => __( 'Save changes', 'your-text-domain' ),
			'show_buttons'    => true,
			'screen_icon'     => 'options-general',
			'contextual_help' => array(
				'content' => array( array(
						'id'      => 'option_types_help',
						'title'   => __( 'Option Types', 'theme-text-domain' ),
						'content' => '' . __( 'Help content goes here!', 'theme-text-domain' ) . '',
					),
				),
				'sidebar' => '' . __( 'Sidebar content goes here!', 'theme-text-domain' ) . '',
			),
			'sections' => array( array(
				'id'    => 'option_types',
				'title' => __( 'Option Types', 'theme-text-domain' ),
			    ),
			),
			'settings'        => array(
				array(
					'id'           => 'demo_background',
					'label'        => __( 'Background', 'theme-text-domain' ),
					'desc'         => __( 'Some description goes here...', 'theme-text-domain' ),
					'std'          => '',
					'type'         => 'background',
					'section'      => 'option_types',
					'rows'         => '',
					'post_type'    => '',
					'taxonomy'     => '',
					'min_max_step' => '',
					'class'        => '',
					'condition'    => '',
					'operator'     => 'and',
				),
				array(
					'id'           => 'demo_border',
					'label'        => __( 'Border', 'theme-text-domain' ),
					'desc'         => __( 'Some description goes here...', 'theme-text-domain' ),
					'std'          => '',
					'type'         => 'border',
					'section'      => 'option_types',
					'rows'         => '',
					'post_type'    => '',
					'taxonomy'     => '',
					'min_max_step' => '',
					'class'        => '',
					'condition'    => '',
					'operator'     => 'and',
				),
				array(
					'id'           => 'demo_box_shadow',
					'label'        => __( 'Box Shadow', 'theme-text-domain' ),
					'desc'         => __( 'Some description goes here...', 'theme-text-domain' ),
					'std'          => '',
					'type'         => 'box-shadow',
					'section'      => 'option_types',
					'rows'         => '',
					'post_type'    => '',
					'taxonomy'     => '',
					'min_max_step' => '',
					'class'        => '',
					'condition'    => '',
					'operator'     => 'and',
				),
			)
		)
	)
);

$framework->register_settings( array( $settings ) ); // Note: $settings one group option pages, you can add multiple groups of pages.
```

#### Retrieving options

[](#retrieving-options)

To retrieve options for the above settings, locate the settings key, in our case `custom_options`.

```
// Make settings instance
$settings = get_option('custom_options');

// To access demo_background setting
$demo_bg = isset($settings['demo_background']) ? $settings['demo_background'] : ''; // or simply $settings['demo_background'].
```

### Metaboxes

[](#metaboxes)

```
$framework->register_metabox( array(
	'id'       => 'demo_meta_box',
	'title'    => __( 'Demo Meta Box', 'theme-text-domain' ),
	'desc'     => '',
	'pages'    => array( 'post' ),
	'context'  => 'normal',
	'priority' => 'high',
	'fields'   => array(
		array(
			'label' => __( 'Conditions', 'theme-text-domain' ),
			'id'    => 'demo_conditions',
			'type'  => 'tab',
		),
		array(
			'label' => __( 'Show Gallery', 'theme-text-domain' ),
			'id'    => 'demo_show_gallery',
			'type'  => 'on-off',
			'desc'  => sprintf( __( 'Shows the Gallery when set to %s.', 'theme-text-domain' ), 'on' ),
			'std'   => 'off',
		),
		array(
			'label'     => '',
			'id'        => 'demo_textblock',
			'type'      => 'textblock',
			'desc'      => __( 'Congratulations, you created a gallery!', 'theme-text-domain' ),
			'operator'  => 'and',
			'condition' => 'demo_show_gallery:is(on),demo_gallery:not()',
		),
		array(
			'label'     => __( 'Gallery', 'theme-text-domain' ),
			'id'        => 'demo_gallery',
			'type'      => 'gallery',
			'desc'      => sprintf( __( 'This is a Gallery option type. It displays when %s.', 'theme-text-domain' ), 'demo_show_gallery:is(on)' ),
			'condition' => 'demo_show_gallery:is(on)',
		),
		array(
			'label' => __( 'More Options', 'theme-text-domain' ),
			'id'    => 'demo_more_options',
			'type'  => 'tab',
		),
		array(
			'label' => __( 'Text', 'theme-text-domain' ),
			'id'    => 'demo_text',
			'type'  => 'text',
			'desc'  => __( 'This is a demo Text field.', 'theme-text-domain' ),
		),
		array(
			'label' => __( 'Textarea', 'theme-text-domain' ),
			'id'    => 'demo_textarea',
			'type'  => 'textarea',
			'desc'  => __( 'This is a demo Textarea field.', 'theme-text-domain' ),
		),
	),
) );
```

#### Retrieving metabox settings

[](#retrieving-metabox-settings)

To retrieve the metabox settings, use get\_post\_meta() function as follows.

```
$value = get_post_meta($post_id, 'demo_text', true);
```

If you are using `'save_mode' => 'array'` in the metabox settings, then all the settings will be stored into one meta row as serialized array. This appraoch is good if you want better performance. The data will be accessible with one mysql query instead of separate for each field.

To retrieve with this kind of save\_mode, call the get\_post\_meta() function on the metabox id as follows:

```
$data = get_post_meta($post_id, 'demo_meta_box', true);
$value = $data['demo_text'];
```

### More details

[](#more-details)

- [Example array with all available option types and the accepted parameters](https://github.com/IgniteKit/wp-option-builder/wiki/Available-Option-Types)
- [Creating metaboxes](https://github.com/IgniteKit/wp-option-builder/wiki/Creating-Metaboxes)
- [Creating option pages](https://github.com/IgniteKit/wp-option-builder/wiki/Creating-Option-Pages)
- [More details about the option types](https://github.com/IgniteKit/wp-option-builder/wiki/Details-about-the-option-types)
- [Admin UI Option Builder](https://github.com/IgniteKit/wp-option-builder/wiki/UI-Option-Builder)

License
-------

[](#license)

```
Copyright (C) 2021 Darko Gjorgjijoski (https://darkog.com)

This file is part of WP Option Builder

WP Option Builder is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

WP Option Builder is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with WP Option Builder. If not, see .

```

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1315d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ada47934d456fffb53f10484b93c24b06efd153a2fe4906ca6024518fe8be12?d=identicon)[niznet](/maintainers/niznet)

---

Top Contributors

[![gdarko](https://avatars.githubusercontent.com/u/5760249?v=4)](https://github.com/gdarko "gdarko (9 commits)")[![iniznet](https://avatars.githubusercontent.com/u/34362833?v=4)](https://github.com/iniznet "iniznet (5 commits)")

### Embed Badge

![Health badge](/badges/iniznet-wp-option-builder/health.svg)

```
[![Health](https://phpackages.com/badges/iniznet-wp-option-builder/health.svg)](https://phpackages.com/packages/iniznet-wp-option-builder)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M190](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M255](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M591](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M119](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
