PHPackages                             diazoxide/wp-lib-option - 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. [Admin Panels](/categories/admin)
4. /
5. diazoxide/wp-lib-option

ActiveLibrary[Admin Panels](/categories/admin)

diazoxide/wp-lib-option
=======================

WordPress Option

1.0.2(5y ago)1481GPL-3.0-or-laterPHPPHP &gt;=7.2

Since Apr 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/diazoxide/wp-lib-option)[ Packagist](https://packagist.org/packages/diazoxide/wp-lib-option)[ RSS](/packages/diazoxide-wp-lib-option/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

WordPress options form dynamic fields creation library
======================================================

[](#wordpress-options-form-dynamic-fields-creation-library)

Create dynamic admin settings page with flexible configurations.

Methods
-------

[](#methods)

- Single
- Multiple

Types
-----

[](#types)

- Boolean
- Text
- Object
- Group

Markup
------

[](#markup)

- Text
- Checkbox
- Select
- Number
- Textarea

[![Screenshot_1](docs/Screenshot_1.png)](docs/Screenshot_1.png)

How to install
==============

[](#how-to-install)

### Install with composer

[](#install-with-composer)

On your custom plugin directory run this composer command

```
composer require diazoxide/wp-lib-option:dev-master
```

Or add in your `composer.json` require field

```
{
 "require": {
    "diazoxide/wp-lib-option": "dev-master"
  }
}
```

How to use
==========

[](#how-to-use)

For example we have multidimensional array `$config` that have one static value `name`, two dynamic values `country` and `other->is_solder`.

`country` field should be set by user from admin side

```
use diazoxide\wp\lib\option\v2\Option;

$config = [
    'name'=>'Arthur',
    'country' => new Option(
        [
            'default'     => 'uk',
            'type'        => Option::TYPE_TEXT,
            'method'      => Option::METHOD_SINGLE,
            'values'      => [
                'fr'=>"France",
                'uk'=>"United Kingdom",
                'it'=>"Italy"
            ],
            'label'       => 'Country',
            'description' => 'Select country.'
        ]
    ),
    'other'=>[
        'is_solder'=>new Option(
             [
                 'default'     => false,
                 'type'        => Option::TYPE_BOOL,
                 'label'       => 'Solder or not'
             ]
         )
    ]
];
```

Print this config form
----------------------

[](#print-this-config-form)

```
Option::printForm(
    'custom_index_key_for_config',
    $config,
    [
        'title' => 'Arthur Configuration'
    ]
);
```

If change values from printed form and click save, then all changes will be stored on `wp_options`table with custom `custom_index_key_for_config` prefix.

Getting final values of this options
------------------------------------

[](#getting-final-values-of-this-options)

```
$options = Option::expandOptions(
    $config,
    'custom_index_key_for_config'
);
```

So we have already expanded options with dynamic and static values. You can use it simply.

#### For example

[](#for-example)

```
echo $options['name']; // Output: Arthur

echo $options['country']; // Output is dynamic. Default value is `fr`

var_dump($options['other']['is_solder']); // Output is dynamic. Default value is `false`
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~77 days

Total

3

Last Release

2081d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/759f35eb535bd0e8362784571e18d215e04dd4eb531c75d7b3b6a82bd5243a6d?d=identicon)[eyehollow](/maintainers/eyehollow)

---

Top Contributors

[![diazoxide](https://avatars.githubusercontent.com/u/25997814?v=4)](https://github.com/diazoxide "diazoxide (202 commits)")

---

Tags

wordpressuigeneratorinterfaceformadmindynamic

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/diazoxide-wp-lib-option/health.svg)

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

###  Alternatives

[cedriclombardot/admingenerator-generator-bundle

Admingenerator for Symfony2 based on YAML configuration and Twig templating

36485.6k4](/packages/cedriclombardot-admingenerator-generator-bundle)

PHPackages © 2026

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