PHPackages                             sofyansitorus/wp-yes - 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. sofyansitorus/wp-yes

ActiveWordpress-plugin[Admin Panels](/categories/admin)

sofyansitorus/wp-yes
====================

WordPress Yet Easy Settings class is PHP class for easy to build advanced admin page for WordPress.

1.0.8(6y ago)3622GPL-2.0-or-laterPHPPHP &gt;=5.6.3

Since Dec 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/sofyansitorus/WordPress-Yet-Easy-Settings)[ Packagist](https://packagist.org/packages/sofyansitorus/wp-yes)[ Docs](https://github.com/sofyansitorus/WordPress-Yet-Easy-Settings)[ RSS](/packages/sofyansitorus-wp-yes/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (9)Dependencies (5)Versions (13)Used By (0)

WordPress-Yet-Easy-Settings
===========================

[](#wordpress-yet-easy-settings)

WordPress Yet Easy Settings class is PHP class for easy to build advanced admin page for WordPress.

Built-in setting field types
----------------------------

[](#built-in-setting-field-types)

- Text
- URL
- Email
- Password
- Number
- Decimal
- Textarea
- Checkbox
- Multiple Checkbox
- Select
- Multiple Select
- Radio Button
- Color Picker
- File Upload
- WYSIWYG

Key features
------------

[](#key-features)

- Add as many as admin pages, placed it any where as top level admin menu or sub-menu.
- Add custom callback to render custom setting field type.
- Add custom callback to render custom tab content.
- Add custom callback to render custom page content.
- Built-in data sanitation and validation.
- Easy to add help tabs for admin page.
- Easy to add custom action button for admin page.
- Enqueue custom scripts and styles.
- Built-in data validation.

How to Use
----------

[](#how-to-use)

Installation:

`composer require sofyansitorus/wp-yes`

After you include the WP\_Yes class file, all you have to do is to initialize the WP\_Yes class, then add the settings object properties in sequence add tabs, add sections, add fields.

### Simple admin page setting

[](#simple-admin-page-setting)

This is the simplest way to initialize the setting page without defining the tabs and sections.

```
if ( ! function_exists( 'wp_yes_simple' ) ) {
    function wp_yes_simple() {

        $settings = new WP_Yes( 'wp_yes_simple' ); // Initialize the WP_Yes class.

        $settings->add_field(
            array(
                'id' => 'field_1',
                'label' => 'Field 1',
                'required' => true,
                'type'     => 'text',
            )
        );

        $settings->add_field(
            array(
                'id' => 'field_2',
                'label' => 'Field 2',
                'required' => false,
                'type'     => 'email',
            )
        );

        $settings->init(); // Run the WP_Yes class.
    }
}

add_action( 'init', 'wp_yes_simple' );
```

We can also add the setting fields in bulk by using the `WP_Yes::add_fields` method.

```
if ( ! function_exists( 'wp_yes_simple_bulk' ) ) {
    function wp_yes_simple_bulk() {

        $settings = new WP_Yes( 'wp_yes_simple_bulk' ); // Initialize the WP_Yes class.

        $settings->add_fields(
            array(
                array(
                    'id' => 'field_1',
                    'label' => 'Field 1',
                    'required' => true,
                    'type'     => 'text',
                ),
                array(
                    'id' => 'field_2',
                    'label' => 'Field 2',
                    'required' => true,
                    'type'     => 'email',
                )
            )
        );

        $settings->init(); // Run the WP_Yes class.
    }
}

add_action( 'init', 'wp_yes_simple_bulk' );
```

### Simple admin page setting with Section

[](#simple-admin-page-setting-with-section)

This is the simplest way to initialize the setting page without defining the tabs and sections.

```
if ( ! function_exists( 'wp_yes_simple_with_section' ) ) {
    function wp_yes_simple_with_section() {

        $settings = new WP_Yes( 'wp_yes_simple_with_section' ); // Initialize the WP_Yes class.

        $settings->add_section(
            array(
                'id' => 'section_1',
                'title' => 'Section 1',
            )
        );

        $settings->add_fields(
            array(
                array(
                    'id' => 'field_1',
                    'label' => 'Field 1',
                    'required' => true,
                    'type'     => 'text',
                ),
                array(
                    'id' => 'field_2',
                    'label' => 'Field 2',
                    'required' => true,
                    'type'     => 'email',
                )
            )
        );

        $settings->add_section(
            array(
                'id' => 'section_2',
                'title' => 'Section 2',
            )
        );

        $settings->add_fields(
            array(
                array(
                    'id' => 'field_3',
                    'label' => 'Field 3',
                    'required' => true,
                    'type'     => 'text',
                ),
                array(
                    'id' => 'field_4',
                    'label' => 'Field 4',
                    'required' => true,
                    'type'     => 'email',
                )
            )
        );

        $settings->init(); // Run the WP_Yes class.
    }
}

add_action( 'init', 'wp_yes_simple_with_section' );
```

### Multiple tabs admin page setting

[](#multiple-tabs-admin-page-setting)

By default, the setting page will only has 1 tab. If you want to add more tabs, just simply call the **WP\_Yes::add\_tab** method after the last **WP\_Yes::add\_field** for each tabs, and then following in sequence calling **WP\_Yes::add\_section** and **WP\_Yes::add\_field** method.

```
if ( ! function_exists( 'wp_yes_multi_tabs' ) ) {
    function wp_yes_multi_tabs() {
        $settings = new WP_Yes( 'wp_yes_multi_tabs' ); // Initialize the WP_Yes class.

        $settings->add_tab(
            array(
                'id' => 'tab_1',
                'title' => 'Tab 1',
            )
        );

        $settings->add_section(
            array(
                'id' => 'section_1',
                'title' => 'Section 1',
            )
        );

        $settings->add_field(
            array(
                'id'       => 'field_1',
                'required' => true,
                'type'     => 'text',
            )
        );

        $settings->add_section(
            array(
                'id' => 'section_2',
                'title' => 'Section 2',
            )
        );

        $settings->add_field(
            array(
                'id'       => 'field_2',
                'label' => 'Field 2',
                'required' => true,
                'type'     => 'text',
            )
        );

        $settings->add_tab( //  'tab_2',
                'title' => 'Tab 2',
            )
        );

        $settings->add_fields(
            array(
                array(
                    'id' => 'field_3',
                    'label' => 'Field 3',
                    'required' => true,
                    'type'     => 'text',
                ),
                array(
                    'id' => 'field_4',
                    'label' => 'Field 4',
                    'required' => true,
                    'type'     => 'email',
                )
            )
        );

        $settings->init(); // Run the WP_Yes class.
    }
}
add_action( 'init', 'wp_yes_multi_tabs' );
```

A note you must keep in hand here is that you need to have a unique value for the **menu\_slug** parameter that passed in the WP\_Yes class constructor and field **id** key in the **WP\_Yes::add\_field** method parameter. You can have same tab id in different page menu, also can has same sections id in different tabs.

### Admin page setting with custom action button and help tabs

[](#admin-page-setting-with-custom-action-button-and-help-tabs)

To add help tabs and custom actin button to the admin page, you need to call **WP\_Yes::add\_help\_tab** and **WP\_Yes::add\_button** method anywhere before calling the **WP\_Yes::init** method.

```
if ( ! function_exists( 'wp_yes_button_and_help_tabs' ) ) {
    function wp_yes_button_and_help_tabs() {

        $settings = new WP_Yes( 'wp_yes_button_and_help_tabs' ); // Initialize the WP_Yes class.

        $settings->add_help_tab(  //  'my_help_tab',
                'title'   => __( 'My Help Tab' ),
                'content' => '' . __('Descriptive content that will show in My Help Tab-body goes here.') . '',
            )
        );

        $settings->add_help_tab(  //  'my_help_tab2',
                'title'   => __( 'My Help Tab2' ),
                'content' => '' . __( 'Descriptive content that will show in My Help Tab-body goes here 2. ') . '',
            )
        );

        $settings->add_field(
            array(
                'id' => 'field_1',
                'label' => 'Field 1',
            )
        );

        $settings->add_button( 'Custom Action Button', 'index.php' ); // init(); // Run the WP_Yes class.
    }
}
add_action( 'init', 'wp_yes_button_and_help_tabs' );
```

### Getting the stored option value

[](#getting-the-stored-option-value)

To get the option value is by call built-in WordPress **get\_option** function with filed id as the first argument.

```
get_option( 'field_1' );
```

If you set the $setting\_prefix value at third arguments in WP\_Yes constructor, or set the prefix with `WP_Yes::set_prefix` method, then you need to pre-pend that prefix when calling *get\_option*\* function.

```
if ( ! function_exists( 'wp_yes_with_prefix' ) ) {
    function wp_yes_with_prefix() {

        $settings = new WP_Yes( 'wp_yes_with_prefix', array(), 'my_setting_prefix' ); // Initialize the WP_Yes class.

        $settings->add_field(
            array(
                'id' => 'field_1',
                'label' => 'Field 1',
            )
        );

        $settings->init(); // Run the WP_Yes class.
    }
}
add_action( 'init', 'wp_yes_with_prefix' );

// To get stored option value for setting field field_1
get_option( 'my_setting_prefix_field_1' );
```

```
if ( ! function_exists( 'wp_yes_with_set_prefix' ) ) {
    function wp_yes_with_set_prefix() {

        $settings = new WP_Yes( 'wp_yes_with_set_prefix', array() ); // Initialize the WP_Yes class.

        $settings->set_prefix( 'my_setting_prefix2' );

        $settings->add_field(
            array(
                'id' => 'field_1',
                'label' => 'Field 1',
            )
        );

        $settings->init(); // Run the WP_Yes class.
    }
}
add_action( 'init', 'wp_yes_with_set_prefix' );

// To get stored option value for setting field field_1
get_option( 'my_setting_prefix2_field_1' );
```

For more advanced example such as adding custom tab content, adding custom page content, etc, please take a look all the samples available in [example](https://github.com/sofyansitorus/WordPress-Yet-Easy-Settings/blob/master/example) folder.

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

[](#screenshots)

### Simple Setting Form

[](#simple-setting-form)

[![Simple Setting Form](https://camo.githubusercontent.com/a1a12eb789881d52a7c98671f16243ea51d23e1c02f8c2539ddc8a083c8b3ac4/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f66383534323365362d633238652d343432392d383937382d3064666338373936623035322f323031382d30322d30315f30312d33392d31322e706e67)](https://camo.githubusercontent.com/a1a12eb789881d52a7c98671f16243ea51d23e1c02f8c2539ddc8a083c8b3ac4/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f66383534323365362d633238652d343432392d383937382d3064666338373936623035322f323031382d30322d30315f30312d33392d31322e706e67)

### All Fields Types

[](#all-fields-types)

[![All Fields Types](https://camo.githubusercontent.com/6fe460e083733d4c8469a67889f0a9b8533edfb5ac6b23d216d4f58c30cd32e1/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f61313265356139372d646365312d343965302d383738302d3436336266616437356236322f323031382d30322d30315f30312d34322d34302e706e67)](https://camo.githubusercontent.com/6fe460e083733d4c8469a67889f0a9b8533edfb5ac6b23d216d4f58c30cd32e1/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f61313265356139372d646365312d343965302d383738302d3436336266616437356236322f323031382d30322d30315f30312d34322d34302e706e67)[![All Fields Types](https://camo.githubusercontent.com/8957597229f2782ced884a0d5c7c0caa36f70f1ece1ce499f1063ef9c93be056/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f65666331623938312d623337362d346334312d623234332d3261633839323635343266662f323031382d30322d32315f31362d35322d30312e706e67)](https://camo.githubusercontent.com/8957597229f2782ced884a0d5c7c0caa36f70f1ece1ce499f1063ef9c93be056/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f65666331623938312d623337362d346334312d623234332d3261633839323635343266662f323031382d30322d32315f31362d35322d30312e706e67)

### Setting Form with Tabs

[](#setting-form-with-tabs)

[![Setting Form with Tabs](https://camo.githubusercontent.com/c9ec3e544acf138505091e7ff6e417dd1e8d5d8e2c136024befaac5457a5adf6/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f63646434346162332d353931642d343938632d613434312d3331616431663662626363392f323031382d30322d30315f30312d34372d32382e706e67)](https://camo.githubusercontent.com/c9ec3e544acf138505091e7ff6e417dd1e8d5d8e2c136024befaac5457a5adf6/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f63646434346162332d353931642d343938632d613434312d3331616431663662626363392f323031382d30322d30315f30312d34372d32382e706e67)

### Admin Page with Action Button

[](#admin-page-with-action-button)

[![Admin Page with Action Button](https://camo.githubusercontent.com/f2769d19ec4e200ce1b7df096a1ee0682dd77176fb7565fb967def67df04a30a/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f61313830333536392d383236342d346462392d623862642d3439623539373138366463332f323031382d30322d30315f30312d34392d30362e706e67)](https://camo.githubusercontent.com/f2769d19ec4e200ce1b7df096a1ee0682dd77176fb7565fb967def67df04a30a/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f61313830333536392d383236342d346462392d623862642d3439623539373138366463332f323031382d30322d30315f30312d34392d30362e706e67)

### Admin Page with Help Tabs

[](#admin-page-with-help-tabs)

[![Admin Page with Help Tabs](https://camo.githubusercontent.com/07c8fe820509c7d532f7ba66f241d9e51423cc45de413b5a97b45f1ecdb0849c/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f36393139623963652d333939622d343262372d626263632d3538636337663961383132302f323031382d30322d30315f30312d34392d35382e706e67)](https://camo.githubusercontent.com/07c8fe820509c7d532f7ba66f241d9e51423cc45de413b5a97b45f1ecdb0849c/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f36393139623963652d333939622d343262372d626263632d3538636337663961383132302f323031382d30322d30315f30312d34392d35382e706e67)

### Custom Tab Content

[](#custom-tab-content)

[![Custom Tab Content](https://camo.githubusercontent.com/cdb4b3106fba11a0242f525b95c18d8ed5228ae43f4198251addf029711bd101/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f32616237396533352d306537642d343535352d383061342d3566623732653537343134642f323031382d30322d30315f30312d34332d33322e706e67)](https://camo.githubusercontent.com/cdb4b3106fba11a0242f525b95c18d8ed5228ae43f4198251addf029711bd101/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f32616237396533352d306537642d343535352d383061342d3566623732653537343134642f323031382d30322d30315f30312d34332d33322e706e67)

### Custom Page Content

[](#custom-page-content)

[![Custom Page Content](https://camo.githubusercontent.com/e8149b4a639aa8ee867fddf048bafb56a90ee091c0bebe0c147586bf23f780ab/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f63363439313539392d656138312d343865312d623066632d3237383366323565646138652f323031382d30322d30315f30312d34342d32302e706e67)](https://camo.githubusercontent.com/e8149b4a639aa8ee867fddf048bafb56a90ee091c0bebe0c147586bf23f780ab/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f63363439313539392d656138312d343865312d623066632d3237383366323565646138652f323031382d30322d30315f30312d34342d32302e706e67)

### Sub-menu Admin Page

[](#sub-menu-admin-page)

[![Sub-menu Admin Page](https://camo.githubusercontent.com/14a6d9d7351b5a8498c1b89c49a6836205a6872a90a02b8bbd0e518408f4b3f1/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f38356330343262662d353531362d346362642d383263632d3334353234373730346130382f323031382d30322d32315f31362d33312d34362e706e67)](https://camo.githubusercontent.com/14a6d9d7351b5a8498c1b89c49a6836205a6872a90a02b8bbd0e518408f4b3f1/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f536f6679616e5369746f7275732f666f6c646572732f536e616769742f6d656469612f38356330343262662d353531362d346362642d383263632d3334353234373730346130382f323031382d30322d32315f31362d33312d34362e706e67)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Total

9

Last Release

2323d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.2

1.0.2PHP &gt;=5.6.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1689373?v=4)[Sofyan Sitorus](/maintainers/sofyansitorus)[@sofyansitorus](https://github.com/sofyansitorus)

---

Top Contributors

[![sofyansitorus](https://avatars.githubusercontent.com/u/1689373?v=4)](https://github.com/sofyansitorus "sofyansitorus (111 commits)")

### Embed Badge

![Health badge](/badges/sofyansitorus-wp-yes/health.svg)

```
[![Health](https://phpackages.com/badges/sofyansitorus-wp-yes/health.svg)](https://phpackages.com/packages/sofyansitorus-wp-yes)
```

###  Alternatives

[jeroennoten/laravel-adminlte

Easy AdminLTE integration with Laravel

4.0k4.8M43](/packages/jeroennoten-laravel-adminlte)[dmstr/yii2-adminlte-asset

AdminLTE backend theme asset bundle for Yii 2.0 Framework

1.1k1.8M67](/packages/dmstr-yii2-adminlte-asset)[dwij/laraadmin

LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like CRUD Generation, Module Manager, Media, Menus, Backups and much more

1.6k68.7k](/packages/dwij-laraadmin)[filament/spatie-laravel-media-library-plugin

Filament support for `spatie/laravel-medialibrary`.

1764.8M125](/packages/filament-spatie-laravel-media-library-plugin)[bezhansalleh/filament-exceptions

A Simple &amp; Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel

193195.9k13](/packages/bezhansalleh-filament-exceptions)[filament/infolists

Easily add beautiful read-only infolists to any Livewire component.

1220.8M36](/packages/filament-infolists)

PHPackages © 2026

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