PHPackages                             italystrap/settings - 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. italystrap/settings

ActiveLibrary[Framework](/categories/framework)

italystrap/settings
===================

Settings API for WordPress

0.0.6(1y ago)02801[3 issues](https://github.com/ItalyStrap/settings/issues)MITPHPPHP &gt;=7.2

Since Dec 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ItalyStrap/settings)[ Packagist](https://packagist.org/packages/italystrap/settings)[ RSS](/packages/italystrap-settings/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (6)Dependencies (13)Versions (7)Used By (0)

ItalyStrap Settings API
=======================

[](#italystrap-settings-api)

[![Build Status](https://camo.githubusercontent.com/41dcf71665ddcbff45c5dc162a06b63be002d11b5abab08253658f7b0dfda72d/68747470733a2f2f7472617669732d63692e6f72672f4974616c7953747261702f73657474696e67732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ItalyStrap/settings)[![Latest Stable Version](https://camo.githubusercontent.com/b0d65db1755daf67658f9ed88c36f11d8223242cb854d07d13780cc8d98036d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6974616c7973747261702f73657474696e67732e737667)](https://packagist.org/packages/italystrap/settings)[![Total Downloads](https://camo.githubusercontent.com/b17b6cb0d4802b8b9da41fe5a28c347f36ebfd81670a23fe46188d20bd5c1887/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6974616c7973747261702f73657474696e67732e737667)](https://packagist.org/packages/italystrap/settings)[![Latest Unstable Version](https://camo.githubusercontent.com/ed6c2ae01097d9e578375dbd93be7e9c0ee834a45692ad95d4782fe1f29ab6af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6974616c7973747261702f73657474696e67732e737667)](https://packagist.org/packages/italystrap/settings)[![License](https://camo.githubusercontent.com/5ecf2506bd54e7931e1a9798d18772fd5dbdc75236562f79701dcc061504b6de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6974616c7973747261702f73657474696e67732e737667)](https://packagist.org/packages/italystrap/settings)[![PHP from Packagist](https://camo.githubusercontent.com/5d09e9c5b5259192291c820e7723f2739ad6dbc486db9b93ef008a7e21eb41f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6974616c7973747261702f73657474696e6773)](https://camo.githubusercontent.com/5d09e9c5b5259192291c820e7723f2739ad6dbc486db9b93ef008a7e21eb41f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6974616c7973747261702f73657474696e6773)

WordPress Settings API the OOP way

**Work in progress:** the project is currently in beta until considered viable. Until a 1.0.0 release the code in this repository is not stable. Expect changes breaking backward compatibility between minor versions (0.1.x -&gt; 0.2.x).

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Advanced Usage](#advanced-usage)
- [Contributing](#contributing)
- [License](#license)

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

[](#installation)

The best way to use this package is through Composer:

```
composer require italystrap/settings
```

This package adheres to the [SemVer](http://semver.org/) specification and will be fully backward compatible between minor versions.

Idea of the structure
---------------------

[](#idea-of-the-structure)

- Plugin MUST HAVE one options storage (call get\_option one time and get all the options)
- Plugin COULD HAVE one or more settings pages with its own menu link (Parent and/or Child)
- Settings page COULD HAVE 0, 1 or many section
- Sections MUST HAVE at least 1 field
- Sections ARE separated by tabs
- Plugin COULD HAVE 0, 1 or more links in the plugins.php page

Basic Usage
-----------

[](#basic-usage)

The simpler way to use it is to instantiate the Builder and add the stuff you need.

You can find last updated code in the [example.php](example.php) file

```
use ItalyStrap\Settings\Page;
use ItalyStrap\Settings\SettingsBuilder;

$text_domain = 'ItalyStrap';
$option_name = 'italystrap';
$settings_config = \ItalyStrap\Config\ConfigFactory::make(
	require __DIR__ . '/tests/_data/fixtures/config/settings.php'
);

// Initialize the builder
$settings = new SettingsBuilder(
	$option_name,
	ITALYSTRAP_BASENAME,
	ITALYSTRAP_FILE
);

// You can add configuration via the \ItalyStrap\Config\ConfigFactory::class
$settings->addPage(
	$settings_config->get( 'page' ),
	$settings_config->get( 'sections' )
);

// Ora manually
// The section parameter is optional
// Not every page need a section with fields
// For example in a docs page
// Manu title and slug are mandatory
$settings->addPage(
	[
		Page::PARENT		=> 'italystrap-dashboard',
		Page::PAGE_TITLE	=> \__( 'Dashboard 2', 'italystrap' ),
		Page::MENU_TITLE	=> \__( 'Child1', 'italystrap' ),
		Page::SLUG			=> 'slug-for-child-page',
		Page::VIEW			=> __DIR__ . '/tests/_data/fixtures/view/empty_form.php',
	]
);

// You can also add a sub page either for you parent page or for the WP admin pages
$settings->addPage(
	[
		Page::PARENT		=> 'options-general.php',
//		Page::PAGE_TITLE	=> \__( 'ItalyStrap Dashboard 2', 'italystrap' ),
		Page::MENU_TITLE	=> \__( 'Child-general', 'italystrap' ),
		Page::SLUG			=> 'slug-for-child-general',
		Page::VIEW			=> __DIR__ . '/tests/_data/fixtures/view/empty_form.php',
	]
);

// You can also add a link to the plugins.php page in your plugin link for activation
// For example if you want to add an external link to your docs.
$settings->addCustomPluginLink(
	'key-for-css',
	'http://localhost.com',
	'Custom',
	[ 'target' => '_blank' ]
);

// After you added pages[?section] and/or link call the build() method.
$settings->build();
```

Advanced Usage
--------------

[](#advanced-usage)

> TODO

Contributing
------------

[](#contributing)

All feedback / bug reports / pull requests are welcome.

License
-------

[](#license)

Copyright (c) 2019 Enea Overclokk, ItalyStrap

This code is licensed under the [MIT](LICENSE).

Credits
-------

[](#credits)

> TODO

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.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

Every ~363 days

Recently: every ~454 days

Total

6

Last Release

514d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13d145319a065be260ee79e728655780ddd63002e5ac6c317701c8996ec8d94c?d=identicon)[overclokk](/maintainers/overclokk)

---

Top Contributors

[![overclokk](https://avatars.githubusercontent.com/u/4604932?v=4)](https://github.com/overclokk "overclokk (266 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (2 commits)")

---

Tags

wordpresswordpress-php-libraryframeworkwordpressSettings

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/italystrap-settings/health.svg)

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

###  Alternatives

[redux-framework/redux-framework

Build better and beautiful sites in WordPress, faster.

1.8k6.2k](/packages/redux-framework-redux-framework)[themosis/theme

The Themosis framework boilerplate theme.

10449.0k3](/packages/themosis-theme)[wpstarter/framework

The WpStarter Framework - Laravel Framework for WordPress

1810.1k4](/packages/wpstarter-framework)[alleyinteractive/pest-plugin-wordpress

WordPress Pest Integration

263.7k1](/packages/alleyinteractive-pest-plugin-wordpress)

PHPackages © 2026

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