arraypress/wp-register-setting-fields

Lightweight library for registering WordPress settings pages with fields using the Settings API, featuring tabs, conditional field visibility, repeaters, and REST API integration.

Installs: 20

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/arraypress/wp-register-setting-fields

dev-main 2026-02-23 19:23 UTC

This package is auto-updated.

Last update: 2026-02-23 19:23:15 UTC


README

A WordPress library for creating settings pages with tabs, sections, branded headers, and 30+ field types. Handles registration, rendering, sanitization, and the Settings API — you just define your fields.

Installation

composer require arraypress/wp-register-setting-fields

Quick Start

register_setting_fields( 'my_plugin', [
    'page_title'  => 'My Plugin Settings',
    'menu_title'  => 'My Plugin',
    'parent_slug' => 'options-general.php',
    'fields'      => [
        'site_name'      => [ 'type' => 'text', 'label' => 'Site Name' ],
        'enable_feature' => [ 'type' => 'toggle', 'label' => 'Enable Feature' ],
        'items_per_page' => [ 'type' => 'number', 'label' => 'Items Per Page', 'min' => 1, 'max' => 100 ],
    ],
] );

$name = get_setting_field_value( 'my_plugin', 'site_name' );

if ( is_setting_on( 'my_plugin', 'enable_feature' ) ) {
    // Feature is enabled
}

Documentation

Full documentation is available at https://arraypress.github.io/wp-register-setting-fields

Requirements

  • PHP 7.4+
  • WordPress 5.8+

License

GPL-2.0-or-later