PHPackages                             youniwemi/wp-settings-kit - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. youniwemi/wp-settings-kit

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

youniwemi/wp-settings-kit
=========================

WP Settings Kit is a lightweight library for easily creating WordPress settings pages and Post metaboxes.

1.1.5(10mo ago)124GPL-2.0PHPPHP &gt;=7.3CI failing

Since May 7Pushed 10mo agoCompare

[ Source](https://github.com/Youniwemi/WP-OOP-Settings-API)[ Packagist](https://packagist.org/packages/youniwemi/wp-settings-kit)[ RSS](/packages/youniwemi-wp-settings-kit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

 WordPress Settings Kit - Lightweight library for easily creating WordPress Settings Pages and Post Metaboxes
==============================================================================================================

[](#--wordpress-settings-kit---lightweight-library-for-easily-creating-wordpress-settings-pages-and-post-metaboxes)

[![Tweet for help](https://camo.githubusercontent.com/ae295010349253590133c20b25a3528f18224ed4f76c46f0cc0647b05334b571/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f726168616c61626f756c666574682e7376673f7374796c653d736f6369616c266c6162656c3d547765657425323040726168616c61626f756c66657468)](https://twitter.com/rahalaboulfeth/) [![GitHub stars](https://camo.githubusercontent.com/d6b9df5da463aebf0a4796b34d2dd3c45b3f037675986c038b96cdbc5e4ac966/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f796f756e6977656d692f57502d4f4f502d53657474696e67732d4150492e7376673f7374796c653d736f6369616c266c6162656c3d5374617273)](https://github.com/youniwemi/WP-OOP-Settings-API/stargazers) [![GitHub followers](https://camo.githubusercontent.com/84cb049f2e322992b75c0f551952a65e5de4c17e88e3af532444a2aba46a7067/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f796f756e6977656d692e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f77)](https://github.com/youniwemi?tab=followers) — ☝️ Make sure you ⭐ and 👀 this repository!

> Ever wanted to build custom settings (or metaboxes) inside your WordPress plugin or theme and didn't like the non-DRY approach for creating custom settings and metaboxes via WordPress API? Well, this package is an attempt to fix this. 🎊

Screenshots
-----------

[](#screenshots)

[![](https://camo.githubusercontent.com/7afd0a0116e9581b6c41734a246a01dbce0c1c04eb3bd380c2f9bed41f4be8b4/68747470733a2f2f692e696d6775722e636f6d2f4558556f654c5a2e706e67)](https://camo.githubusercontent.com/7afd0a0116e9581b6c41734a246a01dbce0c1c04eb3bd380c2f9bed41f4be8b4/68747470733a2f2f692e696d6775722e636f6d2f4558556f654c5a2e706e67)[![](https://camo.githubusercontent.com/c8faf380d4018e2edb5c3e1e781d63226f758fa1f73c91241742eef0d5d818c0/68747470733a2f2f692e696d6775722e636f6d2f736339383136572e706e67)](https://camo.githubusercontent.com/c8faf380d4018e2edb5c3e1e781d63226f758fa1f73c91241742eef0d5d818c0/68747470733a2f2f692e696d6775722e636f6d2f736339383136572e706e67)

COMPOSER INSTALL
----------------

[](#composer-install)

- You can install the library using composer

```
composer require youniwemi/wp-settings-kit
```

- You'll be able to use WP\_Settings\_Kit class after requiring vendor/autoload.php

USAGE
-----

[](#usage)

### USAGE For Setting Page

[](#usage-for-setting-page)

- Prepare an array of options then instanciate WP\_Settings\_Kit

```
$options =
[
    'name' => 'MY_AWESOME_FEATURE',
    'title' => 'My Awesome Feature',
    'description' => "My Awesome Feature description",
    'side_panel' => "A side Panel content : to add some explanations if necessary",
    'fields' => [
        [
            'id' => 'ACTIVE',
            'type' => 'checkbox',
            'title' => 'The feature is active' ,
        ],
        [
            'id' => 'FIRST_SETTING',
            'type' => 'number',
            'title' => 'First setting' ,
            'default' => 0 ,
            // This setting will be included only if the first checkbox is checked
            'show_if' => function(){ return defined('MY_AWESOME_FEATURE_ACTIVE') && MY_AWESOME_FEATURE_ACTIVE == 'on'; }
        ]
    ]
];
$setting = new WP_Settings_Kit($options);
```

- Once the options are saved, constants MY\_AWESOME\_FEATURE\_ACTIVE will be available and will be able to set the first setting MY\_AWESOME\_FEATURE\_FIRST\_SETTING

### USAGE For Post Metabox

[](#usage-for-post-metabox)

- Prepare an array of options as well as the metabox definition then instanciate WP\_Settings\_Kit

```
$options =
[
    'name' => 'MY_AWESOME_FEATURE',
    'title' => 'My Awesome Feature',
    'fields' => [
        [
            'id' => 'ACTIVE',
            'type' => 'checkbox',
            'title' => 'The feature is active' ,
        ],
        [
            'id' => 'FIRST_SETTING',
            'type' => 'number',
            'title' => 'First setting' ,
            'default' => 0 ,
            // This field will be included only if the first checkbox is checked
            'show_if' => function(){ return defined('MY_AWESOME_FEATURE_ACTIVE') && MY_AWESOME_FEATURE_ACTIVE == 'on'; }
        ]
    ]
];
$metabox = [
    'id' => 'my_metabox',
    'title' => 'My Awesome Metabox',
    'post_types' => ['post'], // Post types to display meta box
    'context' => 'advanced',
    'priority' => 'default',
];
$metabox = new WP_Settings_Kit($options , $metabox);
```

- Once the metabox is saved, fields will be saved as post metas : MY\_AWESOME\_FEATURE\_FIRST\_ACTIVE and MY\_AWESOME\_FEATURE\_FIRST\_SETTING

TODO:
-----

[](#todo)

- Basic Settings Page
- Tabs on Settings Page with JS
- Tabs on Settings Page with JS
- Documentation for code workflow
- Create Field: `text`
- Create Field: `textarea`
- Create Field: `url`
- Create Field: `number`
- Create Field: `checkbox`
- Create Field: `multicheck`
- Create Field: `radio`
- Create Field: `select`
- Create Field: `html`
- Create Field: `wysiwyg`
- Create Field: `file`
- Create Field: `image`
- Create Field: `password`
- Create Field: `color`
- Create Field: `email`
- Create Field: `date`
- Create Field (generated content with callback): `content`
- Create Field: `range`
- Support for post metabox
- Re-factor the code with WP Standards
- Tutorials
- Blog post
- Documentation

License
-------

[](#license)

Release under GNU GPL v2.0

Credits
-------

[](#credits)

This package is a fork of  based on the work of @tareq1988

@AhmadAwais, @deviorobert, @MaedahBatool AND @WordPress, @tareq1988, @royboy789, @twigpress, @rahal.

---

### 🙌 [Youniwemi](https://www.youniwemi.com)

[](#-youniwemi)

This open source fork is maintained by the help of awesome businesses listed below :

- [Youniwemi](https://www.youniwemi.com)
- [Instareza](https://www.instareza.com)

This package is used in the following wordpress plugins

- [Mail Control](https://wordpress.org/plugins/mail-control/)
- [Aiify Blocks](https://wordpress.org/plugins/aiify/)

**For anything else, tweet at [@rahalaboulfeth](https://twitter.com/rahalaboulfeth/)**

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance57

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~156 days

Total

6

Last Release

313d ago

PHP version history (2 changes)1.1.0PHP &gt;=7.4

1.1.3PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/434d10de4e57eb930e47e929c07b956e13153ae9738179eecd10151b65e08b59?d=identicon)[rahal](/maintainers/rahal)

---

Top Contributors

[![rahal](https://avatars.githubusercontent.com/u/34531?v=4)](https://github.com/rahal "rahal (18 commits)")[![robertdevore](https://avatars.githubusercontent.com/u/9917957?v=4)](https://github.com/robertdevore "robertdevore (17 commits)")[![ahmadawais](https://avatars.githubusercontent.com/u/960133?v=4)](https://github.com/ahmadawais "ahmadawais (5 commits)")[![MikeiLL](https://avatars.githubusercontent.com/u/6392263?v=4)](https://github.com/MikeiLL "MikeiLL (1 commits)")[![wonder32](https://avatars.githubusercontent.com/u/5481217?v=4)](https://github.com/wonder32 "wonder32 (1 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/youniwemi-wp-settings-kit/health.svg)

```
[![Health](https://phpackages.com/badges/youniwemi-wp-settings-kit/health.svg)](https://phpackages.com/packages/youniwemi-wp-settings-kit)
```

###  Alternatives

[shipmonk/name-collision-detector

Simple tool to find ambiguous classes or any other name duplicates within your project.

362.1M34](/packages/shipmonk-name-collision-detector)[bostondv/bootstrap-ninja-forms

Adds Bootstrap classes to Ninja Forms

222.2k](/packages/bostondv-bootstrap-ninja-forms)

PHPackages © 2026

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