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
===============

Modern Laravel-style field generator for WordPress with 50+ field types, fluent API, React UI, repeater/flexible content fields, conditional logic, and complete storage strategies.

3.1.1(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 1mo ago

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

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

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

[](#wp_field)

 **HTML Fields Library for WordPress**
 A foundation for building custom frameworks, settings systems, and admin UIs.
 Fluent API, 48 unique field types (+4 aliases), React/Vanilla UI, and modern v3 architecture.

 [![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) • [Field Types](#field-types) • [Examples](#examples) • [Dependencies](#dependencies) • [RU version](README.ru.md)

---

Features
--------

[](#features)

### v3.0 — Modern Laravel-Style API

[](#v30--modern-laravel-style-api)

- ✨ **Fluent Interface** — Chain methods like Laravel: `Field::text('name')->label('Name')->required()`
- 🔁 **Repeater Fields** — Infinite nesting support with min/max constraints
- 🎨 **Flexible Content** — ACF-style layout builder with multiple block types
- ⚛️ **React UI** — Modern React components with Vanilla JS fallback
- 🏗️ **SOLID Architecture** — Interfaces, traits, dependency injection
- 📦 **Storage Strategies** — PostMeta, TermMeta, UserMeta, Options, CustomTable
- 🛡️ **Type Safety** — PHPStan Level 9, strict types, full PHPDoc

### Core Features

[](#core-features)

- 🚀 **48 Unique Field Types** — Text, select, repeater, flexible content, and more
- ♻️ **4 Compatibility Aliases** — `date_time`, `datetime-local`, `image_picker`, `imagepicker`
- 🔗 **Conditional Logic** — 14 operators with AND/OR relations
- 🧪 **Full Test Coverage** — Pest/PHPUnit tests with 100% pass rate
- 🎨 **WP Components** — Native WordPress UI integration
- 🌍 **i18n Ready** — Multilingual support

Requirements
------------

[](#requirements)

- PHP 8.3+
- WordPress 6.0+
- Composer (for installation)

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

[](#installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

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

### Manual Installation

[](#manual-installation)

1. Clone or download to `wp-content/plugins/wp-field-plugin`
2. Run `composer install --no-dev`
3. Activate the plugin in WordPress admin

### Build React Components (Optional)

[](#build-react-components-optional)

```
npm install
npm run build
```

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

[](#quick-start)

### Modern API (v3.0)

[](#modern-api-v30)

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

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

// Render field
echo $field->render();

// Create metabox with fields
$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)

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

### Flexible Content Field

[](#flexible-content-field)

```
$flexible = Field::flexibleContent('page_sections')
    ->label('Page Sections')
    ->addLayout('text_block', 'Text Block', [
        Field::text('heading')->label('Heading'),
        Field::text('content')->label('Content'),
    ])
    ->addLayout('image', 'Image', [
        Field::text('image_url')->label('Image URL')->url(),
        Field::text('caption')->label('Caption'),
    ])
    ->min(1)
    ->buttonLabel('Add Section');
```

Field Types (48 unique + 4 aliases)
-----------------------------------

[](#field-types-48-unique--4-aliases)

### Basic (9)

[](#basic-9)

- `text` — Text input
- `password` — Password field
- `email` — Email input
- `url` — URL input
- `tel` — Telephone input
- `number` — Number input
- `range` — Range slider
- `hidden` — Hidden field
- `textarea` — Multi-line text

### Choice (5)

[](#choice-5)

- `select` — Dropdown list
- `multiselect` — Multiple selection
- `radio` — Radio buttons
- `checkbox` — Single checkbox
- `checkbox_group` — Checkbox group

### Advanced (9)

[](#advanced-9)

- `editor` — wp\_editor
- `media` — Media library (ID or URL)
- `image` — Image with preview
- `file` — File upload
- `gallery` — Image gallery
- `color` — Color picker
- `date` — Date picker
- `time` — Time picker
- `datetime` — Date and time

### Composite (2)

[](#composite-2)

- `group` — Nested fields
- `repeater` — Repeating elements

### Simple Fields (9)

[](#simple-fields-9)

- `switcher` — On/off switcher
- `spinner` — Number spinner
- `button_set` — Button selection
- `slider` — Value slider
- `heading` — Heading
- `subheading` — Subheading
- `notice` — Notice (info/success/warning/error)
- `content` — Custom HTML content
- `fieldset` — Field grouping

### Medium Complexity Fields (10)

[](#medium-complexity-fields-10)

- `accordion` — Collapsible sections
- `tabbed` — Tabs
- `typography` — Typography settings
- `spacing` — Spacing controls
- `dimensions` — Size controls
- `border` — Border settings
- `background` — Background options
- `link_color` — Link colors
- `color_group` — Color group
- `image_select` — Image selection

### High Complexity Fields (8)

[](#high-complexity-fields-8)

- `code_editor` — Code editor with syntax highlighting
- `icon` — Icon picker from library
- `map` — Google Maps location
- `sortable` — Drag &amp; drop sorting
- `sorter` — Enabled/disabled sorting
- `palette` — Color palette
- `link` — Link field (URL + text + target)
- `backup` — Settings export/import

Examples
--------

[](#examples)

### Dependencies

[](#dependencies)

```
// Show field only if another field has specific value
Field::text('courier_address')
    ->label('Delivery Address')
    ->when('delivery_type', '==', 'courier');

// Multiple conditions (AND)
Field::text('special_field')
    ->label('Special Field')
    ->when('field1', '==', 'value1')
    ->when('field2', '!=', 'value2');

// Multiple conditions (OR)
Field::text('notification')
    ->label('Notification')
    ->when('type', '==', 'sms')
    ->orWhen('type', '==', 'email');
```

### Repeater

[](#repeater)

```
Field::repeater('work_times')
    ->label('Work Times')
    ->min(1)
    ->max(7)
    ->buttonLabel('Add Day')
    ->fields([
        Field::make('select', 'day')
            ->label('Day')
            ->options(['mon' => 'Mon', 'tue' => 'Tue']),
        Field::make('time', 'from')
            ->label('From'),
        Field::make('time', 'to')
            ->label('To'),
    ]);
```

### Group

[](#group)

```
Field::make('group', 'address')
    ->label('Address')
    ->fields([
        Field::text('city')->label('City'),
        Field::text('street')->label('Street'),
        Field::text('number')->label('Number'),
    ]);
```

### Code Editor

[](#code-editor)

```
Field::make('code_editor', 'custom_css')
    ->label('Custom CSS')
    ->mode('css') // css, javascript, php, html
    ->height('400px');
```

### Icon Picker

[](#icon-picker)

```
Field::make('icon', 'menu_icon')
    ->label('Menu Icon')
    ->library('dashicons');
```

### Map

[](#map)

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

### Sortable

[](#sortable)

```
Field::make('sortable', 'menu_order')
    ->label('Menu Order')
    ->options([
        'home'     => 'Home',
        'about'    => 'About',
        'services' => 'Services',
        'contact'  => 'Contact',
    ]);
```

### Palette

[](#palette)

```
Field::make('palette', 'color_scheme')
    ->label('Color Scheme')
    ->palettes([
        'blue'   => ['#0073aa', '#005a87', '#003d82'],
        'green'  => ['#28a745', '#218838', '#1e7e34'],
        'red'    => ['#dc3545', '#c82333', '#bd2130'],
    ]);
```

### Link

[](#link)

```
Field::make('link', 'cta_button')
    ->label('CTA Button');

// Get value:
// $link = get_post_meta($post_id, 'cta_button', true);
// ['url' => '...', 'text' => '...', 'target' => '_blank']
```

### Accordion

[](#accordion)

```
Field::make('accordion', 'settings_accordion')
    ->label('Settings')
    ->sections([
        [
            'title'  => 'General',
            'open'   => true,
            'fields' => [
                Field::text('title')->label('Title'),
            ],
        ],
        [
            'title'  => 'Advanced',
            'fields' => [
                Field::make('textarea', 'desc')->label('Description'),
            ],
        ],
    ]);
```

### Typography

[](#typography)

```
Field::make('typography', 'heading_typography')
    ->label('Heading Typography');

// Saved as:
// [
//     'font_family' => 'Arial',
//     'font_size' => '24',
//     'font_weight' => '700',
//     'line_height' => '1.5',
//     'text_align' => 'center',
//     'color' => '#333333'
// ]
```

Dependency Operators
--------------------

[](#dependency-operators)

- `==` — Equal
- `!=` — Not equal
- `>`, `>=`, ` 'value']];
    return $types;
});
```

### Adding Icon Libraries

[](#adding-icon-libraries)

```
add_filter('wp_field_icon_library', function($icons, $library) {
    if ($library === 'fontawesome') {
        return ['fa-home', 'fa-user', 'fa-cog', ...];
    }
    return $icons;
}, 10, 2);
```

### Custom Value Retrieval

[](#custom-value-retrieval)

```
add_filter('wp_field_get_value', function($value, $storage_type, $key, $id, $field) {
    if ($storage_type === 'custom') {
        return get_custom_value($key, $id);
    }
    return $value;
}, 10, 5);
```

Changelog
---------

[](#changelog)

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

Project Stats
-------------

[](#project-stats)

- **PHP Lines:** 2705 (WP\_Field.php)
- **JS Lines:** 1222 (wp-field.js)
- **CSS Lines:** 1839 (wp-field.css)
- **Field Types:** 48
- **Dependency Operators:** 12
- **Storage Types:** 5
- **External Dependencies:** 0

Compatibility
-------------

[](#compatibility)

- **WordPress:** 6.0+
- **PHP:** 8.3+
- **Dependencies:** jQuery, jQuery UI Sortable, WordPress built-in components
- **Browsers:** Chrome, Firefox, Safari, Edge (latest 2 versions)

Performance
-----------

[](#performance)

- Minimal CSS size: ~20KB
- Minimal JS size: ~15KB
- Lazy loading for heavy components (CodeMirror, Google Maps)
- Optimized selectors and events

License
-------

[](#license)

GPL v2 or later

Author
------

[](#author)

Aleksei Tikhomirov ()

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance84

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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 ~50 days

Recently: every ~0 days

Total

11

Last Release

83d ago

Major Versions

2.1.0 → 3.0.02026-02-23

2.5.1 → 3.0.22026-02-24

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

2.5.2PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3be160e119825aea7f9813b3863745ecf64c15f2e9aa0e1efedbf423a2dccbf2?d=identicon)[tikhomirov](/maintainers/tikhomirov)

---

Top Contributors

[![tikhomirov](https://avatars.githubusercontent.com/u/19173833?v=4)](https://github.com/tikhomirov "tikhomirov (5 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

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.0k640.4k23](/packages/cmb2-cmb2)[akaunting/laravel-setting

Persistent settings package for Laravel

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

PHPackages © 2026

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