PHPackages                             rwsite/wp-field - 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. rwsite/wp-field

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

rwsite/wp-field
===============

WP\_Field v4 HTML fields library for WordPress with fluent API, 52 field types, legacy compatibility, React/Vanilla integrations, conditional logic, and storage strategies.

4.0.0(2mo ago)511GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Oct 13Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/tikhomirov/wp-field-plugin)[ Packagist](https://packagist.org/packages/rwsite/wp-field)[ Docs](https://github.com/rwsite/wp-field-plugin)[ RSS](/packages/rwsite-wp-field/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (11)Versions (15)Used By (0)

 [![WP_Field Logo](logo.svg)](logo.svg)

WP\_Field
=========

[](#wp_field)

 **HTML Fields Library for WordPress**
 Final v4 release for building custom frameworks, settings systems, and admin UI.
 Fluent API, 52 field types, legacy compatibility, and React/Vanilla integrations where needed.

 [![Latest Version](https://camo.githubusercontent.com/076f78285fc6c7479a9964bcd13cf9706bb64ed62d5304932b2265302c991af2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7277736974652f77702d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rwsite/wp-field) [![PHP Version](https://camo.githubusercontent.com/8960f704476a7efc65571df383c7c2477ede1654e8df16e70201ad7e36331d19/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332b2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/8960f704476a7efc65571df383c7c2477ede1654e8df16e70201ad7e36331d19/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332b2d626c75652e7376673f7374796c653d666c61742d737175617265) [![License](https://camo.githubusercontent.com/66b4b0c87d7aa0841ad531439e11f69b4ce2bb23c8a7f3f456721c26a4e8c803/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c2d2d322e302d2d6f722d2d6c617465722d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

 [Features](#features) • [Installation](#installation) • [Quick Start](#quick-start) • [Architecture](#architecture) • [Field Types](#field-types) • [Demo Pages](#demo-pages) • [Development](#development) • [RU version](README.ru.md)

---

Modern version
--------------

[](#modern-version)

WP\_Field v4 is the production-ready release of the modern field API. Use it for new integrations and for migrations away from ad-hoc legacy arrays. The modern layer gives you a typed, fluent field builder and a cleaner server-rendered integration model for WordPress forms.

This is not a WordPress-free browser runtime. Interactive fields still rely on core WordPress admin assets where that is the correct production integration.

Features
--------

[](#features)

### What's new in v4

[](#whats-new-in-v4)

- Modern API is the primary integration layer for new code.
- Legacy runtime is isolated in `vanilla/` and remains available for compatibility.
- Standalone vanilla export builds a separate installable plugin archive.
- Demo pages are split by purpose: legacy examples, modern field docs, and UI showcase.
- Map fields expose provider configuration through the public field API.
- Quality tooling is aligned across PHP, JS, and documentation updates.

### Core capabilities

[](#core-capabilities)

- Fluent field builder through `WpField\Field\Field`
- 52 supported field types across simple, composite, layout, and WordPress-integrated controls
- Conditional logic with AND/OR relations
- Repeater and flexible content for nested data structures
- Containers for metaboxes, settings pages, taxonomies, and users
- Storage strategies for post meta, term meta, user meta, options, and custom tables
- React/Vanilla UI layer for admin shell, wizard, repeater, and flexible content flows
- Legacy compatibility layer for older integrations and unsupported custom field types

Architecture
------------

[](#architecture)

WP\_Field has two layers:

- **Modern API** — `WpField\Field\Field` and classes under `src/Field/Types/`
- **Legacy compatibility layer** — `WP_Field.php` and `vanilla/`

Use the modern API for new code. Keep the legacy layer for existing integrations, unsupported custom field types, or the standalone vanilla package.

### How the field lifecycle works

[](#how-the-field-lifecycle-works)

1. Create a field with `Field::make()` or a typed shortcut.
2. Configure label, description, defaults, options, validation, and field-specific settings.
3. Render the field inside a WordPress admin form.
4. Save through a container or your own save flow.
5. Pass the stored value back into the same field definition to render the saved state.

WordPress dependencies that remain
----------------------------------

[](#wordpress-dependencies-that-remain)

The modern layer still uses WordPress-provided functionality for these features:

- `wp.media` / Media Modal — `media`, `image`, `file`, `gallery`, `background`
- `wp-color-picker` — `color`, `palette`, and color-based composite controls
- `wp.editor` — classic editor fields
- `wp.codeEditor` — code editor fields
- `jquery-ui-sortable` — `sortable`, `sorter`, `repeater`, `flexible_content`
- `jquery-ui-datepicker` — date and time UI where WordPress-native pickers are expected
- `dashicons` or another icon library — `icon`
- provider-specific assets when a map provider requires them

Do not unload these assets on screens that render interactive fields unless you replace them with an equivalent setup.

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

[](#installation)

### Via Composer

[](#via-composer)

```
composer require rwsite/wp-field
```

### Manual installation

[](#manual-installation)

1. Copy the package into `wp-content/plugins/wp-field-plugin`
2. Run `composer install --no-dev`
3. Activate the plugin in WordPress admin

### Build frontend assets

[](#build-frontend-assets)

```
npm install
npm run build
```

Standalone vanilla build
------------------------

[](#standalone-vanilla-build)

You can export the legacy runtime as a separate WordPress plugin that does not depend on the original `woo2iiko` plugin directory.

```
npm run build:standalone
```

The build script:

- copies the minimal runtime from `vanilla/`
- includes legacy assets and translations
- generates a dedicated plugin bootstrap
- writes the plugin to `dist/wp-field-vanilla/`
- creates `dist/wp-field-vanilla.zip`

The standalone package includes only the runtime required for the vanilla version:

- `wp-field-vanilla.php`
- `README.txt`
- `vanilla/bootstrap.php`
- `vanilla/WP_Field.php`
- `vanilla/assets/css/wp-field.css`
- `vanilla/assets/js/wp-field.js`
- `lang/wp-field.pot`
- `lang/wp-field-ru_RU.po`
- `lang/wp-field-ru_RU.mo`
- `lang/wp-field-ru_RU.l10n.php`

It does not include the modern React layer, demo pages, tests, source SCSS, or repository-only development files.

Quick Start
-----------

[](#quick-start)

### Modern API (v4.0)

[](#modern-api-v40)

```
use WpField\Container\MetaboxContainer;
use WpField\Field\Field;

$field = Field::text('email')
    ->label('Email Address')
    ->placeholder('user@example.com')
    ->required();

echo $field->render();

$metabox = new MetaboxContainer('product_details', [
    'title' => 'Product Details',
    'post_types' => ['product'],
]);

$metabox->addField(
    Field::text('sku')->label('SKU')->required()
);

$metabox->addField(
    Field::text('price')->label('Price')->required()
);

$metabox->register();
```

### Repeater field

[](#repeater-field)

```
Field::repeater('team_members')
    ->label('Team Members')
    ->fields([
        Field::text('name')->label('Name')->required(),
        Field::text('position')->label('Position'),
        Field::make('email', 'email')->label('Email'),
    ])
    ->min(1)
    ->max(10)
    ->buttonLabel('Add Member')
    ->layout('table');
```

### Flexible content field

[](#flexible-content-field)

```
Field::flexibleContent('page_sections')
    ->label('Page Sections')
    ->addLayout('text_block', 'Text Block', [
        Field::text('heading')->label('Heading'),
        Field::make('textarea', 'content')->label('Content'),
    ])
    ->addLayout('image_block', 'Image Block', [
        Field::make('image', 'image')->label('Image'),
        Field::text('caption')->label('Caption'),
    ])
    ->min(1)
    ->buttonLabel('Add Section');
```

### Map field provider contract

[](#map-field-provider-contract)

```
Field::make('map', 'location')
    ->label('Location')
    ->provider('google')
    ->apiKey('your-api-key')
    ->zoom(12)
    ->center(['lat' => 55.7558, 'lng' => 37.6173]);
```

Containers and storage
----------------------

[](#containers-and-storage)

Containers integrate fields with WordPress screens and persistence:

- `MetaboxContainer` — post meta and metaboxes
- `SettingsContainer` — settings pages and options
- `TaxonomyContainer` — taxonomy forms and term meta
- `UserContainer` — user profile forms and user meta

Storage strategies:

- `PostMetaStorage`
- `TermMetaStorage`
- `UserMetaStorage`
- `OptionStorage`
- `CustomTableStorage`

Field Types
-----------

[](#field-types)

### Basic (9)

[](#basic-9)

- `text`
- `password`
- `email`
- `url`
- `tel`
- `number`
- `range`
- `hidden`
- `textarea`

### Choice (5)

[](#choice-5)

- `select`
- `multiselect`
- `radio`
- `checkbox`
- `checkbox_group`

### WordPress-integrated (9)

[](#wordpress-integrated-9)

- `editor`
- `media`
- `image`
- `file`
- `gallery`
- `color`
- `date`
- `time`
- `datetime-local`

### Composite (2)

[](#composite-2)

- `group`
- `repeater`

### Simple UI (9)

[](#simple-ui-9)

- `switcher`
- `spinner`
- `button_set`
- `slider`
- `heading`
- `subheading`
- `notice`
- `content`
- `fieldset`

### Medium complexity (10)

[](#medium-complexity-10)

- `accordion`
- `tabbed`
- `typography`
- `spacing`
- `dimensions`
- `border`
- `background`
- `link_color`
- `color_group`
- `image_select`

### High complexity (8)

[](#high-complexity-8)

- `code_editor`
- `icon`
- `map`
- `sortable`
- `sorter`
- `palette`
- `link`
- `backup`

### Compatibility aliases

[](#compatibility-aliases)

- `date_time` → `datetime-local`
- `datetime` → `datetime-local`
- `imagepicker` → `image_picker`

Demo Pages
----------

[](#demo-pages)

In WordPress admin debug mode, the plugin registers demo pages under **Tools**:

- **WP\_Field Examples** — legacy/classic API reference page
- **WP\_Field Components** — modern field documentation and live examples
- **Admin Shell UI Demo** — UI showcase for the shell and wizard layer

Routes:

- `/wp-admin/tools.php?page=wp-field-examples`
- `/wp-admin/tools.php?page=wp-field-components`
- `/wp-admin/tools.php?page=wp-field-ui-demo`

Development
-----------

[](#development)

### Frontend

[](#frontend)

```
npm run dev
npm run lint
npm run build
```

`npm run dev` starts Vite and watches `vanilla/assets/scss/wp-field-examples-vanilla.scss` to rebuild `vanilla/assets/css/wp-field-examples-vanilla.css`.

Edit SCSS sources under `vanilla/assets/scss/`. Do not edit generated CSS manually.

### PHP and repository checks

[](#php-and-repository-checks)

```
composer test
composer analyse
composer lint:check
./.agents/skills/qa-gate/scripts/verify.sh
```

Limitations
-----------

[](#limitations)

- The modern layer is not fully standalone in the browser.
- Removing WordPress admin runtime or required UI assets breaks interactive fields.
- Some interactions are intended only for backend screens.
- Demo pages are reference implementations, not a replacement for the normal plugin bootstrap in production.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for version history.

License
-------

[](#license)

GPL v2 or later

Author
------

[](#author)

Aleksei Tikhomirov ()

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance83

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 94.2% 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 ~49 days

Recently: every ~11 days

Total

12

Last Release

85d ago

Major Versions

2.1.0 → 3.0.02026-02-23

2.5.0 → 3.0.22026-02-24

3.1.1 → 4.0.02026-04-10

PHP version history (2 changes)3.0.0PHP &gt;=8.3

2.5.2PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19173833?v=4)[Aleksei Tikhomirov](/maintainers/tikhomirov)[@tikhomirov](https://github.com/tikhomirov)

---

Top Contributors

[![tikhomirov](https://avatars.githubusercontent.com/u/19173833?v=4)](https://github.com/tikhomirov "tikhomirov (65 commits)")[![stephenalexbrowne](https://avatars.githubusercontent.com/u/6238781?v=4)](https://github.com/stephenalexbrowne "stephenalexbrowne (4 commits)")

---

Tags

wordpresswordpress-pluginlaravelwordpressSettingsfluentreactfieldsFormsmetaboxRepeaterflexible-content

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rwsite-wp-field/health.svg)

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

###  Alternatives

[cmb2/cmb2

CMB2 is a metabox, custom fields, and forms library for WordPress that will blow your mind.

3.0k676.1k28](/packages/cmb2-cmb2)[akaunting/laravel-setting

Persistent settings package for Laravel

490883.0k7](/packages/akaunting-laravel-setting)

PHPackages © 2026

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