threadi/easy-settings-for-wordpress

Provides a settings wrapper for WordPress plugins and themes.

Maintainers

Package info

github.com/threadi/easy-settings-for-wordpress

pkg:composer/threadi/easy-settings-for-wordpress

Transparency log

Statistics

Installs: 4 028

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 1

3.0.2 2026-08-02 13:11 UTC

This package is auto-updated.

Last update: 2026-08-02 22:37:25 UTC


README

This composer packages add a simple wrapper for settings for WordPress plugins and themes. You no longer need to worry about inputting or outputting settings for your own implementation - leave that to this package. Simply use the WordPress-own get_option() to get the values of your settings.

Advantages

  • Don't worry about the data type accuracy of your settings - WordPress doesn't (yet) take that into account.
  • Use settings that are interdependent.
  • Save time when configuring your plugin settings.
  • Have your AI generate a ready-made JSON file for your settings, which you can then simply drop in.

Requirements

  • A custom WordPress plugin or theme
  • composer to install this package

Installation

Run this in your custom plugin or theme directory:

composer require threadi/easy-settings-for-wordpress

Don't forget to embed the composer autoloader in your plugin or theme:

require __DIR__ . '/vendor/autoload.php';

Usage

Note: Take a look at the demo plugin to see how this package can be used.

Quick-Start

This will give you a demo view that you can then further customize:

function your_custom_init_for_settings(): void {
    $settings_object = new Settings( __FILE__ );
    $settings_object->init();
}
add_action( 'init', 'your_custom_init_for_settings' );

Use it

Follow the documentation here.

Upgrade hints

for 3.0.0

  • remove do_not_register() from TextInfo() and Value() fields
  • remove set_type() from Checkbox() fields
  • use add_data() instead of set_custom_attributes() for Import and Export buttons
  • Do not use add_tab() on Settings object.

For developers of this package

Check for WordPress Coding Standards

Initialize

composer install

Run

vendor/bin/phpcs .

Repair

vendor/bin/phpcbf .

Check for WordPress VIP Coding Standards

Hint: this check runs against the VIP-GO-platform, not our target for this package. Many warnings can be ignored.

Run

vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/tests/*,*/node_modules/* --standard=WordPress-VIP-Go .